diff --git a/README.md b/README.md index cb06c64..37f77f3 100644 --- a/README.md +++ b/README.md @@ -291,8 +291,8 @@ removal and simply stops tracking the path. ## Web server `bdrive serve` serves a website — browse folders and files, read markdown -rendered Obsidian-style (including `[[wikilinks]]`, task lists, and -tables), download any file — and, pointed at a storage root, becomes a +rendered Obsidian-style (including `[[wikilinks]]`, task lists, tables, +and ```` ```mermaid ```` diagrams), download any file — and, pointed at a storage root, becomes a **multi-project sync hub**. It is read-only unless started with `--upload`. ```sh diff --git a/architecture/webapp-frontend.md b/architecture/webapp-frontend.md index 4d3c21d..3d16218 100644 --- a/architecture/webapp-frontend.md +++ b/architecture/webapp-frontend.md @@ -15,6 +15,13 @@ classDiagram } note for ErrorBoundary "ErrorBoundary.tsx — the app's floor, mounted in main.tsx ABOVE QueryClientProvider so it covers every route. React unmounts the whole tree when a render throws and nothing catches it, and the address bar keeps the URL, so a reload reproduces the blank page: a permanent client-side DoS that another member's CONTENT can reach (a link in a teammate's markdown reaching decodePath, a folder named `constructor` reaching ProjectIcon). Deliberately the smallest thing that works — no reporting, no retry machine, no per-route boundaries" + class shareMermaid { + <> + src/share-mermaid.ts → static/share-mermaid.js + picks DARK/LIGHT from prefers-color-scheme + } + note for shareMermaid "The only script the server-rendered /s/ share page ever loads, and only when shares.go finds a mermaid fence in the document. Built as a SECOND rollup input with a fixed, unhashed name at the static root — sharedMarkdownShell is a Go const and cannot know a content hash, and server.go marks assets/ immutable for a year, so an unhashed file there would pin a stale bundle in shared caches. Mermaid's own chunks keep their hashed assets/ names, which is why the share page needs the ACAO header: its sandbox origin is opaque" + class App { mode from /api/config } @@ -101,8 +108,10 @@ classDiagram +heat.ts placeLabels LABEL_MAX (scatter danger-dot labels) +sniff.ts sniffBytes BlobText MAX_BYTES +csv.ts parseDelimited Csv CSV_ROWS + +mermaid.ts hasMermaid renderMermaid Palette DARK LIGHT +utils.ts } + note for lib "mermaid.ts is the one exception to 'pure, no React, unit-tested on node': it needs a DOM and a browser-only library, so its coverage is Playwright. html in → html out, so neither caller can be tempted to patch a live subtree. It imports mermaid only when hasMermaid() says a document has a fence — that gate is what keeps a diagram-free page from downloading any of it — and every failure (unparseable fence, render throw, chunk that never loads) returns the untouched <pre><code> instead of throwing" note for lib "pure, no React, unit-tested on node (npm test) — the line diff is ~40 lines, cheaper than auditing a diff package. heat.ts is the one read-count arithmetic: every surface (file header, folder listing, Dashboard bar) totals and splits through it, so they cannot disagree; useBrowse re-exports it" note for lib "csv.ts parses .csv/.tsv for FileView's table view — ~50 lines against RFC 4180, so no papaparse. It NEVER throws: null means 'not a table' (unterminated quote, no delimiter) and the caller falls back to the plain-text preview, which is why the fallback is a type-level guarantee rather than a try/catch someone can forget" @@ -116,8 +125,9 @@ classDiagram Browser --> components HubApp --> components components --> nav : linkProps navigate - components --> lib : diffText groupRuns hotPathSplit placeLabels parseDelimited + components --> lib : diffText groupRuns hotPathSplit placeLabels parseDelimited renderMermaid hooks --> lib : re-exports heat.ts, sniffBytes + shareMermaid --> lib : renderMermaid hooks --> api Browser --> hooks HubApp --> hooks diff --git a/architecture/webapp-server.md b/architecture/webapp-server.md index e69c759..c7b28d7 100644 --- a/architecture/webapp-server.md +++ b/architecture/webapp-server.md @@ -283,6 +283,14 @@ classDiagram +Token +Project +Path +Creator +Expires } + class mermaidTag { + <<shares.go, the .md branch>> + body contains language-mermaid? + → module script tag, else "" + sharedMarkdownShell verb 2 of 4 + } + note for mermaidTag "A share page is a zero-JavaScript document and stays one unless the document it renders actually has a diagram — the server already holds the rendered HTML, so it can decide. The tag is a MODULE, which only loads because frontend() now sets Access-Control-Allow-Origin on real assets: under this page's `sandbox allow-scripts` the origin is opaque, so a module and every import() it makes are fetched with Origin: null. The CSP itself is unchanged, and no allow-same-origin was added — the sandbox is what keeps shared content off the hub's origin" + class DeviceRegistry { -repo DeviceRepo -byKey devKey → row @@ -432,6 +440,7 @@ classDiagram projectPerm ..> Project : Perms + Default projectPerm ..> Directory : org role ShareDB ..> Share + ShareDB ..> mermaidTag : markdown shares only DeviceRegistry ..> DeviceInfo DeviceRegistry *-- devKey : (account, id) RemoteSource ..> sourcedOp : attribution comes from the journal key diff --git a/internal/webapp/dir_test.go b/internal/webapp/dir_test.go index 0797b18..3174b4c 100644 --- a/internal/webapp/dir_test.go +++ b/internal/webapp/dir_test.go @@ -146,3 +146,29 @@ func TestFrontendSPAFallback(t *testing.T) { t.Fatalf("/api/bogus: want 404, got %d", rec.Code) } } + +// Every file the frontend build wrote must actually be IN the binary. A bare +// `//go:embed static` skips names starting with `_` or `.`, which is how Vite's +// first `_commonjsHelpers-.js` chunk went missing: the build passes, the +// commit looks right, and the running app answers that chunk with index.html +// until the browser refuses the whole entry over its MIME type. Nothing about +// that is visible without loading the page, so it is asserted here instead. +func TestEveryBuiltAssetIsEmbedded(t *testing.T) { + built := os.DirFS("static") + embedded, err := fs.Sub(staticFiles, "static") + if err != nil { + t.Fatal(err) + } + err = fs.WalkDir(built, ".", func(p string, d fs.DirEntry, err error) error { + if err != nil || d.IsDir() { + return err + } + if _, err := fs.Stat(embedded, p); err != nil { + t.Errorf("static/%s is on disk but not in the binary — //go:embed needs the all: prefix for a name like this", p) + } + return nil + }) + if err != nil { + t.Fatal(err) + } +} diff --git a/internal/webapp/e2e_serve_test.go b/internal/webapp/e2e_serve_test.go index fc0455e..bdda3da 100644 --- a/internal/webapp/e2e_serve_test.go +++ b/internal/webapp/e2e_serve_test.go @@ -288,6 +288,13 @@ func seedE2E(t *testing.T, state, prefix, projectID string) { // content, so their rows stay unclickable while every other row is now an // address for its own version. put("scratch.md", "# Scratch\n\nTemporary.\n", 12*time.Hour) + // One good fence and one deliberately broken one on the same page: the + // point of the fallback is that a diagram nobody can parse doesn't take + // the diagrams around it down with it. Appended LAST on purpose — the + // mutations above address ops by index, so an insert anywhere earlier + // hands one file's author or note to another file. + put("diagram.md", "# Diagram\n\n```mermaid\ngraph TD\n A[Agent] --> B[Hub]\n B --> C[Teammate]\n```\n\n"+ + "Broken one below.\n\n```mermaid\ngraph TD\n A[[[[ --> ???\n```\n", 24*time.Hour) lam++ seq++ ops = append(ops, journal.Op{ diff --git a/internal/webapp/frontend/e2e/browse.spec.ts b/internal/webapp/frontend/e2e/browse.spec.ts index dafae7c..6fa7ebc 100644 --- a/internal/webapp/frontend/e2e/browse.spec.ts +++ b/internal/webapp/frontend/e2e/browse.spec.ts @@ -1013,3 +1013,51 @@ test("a wide csv scrolls inside its own box at 390px", async ({ page }) => { await page.evaluate(() => document.documentElement.scrollWidth > window.innerWidth + 1), ).toBe(false); }); + +test("mermaid: a good fence renders, a broken one keeps its code block", async ({ page }) => { + await login(page); + const pid = await wikiId(page); + await page.goto(`/${pid}/diagram.md`); + // The valid fence became a diagram... + const svg = page.locator("#content .mermaid-diagram svg"); + await expect(svg).toHaveCount(1); + await expect(svg).toContainText("Teammate"); + // ...and the broken one below it kept today's
 plus a note. One
+  // bad fence must not take the good one on the same page down with it.
+  await expect(page.locator("#content pre code.language-mermaid")).toHaveCount(1);
+  await expect(page.locator("#content .mermaid-err")).toHaveText("Couldn't render this diagram.");
+});
+
+test("a file with no mermaid fence fetches no mermaid chunk", async ({ page }) => {
+  await login(page);
+  const pid = await wikiId(page);
+  // mermaid.core is the library; the *Diagram-* chunks are its per-grammar
+  // splits. lib/mermaid.ts itself is a static import of the app entry (a few
+  // KB of gate, no mermaid code in it), which is exactly why the gate is a
+  // plain string check and not something that has to load mermaid to answer.
+  const fetched: string[] = [];
+  page.on("request", (r) => /mermaid\.core|Diagram-/.test(r.url()) && fetched.push(r.url()));
+  await page.goto(`/${pid}/guide.md`);
+  await expect(page.locator("#content")).toContainText("Second version");
+  await page.waitForTimeout(500);
+  expect(fetched).toEqual([]);
+});
+
+test("a shared diagram renders on the public page, without one there is no script", async ({
+  page,
+}) => {
+  await login(page);
+  const pid = await wikiId(page);
+  const mint = async (path: string) =>
+    (await (await page.request.post(`/api/p/${pid}/shares`, { data: { path } })).json()).token;
+
+  // Diagram-free share pages stay the zero-JavaScript document they were.
+  const plain = await page.request.get(`/s/${await mint("index.md")}`);
+  expect(await plain.text()).not.toContain("=6.9.0"
       }
     },
+    "node_modules/@braintree/sanitize-url": {
+      "version": "7.1.2",
+      "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-7.1.2.tgz",
+      "integrity": "sha512-jigsZK+sMF/cuiB7sERuo9V7N9jx+dhmHHnQyDSVdpZwVutaBu7WvNYqMDLSgFgfB30n452TP3vjDAvFC973mA==",
+      "license": "MIT"
+    },
+    "node_modules/@chevrotain/types": {
+      "version": "11.1.2",
+      "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-11.1.2.tgz",
+      "integrity": "sha512-U+HFai5+zmJCkK86QsaJtoITlboZHBqrVketcO2ROv865xfCMSFpELQoz1GkX5GzME8pTa+3kbKrZHQtI0gdbw==",
+      "license": "Apache-2.0"
+    },
     "node_modules/@esbuild/aix-ppc64": {
       "version": "0.28.1",
       "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz",
@@ -810,6 +836,23 @@
         "react-hook-form": "^7.55.0"
       }
     },
+    "node_modules/@iconify/types": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz",
+      "integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==",
+      "license": "MIT"
+    },
+    "node_modules/@iconify/utils": {
+      "version": "3.1.4",
+      "resolved": "https://registry.npmjs.org/@iconify/utils/-/utils-3.1.4.tgz",
+      "integrity": "sha512-b1S7B1k9ohZ+iNTi2ATxbRYG9fTrJmUT0rc46bvVnNxqNRGW7dyo/vRREwyniI5IRN2RSJHDcm+s3BjWrSAjHw==",
+      "license": "MIT",
+      "dependencies": {
+        "@antfu/install-pkg": "^1.1.0",
+        "@iconify/types": "^2.0.0",
+        "import-meta-resolve": "^4.2.0"
+      }
+    },
     "node_modules/@jridgewell/gen-mapping": {
       "version": "0.3.13",
       "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
@@ -860,6 +903,15 @@
         "@jridgewell/sourcemap-codec": "^1.4.14"
       }
     },
+    "node_modules/@mermaid-js/parser": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/@mermaid-js/parser/-/parser-1.2.0.tgz",
+      "integrity": "sha512-oYPyv8A4As1yH5Bx+04iQEQxXuIQDe0GKCNSRgao6z8AM9jixXIfP0vsppRLvGf+nKIOb9/LdpWA4YuJiVvESA==",
+      "license": "MIT",
+      "dependencies": {
+        "@chevrotain/types": "~11.1.2"
+      }
+    },
     "node_modules/@playwright/test": {
       "version": "1.61.1",
       "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.61.1.tgz",
@@ -3137,6 +3189,259 @@
         "@babel/types": "^7.28.2"
       }
     },
+    "node_modules/@types/d3": {
+      "version": "7.4.3",
+      "resolved": "https://registry.npmjs.org/@types/d3/-/d3-7.4.3.tgz",
+      "integrity": "sha512-lZXZ9ckh5R8uiFVt8ogUNf+pIrK4EsWrx2Np75WvF/eTpJ0FMHNhjXk8CKEx/+gpHbNQyJWehbFaTvqmHWB3ww==",
+      "license": "MIT",
+      "dependencies": {
+        "@types/d3-array": "*",
+        "@types/d3-axis": "*",
+        "@types/d3-brush": "*",
+        "@types/d3-chord": "*",
+        "@types/d3-color": "*",
+        "@types/d3-contour": "*",
+        "@types/d3-delaunay": "*",
+        "@types/d3-dispatch": "*",
+        "@types/d3-drag": "*",
+        "@types/d3-dsv": "*",
+        "@types/d3-ease": "*",
+        "@types/d3-fetch": "*",
+        "@types/d3-force": "*",
+        "@types/d3-format": "*",
+        "@types/d3-geo": "*",
+        "@types/d3-hierarchy": "*",
+        "@types/d3-interpolate": "*",
+        "@types/d3-path": "*",
+        "@types/d3-polygon": "*",
+        "@types/d3-quadtree": "*",
+        "@types/d3-random": "*",
+        "@types/d3-scale": "*",
+        "@types/d3-scale-chromatic": "*",
+        "@types/d3-selection": "*",
+        "@types/d3-shape": "*",
+        "@types/d3-time": "*",
+        "@types/d3-time-format": "*",
+        "@types/d3-timer": "*",
+        "@types/d3-transition": "*",
+        "@types/d3-zoom": "*"
+      }
+    },
+    "node_modules/@types/d3-array": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz",
+      "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-axis": {
+      "version": "3.0.6",
+      "resolved": "https://registry.npmjs.org/@types/d3-axis/-/d3-axis-3.0.6.tgz",
+      "integrity": "sha512-pYeijfZuBd87T0hGn0FO1vQ/cgLk6E1ALJjfkC0oJ8cbwkZl3TpgS8bVBLZN+2jjGgg38epgxb2zmoGtSfvgMw==",
+      "license": "MIT",
+      "dependencies": {
+        "@types/d3-selection": "*"
+      }
+    },
+    "node_modules/@types/d3-brush": {
+      "version": "3.0.6",
+      "resolved": "https://registry.npmjs.org/@types/d3-brush/-/d3-brush-3.0.6.tgz",
+      "integrity": "sha512-nH60IZNNxEcrh6L1ZSMNA28rj27ut/2ZmI3r96Zd+1jrZD++zD3LsMIjWlvg4AYrHn/Pqz4CF3veCxGjtbqt7A==",
+      "license": "MIT",
+      "dependencies": {
+        "@types/d3-selection": "*"
+      }
+    },
+    "node_modules/@types/d3-chord": {
+      "version": "3.0.6",
+      "resolved": "https://registry.npmjs.org/@types/d3-chord/-/d3-chord-3.0.6.tgz",
+      "integrity": "sha512-LFYWWd8nwfwEmTZG9PfQxd17HbNPksHBiJHaKuY1XeqscXacsS2tyoo6OdRsjf+NQYeB6XrNL3a25E3gH69lcg==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-color": {
+      "version": "3.1.3",
+      "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz",
+      "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-contour": {
+      "version": "3.0.6",
+      "resolved": "https://registry.npmjs.org/@types/d3-contour/-/d3-contour-3.0.6.tgz",
+      "integrity": "sha512-BjzLgXGnCWjUSYGfH1cpdo41/hgdWETu4YxpezoztawmqsvCeep+8QGfiY6YbDvfgHz/DkjeIkkZVJavB4a3rg==",
+      "license": "MIT",
+      "dependencies": {
+        "@types/d3-array": "*",
+        "@types/geojson": "*"
+      }
+    },
+    "node_modules/@types/d3-delaunay": {
+      "version": "6.0.4",
+      "resolved": "https://registry.npmjs.org/@types/d3-delaunay/-/d3-delaunay-6.0.4.tgz",
+      "integrity": "sha512-ZMaSKu4THYCU6sV64Lhg6qjf1orxBthaC161plr5KuPHo3CNm8DTHiLw/5Eq2b6TsNP0W0iJrUOFscY6Q450Hw==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-dispatch": {
+      "version": "3.0.7",
+      "resolved": "https://registry.npmjs.org/@types/d3-dispatch/-/d3-dispatch-3.0.7.tgz",
+      "integrity": "sha512-5o9OIAdKkhN1QItV2oqaE5KMIiXAvDWBDPrD85e58Qlz1c1kI/J0NcqbEG88CoTwJrYe7ntUCVfeUl2UJKbWgA==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-drag": {
+      "version": "3.0.7",
+      "resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-3.0.7.tgz",
+      "integrity": "sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==",
+      "license": "MIT",
+      "dependencies": {
+        "@types/d3-selection": "*"
+      }
+    },
+    "node_modules/@types/d3-dsv": {
+      "version": "3.0.7",
+      "resolved": "https://registry.npmjs.org/@types/d3-dsv/-/d3-dsv-3.0.7.tgz",
+      "integrity": "sha512-n6QBF9/+XASqcKK6waudgL0pf/S5XHPPI8APyMLLUHd8NqouBGLsU8MgtO7NINGtPBtk9Kko/W4ea0oAspwh9g==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-ease": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz",
+      "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-fetch": {
+      "version": "3.0.7",
+      "resolved": "https://registry.npmjs.org/@types/d3-fetch/-/d3-fetch-3.0.7.tgz",
+      "integrity": "sha512-fTAfNmxSb9SOWNB9IoG5c8Hg6R+AzUHDRlsXsDZsNp6sxAEOP0tkP3gKkNSO/qmHPoBFTxNrjDprVHDQDvo5aA==",
+      "license": "MIT",
+      "dependencies": {
+        "@types/d3-dsv": "*"
+      }
+    },
+    "node_modules/@types/d3-force": {
+      "version": "3.0.10",
+      "resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-3.0.10.tgz",
+      "integrity": "sha512-ZYeSaCF3p73RdOKcjj+swRlZfnYpK1EbaDiYICEEp5Q6sUiqFaFQ9qgoshp5CzIyyb/yD09kD9o2zEltCexlgw==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-format": {
+      "version": "3.0.4",
+      "resolved": "https://registry.npmjs.org/@types/d3-format/-/d3-format-3.0.4.tgz",
+      "integrity": "sha512-fALi2aI6shfg7vM5KiR1wNJnZ7r6UuggVqtDA+xiEdPZQwy/trcQaHnwShLuLdta2rTymCNpxYTiMZX/e09F4g==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-geo": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-3.1.1.tgz",
+      "integrity": "sha512-65Emv9fQiQQqphLlRkuQ5ypPsOmWPhtBGCMv61JDPEPMvsx+gzhGf74yw1a78xFKPj6zw4AgQICJoQv0vK9M2w==",
+      "license": "MIT",
+      "dependencies": {
+        "@types/geojson": "*"
+      }
+    },
+    "node_modules/@types/d3-hierarchy": {
+      "version": "3.1.7",
+      "resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-3.1.7.tgz",
+      "integrity": "sha512-tJFtNoYBtRtkNysX1Xq4sxtjK8YgoWUNpIiUee0/jHGRwqvzYxkq0hGVbbOGSz+JgFxxRu4K8nb3YpG3CMARtg==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-interpolate": {
+      "version": "3.0.4",
+      "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz",
+      "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==",
+      "license": "MIT",
+      "dependencies": {
+        "@types/d3-color": "*"
+      }
+    },
+    "node_modules/@types/d3-path": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz",
+      "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-polygon": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/@types/d3-polygon/-/d3-polygon-3.0.2.tgz",
+      "integrity": "sha512-ZuWOtMaHCkN9xoeEMr1ubW2nGWsp4nIql+OPQRstu4ypeZ+zk3YKqQT0CXVe/PYqrKpZAi+J9mTs05TKwjXSRA==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-quadtree": {
+      "version": "3.0.6",
+      "resolved": "https://registry.npmjs.org/@types/d3-quadtree/-/d3-quadtree-3.0.6.tgz",
+      "integrity": "sha512-oUzyO1/Zm6rsxKRHA1vH0NEDG58HrT5icx/azi9MF1TWdtttWl0UIUsjEQBBh+SIkrpd21ZjEv7ptxWys1ncsg==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-random": {
+      "version": "3.0.4",
+      "resolved": "https://registry.npmjs.org/@types/d3-random/-/d3-random-3.0.4.tgz",
+      "integrity": "sha512-UHYId5WTCx4L4YNel7NU00XUXXgvgpgZOvp10PuvsQENjMDXhh2RyFc0KBjO7B45ne4Ha1yVH7ii0vnzKkuzWA==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-scale": {
+      "version": "4.0.9",
+      "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz",
+      "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==",
+      "license": "MIT",
+      "dependencies": {
+        "@types/d3-time": "*"
+      }
+    },
+    "node_modules/@types/d3-scale-chromatic": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz",
+      "integrity": "sha512-iWMJgwkK7yTRmWqRB5plb1kadXyQ5Sj8V/zYlFGMUBbIPKQScw+Dku9cAAMgJG+z5GYDoMjWGLVOvjghDEFnKQ==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-selection": {
+      "version": "3.0.11",
+      "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-3.0.11.tgz",
+      "integrity": "sha512-bhAXu23DJWsrI45xafYpkQ4NtcKMwWnAC/vKrd2l+nxMFuvOT3XMYTIj2opv8vq8AO5Yh7Qac/nSeP/3zjTK0w==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-shape": {
+      "version": "3.1.8",
+      "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.8.tgz",
+      "integrity": "sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w==",
+      "license": "MIT",
+      "dependencies": {
+        "@types/d3-path": "*"
+      }
+    },
+    "node_modules/@types/d3-time": {
+      "version": "3.0.4",
+      "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz",
+      "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-time-format": {
+      "version": "4.0.3",
+      "resolved": "https://registry.npmjs.org/@types/d3-time-format/-/d3-time-format-4.0.3.tgz",
+      "integrity": "sha512-5xg9rC+wWL8kdDj153qZcsJ0FWiFt0J5RB6LYUNZjwSnesfblqrI/bJ1wBdJ8OQfncgbJG5+2F+qfqnqyzYxyg==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-timer": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz",
+      "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==",
+      "license": "MIT"
+    },
+    "node_modules/@types/d3-transition": {
+      "version": "3.0.9",
+      "resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-3.0.9.tgz",
+      "integrity": "sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg==",
+      "license": "MIT",
+      "dependencies": {
+        "@types/d3-selection": "*"
+      }
+    },
+    "node_modules/@types/d3-zoom": {
+      "version": "3.0.8",
+      "resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-3.0.8.tgz",
+      "integrity": "sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw==",
+      "license": "MIT",
+      "dependencies": {
+        "@types/d3-interpolate": "*",
+        "@types/d3-selection": "*"
+      }
+    },
     "node_modules/@types/estree": {
       "version": "1.0.9",
       "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",
@@ -3144,6 +3449,12 @@
       "dev": true,
       "license": "MIT"
     },
+    "node_modules/@types/geojson": {
+      "version": "7946.0.16",
+      "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz",
+      "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==",
+      "license": "MIT"
+    },
     "node_modules/@types/react": {
       "version": "19.2.17",
       "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.17.tgz",
@@ -3164,6 +3475,23 @@
         "@types/react": "^19.2.0"
       }
     },
+    "node_modules/@types/trusted-types": {
+      "version": "2.0.7",
+      "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
+      "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
+      "license": "MIT",
+      "optional": true
+    },
+    "node_modules/@upsetjs/venn.js": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/@upsetjs/venn.js/-/venn.js-2.0.0.tgz",
+      "integrity": "sha512-WbBhLrooyePuQ1VZxrJjtLvTc4NVfpOyKx0sKqioq9bX1C1m7Jgykkn8gLrtwumBioXIqam8DLxp88Adbue6Hw==",
+      "license": "MIT",
+      "optionalDependencies": {
+        "d3-selection": "^3.0.0",
+        "d3-transition": "^3.0.1"
+      }
+    },
     "node_modules/@vitejs/plugin-react": {
       "version": "5.2.0",
       "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.2.0.tgz",
@@ -3302,6 +3630,15 @@
         "react-dom": "^18 || ^19 || ^19.0.0-rc"
       }
     },
+    "node_modules/commander": {
+      "version": "7.2.0",
+      "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
+      "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 10"
+      }
+    },
     "node_modules/convert-source-map": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
@@ -3309,6 +3646,15 @@
       "dev": true,
       "license": "MIT"
     },
+    "node_modules/cose-base": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/cose-base/-/cose-base-1.0.3.tgz",
+      "integrity": "sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==",
+      "license": "MIT",
+      "dependencies": {
+        "layout-base": "^1.0.0"
+      }
+    },
     "node_modules/csstype": {
       "version": "3.2.3",
       "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
@@ -3316,6 +3662,511 @@
       "devOptional": true,
       "license": "MIT"
     },
+    "node_modules/cytoscape": {
+      "version": "3.34.0",
+      "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.34.0.tgz",
+      "integrity": "sha512-62rNSrioXw93uliKFBwjukeQyeWwH2PqDrTac31r2P6464u3AUvTk0xS4LVvT251g7IgkFunrI48ZEZGjywSOg==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10"
+      }
+    },
+    "node_modules/cytoscape-cose-bilkent": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/cytoscape-cose-bilkent/-/cytoscape-cose-bilkent-4.1.0.tgz",
+      "integrity": "sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ==",
+      "license": "MIT",
+      "dependencies": {
+        "cose-base": "^1.0.0"
+      },
+      "peerDependencies": {
+        "cytoscape": "^3.2.0"
+      }
+    },
+    "node_modules/cytoscape-fcose": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/cytoscape-fcose/-/cytoscape-fcose-2.2.0.tgz",
+      "integrity": "sha512-ki1/VuRIHFCzxWNrsshHYPs6L7TvLu3DL+TyIGEsRcvVERmxokbf5Gdk7mFxZnTdiGtnA4cfSmjZJMviqSuZrQ==",
+      "license": "MIT",
+      "dependencies": {
+        "cose-base": "^2.2.0"
+      },
+      "peerDependencies": {
+        "cytoscape": "^3.2.0"
+      }
+    },
+    "node_modules/cytoscape-fcose/node_modules/cose-base": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/cose-base/-/cose-base-2.2.0.tgz",
+      "integrity": "sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==",
+      "license": "MIT",
+      "dependencies": {
+        "layout-base": "^2.0.0"
+      }
+    },
+    "node_modules/cytoscape-fcose/node_modules/layout-base": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-2.0.1.tgz",
+      "integrity": "sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==",
+      "license": "MIT"
+    },
+    "node_modules/d3": {
+      "version": "7.9.0",
+      "resolved": "https://registry.npmjs.org/d3/-/d3-7.9.0.tgz",
+      "integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-array": "3",
+        "d3-axis": "3",
+        "d3-brush": "3",
+        "d3-chord": "3",
+        "d3-color": "3",
+        "d3-contour": "4",
+        "d3-delaunay": "6",
+        "d3-dispatch": "3",
+        "d3-drag": "3",
+        "d3-dsv": "3",
+        "d3-ease": "3",
+        "d3-fetch": "3",
+        "d3-force": "3",
+        "d3-format": "3",
+        "d3-geo": "3",
+        "d3-hierarchy": "3",
+        "d3-interpolate": "3",
+        "d3-path": "3",
+        "d3-polygon": "3",
+        "d3-quadtree": "3",
+        "d3-random": "3",
+        "d3-scale": "4",
+        "d3-scale-chromatic": "3",
+        "d3-selection": "3",
+        "d3-shape": "3",
+        "d3-time": "3",
+        "d3-time-format": "4",
+        "d3-timer": "3",
+        "d3-transition": "3",
+        "d3-zoom": "3"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-array": {
+      "version": "3.2.4",
+      "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz",
+      "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==",
+      "license": "ISC",
+      "dependencies": {
+        "internmap": "1 - 2"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-axis": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz",
+      "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==",
+      "license": "ISC",
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-brush": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz",
+      "integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-dispatch": "1 - 3",
+        "d3-drag": "2 - 3",
+        "d3-interpolate": "1 - 3",
+        "d3-selection": "3",
+        "d3-transition": "3"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-chord": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz",
+      "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-path": "1 - 3"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-color": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz",
+      "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==",
+      "license": "ISC",
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-contour": {
+      "version": "4.0.2",
+      "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-4.0.2.tgz",
+      "integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-array": "^3.2.0"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-delaunay": {
+      "version": "6.0.4",
+      "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.4.tgz",
+      "integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==",
+      "license": "ISC",
+      "dependencies": {
+        "delaunator": "5"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-dispatch": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz",
+      "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==",
+      "license": "ISC",
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-drag": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz",
+      "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-dispatch": "1 - 3",
+        "d3-selection": "3"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-dsv": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz",
+      "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==",
+      "license": "ISC",
+      "dependencies": {
+        "commander": "7",
+        "iconv-lite": "0.6",
+        "rw": "1"
+      },
+      "bin": {
+        "csv2json": "bin/dsv2json.js",
+        "csv2tsv": "bin/dsv2dsv.js",
+        "dsv2dsv": "bin/dsv2dsv.js",
+        "dsv2json": "bin/dsv2json.js",
+        "json2csv": "bin/json2dsv.js",
+        "json2dsv": "bin/json2dsv.js",
+        "json2tsv": "bin/json2dsv.js",
+        "tsv2csv": "bin/dsv2dsv.js",
+        "tsv2json": "bin/dsv2json.js"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-ease": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz",
+      "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==",
+      "license": "BSD-3-Clause",
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-fetch": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-3.0.1.tgz",
+      "integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-dsv": "1 - 3"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-force": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz",
+      "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-dispatch": "1 - 3",
+        "d3-quadtree": "1 - 3",
+        "d3-timer": "1 - 3"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-format": {
+      "version": "3.1.2",
+      "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz",
+      "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==",
+      "license": "ISC",
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-geo": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.1.tgz",
+      "integrity": "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-array": "2.5.0 - 3"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-hierarchy": {
+      "version": "3.1.2",
+      "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz",
+      "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==",
+      "license": "ISC",
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-interpolate": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
+      "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-color": "1 - 3"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-path": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz",
+      "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==",
+      "license": "ISC",
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-polygon": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz",
+      "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==",
+      "license": "ISC",
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-quadtree": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz",
+      "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==",
+      "license": "ISC",
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-random": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz",
+      "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==",
+      "license": "ISC",
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-sankey": {
+      "version": "0.12.3",
+      "resolved": "https://registry.npmjs.org/d3-sankey/-/d3-sankey-0.12.3.tgz",
+      "integrity": "sha512-nQhsBRmM19Ax5xEIPLMY9ZmJ/cDvd1BG3UVvt5h3WRxKg5zGRbvnteTyWAbzeSvlh3tW7ZEmq4VwR5mB3tutmQ==",
+      "license": "BSD-3-Clause",
+      "dependencies": {
+        "d3-array": "1 - 2",
+        "d3-shape": "^1.2.0"
+      }
+    },
+    "node_modules/d3-sankey/node_modules/d3-array": {
+      "version": "2.12.1",
+      "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz",
+      "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==",
+      "license": "BSD-3-Clause",
+      "dependencies": {
+        "internmap": "^1.0.0"
+      }
+    },
+    "node_modules/d3-sankey/node_modules/d3-path": {
+      "version": "1.0.9",
+      "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz",
+      "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==",
+      "license": "BSD-3-Clause"
+    },
+    "node_modules/d3-sankey/node_modules/d3-shape": {
+      "version": "1.3.7",
+      "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz",
+      "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==",
+      "license": "BSD-3-Clause",
+      "dependencies": {
+        "d3-path": "1"
+      }
+    },
+    "node_modules/d3-sankey/node_modules/internmap": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz",
+      "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==",
+      "license": "ISC"
+    },
+    "node_modules/d3-scale": {
+      "version": "4.0.2",
+      "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz",
+      "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-array": "2.10.0 - 3",
+        "d3-format": "1 - 3",
+        "d3-interpolate": "1.2.0 - 3",
+        "d3-time": "2.1.1 - 3",
+        "d3-time-format": "2 - 4"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-scale-chromatic": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz",
+      "integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-color": "1 - 3",
+        "d3-interpolate": "1 - 3"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-selection": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
+      "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
+      "license": "ISC",
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-shape": {
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz",
+      "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-path": "^3.1.0"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-time": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz",
+      "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-array": "2 - 3"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-time-format": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz",
+      "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-time": "1 - 3"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-timer": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz",
+      "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==",
+      "license": "ISC",
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/d3-transition": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz",
+      "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-color": "1 - 3",
+        "d3-dispatch": "1 - 3",
+        "d3-ease": "1 - 3",
+        "d3-interpolate": "1 - 3",
+        "d3-timer": "1 - 3"
+      },
+      "engines": {
+        "node": ">=12"
+      },
+      "peerDependencies": {
+        "d3-selection": "2 - 3"
+      }
+    },
+    "node_modules/d3-zoom": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz",
+      "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==",
+      "license": "ISC",
+      "dependencies": {
+        "d3-dispatch": "1 - 3",
+        "d3-drag": "2 - 3",
+        "d3-interpolate": "1 - 3",
+        "d3-selection": "2 - 3",
+        "d3-transition": "2 - 3"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/dagre-d3-es": {
+      "version": "7.0.14",
+      "resolved": "https://registry.npmjs.org/dagre-d3-es/-/dagre-d3-es-7.0.14.tgz",
+      "integrity": "sha512-P4rFMVq9ESWqmOgK+dlXvOtLwYg0i7u0HBGJER0LZDJT2VHIPAMZ/riPxqJceWMStH5+E61QxFra9kIS3AqdMg==",
+      "license": "MIT",
+      "dependencies": {
+        "d3": "^7.9.0",
+        "lodash-es": "^4.17.21"
+      }
+    },
+    "node_modules/dayjs": {
+      "version": "1.11.21",
+      "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.21.tgz",
+      "integrity": "sha512-98IT+HOahAisibz/yjKbzuOBwYcjJ7BCLPzARyHiyEBmRz4fatF+KPJszEHXsGYjUG234aH/cOjW1wwTbKUZlA==",
+      "license": "MIT"
+    },
     "node_modules/debug": {
       "version": "4.4.3",
       "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
@@ -3334,6 +4185,15 @@
         }
       }
     },
+    "node_modules/delaunator": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.1.0.tgz",
+      "integrity": "sha512-AGrQ4QSgssa1NGmWmLPqN5NY2KajF5MqxetNEO+o0n3ZwZZeTmt7bBnvzHWrmkZFxGgr4HdyFgelzgi06otLuQ==",
+      "license": "ISC",
+      "dependencies": {
+        "robust-predicates": "^3.0.2"
+      }
+    },
     "node_modules/detect-libc": {
       "version": "2.1.2",
       "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
@@ -3350,6 +4210,15 @@
       "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==",
       "license": "MIT"
     },
+    "node_modules/dompurify": {
+      "version": "3.4.13",
+      "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.13.tgz",
+      "integrity": "sha512-2vmYIoqjze2d+kakP8S/nS5shfsl587kzwEjcGlTdiksUVgFHnFCsLYDVj/JNqJVOQZGSYBTmuycv0PodwmnMQ==",
+      "license": "(MPL-2.0 OR Apache-2.0)",
+      "optionalDependencies": {
+        "@types/trusted-types": "^2.0.7"
+      }
+    },
     "node_modules/electron-to-chromium": {
       "version": "1.5.389",
       "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.389.tgz",
@@ -3371,6 +4240,17 @@
         "node": ">=10.13.0"
       }
     },
+    "node_modules/es-toolkit": {
+      "version": "1.50.0",
+      "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.50.0.tgz",
+      "integrity": "sha512-OyZKhUVvEep9ITEiwHn8GKnMRQIVqoSIX7WnRbkWgJkllCujilqP2rD0u979tkl8wqyc8ICwlc1UBVv/Sl1G6w==",
+      "license": "MIT",
+      "workspaces": [
+        "docs",
+        "benchmarks",
+        "tests/types"
+      ]
+    },
     "node_modules/esbuild": {
       "version": "0.28.1",
       "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz",
@@ -3482,6 +4362,43 @@
       "dev": true,
       "license": "ISC"
     },
+    "node_modules/hachure-fill": {
+      "version": "0.5.2",
+      "resolved": "https://registry.npmjs.org/hachure-fill/-/hachure-fill-0.5.2.tgz",
+      "integrity": "sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==",
+      "license": "MIT"
+    },
+    "node_modules/iconv-lite": {
+      "version": "0.6.3",
+      "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
+      "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
+      "license": "MIT",
+      "dependencies": {
+        "safer-buffer": ">= 2.1.2 < 3.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/import-meta-resolve": {
+      "version": "4.2.0",
+      "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz",
+      "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==",
+      "license": "MIT",
+      "funding": {
+        "type": "github",
+        "url": "https://github.com/sponsors/wooorm"
+      }
+    },
+    "node_modules/internmap": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz",
+      "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==",
+      "license": "ISC",
+      "engines": {
+        "node": ">=12"
+      }
+    },
     "node_modules/jiti": {
       "version": "2.7.0",
       "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz",
@@ -3525,6 +4442,42 @@
         "node": ">=6"
       }
     },
+    "node_modules/katex": {
+      "version": "0.16.47",
+      "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.47.tgz",
+      "integrity": "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg==",
+      "funding": [
+        "https://opencollective.com/katex",
+        "https://github.com/sponsors/katex"
+      ],
+      "license": "MIT",
+      "dependencies": {
+        "commander": "^8.3.0"
+      },
+      "bin": {
+        "katex": "cli.js"
+      }
+    },
+    "node_modules/katex/node_modules/commander": {
+      "version": "8.3.0",
+      "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
+      "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 12"
+      }
+    },
+    "node_modules/khroma": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/khroma/-/khroma-2.1.0.tgz",
+      "integrity": "sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw=="
+    },
+    "node_modules/layout-base": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-1.0.2.tgz",
+      "integrity": "sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg==",
+      "license": "MIT"
+    },
     "node_modules/lightningcss": {
       "version": "1.32.0",
       "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz",
@@ -3786,6 +4739,12 @@
         "url": "https://opencollective.com/parcel"
       }
     },
+    "node_modules/lodash-es": {
+      "version": "4.18.1",
+      "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.18.1.tgz",
+      "integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==",
+      "license": "MIT"
+    },
     "node_modules/lru-cache": {
       "version": "5.1.1",
       "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
@@ -3815,6 +4774,47 @@
         "@jridgewell/sourcemap-codec": "^1.5.5"
       }
     },
+    "node_modules/marked": {
+      "version": "16.4.2",
+      "resolved": "https://registry.npmjs.org/marked/-/marked-16.4.2.tgz",
+      "integrity": "sha512-TI3V8YYWvkVf3KJe1dRkpnjs68JUPyEa5vjKrp1XEEJUAOaQc+Qj+L1qWbPd0SJuAdQkFU0h73sXXqwDYxsiDA==",
+      "license": "MIT",
+      "bin": {
+        "marked": "bin/marked.js"
+      },
+      "engines": {
+        "node": ">= 20"
+      }
+    },
+    "node_modules/mermaid": {
+      "version": "11.16.1",
+      "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-11.16.1.tgz",
+      "integrity": "sha512-TQsq6u22fAn3rek5VOubrhKPo1g5hwC3FXUN9hiyupTckcYiGuuKGkNQrKYwGJkXUxZdojwRG46gsSCFZMDp4g==",
+      "license": "MIT",
+      "dependencies": {
+        "@braintree/sanitize-url": "^7.1.2",
+        "@iconify/utils": "^3.0.2",
+        "@mermaid-js/parser": "^1.2.0",
+        "@types/d3": "^7.4.3",
+        "@upsetjs/venn.js": "^2.0.0",
+        "cytoscape": "^3.33.3",
+        "cytoscape-cose-bilkent": "^4.1.0",
+        "cytoscape-fcose": "^2.2.0",
+        "d3": "^7.9.0",
+        "d3-sankey": "^0.12.3",
+        "dagre-d3-es": "7.0.14",
+        "dayjs": "^1.11.20",
+        "dompurify": "^3.3.3",
+        "es-toolkit": "^1.45.1",
+        "katex": "^0.16.45",
+        "khroma": "^2.1.0",
+        "marked": "^16.3.0",
+        "roughjs": "^4.6.6",
+        "stylis": "^4.3.6",
+        "ts-dedent": "^2.2.0",
+        "uuid": "^11.1.0 || ^12 || ^13 || ^14.0.0"
+      }
+    },
     "node_modules/ms": {
       "version": "2.1.3",
       "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@@ -3851,6 +4851,18 @@
         "node": ">=18"
       }
     },
+    "node_modules/package-manager-detector": {
+      "version": "1.8.0",
+      "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.8.0.tgz",
+      "integrity": "sha512-yQA4H19AmPEoMUeavPMDIe1higySl/gH/yaQrkT/s07Qp+7pp2hYz30N3z2l5BkjVkF9Ow6o0wjJamm2y7Sn0A==",
+      "license": "MIT"
+    },
+    "node_modules/path-data-parser": {
+      "version": "0.1.0",
+      "resolved": "https://registry.npmjs.org/path-data-parser/-/path-data-parser-0.1.0.tgz",
+      "integrity": "sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w==",
+      "license": "MIT"
+    },
     "node_modules/picocolors": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
@@ -3903,6 +4915,22 @@
         "node": ">=18"
       }
     },
+    "node_modules/points-on-curve": {
+      "version": "0.2.0",
+      "resolved": "https://registry.npmjs.org/points-on-curve/-/points-on-curve-0.2.0.tgz",
+      "integrity": "sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A==",
+      "license": "MIT"
+    },
+    "node_modules/points-on-path": {
+      "version": "0.2.1",
+      "resolved": "https://registry.npmjs.org/points-on-path/-/points-on-path-0.2.1.tgz",
+      "integrity": "sha512-25ClnWWuw7JbWZcgqY/gJ4FQWadKxGWk+3kR/7kD0tCaDtPPMj7oHu2ToLaVhfpnHrZzYby2w6tUA0eOIuUg8g==",
+      "license": "MIT",
+      "dependencies": {
+        "path-data-parser": "0.1.0",
+        "points-on-curve": "0.2.0"
+      }
+    },
     "node_modules/postcss": {
       "version": "8.5.19",
       "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.19.tgz",
@@ -4125,6 +5153,12 @@
         }
       }
     },
+    "node_modules/robust-predicates": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.3.tgz",
+      "integrity": "sha512-NS3levdsRIUOmiJ8FZWCP7LG3QpJyrs/TE0Zpf1yvZu8cAJJ6QMW92H1c7kWpdIHo8RvmLxN/o2JXTKHp74lUA==",
+      "license": "Unlicense"
+    },
     "node_modules/rollup": {
       "version": "4.62.2",
       "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz",
@@ -4170,6 +5204,30 @@
         "fsevents": "~2.3.2"
       }
     },
+    "node_modules/roughjs": {
+      "version": "4.6.6",
+      "resolved": "https://registry.npmjs.org/roughjs/-/roughjs-4.6.6.tgz",
+      "integrity": "sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ==",
+      "license": "MIT",
+      "dependencies": {
+        "hachure-fill": "^0.5.2",
+        "path-data-parser": "^0.1.0",
+        "points-on-curve": "^0.2.0",
+        "points-on-path": "^0.2.1"
+      }
+    },
+    "node_modules/rw": {
+      "version": "1.3.3",
+      "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz",
+      "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==",
+      "license": "BSD-3-Clause"
+    },
+    "node_modules/safer-buffer": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+      "license": "MIT"
+    },
     "node_modules/scheduler": {
       "version": "0.27.0",
       "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",
@@ -4206,6 +5264,12 @@
         "node": ">=0.10.0"
       }
     },
+    "node_modules/stylis": {
+      "version": "4.4.0",
+      "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.4.0.tgz",
+      "integrity": "sha512-5Z9ZpRzfuH6l/UAvCPAPUo3665Nk2wLaZU3x+TLHKVzIz33+sbJqbtrYoC3KD4/uVOr2Zp+L0LySezP9OHV9yA==",
+      "license": "MIT"
+    },
     "node_modules/tailwind-merge": {
       "version": "3.6.0",
       "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.6.0.tgz",
@@ -4237,6 +5301,15 @@
         "url": "https://opencollective.com/webpack"
       }
     },
+    "node_modules/tinyexec": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.0.tgz",
+      "integrity": "sha512-QKAl9m8gWWGHV8jZcPeym6j+XULi6tOf1mT83WYJ4Lk2ytW/uwAWkrP0uFsdoYMdueVJ0qs26wZ+23xeB4ibNQ==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=18"
+      }
+    },
     "node_modules/tinyglobby": {
       "version": "0.2.17",
       "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
@@ -4254,6 +5327,15 @@
         "url": "https://github.com/sponsors/SuperchupuDev"
       }
     },
+    "node_modules/ts-dedent": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.3.0.tgz",
+      "integrity": "sha512-JfJeIHke7y2egdGGgRAvpCwYFUsHlM2gPcrVOxFkznt/4uzQ7HFmvE63iFHVLBJNDuyDOQgijDK/tXH/f6Msjg==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=6.10"
+      }
+    },
     "node_modules/tslib": {
       "version": "2.8.1",
       "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
@@ -4358,6 +5440,19 @@
         }
       }
     },
+    "node_modules/uuid": {
+      "version": "14.0.1",
+      "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.1.tgz",
+      "integrity": "sha512-6ZxzVpzDXDa3bJWaHilVayA+BH/1zmxCJoVgvmqJnid/gPoKHxUrS/aC/T6LGQtNHT+XHG9fXPJB4d+IrU30Ew==",
+      "funding": [
+        "https://github.com/sponsors/broofa",
+        "https://github.com/sponsors/ctavan"
+      ],
+      "license": "MIT",
+      "bin": {
+        "uuid": "dist-node/bin/uuid"
+      }
+    },
     "node_modules/vite": {
       "version": "7.3.6",
       "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.6.tgz",
diff --git a/internal/webapp/frontend/package.json b/internal/webapp/frontend/package.json
index 0ac9e2c..a043274 100644
--- a/internal/webapp/frontend/package.json
+++ b/internal/webapp/frontend/package.json
@@ -18,6 +18,7 @@
     "clsx": "^2.1.1",
     "cmdk": "^1.1.1",
     "lucide-react": "^1.25.0",
+    "mermaid": "^11.16.1",
     "radix-ui": "^1.6.2",
     "react": "^19.2.0",
     "react-dom": "^19.2.0",
diff --git a/internal/webapp/frontend/src/components/FileView.tsx b/internal/webapp/frontend/src/components/FileView.tsx
index 0ed9a23..d344770 100644
--- a/internal/webapp/frontend/src/components/FileView.tsx
+++ b/internal/webapp/frontend/src/components/FileView.tsx
@@ -16,6 +16,7 @@ import {
   whoChanged,
 } from "../util";
 import { CSV_ROWS, parseDelimited, type Csv } from "../lib/csv";
+import { hasMermaid, renderMermaid } from "../lib/mermaid";
 
 export function FileView(props: {
   apiBase: string;
@@ -151,6 +152,25 @@ function MarkdownView(props: Parameters[0]) {
     [doc, path, apiBase],
   );
 
+  // Diagrams are rendered into a NEW html string and fed back through state,
+  // so the one dangerouslySetInnerHTML below re-mounts with the SVG already
+  // in it — the same reason transformHTML runs before the mount and not after
+  // it. Runs on transformHTML's output, so a diagram's SVG never goes through
+  // the img/link rewriting pass.
+  const [diagrams, setDiagrams] = useState(null);
+  useEffect(() => {
+    setDiagrams(null);
+    if (!hasMermaid(html)) return; // no fence: mermaid is never downloaded
+    let cancelled = false;
+    renderMermaid(html).then((out) => {
+      // A slow render of the file we just left must not paint over this one.
+      if (!cancelled) setDiagrams(out);
+    });
+    return () => {
+      cancelled = true;
+    };
+  }, [html]);
+
   useEffect(() => {
     if (!doc) return;
     const parts: string[] = [];
@@ -176,7 +196,7 @@ function MarkdownView(props: Parameters[0]) {
   // classic app assigning innerHTML.
   return (
     
handleLinkClick(e, path, flatFiles, onOpenFile)} /> ); diff --git a/internal/webapp/frontend/src/lib/mermaid.ts b/internal/webapp/frontend/src/lib/mermaid.ts new file mode 100644 index 0000000..2856195 --- /dev/null +++ b/internal/webapp/frontend/src/lib/mermaid.ts @@ -0,0 +1,100 @@ +/* Mermaid fences -> SVG, shared by the hub viewer and the /s/ share page. + + HTML string in, HTML string out: it never mutates a live DOM. The viewer + feeds the result back through state into its single dangerouslySetInnerHTML + (CLAUDE.md: React re-applies that markup on unrelated updates and silently + discards post-commit DOM patches), and the share page assigns the result + itself. + + Failure is the common path, not the edge case — hand-written diagrams in a + wiki fail to parse often. A fence that doesn't parse, a render that throws, + and a chunk that never loads all end up at the same place: today's +
 block, plus a small note. One bad fence never stops the good
+   ones beside it. */
+
+const SEL = "pre > code.language-mermaid";
+
+// Colours come from the surrounding surface rather than mermaid's stock
+// palette. The hub app is dark-only; the share page follows the OS.
+export type Palette = {
+  bg: string; // diagram node fill
+  line: string; // node borders and edges
+  text: string; // labels
+  accent: string; // the one highlight (cluster borders, note edges)
+};
+
+export const DARK: Palette = { bg: "#15171b", line: "#9aa0a9", text: "#eef0f3", accent: "#f5a623" };
+export const LIGHT: Palette = { bg: "#f6f8fa", line: "#57606a", text: "#24292f", accent: "#b26a00" };
+
+/** True when html contains at least one mermaid fence — cheap enough to gate
+ *  the dynamic import on, so a document without one downloads no mermaid. */
+export function hasMermaid(html: string): boolean {
+  return html.includes('class="language-mermaid"');
+}
+
+/** Renders every mermaid fence in html and returns the new HTML. Returns html
+ *  unchanged (importing nothing) when there are no fences, or when mermaid
+ *  itself fails to load. */
+export async function renderMermaid(html: string, palette: Palette = DARK): Promise {
+  if (!hasMermaid(html)) return html;
+  const doc = new DOMParser().parseFromString(html, "text/html");
+  const blocks = [...doc.querySelectorAll(SEL)];
+  if (!blocks.length) return html;
+
+  let mermaid;
+  try {
+    mermaid = (await import("mermaid")).default;
+    mermaid.initialize({
+      startOnLoad: false,
+      // The source is teammate-authored content on a page that carries a
+      // signed-in hub session. Don't relax this for htmlLabels.
+      securityLevel: "strict",
+      theme: "base",
+      fontFamily: "inherit",
+      themeVariables: {
+        background: "transparent",
+        primaryColor: palette.bg,
+        primaryTextColor: palette.text,
+        primaryBorderColor: palette.line,
+        secondaryColor: palette.bg,
+        tertiaryColor: palette.bg,
+        lineColor: palette.line,
+        textColor: palette.text,
+        mainBkg: palette.bg,
+        nodeBorder: palette.line,
+        clusterBkg: "transparent",
+        clusterBorder: palette.accent,
+        titleColor: palette.text,
+        edgeLabelBackground: palette.bg,
+      },
+    });
+  } catch {
+    return html; // chunk blocked or offline: today's code blocks, untouched
+  }
+
+  for (const [i, code] of blocks.entries()) {
+    const pre = code.parentElement!;
+    try {
+      // Unique per call as well as per block: two renders of the same
+      // document must not collide on an element id.
+      const id = "mmd-" + Math.random().toString(36).slice(2) + "-" + i;
+      const { svg } = await mermaid.render(id, code.textContent || "");
+      const wrap = doc.createElement("div");
+      wrap.className = "mermaid-diagram";
+      wrap.innerHTML = svg;
+      pre.replaceWith(wrap);
+    } catch {
+      const note = doc.createElement("div");
+      note.className = "mermaid-err";
+      note.textContent = "Couldn't render this diagram.";
+      pre.after(note);
+    }
+  }
+  // mermaid.render measures in a temporary `d` element on the live body
+  // and normally removes it itself; a throw mid-render can leave one behind.
+  // Deliberately `dmmd-` ONLY — sweeping `mmd-` would match the SVGs already
+  // MOUNTED from an earlier file and delete them, which is the post-commit
+  // DOM patch this whole helper exists to avoid.
+  for (const stray of document.querySelectorAll("[id^='dmmd-']")) stray.remove();
+  return doc.body.innerHTML;
+}
diff --git a/internal/webapp/frontend/src/share-mermaid.ts b/internal/webapp/frontend/src/share-mermaid.ts
new file mode 100644
index 0000000..0c74ffa
--- /dev/null
+++ b/internal/webapp/frontend/src/share-mermaid.ts
@@ -0,0 +1,18 @@
+/* The share page's only script. Injected by shares.go ONLY when the shared
+   document contains a mermaid fence, so a diagram-free share page still
+   downloads nothing.
+
+   No framework owns this DOM, so the rendered string goes straight back into
+   document.body. The page is served under `sandbox allow-scripts` with an
+   opaque origin — a module script and its import() both need
+   Access-Control-Allow-Origin on the static assets (server.go), which is why
+   this is a module rather than one self-contained classic bundle. */
+import { renderMermaid, DARK, LIGHT } from "./lib/mermaid";
+
+// Picked once, at load: the shell's colours come from a prefers-color-scheme
+// block, and mermaid bakes its palette in at render time.
+const dark = matchMedia("(prefers-color-scheme: dark)").matches;
+
+renderMermaid(document.body.innerHTML, dark ? DARK : LIGHT).then((html) => {
+  document.body.innerHTML = html;
+});
diff --git a/internal/webapp/frontend/src/style.css b/internal/webapp/frontend/src/style.css
index 4bc0271..1a6a543 100644
--- a/internal/webapp/frontend/src/style.css
+++ b/internal/webapp/frontend/src/style.css
@@ -1063,6 +1063,12 @@ a.ai-main:hover { color: var(--accent); }
 .markdown tr:hover td { background: rgba(255,255,255,.02); }
 .markdown img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); }
 .markdown hr { border: none; border-top: 1px solid var(--border); margin: 2.2em 0; }
+/* Rendered mermaid. The note is what a fence that doesn't parse gets, sitting
+   under the code block it kept — quiet, since a wiki full of hand-written
+   diagrams would otherwise be a wall of red. */
+.markdown .mermaid-diagram { margin: 1.3em 0; overflow-x: auto; }
+.markdown .mermaid-diagram svg { max-width: 100%; height: auto; }
+.markdown .mermaid-err { margin: -.9em 0 1.3em; font-size: 12px; color: var(--text-faint); }
 /* Frontmatter key/value table (server-rendered from a doc's YAML header). */
 .markdown table.frontmatter { margin: 0 0 1.8em; font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; border-collapse: separate; border-spacing: 0; }
 .markdown table.frontmatter th { text-transform: none; letter-spacing: 0; font-size: 11.5px; color: var(--text-faint); font-weight: 600; text-align: left; white-space: nowrap; vertical-align: top; padding: 6px 14px 6px 12px; border-bottom: 1px solid var(--border); }
diff --git a/internal/webapp/frontend/vite.config.ts b/internal/webapp/frontend/vite.config.ts
index 6a693d9..dc5e3bd 100644
--- a/internal/webapp/frontend/vite.config.ts
+++ b/internal/webapp/frontend/vite.config.ts
@@ -13,7 +13,27 @@ const target = process.env.BDRIVE_DEV_PROXY || "http://localhost:8080";
 export default defineConfig({
   plugins: [react(), tailwindcss()],
   resolve: { alias: { "@": path.resolve(__dirname, "src") } },
-  build: { outDir: "../static", emptyOutDir: true },
+  build: {
+    outDir: "../static",
+    emptyOutDir: true,
+    rollupOptions: {
+      // Two entries: the SPA, and the one script the server-rendered /s/
+      // share page loads when its document has a mermaid fence.
+      input: {
+        index: path.resolve(__dirname, "index.html"),
+        "share-mermaid": path.resolve(__dirname, "src/share-mermaid.ts"),
+      },
+      output: {
+        // Fixed name OUTSIDE assets/: sharedMarkdownShell is a const string
+        // and can't know a content hash, and server.go marks assets/
+        // immutable for a year — an unhashed file there would pin a stale
+        // bundle in shared caches. At the static root it gets no-cache.
+        // Mermaid's own chunks keep the hashed assets/ names.
+        entryFileNames: (c) =>
+          c.name === "share-mermaid" ? "[name].js" : "assets/[name]-[hash].js",
+      },
+    },
+  },
   server: {
     proxy: {
       // Everything the Go server owns; the frontend itself only ever uses
diff --git a/internal/webapp/server.go b/internal/webapp/server.go
index a84fce6..885bf4c 100644
--- a/internal/webapp/server.go
+++ b/internal/webapp/server.go
@@ -45,7 +45,14 @@ import (
 	"github.com/runbear-io/beardrive/internal/templates"
 )
 
-//go:embed static
+// all:, not a bare `static` — a bare embed silently skips every file whose
+// name begins with `_` or `.`, and Vite names shared chunks after the module
+// they came from (`_commonjsHelpers-.js` is the first one this build
+// produces). The miss is invisible at build time and total at runtime: the
+// chunk 404s, the SPA fallback answers with index.html, and the browser
+// refuses the whole entry over its MIME type — a blank app, not a degraded one.
+//
+//go:embed all:static
 var staticFiles embed.FS
 
 // Source supplies the file set and content of one volume. Implementations:
@@ -820,6 +827,18 @@ func (s *Server) frontend(static fs.FS) http.HandlerFunc {
 					if strings.HasPrefix(upath, "assets/") {
 						w.Header().Set("Cache-Control", "public, max-age=31536000, immutable")
 					}
+					// The /s/ share page runs under `sandbox allow-scripts`, so
+					// its origin is opaque: a module script and every import()
+					// it makes are fetched with `Origin: null` and blocked
+					// without this. That is how share-mermaid.js and mermaid's
+					// chunks reach a share page at all.
+					//
+					// On the real asset ONLY, never on the index.html fallback
+					// below: these files are already public, unauthenticated
+					// and cookie-less, and `*` forbids credentialed requests by
+					// definition, so this grants a cross-origin reader nothing
+					// it could not already fetch in no-cors mode.
+					w.Header().Set("Access-Control-Allow-Origin", "*")
 					files.ServeHTTP(w, r) // a real asset
 					return
 				}
diff --git a/internal/webapp/shares.go b/internal/webapp/shares.go
index 858bc39..39df55e 100644
--- a/internal/webapp/shares.go
+++ b/internal/webapp/shares.go
@@ -567,7 +567,7 @@ func (s *Server) handleShared(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 		w.Header().Set("Content-Type", "text/html; charset=utf-8")
-		fmt.Fprintf(cw, sharedMarkdownShell, html.EscapeString(path.Base(sp)), updatedStamp(fi.Time), body)
+		fmt.Fprintf(cw, sharedMarkdownShell, html.EscapeString(path.Base(sp)), mermaidTag(body), updatedStamp(fi.Time), body)
 	case ".html", ".htm":
 		w.Header().Set("Content-Type", "text/html; charset=utf-8")
 		io.Copy(cw, rc)
@@ -590,8 +590,25 @@ func updatedStamp(t time.Time) string {
 		html.EscapeString(t.Format(time.RFC3339)), html.EscapeString(t.Format("2 Jan 2006")))
 }
 
+// mermaidTag is the share page's only script, and only when the document
+// actually has a diagram in it — a share page without a mermaid fence must
+// stay the byte-for-byte zero-JavaScript document it has always been.
+//
+// The tag is a module: under this page's sandbox CSP the origin is opaque, so
+// the asset responses carry Access-Control-Allow-Origin (server.go) and
+// mermaid keeps its code splitting instead of arriving as one file. The name
+// is fixed and lives outside assets/ because this template cannot know Vite's
+// content hash.
+func mermaidTag(body string) string {
+	if !strings.Contains(body, `class="language-mermaid"`) {
+		return ""
+	}
+	return ``
+}
+
 // sharedMarkdownShell wraps rendered markdown in a minimal readable page.
-// Verbs, in order: title, updated stamp, body.
+// Verbs, in order: title, mermaid script tag (usually empty), updated stamp,
+// body.
 const sharedMarkdownShell = `
 %s
 %s%s
+.updated{color:#868b93}
+.mermaid-err{color:#868b93}}
+%s%s%s
 
Shared with BearDrive — synced files for AI agent teams
` diff --git a/internal/webapp/shares_test.go b/internal/webapp/shares_test.go index d25f065..b9cb56a 100644 --- a/internal/webapp/shares_test.go +++ b/internal/webapp/shares_test.go @@ -486,6 +486,41 @@ func TestShareDarkThemeIsLast(t *testing.T) { } } +// A share page is a zero-JavaScript document, and it stays one unless the +// document it renders actually has a diagram in it. The tag is the whole cost +// of the feature for every other share page on the hub, so it is worth a test +// that it isn't paid — and that the CSP sandbox that makes the tag work at all +// is unchanged. +func TestShareMermaidScriptOnlyWhenNeeded(t *testing.T) { + srv, p, _, f, h := shareHub(t) + f.put("dev1", "wiki/diagram.md", "# D\n\n```mermaid\ngraph TD\n A --> B\n```\n") + + tag := `` + + token, _ := authedShare(t, srv, h, p.ID, "wiki/diagram.md") + rec := do(t, h, "GET", "/s/"+token, nil) + body := rec.Body.String() + if !strings.Contains(body, tag) { + t.Errorf("a document with a mermaid fence must load the script: %s", body) + } + if strings.Contains(body, "%!") { + t.Errorf("format verb leaked into the page: %s", body) + } + // The tag only works because the page is sandboxed with scripts allowed + // and its origin is opaque; adding allow-same-origin to make loading + // easier would hand shared content the hub's origin. + if csp := rec.Header().Get("Content-Security-Policy"); csp != "sandbox allow-scripts allow-popups" { + t.Errorf("share CSP = %q, want the unchanged sandbox", csp) + } + + // wiki/notes.md has no fence: not one byte of mermaid. + plain, _ := authedShare(t, srv, h, p.ID, "wiki/notes.md") + if b := do(t, h, "GET", "/s/"+plain, nil).Body.String(); strings.Contains(b, "share-mermaid") || + strings.Contains(b, "{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram}; diff --git a/internal/webapp/static/assets/arc-DQmUyXqg.js b/internal/webapp/static/assets/arc-DQmUyXqg.js new file mode 100644 index 0000000..1425511 --- /dev/null +++ b/internal/webapp/static/assets/arc-DQmUyXqg.js @@ -0,0 +1 @@ +import{Y as ln,$ as an,a0 as F,a1 as q,a2 as j,a3 as un,a4 as y,a5 as tn,a6 as J,a7 as _,a8 as rn,a9 as o,aa as on,ab as sn,ac as fn}from"./mermaid.core-B7WVQkyL.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,z,a){var O=I-l,i=D-h,n=z-v,d=a-A,u=d*O-n*i;if(!(u*ur*r+C*C&&(Y=w,$=p),{cx:Y,cy:$,x01:-n,y01:-d,x11:Y*(v/T-1),y11:$*(v/T-1)}}function hn(){var l=cn,h=yn,I=j(0),D=null,v=gn,A=dn,z=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,B=rn(c-f),t=c>f;if(a||(a=n=O()),sy))a.moveTo(0,0);else if(B>tn-y)a.moveTo(s*F(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*F(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=B,S=B,Y=z.apply(this,arguments)/2,$=Y>y&&(D?+D.apply(this,arguments):J(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if($>y){var C=sn($/u*q(Y)),K=sn($/s*q(Y));(P-=C*2)>y?(C*=t?1:-1,R+=C,T-=C):(P=0,R=T=(f+c)/2),(S-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(S=0,m=g=(f+c)/2)}var G=s*F(m),H=s*q(m),L=u*F(T),M=u*q(T);if(w>y){var N=s*F(g),Q=s*q(g),V=u*F(R),W=u*q(R),E;if(By?x>y?(e=U(V,W,G,H,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(G,H,V,W,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),ps?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),h=t.inverseTransformPoint(c);this.setLocation(h.x,h.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},w.exports=e}),(function(w,R,T){var v=T(0);function l(){}for(var i in v)l[i]=v[i];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,l.COOLING_ADAPTATION_FACTOR=.33,l.ADAPTATION_LOWER_NODE_LIMIT=1e3,l.ADAPTATION_UPPER_NODE_LIMIT=5e3,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,w.exports=l}),(function(w,R,T){function v(l,i){l==null&&i==null?(this.x=0,this.y=0):(this.x=l,this.y=i)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(l){this.x=l},v.prototype.setY=function(l){this.y=l},v.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},w.exports=v}),(function(w,R,T){var v=T(2),l=T(10),i=T(0),r=T(7),a=T(3),f=T(1),e=T(13),d=T(12),t=T(11);function s(c,h,N){v.call(this,N),this.estimatedSize=l.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,h!=null&&h instanceof r?this.graphManager=h:h!=null&&h instanceof Layout&&(this.graphManager=h.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,h,N){if(h==null&&N==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var u=c;if(!(this.getNodes().indexOf(h)>-1&&this.getNodes().indexOf(N)>-1))throw"Source or target not in graph!";if(!(h.owner==N.owner&&h.owner==this))throw"Both owners must be this graph!";return h.owner!=N.owner?null:(u.source=h,u.target=N,u.isInterGraph=!1,this.getEdges().push(u),h.edges.push(u),N!=h&&N.edges.push(u),u)}},s.prototype.remove=function(c){var h=c;if(c instanceof a){if(h==null)throw"Node is null!";if(!(h.owner!=null&&h.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var N=h.edges.slice(),g,u=N.length,L=0;L-1&&G>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(C,1),g.target!=g.source&&g.target.edges.splice(G,1);var F=g.source.owner.getEdges().indexOf(g);if(F==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(F,1)}},s.prototype.updateLeftTop=function(){for(var c=l.MAX_VALUE,h=l.MAX_VALUE,N,g,u,L=this.getNodes(),F=L.length,C=0;CN&&(c=N),h>g&&(h=g)}return c==l.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?u=L[0].getParent().paddingLeft:u=this.margin,this.left=h-u,this.top=c-u,new d(this.left,this.top))},s.prototype.updateBounds=function(c){for(var h=l.MAX_VALUE,N=-l.MAX_VALUE,g=l.MAX_VALUE,u=-l.MAX_VALUE,L,F,C,G,V,Y=this.nodes,z=Y.length,A=0;AL&&(h=L),NC&&(g=C),uL&&(h=L),NC&&(g=C),u=this.nodes.length){var z=0;N.forEach(function(A){A.owner==c&&z++}),z==this.nodes.length&&(this.isConnected=!0)}},w.exports=s}),(function(w,R,T){var v,l=T(1);function i(r){v=T(6),this.layout=r,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(r,a);return this.setRootGraph(f),this.rootGraph},i.prototype.add=function(r,a,f,e,d){if(f==null&&e==null&&d==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{d=f,e=a,f=r;var t=e.getOwner(),s=d.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,d);if(f.isInterGraph=!0,f.source=e,f.target=d,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},i.prototype.remove=function(r){if(r instanceof v){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var e,d=f.length,t=0;t=r.getRight()?a[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight()):r.getX()<=i.getX()&&r.getRight()>=i.getRight()&&(a[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight())),i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()):r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()&&(a[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()));var d=Math.abs((r.getCenterY()-i.getCenterY())/(r.getCenterX()-i.getCenterX()));r.getCenterY()===i.getCenterY()&&r.getCenterX()===i.getCenterX()&&(d=1);var t=d*a[0],s=a[1]/d;a[0]t)return a[0]=f,a[1]=o,a[2]=d,a[3]=Y,!1;if(ed)return a[0]=s,a[1]=e,a[2]=G,a[3]=t,!1;if(fd?(a[0]=h,a[1]=N,n=!0):(a[0]=c,a[1]=o,n=!0):p===y&&(f>d?(a[0]=s,a[1]=o,n=!0):(a[0]=g,a[1]=N,n=!0)),-m===y?d>f?(a[2]=V,a[3]=Y,E=!0):(a[2]=G,a[3]=C,E=!0):m===y&&(d>f?(a[2]=F,a[3]=C,E=!0):(a[2]=z,a[3]=Y,E=!0)),n&&E)return!1;if(f>d?e>t?(S=this.getCardinalDirection(p,y,4),D=this.getCardinalDirection(m,y,2)):(S=this.getCardinalDirection(-p,y,3),D=this.getCardinalDirection(-m,y,1)):e>t?(S=this.getCardinalDirection(-p,y,1),D=this.getCardinalDirection(-m,y,3)):(S=this.getCardinalDirection(p,y,2),D=this.getCardinalDirection(m,y,4)),!n)switch(S){case 1:W=o,b=f+-L/y,a[0]=b,a[1]=W;break;case 2:b=g,W=e+u*y,a[0]=b,a[1]=W;break;case 3:W=N,b=f+L/y,a[0]=b,a[1]=W;break;case 4:b=h,W=e+-u*y,a[0]=b,a[1]=W;break}if(!E)switch(D){case 1:Q=C,I=d+-_/y,a[2]=I,a[3]=Q;break;case 2:I=z,Q=t+A*y,a[2]=I,a[3]=Q;break;case 3:Q=Y,I=d+_/y,a[2]=I,a[3]=Q;break;case 4:I=V,Q=t+-A*y,a[2]=I,a[3]=Q;break}}return!1},l.getCardinalDirection=function(i,r,a){return i>r?a:1+a%4},l.getIntersection=function(i,r,a,f){if(f==null)return this.getIntersection2(i,r,a);var e=i.x,d=i.y,t=r.x,s=r.y,o=a.x,c=a.y,h=f.x,N=f.y,g=void 0,u=void 0,L=void 0,F=void 0,C=void 0,G=void 0,V=void 0,Y=void 0,z=void 0;return L=s-d,C=e-t,V=t*d-e*s,F=N-c,G=o-h,Y=h*c-o*N,z=L*G-F*C,z===0?null:(g=(C*Y-G*V)/z,u=(F*V-L*Y)/z,new v(g,u))},l.angleOfVector=function(i,r,a,f){var e=void 0;return i!==a?(e=Math.atan((f-r)/(a-i)),a=0){var N=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),u=null;return N>=0&&N<=1?[N]:g>=0&&g<=1?[g]:u}else return null},l.HALF_PI=.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,w.exports=l}),(function(w,R,T){function v(){}v.sign=function(l){return l>0?1:l<0?-1:0},v.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},v.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},w.exports=v}),(function(w,R,T){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,w.exports=v}),(function(w,R,T){var v=(function(){function e(d,t){for(var s=0;s"u"?"undefined":v(i);return i==null||r!="object"&&r!="function"},w.exports=l}),(function(w,R,T){function v(o){if(Array.isArray(o)){for(var c=0,h=Array(o.length);c0&&c;){for(L.push(C[0]);L.length>0&&c;){var G=L[0];L.splice(0,1),u.add(G);for(var V=G.getEdges(),g=0;g-1&&C.splice(_,1)}u=new Set,F=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],h=o.source,N=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var N=this.edgeToDummyNodes.get(h),g=0;g=0&&c.splice(Y,1);var z=F.getNeighborsList();z.forEach(function(n){if(h.indexOf(n)<0){var E=N.get(n),p=E-1;p==1&&G.push(n),N.set(n,p)}})}h=h.concat(G),(c.length==1||c.length==2)&&(g=!0,u=c[0])}return u},s.prototype.setGraphManager=function(o){this.graphManager=o},w.exports=s}),(function(w,R,T){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},w.exports=v}),(function(w,R,T){var v=T(5);function l(i,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}l.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(i){this.lworldExtX=i},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(i){this.lworldExtY=i},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},l.prototype.transformX=function(i){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/a),r},l.prototype.transformY=function(i){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/a),r},l.prototype.inverseTransformX=function(i){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/a),r},l.prototype.inverseTransformY=function(i){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/a),r},l.prototype.inverseTransformPoint=function(i){var r=new v(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return r},w.exports=l}),(function(w,R,T){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);si.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,h,N,g=this.getAllNodes(),u;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),u=new Set,o=0;oL||u>L)&&(t.gravitationForceX=-this.gravityConstant*h,t.gravitationForceY=-this.gravityConstant*N)):(L=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>L||u>L)&&(t.gravitationForceX=-this.gravityConstant*h*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*N*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||L>=g[0].length)){for(var F=0;Fe}}]),a})();w.exports=r}),(function(w,R,T){function v(){}v.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var i=Math.min(this.m,this.n);this.s=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var wt=function $t(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)wt.push(0);return wt})(this.n),a=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(this.m),f=!0,e=Math.min(this.m-1,this.n),d=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;$--){if((function(Tt,wt){return Tt&&wt})($0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),Ct=this.s[ut]/Et,Dt=it/Et;this.s[ut]=Et,ut!==J&&(it=-Dt*r[ut-1],r[ut-1]=Ct*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(i)?(r=i/l,r=Math.abs(l)*Math.sqrt(1+r*r)):i!=0?(r=l/i,r=Math.abs(i)*Math.sqrt(1+r*r)):r=0,r},w.exports=v}),(function(w,R,T){var v=(function(){function r(a,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,r),this.sequence1=a,this.sequence2=f,this.match_score=e,this.mismatch_penalty=d,this.gap_penalty=t,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;a--){var f=this.listeners[a];f.event===i&&f.callback===r&&this.listeners.splice(a,1)}},l.emit=function(i,r){for(var a=0;a{var R={45:((i,r,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),i.exports=f}),806:((i,r,a)=>{var f=a(551).FDLayoutConstants;function e(){}for(var d in f)e[d]=f[d];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,i.exports=e}),767:((i,r,a)=>{var f=a(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var d in f)e[d]=f[d];i.exports=e}),880:((i,r,a)=>{var f=a(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var d in f)e[d]=f[d];i.exports=e}),578:((i,r,a)=>{var f=a(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var d in f)e[d]=f[d];i.exports=e}),765:((i,r,a)=>{var f=a(551).FDLayout,e=a(578),d=a(880),t=a(991),s=a(767),o=a(806),c=a(902),h=a(551).FDLayoutConstants,N=a(551).LayoutConstants,g=a(551).Point,u=a(551).PointD,L=a(551).DimensionD,F=a(551).Layout,C=a(551).Integer,G=a(551).IGeometry,V=a(551).LGraph,Y=a(551).Transform,z=a(551).LinkedList;function A(){f.call(this),this.toBeTiled={},this.constraints={}}A.prototype=Object.create(f.prototype);for(var _ in f)A[_]=f[_];A.prototype.newGraphManager=function(){var n=new e(this);return this.graphManager=n,n},A.prototype.newGraph=function(n){return new d(null,this.graphManager,n)},A.prototype.newNode=function(n){return new t(this.graphManager,n)},A.prototype.newEdge=function(n){return new s(null,null,n)},A.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=h.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=h.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},A.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/h.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},A.prototype.layout=function(){var n=N.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},A.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(S){return E.has(S)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},A.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%h.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=S)}}if(this.constraints.relativePlacementConstraint){var D=new Map,b=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){n.fixedNodesOnHorizontal.add(O),n.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*O.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),Z=O[tt],O[tt]=O[H],O[H]=Z;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(Z)||(n.nodesInRelativeHorizontal.push(Z),n.nodeToRelativeConstraintMapHorizontal.set(Z,[]),n.dummyToNodeForVerticalAlignment.has(Z)?n.nodeToTempPositionMapHorizontal.set(Z,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(Z,n.idToNodeMap.get(Z).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:Z,gap:O.gap}),n.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:H,gap:O.gap})}else{var tt=b.has(O.top)?b.get(O.top):O.top,ht=b.has(O.bottom)?b.get(O.bottom):O.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:O.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:O.gap})}});else{var Q=new Map,$=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;Q.has(H)?Q.get(H).push(Z):Q.set(H,[Z]),Q.has(Z)?Q.get(Z).push(H):Q.set(Z,[H])}else{var tt=b.has(O.top)?b.get(O.top):O.top,ht=b.has(O.bottom)?b.get(O.bottom):O.bottom;$.has(tt)?$.get(tt).push(ht):$.set(tt,[ht]),$.has(ht)?$.get(ht).push(tt):$.set(ht,[tt])}});var X=function(H,Z){var tt=[],ht=[],J=new z,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),Z.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(Ct){It.has(Ct)||(J.push(Ct),It.add(Ct),tt[Nt].push(Ct))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var B=X($,n.fixedNodesOnVertical);this.componentsOnVertical=B.components,this.fixedComponentsOnVertical=B.isFixed}}},A.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(B){var O=n.idToNodeMap.get(B.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var b;for(b=0;bm&&(m=Math.floor(D.y)),S=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new u(N.WORLD_CENTER_X-D.x/2,N.WORLD_CENTER_Y-D.y/2))},A.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(E,null,0,359,0,m);var y=V.calculateBounds(n),S=new Y;S.setDeviceOrgX(y.getMinX()),S.setDeviceOrgY(y.getMinY()),S.setWorldOrgX(p.x),S.setWorldOrgY(p.y);for(var D=0;D1;){var Z=H[0];H.splice(0,1);var tt=$.indexOf(Z);tt>=0&&$.splice(tt,1),B--,X--}E!=null?O=($.indexOf(H[0])+1)%B:O=0;for(var ht=Math.abs(m-p)/X,J=O;rt!=X;J=++J%B){var It=$[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;A.branchRadialLayout(It,n,Nt,vt,y+S,S),rt++}}},A.maxDiagonalInTree=function(n){for(var E=C.MIN_VALUE,p=0;pE&&(E=y)}return E},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[b]=[]),E[b]=E[b].concat(S)}Object.keys(E).forEach(function(W){if(E[W].length>1){var I="DummyCompound_"+W;n.memberGroups[I]=E[W];var Q=E[W][0].getParent(),$=new t(n.graphManager);$.id=I,$.paddingLeft=Q.paddingLeft||0,$.paddingRight=Q.paddingRight||0,$.paddingBottom=Q.paddingBottom||0,$.paddingTop=Q.paddingTop||0,n.idToDummyNode[I]=$;var X=n.getGraphManager().add(n.newGraph(),$),rt=Q.getChild();rt.add($);for(var B=0;By?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(S+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>S?(m.rect.y-=(m.labelHeight-S)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-S)/2):m.labelPosVertical=="bottom"&&m.setHeight(S+m.labelHeight))}})},A.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,S=E.labelMarginLeft,D=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,S,D)}},A.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,S=m.paddingTop,D=m.labelMarginLeft,b=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,S,D,b)})},A.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(S.getChild()==null){this.toBeTiled[S.id]=!1;continue}if(!this.getToBeTiled(S))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},A.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},A.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var S=y.rect.width,D=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(S+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>S?(y.rect.x-=(y.labelWidth-S)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-S)/2):y.labelPosHorizontal=="right"&&y.setWidth(S+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(D+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>D?(y.rect.y-=(y.labelHeight-D)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-D)/2):y.labelPosVertical=="bottom"&&y.setHeight(D+y.labelHeight))}})},A.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),S=this.getOrgRatio(m),D;return Sb&&(b=B.getWidth())});var W=S/y,I=D/y,Q=Math.pow(p-m,2)+4*(W+m)*(I+p)*y,$=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil($),X==$&&X++):X=Math.floor($);var rt=X*(W+m)-m;return b>rt&&(rt=b),rt+=m*2,rt},A.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,S=o.TILING_COMPARE_BY,D={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};S&&(D.idealRowWidth=this.calcIdealRowWidth(n,p));var b=function(O){return O.rect.width*O.rect.height},W=function(O,H){return b(H)-b(O)};n.sort(function(B,O){var H=W;return D.idealRowWidth?(H=S,H(B.id,O.id)):H(B,O)});for(var I=0,Q=0,$=0;$0&&(D+=n.horizontalPadding),n.rowWidth[p]=D,n.width0&&(b+=n.verticalPadding);var W=0;b>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=b,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},A.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},A.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var S=this.getShortestRowIndex(n);if(S<0)return!0;var D=n.rowWidth[S];if(D+n.horizontalPadding+E<=n.width)return!0;var b=0;n.rowHeight[S]0&&(b=p+n.verticalPadding-n.rowHeight[S]);var W;n.width-D>=E+n.horizontalPadding?W=(n.height+b)/(D+E+n.horizontalPadding):W=(n.height+b)/n.width,b=p+n.verticalPadding;var I;return n.widthS&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-S,n.rowWidth[p]=n.rowWidth[p]+S,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var D=Number.MIN_VALUE,b=0;bD&&(D=m[b].height);E>0&&(D+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=D,n.rowHeight[p]0)for(var rt=y;rt<=S;rt++)X[0]+=this.grid[rt][D-1].length+this.grid[rt][D].length-1;if(S0)for(var rt=D;rt<=b;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var B=C.MAX_VALUE,O,H,Z=0;Z{var f=a(551).FDLayoutNode,e=a(551).IMath;function d(s,o,c,h){f.call(this,s,o,c,h)}d.prototype=Object.create(f.prototype);for(var t in f)d[t]=f[t];d.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},d.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),h,N=0;N{function f(c){if(Array.isArray(c)){for(var h=0,N=Array(c.length);h0){var Lt=0;ot.forEach(function(st){k=="horizontal"?(et.set(st,g.has(st)?u[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?L[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){k=="horizontal"?ft+=g.has(st)?u[g.get(st)]:q.get(st):ft+=g.has(st)?L[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var Mt=function(){var ot=dt.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=Zt),KtXt&&(Xt=Kt)}}catch(ee){wt=!0,$t=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(wt)throw $t}}var ce=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),oe;!(Qt=(oe=Jt.next()).done);Qt=!0){var te=oe.value;et.set(te,et.get(te)+ce)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(U){var k=0,K=0,q=0,at=0;if(U.forEach(function(j){j.left?u[g.get(j.left)]-u[g.get(j.right)]>=0?k++:K++:L[g.get(j.top)]-L[g.get(j.bottom)]>=0?q++:at++}),k>K&&q>at)for(var gt=0;gtK)for(var nt=0;ntat)for(var et=0;et1)h.fixedNodeConstraint.forEach(function(P,U){m[U]=[P.position.x,P.position.y],y[U]=[u[g.get(P.nodeId)],L[g.get(P.nodeId)]]}),S=!0;else if(h.alignmentConstraint)(function(){var P=0;if(h.alignmentConstraint.vertical){for(var U=h.alignmentConstraint.vertical,k=function(et){var j=new Set;U[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return b.has(pt)})),Mt=void 0;dt.size>0?Mt=u[g.get(dt.values().next().value)]:Mt=z(j).x,U[et].forEach(function(pt){m[P]=[Mt,L[g.get(pt)]],y[P]=[u[g.get(pt)],L[g.get(pt)]],P++})},K=0;K0?Mt=u[g.get(dt.values().next().value)]:Mt=z(j).y,q[et].forEach(function(pt){m[P]=[u[g.get(pt)],Mt],y[P]=[u[g.get(pt)],L[g.get(pt)]],P++})},gt=0;gt$&&($=Q[rt].length,X=rt);if($0){var mt={x:0,y:0};h.fixedNodeConstraint.forEach(function(P,U){var k={x:u[g.get(P.nodeId)],y:L[g.get(P.nodeId)]},K=P.position,q=Y(K,k);mt.x+=q.x,mt.y+=q.y}),mt.x/=h.fixedNodeConstraint.length,mt.y/=h.fixedNodeConstraint.length,u.forEach(function(P,U){u[U]+=mt.x}),L.forEach(function(P,U){L[U]+=mt.y}),h.fixedNodeConstraint.forEach(function(P){u[g.get(P.nodeId)]=P.position.x,L[g.get(P.nodeId)]=P.position.y})}if(h.alignmentConstraint){if(h.alignmentConstraint.vertical)for(var Ot=h.alignmentConstraint.vertical,Rt=function(U){var k=new Set;Ot[U].forEach(function(at){k.add(at)});var K=new Set([].concat(f(k)).filter(function(at){return b.has(at)})),q=void 0;K.size>0?q=u[g.get(K.values().next().value)]:q=z(k).x,k.forEach(function(at){b.has(at)||(u[g.get(at)]=q)})},Ht=0;Ht0?q=L[g.get(K.values().next().value)]:q=z(k).y,k.forEach(function(at){b.has(at)||(L[g.get(at)]=q)})},Ft=0;Ft{i.exports=w})},T={};function v(i){var r=T[i];if(r!==void 0)return r.exports;var a=T[i]={exports:{}};return R[i](a,a.exports,v),a.exports}var l=v(45);return l})()})})(le)),le.exports}var mr=he.exports,xe;function Er(){return xe||(xe=1,(function(x,M){(function(R,T){x.exports=T(yr())})(mr,function(w){return(()=>{var R={658:(i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var a=arguments.length,f=Array(a>1?a-1:0),e=1;e{var f=(function(){function t(s,o){var c=[],h=!0,N=!1,g=void 0;try{for(var u=s[Symbol.iterator](),L;!(h=(L=u.next()).done)&&(c.push(L.value),!(o&&c.length===o));h=!0);}catch(F){N=!0,g=F}finally{try{!h&&u.return&&u.return()}finally{if(N)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=a(140).layoutBase.LinkedList,d={};d.getTopMostNodes=function(t){for(var s={},o=0;o0&&S.merge(I)});for(var D=0;D1){L=g[0],F=L.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),V),Y},d.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,N=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var u=!0,L=!1,F=void 0;try{for(var C=s.nodeIndexes[Symbol.iterator](),G;!(u=(G=C.next()).done);u=!0){var V=G.value,Y=f(V,2),z=Y[0],A=Y[1],_=o.cy.getElementById(z);if(_){var n=_.boundingBox(),E=s.xCoords[A]-n.w/2,p=s.xCoords[A]+n.w/2,m=s.yCoords[A]-n.h/2,y=s.yCoords[A]+n.h/2;Eh&&(h=p),mg&&(g=y)}}}catch(I){L=!0,F=I}finally{try{!u&&C.return&&C.return()}finally{if(L)throw F}}var S=t.x-(h+c)/2,D=t.y-(g+N)/2;s.xCoords=s.xCoords.map(function(I){return I+S}),s.yCoords=s.yCoords.map(function(I){return I+D})}else{Object.keys(s).forEach(function(I){var Q=s[I],$=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,B=Q.getRect().y+Q.getRect().height;$h&&(h=X),rtg&&(g=B)});var b=t.x-(h+c)/2,W=t.y-(g+N)/2;Object.keys(s).forEach(function(I){var Q=s[I];Q.setCenter(Q.getCenterX()+b,Q.getCenterY()+W)})}}},d.calcBoundingBox=function(t,s,o,c){for(var h=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,u=Number.MIN_SAFE_INTEGER,L=void 0,F=void 0,C=void 0,G=void 0,V=t.descendants().not(":parent"),Y=V.length,z=0;zL&&(h=L),NC&&(g=C),u{var f=a(548),e=a(140).CoSELayout,d=a(140).CoSENode,t=a(140).layoutBase.PointD,s=a(140).layoutBase.DimensionD,o=a(140).layoutBase.LayoutConstants,c=a(140).layoutBase.FDLayoutConstants,h=a(140).CoSEConstants,N=function(u,L){var F=u.cy,C=u.eles,G=C.nodes(),V=C.edges(),Y=void 0,z=void 0,A=void 0,_={};u.randomize&&(Y=L.nodeIndexes,z=L.xCoords,A=L.yCoords);var n=function(I){return typeof I=="function"},E=function(I,Q){return n(I)?I(Q):I},p=f.calcParentsWithoutChildren(F,C),m=function W(I,Q,$,X){for(var rt=Q.length,B=0;B0){var J=void 0;J=$.getGraphManager().add($.newGraph(),Z),W(J,H,$,X)}}},y=function(I,Q,$){for(var X=0,rt=0,B=0;B<$.length;B++){var O=$[B],H=_[O.data("source")],Z=_[O.data("target")];if(H&&Z&&H!==Z&&H.getEdgesBetween(Z).length==0){var tt=Q.add(I.newEdge(),H,Z);tt.id=O.id(),tt.idealLength=E(u.idealEdgeLength,O),tt.edgeElasticity=E(u.edgeElasticity,O),X+=tt.idealLength,rt++}}u.idealEdgeLength!=null&&(rt>0?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(u.idealEdgeLength)?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=u.idealEdgeLength,h.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,h.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},S=function(I,Q){Q.fixedNodeConstraint&&(I.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(I.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(I.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};u.nestingFactor!=null&&(h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.nestingFactor),u.gravity!=null&&(h.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=u.gravity),u.numIter!=null&&(h.MAX_ITERATIONS=c.MAX_ITERATIONS=u.numIter),u.gravityRange!=null&&(h.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=u.gravityRange),u.gravityCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.gravityCompound),u.gravityRangeCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.gravityRangeCompound),u.initialEnergyOnIncremental!=null&&(h.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.initialEnergyOnIncremental),u.tilingCompareBy!=null&&(h.TILING_COMPARE_BY=u.tilingCompareBy),u.quality=="proof"?o.QUALITY=2:o.QUALITY=0,h.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=u.nodeDimensionsIncludeLabels,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!u.randomize,h.ANIMATE=c.ANIMATE=o.ANIMATE=u.animate,h.TILE=u.tile,h.TILING_PADDING_VERTICAL=typeof u.tilingPaddingVertical=="function"?u.tilingPaddingVertical.call():u.tilingPaddingVertical,h.TILING_PADDING_HORIZONTAL=typeof u.tilingPaddingHorizontal=="function"?u.tilingPaddingHorizontal.call():u.tilingPaddingHorizontal,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,h.PURE_INCREMENTAL=!u.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=u.uniformNodeDimensions,u.step=="transformed"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!1),u.step=="enforced"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!1),u.step=="cose"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!0),u.step=="all"&&(u.randomize?h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!0),u.fixedNodeConstraint||u.alignmentConstraint||u.relativePlacementConstraint?h.TREE_REDUCTION_ON_INCREMENTAL=!1:h.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new e,b=D.newGraphManager();return m(b.addRoot(),f.getTopMostNodes(G),D,u),y(D,b,V),S(D,u),D.runLayout(),_};i.exports={coseLayout:N}}),212:((i,r,a)=>{var f=(function(){function u(L,F){for(var C=0;C0)if(p){var S=t.getTopMostNodes(C.eles.nodes());if(A=t.connectComponents(G,C.eles,S),A.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),C.randomize&&A.forEach(function(vt){C.eles=vt,Y.push(o(C))}),C.quality=="default"||C.quality=="proof"){var D=G.collection();if(C.tile){var b=new Map,W=[],I=[],Q=0,$={nodeIndexes:b,xCoords:W,yCoords:I},X=[];if(A.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){D.merge(vt.nodes()[Et]),ut.isParent()||($.nodeIndexes.set(vt.nodes()[Et].id(),Q++),$.xCoords.push(vt.nodes()[0].position().x),$.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),D.length>1){var rt=D.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),A.push(D),Y.push($);for(var B=X.length-1;B>=0;B--)A.splice(X[B],1),Y.splice(X[B],1),_.splice(X[B],1)}}A.forEach(function(vt,it){C.eles=vt,z.push(h(C,Y[it])),t.relocateComponent(_[it],z[it],C)})}else A.forEach(function(vt,it){t.relocateComponent(_[it],Y[it],C)});var O=new Set;if(A.length>1){var H=[],Z=V.filter(function(vt){return vt.css("display")=="none"});A.forEach(function(vt,it){var ut=void 0;if(C.quality=="draft"&&(ut=Y[it].nodeIndexes),vt.nodes().not(Z).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;vt.nodes().not(Z).forEach(function(Dt){if(C.quality=="draft")if(!Dt.isParent())Ct=ut.get(Dt.id()),Et.nodes.push({x:Y[it].xCoords[Ct]-Dt.boundingbox().w/2,y:Y[it].yCoords[Ct]-Dt.boundingbox().h/2,width:Dt.boundingbox().w,height:Dt.boundingbox().h});else{var mt=t.calcBoundingBox(Dt,Y[it].xCoords,Y[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else z[it][Dt.id()]&&Et.nodes.push({x:z[it][Dt.id()].getLeft(),y:z[it][Dt.id()].getTop(),width:z[it][Dt.id()].getWidth(),height:z[it][Dt.id()].getHeight()})}),vt.edges().forEach(function(Dt){var mt=Dt.source(),Ot=Dt.target();if(mt.css("display")!="none"&&Ot.css("display")!="none")if(C.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Ot.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,Y[it].xCoords,Y[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(Y[it].xCoords[Rt]),Ut.push(Y[it].yCoords[Rt]);if(Ot.isParent()){var Yt=t.calcBoundingBox(Ot,Y[it].xCoords,Y[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(Y[it].xCoords[Ht]),Pt.push(Y[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else z[it][mt.id()]&&z[it][Ot.id()]&&Et.edges.push({startX:z[it][mt.id()].getCenterX(),startY:z[it][mt.id()].getCenterY(),endX:z[it][Ot.id()].getCenterX(),endY:z[it][Ot.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),O.add(it))}});var tt=E.packComponents(H,C.randomize).shifts;if(C.quality=="draft")Y.forEach(function(vt,it){var ut=vt.xCoords.map(function(Ct){return Ct+tt[it].dx}),Et=vt.yCoords.map(function(Ct){return Ct+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;O.forEach(function(vt){Object.keys(z[vt]).forEach(function(it){var ut=z[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=C.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),C.randomize){var y=o(C);Y.push(y)}C.quality=="default"||C.quality=="proof"?(z.push(h(C,Y[0])),t.relocateComponent(_[0],z[0],C)):t.relocateComponent(_[0],Y[0],C)}var J=function(it,ut){if(C.quality=="default"||C.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,Ct=void 0,Dt=it.data("id");return z.forEach(function(Ot){Dt in Ot&&(Et={x:Ot[Dt].getRect().getCenterX(),y:Ot[Dt].getRect().getCenterY()},Ct=Ot[Dt])}),C.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return Y.forEach(function(Ot){var Rt=Ot.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Ot.xCoords[Rt],y:Ot.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var It=t.calcParentsWithoutChildren(G,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});C.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(F,C,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),u})();i.exports=g}),657:((i,r,a)=>{var f=a(548),e=a(140).layoutBase.Matrix,d=a(140).layoutBase.SVD,t=function(o){var c=o.cy,h=o.eles,N=h.nodes(),g=h.nodes(":parent"),u=new Map,L=new Map,F=new Map,C=[],G=[],V=[],Y=[],z=[],A=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,S=o.samplingType,D=o.nodeSeparation,b=void 0,W=function(){for(var U=0,k=0,K=!1;k=at;){nt=q[at++];for(var xt=C[nt],lt=0;ltdt&&(dt=z[Lt],Mt=Lt)}return Mt},Q=function(U){var k=void 0;if(U){k=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(k.isParent()?C[U].push(F.get(k.id())):C[U].push(k.id()))})});var Nt=function(U){var k=L.get(U),K=void 0;u.get(U).forEach(function(q){c.getElementById(q).isParent()?K=F.get(q):K=q,C[k].push(K),C[L.get(K)].push(U)})},vt=!0,it=!1,ut=void 0;try{for(var Et=u.keys()[Symbol.iterator](),Ct;!(vt=(Ct=Et.next()).done);vt=!0){var Dt=Ct.value;Nt(Dt)}}catch(P){it=!0,ut=P}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=L.size;var mt=void 0;if(E>2){b=E{var f=a(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),i.exports=e}),140:(i=>{i.exports=w})},T={};function v(i){var r=T[i];if(r!==void 0)return r.exports;var a=T[i]={exports:{}};return R[i](a,a.exports,v),a.exports}var l=v(579);return l})()})})(he)),he.exports}var Tr=Er();const Nr=ur(Tr);var Ie={L:"left",R:"right",T:"top",B:"bottom"},Re={L:ct(x=>`${x},${x/2} 0,${x} 0,0`,"L"),R:ct(x=>`0,${x/2} ${x},0 ${x},${x}`,"R"),T:ct(x=>`0,0 ${x},0 ${x/2},${x}`,"T"),B:ct(x=>`${x/2},0 ${x},${x} 0,${x}`,"B")},se={L:ct((x,M)=>x-M+2,"L"),R:ct((x,M)=>x-2,"R"),T:ct((x,M)=>x-M+2,"T"),B:ct((x,M)=>x-2,"B")},Lr=ct(function(x){return Wt(x)?x==="L"?"R":"L":x==="T"?"B":"T"},"getOppositeArchitectureDirection"),Se=ct(function(x){const M=x;return M==="L"||M==="R"||M==="T"||M==="B"},"isArchitectureDirection"),Wt=ct(function(x){const M=x;return M==="L"||M==="R"},"isArchitectureDirectionX"),qt=ct(function(x){const M=x;return M==="T"||M==="B"},"isArchitectureDirectionY"),Ne=ct(function(x,M){const w=Wt(x)&&qt(M),R=qt(x)&&Wt(M);return w||R},"isArchitectureDirectionXY"),wr=ct(function(x){const M=x[0],w=x[1],R=Wt(M)&&qt(w),T=qt(M)&&Wt(w);return R||T},"isArchitecturePairXY"),Cr=ct(function(x){return x!=="LL"&&x!=="RR"&&x!=="TT"&&x!=="BB"},"isValidArchitectureDirectionPair"),ye=ct(function(x,M){const w=`${x}${M}`;return Cr(w)?w:void 0},"getArchitectureDirectionPair"),Mr=ct(function([x,M],w){const R=w[0],T=w[1];return Wt(R)?qt(T)?[x+(R==="L"?-1:1),M+(T==="T"?1:-1)]:[x+(R==="L"?-1:1),M]:Wt(T)?[x+(T==="L"?1:-1),M+(R==="T"?1:-1)]:[x,M+(R==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Ar=ct(function(x){return x==="LT"||x==="TL"?[1,1]:x==="BL"||x==="LB"?[1,-1]:x==="BR"||x==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Dr=ct(function(x,M){return Ne(x,M)?"bend":Wt(x)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Or=ct(function(x){return x.type==="service"},"isArchitectureService"),xr=ct(function(x){return x.type==="junction"},"isArchitectureJunction"),Pe=ct((x,M)=>{const[w,R]=[x,M].sort();return`${JSON.stringify(w)}-${JSON.stringify(R)}`},"architectureGroupAlignmentKey"),Ge=ct(x=>x.data(),"edgeData"),ie=ct(x=>x.data(),"nodeData"),Ir=or.architecture,ae,Ue=(ae=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Ke,this.getAccTitle=je,this.setDiagramTitle=_e,this.getDiagramTitle=tr,this.getAccDescription=er,this.setAccDescription=rr,this.clear()}setDiagramId(M){this.diagramId=M}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",ir()}addService({id:M,icon:w,in:R,title:T,iconText:v}){if(this.registeredIds.has(M))throw new Error(`The service id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(R!==void 0){if(M===R)throw new Error(`The service [${M}] cannot be placed within itself`);if(!this.registeredIds.has(R))throw new Error(`The service [${M}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(R)==="node")throw new Error(`The service [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"service",icon:w,iconText:v,title:T,edges:[],in:R})}getServices(){return[...this.nodes.values()].filter(Or)}addJunction({id:M,in:w}){if(this.registeredIds.has(M))throw new Error(`The junction id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(w!==void 0){if(M===w)throw new Error(`The junction [${M}] cannot be placed within itself`);if(!this.registeredIds.has(w))throw new Error(`The junction [${M}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(w)==="node")throw new Error(`The junction [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"junction",edges:[],in:w})}getJunctions(){return[...this.nodes.values()].filter(xr)}getNodes(){return[...this.nodes.values()]}getNode(M){return this.nodes.get(M)??null}addGroup({id:M,icon:w,in:R,title:T}){if(this.registeredIds.has(M))throw new Error(`The group id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(R!==void 0){if(M===R)throw new Error(`The group [${M}] cannot be placed within itself`);if(!this.registeredIds.has(R))throw new Error(`The group [${M}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(R)==="node")throw new Error(`The group [${M}]'s parent is not a group`)}this.registeredIds.set(M,"group"),this.groups.set(M,{id:M,icon:w,title:T,in:R})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:M,rhsId:w,lhsDir:R,rhsDir:T,lhsInto:v,rhsInto:l,lhsGroup:i,rhsGroup:r,title:a}){if(!Se(R))throw new Error(`Invalid direction given for left hand side of edge ${M}--${w}. Expected (L,R,T,B) got ${String(R)}`);if(!Se(T))throw new Error(`Invalid direction given for right hand side of edge ${M}--${w}. Expected (L,R,T,B) got ${String(T)}`);if(!this.nodes.has(M)&&!this.groups.has(M))throw new Error(`The left-hand id [${M}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(w)&&!this.groups.has(w))throw new Error(`The right-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);const f=this.nodes.get(M).in,e=this.nodes.get(w).in;if(i&&f&&e&&f==e)throw new Error(`The left-hand id [${M}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(r&&f&&e&&f==e)throw new Error(`The right-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const d={lhsId:M,lhsDir:R,lhsInto:v,lhsGroup:i,rhsId:w,rhsDir:T,rhsInto:l,rhsGroup:r,title:a};this.edges.push(d);const t=this.nodes.get(M),s=this.nodes.get(w);t&&s&&(t.edges.push(this.edges[this.edges.length-1]),s.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(M){if(M.members.length<2)throw new Error(`An align directive requires at least two members; got ${M.members.length}`);const w=new Set;M.members.forEach(R=>{if(this.registeredIds.get(R)!=="node")throw new Error(`align ${M.direction} references [${R}], which is not a service or junction`);if(w.has(R))throw new Error(`align ${M.direction} lists [${R}] more than once`);w.add(R)}),this.layoutHints.push(M)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const M=new Map,w=new Map;for(const[i,r]of this.nodes.entries()){const a=new Map;for(const f of r.edges){const e=this.getNode(f.lhsId)?.in,d=this.getNode(f.rhsId)?.in;if(e&&d&&e!==d){const t=Dr(f.lhsDir,f.rhsDir);t!=="bend"&&M.set(Pe(e,d),t)}if(f.lhsId===i){const t=ye(f.lhsDir,f.rhsDir);t&&a.set(t,f.rhsId)}else{const t=ye(f.rhsDir,f.lhsDir);t&&a.set(t,f.lhsId)}}w.set(i,a)}const R=new Set,T=new Set(w.keys()),v=ct(i=>{const r=new Map([[i,[0,0]]]),a=[i];for(;a.length>0;){const f=a.shift();if(f){R.add(f),T.delete(f);const e=w.get(f);if(!e)throw new Error(`BFS error: adjacency list for id ${f} not found. Please report this as a bug.`);const d=r.get(f);if(!d)throw new Error(`BFS error: position for id ${f} not found in spatial map. Please report this as a bug.`);const[t,s]=d;e.forEach((o,c)=>{R.has(o)||(r.set(o,Mr([t,s],c)),a.push(o))})}}return r},"BFS"),l=[];for(;T.size>0;){const i=T.values().next().value;l.push(v(i))}this.dataStructures={adjList:w,spatialMaps:l,groupAlignments:M}}return this.dataStructures}setElementForId(M,w){this.elements.set(M,w)}getElementById(M){return this.elements.get(M)}getConfig(){return ar({...Ir,...nr().architecture})}getConfigField(M){return this.getConfig()[M]}},ct(ae,"ArchitectureDB"),ae),Rr=ct((x,M)=>{qe(x,M),x.groups.map(w=>M.addGroup(w)),x.services.map(w=>M.addService({...w,type:"service"})),x.junctions.map(w=>M.addJunction({...w,type:"junction"})),x.edges.map(w=>M.addEdge(w)),x.alignments?.map(w=>M.addLayoutHint({direction:w.direction,members:[...w.members]}))},"populateDb"),Ye={parser:{yy:void 0},parse:ct(async x=>{const M=await gr("architecture",x);Fe.debug(M);const w=Ye.parser?.yy;if(!(w instanceof Ue))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Rr(M,w)},"parse")},Sr=ct(x=>` + .edge { + stroke-width: ${x.archEdgeWidth}; + stroke: ${x.archEdgeColor}; + fill: none; + } + + .arrow { + fill: ${x.archEdgeArrowColor}; + } + + .node-bkg { + fill: none; + stroke: ${x.archGroupBorderColor}; + stroke-width: ${x.archGroupBorderWidth}; + stroke-dasharray: 8; + } + .node-icon-text { + display: flex; + align-items: center; + } + + .node-icon-text > div { + color: #fff; + margin: 1px; + height: fit-content; + text-align: center; + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + } +`,"getStyles"),Fr=Sr;function me(x,M){if(x===0)return M();const w=Math.random;let R=x>>>0;Math.random=function(){R=R+1831565813>>>0;let T=R;return T=Math.imul(T^T>>>15,T|1),T^=T+Math.imul(T^T>>>7,T|61),((T^T>>>14)>>>0)/4294967296};try{return M()}finally{Math.random=w}}ct(me,"withSeededRandom");var re=ct(x=>`${x}`,"wrapIcon"),ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('')},server:{body:re('')},disk:{body:re('')},internet:{body:re('')},cloud:{body:re('')},unknown:cr,blank:{body:re("")}}},br=ct(async function(x,M,w,R){const T=w.getConfigField("padding"),v=w.getConfigField("iconSize"),l=v/2,i=v/6,r=i/2;await Promise.all(M.edges().map(async a=>{const{source:f,sourceDir:e,sourceArrow:d,sourceGroup:t,target:s,targetDir:o,targetArrow:c,targetGroup:h,label:N}=Ge(a);let{x:g,y:u}=a[0].sourceEndpoint();const{x:L,y:F}=a[0].midpoint();let{x:C,y:G}=a[0].targetEndpoint();const V=T+4;if(t&&(Wt(e)?g+=e==="L"?-V:V:u+=e==="T"?-V:V+18),h&&(Wt(o)?C+=o==="L"?-V:V:G+=o==="T"?-V:V+18),!t&&w.getNode(f)?.type==="junction"&&(Wt(e)?g+=e==="L"?l:-l:u+=e==="T"?l:-l),!h&&w.getNode(s)?.type==="junction"&&(Wt(o)?C+=o==="L"?l:-l:G+=o==="T"?l:-l),a[0]._private.rscratch){const Y=x.insert("g");if(Y.insert("path").attr("d",`M ${g},${u} L ${L},${F} L${C},${G} `).attr("class","edge").attr("id",`${R}-${lr(f,s,{prefix:"L"})}`),d){const z=Wt(e)?se[e](g,i):g-r,A=qt(e)?se[e](u,i):u-r;Y.insert("polygon").attr("points",Re[e](i)).attr("transform",`translate(${z},${A})`).attr("class","arrow")}if(c){const z=Wt(o)?se[o](C,i):C-r,A=qt(o)?se[o](G,i):G-r;Y.insert("polygon").attr("points",Re[o](i)).attr("transform",`translate(${z},${A})`).attr("class","arrow")}if(N){const z=Ne(e,o)?"XY":Wt(e)?"X":"Y";let A=0;z==="X"?A=Math.abs(g-C):z==="Y"?A=Math.abs(u-G)/1.5:A=Math.abs(g-C)/2;const _=Y.append("g");if(await Te(_,N,{useHtmlLabels:!1,width:A,classes:"architecture-service-label"},Ee()),_.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),z==="X")_.attr("transform","translate("+L+", "+F+")");else if(z==="Y")_.attr("transform","translate("+L+", "+F+") rotate(-90)");else if(z==="XY"){const n=ye(e,o);if(n&&wr(n)){const E=_.node().getBoundingClientRect(),[p,m]=Ar(n);_.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*p*m*45})`);const y=_.node().getBoundingClientRect();_.attr("transform",` + translate(${L}, ${F-E.height/2}) + translate(${p*y.width/2}, ${m*y.height/2}) + rotate(${-1*p*m*45}, 0, ${E.height/2}) + `)}}}}}))},"drawEdges"),Pr=ct(async function(x,M,w,R){const v=w.getConfigField("padding")*.75,l=w.getConfigField("fontSize"),r=w.getConfigField("iconSize")/2;await Promise.all(M.nodes().map(async a=>{const f=ie(a);if(f.type==="group"){const{h:e,w:d,x1:t,y1:s}=a.boundingBox(),o=x.append("rect");o.attr("id",`${R}-group-${f.id}`).attr("x",t+r).attr("y",s+r).attr("width",d).attr("height",e).attr("class","node-bkg");const c=x.append("g");let h=t,N=s;if(f.icon){const g=c.append("g");g.html(`${await pe(f.icon,{height:v,width:v,fallbackPrefix:ne.prefix})}`),g.attr("transform","translate("+(h+r+1)+", "+(N+r+1)+")"),h+=v,N+=l/2-1-2}if(f.label){const g=c.append("g");await Te(g,f.label,{useHtmlLabels:!1,width:d,classes:"architecture-service-label"},Ee()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(h+r+4)+", "+(N+r+2)+")")}w.setElementForId(f.id,o)}}))},"drawGroups"),Gr=ct(async function(x,M,w,R){const T=Ee();for(const v of w){const l=M.append("g"),i=x.getConfigField("iconSize");if(v.title){const e=l.append("g");await Te(e,v.title,{useHtmlLabels:!1,width:i*1.5,classes:"architecture-service-label"},T),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),e.attr("transform","translate("+i/2+", "+i+")")}const r=l.append("g");if(v.icon)r.html(`${await pe(v.icon,{height:i,width:i,fallbackPrefix:ne.prefix})}`);else if(v.iconText){r.html(`${await pe("blank",{height:i,width:i,fallbackPrefix:ne.prefix})}`);const t=r.append("g").append("foreignObject").attr("width",i).attr("height",i).append("div").attr("class","node-icon-text").attr("style",`height: ${i}px;`).append("div").html(sr(v.iconText,T)),s=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((i-2)/s)};`)}else r.append("path").attr("class","node-bkg").attr("id",`${R}-node-${v.id}`).attr("d",`M0,${i} V5 Q0,0 5,0 H${i-5} Q${i},0 ${i},5 V${i} Z`);l.attr("id",`${R}-service-${v.id}`).attr("class","architecture-service");const{width:a,height:f}=l.node().getBBox();v.width=a,v.height=f,x.setElementForId(v.id,l)}return 0},"drawServices"),Ur=ct(function(x,M,w,R){w.forEach(T=>{const v=M.append("g"),l=x.getConfigField("iconSize");v.append("g").append("rect").attr("id",`${R}-node-${T.id}`).attr("fill-opacity","0").attr("width",l).attr("height",l),v.attr("class","architecture-junction");const{width:r,height:a}=v._groups[0][0].getBBox();v.width=r,v.height=a,x.setElementForId(T.id,v)})},"drawJunctions");fr([{name:ne.prefix,icons:ne}]);be.use(Nr);function Xe(x,M,w){x.forEach(R=>{M.add({group:"nodes",data:{type:"service",id:R.id,icon:R.icon,label:R.title,parent:R.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-service"})})}ct(Xe,"addServices");function He(x,M,w){x.forEach(R=>{M.add({group:"nodes",data:{type:"junction",id:R.id,parent:R.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-junction"})})}ct(He,"addJunctions");function We(x,M){M.nodes().map(w=>{const R=ie(w);if(R.type==="group")return;R.x=w.position().x,R.y=w.position().y,x.getElementById(R.id).attr("transform","translate("+(R.x||0)+","+(R.y||0)+")")})}ct(We,"positionNodes");function Ve(x,M){x.forEach(w=>{M.add({group:"nodes",data:{type:"group",id:w.id,icon:w.icon,label:w.title,parent:w.in},classes:"node-group"})})}ct(Ve,"addGroups");function ze(x,M){x.forEach(w=>{const{lhsId:R,rhsId:T,lhsInto:v,lhsGroup:l,rhsInto:i,lhsDir:r,rhsDir:a,rhsGroup:f,title:e}=w,d=Ne(w.lhsDir,w.rhsDir)?"segments":"straight",t={id:`${R}-${T}`,label:e,source:R,sourceDir:r,sourceArrow:v,sourceGroup:l,sourceEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%",target:T,targetDir:a,targetArrow:i,targetGroup:f,targetEndpoint:a==="L"?"0 50%":a==="R"?"100% 50%":a==="T"?"50% 0":"50% 100%"};M.add({group:"edges",data:t,classes:d})})}ct(ze,"addEdges");function $e(x,M,w,R=[]){const T=ct((d,t)=>{const s=new Map;for(const[o,c]of d.entries()){const h=`${o}`;let N=0;const g=[...c.entries()];if(g.length===1){s.set(h,g[0][1]);continue}for(let u=0;u{const t=new Map,s=new Map;return d.forEach(([o,c],h)=>{const N=x.getNode(h)?.in??"default",g=t.get(c)??new Map;t.has(c)||t.set(c,g);const u=s.get(o)??new Map;s.has(o)||s.set(o,u);for(const L of[g,u]){const F=L.get(N)??[];L.has(N)||L.set(N,F),F.push(h)}}),{horiz:[...T(t,"horizontal").values()].filter(o=>o.length>1),vert:[...T(s,"vertical").values()].filter(o=>o.length>1)}}),[l,i]=v.reduce(([d,t],{horiz:s,vert:o})=>[[...d,...s],[...t,...o]],[[],[]]),r=new Set;R.forEach(d=>d.members.forEach(t=>r.add(t)));const a=ct(d=>d.filter(t=>!t.some(s=>r.has(s))),"dropOverlapping"),f=a(l),e=a(i);return R.forEach(d=>{d.members.length<2||(d.direction==="row"?f.push([...d.members]):e.push([...d.members]))}),{horizontal:f,vertical:e}}ct($e,"getAlignments");function Be(x,M,w=[]){const R=[],T=M.getConfigField("iconSize"),v=M.getConfigField("idealEdgeLengthMultiplier"),l=v*T,i=new Set;w.forEach(f=>{for(let e=0;e`${f[0]},${f[1]}`,"posToStr"),a=ct(f=>f.split(",").map(e=>parseInt(e)),"strToPos");return x.forEach(f=>{const e=new Map([...f.entries()].map(([o,c])=>[r(c),o])),d=[r([0,0])],t={},s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;d.length>0;){const o=d.shift();if(o){t[o]=1;const c=e.get(o);if(c){const h=a(o);Object.entries(s).forEach(([N,g])=>{const u=r([h[0]+g[0],h[1]+g[1]]),L=e.get(u);if(L&&!t[u]){if(d.push(u),i.has(`${c}|${L}`))return;R.push({[Ie[N]]:L,[Ie[Lr(N)]]:c,gap:v*T})}})}}}}),R}ct(Be,"getRelativeConstraints");function Ze(x,M,w,R,T,{spatialMaps:v,groupAlignments:l}){return new Promise(i=>{const r=hr("body").append("div").attr("id","cy").attr("style","display:none"),a=be({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${T.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${T.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});r.remove(),Ve(w,a),Xe(x,a,T),He(M,a,T),ze(R,a);const f=T.getLayoutHints(),e=$e(T,v,l,f),d=Be(v,T,f),t=T.getConfigField("iconSize"),s=T.getConfigField("idealEdgeLengthMultiplier")*t,o=.5*t,c=T.getConfigField("edgeElasticity"),h=T.getConfigField("seed"),N=a.layout({name:"fcose",quality:"proof",randomize:T.getConfigField("randomize"),nodeSeparation:T.getConfigField("nodeSeparation"),numIter:T.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(g){const[u,L]=g.connectedNodes(),{parent:F}=ie(u),{parent:C}=ie(L);return F===C?s:o},edgeElasticity(g){const[u,L]=g.connectedNodes(),{parent:F}=ie(u),{parent:C}=ie(L);return F===C?c:.001},alignmentConstraint:e,relativePlacementConstraint:d});N.one("layoutstop",()=>{function g(u,L,F,C){let G,V;const{x:Y,y:z}=u,{x:A,y:_}=L;V=(C-z+(Y-F)*(z-_)/(Y-A))/Math.sqrt(1+Math.pow((z-_)/(Y-A),2)),G=Math.sqrt(Math.pow(C-z,2)+Math.pow(F-Y,2)-Math.pow(V,2));const n=Math.sqrt(Math.pow(A-Y,2)+Math.pow(_-z,2));G=G/n;let E=(A-Y)*(C-z)-(_-z)*(F-Y);switch(!0){case E>=0:E=1;break;case E<0:E=-1;break}let p=(A-Y)*(F-Y)+(_-z)*(C-z);switch(!0){case p>=0:p=1;break;case p<0:p=-1;break}return V=Math.abs(V)*E,G=G*p,{distances:V,weights:G}}ct(g,"getSegmentWeights"),a.startBatch();for(const u of Object.values(a.edges()))if(u.data?.()){const{x:L,y:F}=u.source().position(),{x:C,y:G}=u.target().position();if(L!==C&&F!==G){const V=u.sourceEndpoint(),Y=u.targetEndpoint(),{sourceDir:z}=Ge(u),[A,_]=qt(z)?[V.x,Y.y]:[Y.x,V.y],{weights:n,distances:E}=g(V,Y,A,_);u.style("segment-distances",E),u.style("segment-weights",n)}}a.endBatch(),me(h,()=>N.run())});try{me(h,()=>N.run())}catch(g){throw g instanceof RangeError&&g.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):g}a.ready(g=>{Fe.info("Ready",g),i(a)})})}ct(Ze,"layoutArchitecture");var Yr=ct(async(x,M,w,R)=>{const T=R.db;T.setDiagramId(M);const v=T.getServices(),l=T.getJunctions(),i=T.getGroups(),r=T.getEdges(),a=T.getDataStructures(),f=Qe(M),e=f.append("g");e.attr("class","architecture-edges");const d=f.append("g");d.attr("class","architecture-services");const t=f.append("g");t.attr("class","architecture-groups"),await Gr(T,d,v,M),Ur(T,d,l,M);const s=await Ze(v,l,i,r,T,a);await br(e,s,T,M),await Pr(t,s,T,M),We(T,s),Je(void 0,f,T.getConfigField("padding"),T.getConfigField("useMaxWidth"))},"draw"),Xr={draw:Yr},Zr={parser:Ye,get db(){return new Ue},renderer:Xr,styles:Fr};export{Zr as diagram}; diff --git a/internal/webapp/static/assets/blockDiagram-VBNYF7ZC-Cp8Mn4lx.js b/internal/webapp/static/assets/blockDiagram-VBNYF7ZC-Cp8Mn4lx.js new file mode 100644 index 0000000..6617610 --- /dev/null +++ b/internal/webapp/static/assets/blockDiagram-VBNYF7ZC-Cp8Mn4lx.js @@ -0,0 +1,132 @@ +import{g as de}from"./chunk-5VM5RSS4-DJhOL3Lj.js";import{aA as pe,aB as Kt,aC as fe,aD as xe,aE as ye,aF as be,aG as we,aH as me,aI as Se,aJ as Le,aK as ke,aL as ve,aM as Ee,aN as _e,aO as Te,aP as De,aQ as Be,aR as Ne,aS as Ie,aT as Ce,aU as Oe,aV as Re,aW as Ae,aX as ze,aY as Me,_ as g,y as rt,d as D,e as Pe,l as k,p as Fe,r as We,c as R,aZ as Ye,P as He,Q as Ke,L as Ue,a_ as M,a$ as kt,b0 as Q,as as Xe,x as $,k as Ve,b1 as je,i as Ct,b2 as Ot,b3 as Ge}from"./mermaid.core-B7WVQkyL.js";import{G as Ze}from"./graph-DOmOIIwC.js";import{c as qe}from"./channel-BphRH4Sr.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";function Je(e){return Array.isArray(e)}function Qe(e){if(pe(e))return e;const t=Kt(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(fe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Kt(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:case xe:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var bt=(function(){var e=g(function(T,m,p,x){for(p=p||{},x=T.length;x--;p[T[x]]=m);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],b=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:g(function(m,p,x,L,E,o,F){var f=o.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",o[f-1]),L.setHierarchy(o[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:L.getLogger().debug("Rule: link: ",o[f],m),this.$={edgeTypeStr:o[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const C=parseInt(o[f]),Z=L.generateId();this.$={id:Z,type:"space",label:"",width:C,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const V=L.edgeStrToEdgeData(o[f-1].edgeTypeStr),at=L.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),gt=L.edgeStrToThickness(o[f-1].edgeTypeStr),O=L.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:gt,pattern:O,directions:o[f].directions,arrowTypeEnd:V,arrowTypeStart:at},{id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:L.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),L.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const j=L.generateId();this.$={id:j,type:"composite",label:"",children:o[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:d,16:b}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(w,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:t,11:37,13:4,14:22,15:d,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(h,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:g(function(m,p){if(p.recoverable)this.trace(m);else{var x=new Error(m);throw x.hash=p,x}},"parseError"),parse:g(function(m){var p=this,x=[0],L=[],E=[null],o=[],F=this.table,f="",C=0,Z=0,V=2,at=1,gt=o.slice.call(arguments,1),O=Object.create(this.lexer),j={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(j.yy[ut]=this.yy[ut]);O.setInput(m,j.yy),j.yy.lexer=O,j.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var dt=O.yylloc;o.push(dt);var ge=O.options&&O.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(W){x.length=x.length-2*W,E.length=E.length-W,o.length=o.length-W}g(ue,"popStack");function Nt(){var W;return W=L.pop()||O.lex()||at,typeof W!="number"&&(W instanceof Array&&(L=W,W=L.pop()),W=p.symbols_[W]||W),W}g(Nt,"lex");for(var P,q,H,pt,J={},st,G,It,it;;){if(q=x[x.length-1],this.defaultActions[q]?H=this.defaultActions[q]:((P===null||typeof P>"u")&&(P=Nt()),H=F[q]&&F[q][P]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in F[q])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");O.showPosition?ft="Parse error on line "+(C+1)+`: +`+O.showPosition()+` +Expecting `+it.join(", ")+", got '"+(this.terminals_[P]||P)+"'":ft="Parse error on line "+(C+1)+": Unexpected "+(P==at?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(ft,{text:O.match,token:this.terminals_[P]||P,line:O.yylineno,loc:dt,expected:it})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+P);switch(H[0]){case 1:x.push(P),E.push(O.yytext),o.push(O.yylloc),x.push(H[1]),P=null,Z=O.yyleng,f=O.yytext,C=O.yylineno,dt=O.yylloc;break;case 2:if(G=this.productions_[H[1]][1],J.$=E[E.length-G],J._$={first_line:o[o.length-(G||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(G||1)].first_column,last_column:o[o.length-1].last_column},ge&&(J._$.range=[o[o.length-(G||1)].range[0],o[o.length-1].range[1]]),pt=this.performAction.apply(J,[f,Z,C,j.yy,H[1],E,o].concat(gt)),typeof pt<"u")return pt;G&&(x=x.slice(0,-1*G*2),E=E.slice(0,-1*G),o=o.slice(0,-1*G)),x.push(this.productions_[H[1]][0]),E.push(J.$),o.push(J._$),It=F[x[x.length-2]][x[x.length-1]],x.push(It);break;case 3:return!0}}return!0},"parse")},N=(function(){var T={EOF:1,parseError:g(function(p,x){if(this.yy.parser)this.yy.parser.parseError(p,x);else throw new Error(p)},"parseError"),setInput:g(function(m,p){return this.yy=p||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var p=m.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:g(function(m){var p=m.length,x=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var L=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===L.length?this.yylloc.first_column:0)+L[L.length-x.length].length-x[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(m){this.unput(this.match.slice(m))},"less"),pastInput:g(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var m=this.pastInput(),p=new Array(m.length+1).join("-");return m+this.upcomingInput()+` +`+p+"^"},"showPosition"),test_match:g(function(m,p){var x,L,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),L=m[0].match(/(?:\r\n?|\n).*/g),L&&(this.yylineno+=L.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:L?L[L.length-1].length-L[L.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+m[0].length},this.yytext+=m[0],this.match+=m[0],this.matches=m,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(m[0].length),this.matched+=m[0],x=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var o in E)this[o]=E[o];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var m,p,x,L;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),o=0;op[0].length)){if(p=x,L=o,this.options.backtrack_lexer){if(m=this.test_match(x,E[o]),m!==!1)return m;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(m=this.test_match(p,E[L]),m!==!1?m:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var p=this.next();return p||this.lex()},"lex"),begin:g(function(p){this.conditionStack.push(p)},"begin"),popState:g(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:g(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:g(function(p){this.begin(p)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:g(function(p,x,L,E){switch(L){case 0:return p.getLogger().debug("Found block-beta"),10;case 1:return p.getLogger().debug("Found id-block"),29;case 2:return p.getLogger().debug("Found block"),10;case 3:p.getLogger().debug(".",x.yytext);break;case 4:p.getLogger().debug("_",x.yytext);break;case 5:return 5;case 6:return x.yytext=-1,28;case 7:return x.yytext=x.yytext.replace(/columns\s+/,""),p.getLogger().debug("COLUMNS (LEX)",x.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:p.getLogger().debug("LEX: POPPING STR:",x.yytext),this.popState();break;case 13:return p.getLogger().debug("LEX: STR end:",x.yytext),"STR";case 14:return x.yytext=x.yytext.replace(/space\:/,""),p.getLogger().debug("SPACE NUM (LEX)",x.yytext),21;case 15:return x.yytext="1",p.getLogger().debug("COLUMNS (LEX)",x.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),p.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),p.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),p.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),p.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),p.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),p.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),p.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),p.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),p.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),p.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),p.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),p.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),p.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),p.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),p.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),p.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),p.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return p.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return p.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return p.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return p.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return p.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return p.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return p.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return p.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return p.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return p.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return p.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return p.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),p.getLogger().debug("LEX ARR START"),37;case 74:return p.getLogger().debug("Lex: NODE_ID",x.yytext),31;case 75:return p.getLogger().debug("Lex: EOF",x.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:p.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:p.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return p.getLogger().debug("LEX: NODE_DESCR:",x.yytext),"NODE_DESCR";case 83:p.getLogger().debug("LEX POPPING"),this.popState();break;case 84:p.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (right): dir:",x.yytext),"DIR";case 86:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (left):",x.yytext),"DIR";case 87:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (x):",x.yytext),"DIR";case 88:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (y):",x.yytext),"DIR";case 89:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (up):",x.yytext),"DIR";case 90:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (down):",x.yytext),"DIR";case 91:return x.yytext="]>",p.getLogger().debug("Lex (ARROW_DIR end):",x.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return p.getLogger().debug("Lex: LINK","#"+x.yytext+"#"),15;case 93:return p.getLogger().debug("Lex: LINK",x.yytext),15;case 94:return p.getLogger().debug("Lex: LINK",x.yytext),15;case 95:return p.getLogger().debug("Lex: LINK",x.yytext),15;case 96:return p.getLogger().debug("Lex: START_LINK",x.yytext),this.pushState("LLABEL"),16;case 97:return p.getLogger().debug("Lex: START_LINK",x.yytext),this.pushState("LLABEL"),16;case 98:return p.getLogger().debug("Lex: START_LINK",x.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return p.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),p.getLogger().debug("Lex: LINK","#"+x.yytext+"#"),15;case 102:return this.popState(),p.getLogger().debug("Lex: LINK",x.yytext),15;case 103:return this.popState(),p.getLogger().debug("Lex: LINK",x.yytext),15;case 104:return p.getLogger().debug("Lex: COLON",x.yytext),x.yytext=x.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return T})();S.lexer=N;function _(){this.yy={}}return g(_,"Parser"),_.prototype=S,S.Parser=_,new _})();bt.parser=bt;var ar=bt,U=new Map,vt=[],wt=new Map,Rt="color",At="fill",sr="bgFill",Ut=",",ct=new Map,Et="",ir=g(e=>Ve.sanitizeText(e,R()),"sanitizeText"),nr=g(function(e,t=""){let a=ct.get(e);a||(a={id:e,styles:[],textStyles:[]},ct.set(e,a)),t?.split(Ut).forEach(s=>{const i=s.replace(/([^;]*);/,"$1").trim();if(RegExp(Rt).exec(s)){const r=i.replace(At,sr).replace(Rt,At);a.textStyles.push(r)}a.styles.push(i)})},"addStyleClass"),cr=g(function(e,t=""){const a=U.get(e);t!=null&&(a.styles=t.split(Ut))},"addStyle2Node"),lr=g(function(e,t){e.split(",").forEach(function(a){let s=U.get(a);if(s===void 0){const i=a.trim();s={id:i,type:"na",children:[]},U.set(i,s)}s.classes||(s.classes=[]),s.classes.push(t)})},"setCssClass"),Xt=g((e,t)=>{const a=e.flat(),s=[],c=a.find(r=>r?.type==="column-setting")?.columns??-1;for(const r of a){if(typeof c=="number"&&c>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>c&&k.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${c}`),r.label&&(r.label=ir(r.label)),r.type==="classDef"){nr(r.id,r.css);continue}if(r.type==="applyClass"){lr(r.id,r?.styleClass??"");continue}if(r.type==="applyStyles"){r?.stylesStr&&cr(r.id,r?.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){const n=(wt.get(r.id)??0)+1;wt.set(r.id,n),r.id=n+"-"+r.id,vt.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);const n=U.get(r.id);if(n===void 0?U.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Xt(r.children,r),r.type==="space"){const l=r.width??1;for(let u=0;u{k.debug("Clear called"),Fe(),et={id:"root",type:"composite",children:[],columns:-1},U=new Map([["root",et]]),_t=[],ct=new Map,vt=[],wt=new Map,Et=""},"clear");function Vt(e){switch(k.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return k.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}g(Vt,"typeStr2Type");function jt(e){return k.debug("typeStr2Type",e),e==="=="?"thick":"normal"}g(jt,"edgeTypeStr2Type");function Gt(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}g(Gt,"edgeStrToEdgeData");function Zt(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}g(Zt,"edgeStrToEdgeStartData");function qt(e){return e.includes("==")?"thick":"normal"}g(qt,"edgeStrToThickness");function Jt(e){return e.includes(".-")?"dotted":"solid"}g(Jt,"edgeStrToPattern");var zt=0,hr=g(()=>(zt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+zt),"generateId"),gr=g(e=>{et.children=e,Xt(e,et),_t=et.children},"setHierarchy"),ur=g(e=>{const t=U.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),dr=g(()=>[...U.values()],"getBlocksFlat"),pr=g(()=>_t||[],"getBlocks"),fr=g(()=>vt,"getEdges"),xr=g(e=>U.get(e),"getBlock"),yr=g(e=>{U.set(e.id,e)},"setBlock"),br=g(e=>{Et=e},"setDiagramId"),wr=g(()=>Et,"getDiagramId"),mr=g(()=>k,"getLogger"),Sr=g(function(){return ct},"getClasses"),Lr={getConfig:g(()=>rt().block,"getConfig"),typeStr2Type:Vt,edgeTypeStr2Type:jt,edgeStrToEdgeData:Gt,edgeStrToEdgeStartData:Zt,edgeStrToThickness:qt,edgeStrToPattern:Jt,getLogger:mr,getBlocksFlat:dr,getBlocks:pr,getEdges:fr,setHierarchy:gr,getBlock:xr,setBlock:yr,getColumns:ur,getClasses:Sr,clear:or,generateId:hr,setDiagramId:br,getDiagramId:wr},kr=Lr,yt=g((e,t)=>{const a=qe,s=a(e,"r"),i=a(e,"g"),c=a(e,"b");return We(s,i,c,t)},"fade"),vr=g(e=>`.label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span,p { + color: ${e.titleColor}; + } + + + + .label text,span,p { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: 1px; + } + .flowchart-label text { + text-anchor: middle; + } + // .flowchart-label .text-outer-tspan { + // text-anchor: middle; + // } + // .flowchart-label .text-inner-tspan { + // text-anchor: start; + // } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: 2.0px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + /* + * This is for backward compatibility with existing code that didn't + * add a \`

\` around edge labels. + * + * TODO: We should probably remove this in a future release. + */ + p { + margin: 0; + padding: 0; + display: inline; + } + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${e.edgeLabelBackground}; + } + + .node .cluster { + // fill: ${yt(e.mainBkg,.5)}; + fill: ${yt(e.clusterBkg,.5)}; + stroke: ${yt(e.clusterBorder,.2)}; + box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span,p { + color: ${e.titleColor}; + } + /* .cluster div { + color: ${e.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } + ${de()} +`,"getStyles"),Er=vr,_r=g((e,t,a,s)=>{t.forEach(i=>{zr[i](e,a,s)})},"insertMarkers"),Tr=g((e,t,a)=>{k.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Dr=g((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Br=g((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Nr=g((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Ir=g((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Cr=g((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Or=g((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),Rr=g((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Ar=g((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),zr={extension:Tr,composition:Dr,aggregation:Br,dependency:Nr,lollipop:Ir,point:Cr,circle:Or,cross:Rr,barb:Ar},Mr=_r;function mt(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};const a=t%e,s=Math.floor(t/e);return{px:a,py:s}}g(mt,"calculateBlockPosition");var Pr=g(e=>{let t=0,a=0;for(const s of e.children){const{width:i,height:c,x:r,y:n}=s.size??{width:0,height:0,x:0,y:0};if(k.debug("getMaxChildSize abc95 child:",s.id,"width:",i,"height:",c,"x:",r,"y:",n,s.type),s.type==="space")continue;const l=i/(s.widthInColumns??1);l>t&&(t=l),c>a&&(a=c)}return{width:t,height:a}},"getMaxChildSize");function lt(e,t,a=0,s=0,i=8){k.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",a),e?.size?.width||(e.size={width:a,height:s,x:0,y:0});let c=0,r=0;if(e.children?.length>0){for(const y of e.children)lt(y,t,0,0,i);const n=Pr(e);c=n.width,r=n.height,k.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",c,r);for(const y of e.children)y.size&&(k.debug(`abc95 Setting size of children of ${e.id} id=${y.id} ${c} ${r} ${JSON.stringify(y.size)}`),y.size.width=c*(y.widthInColumns??1)+i*((y.widthInColumns??1)-1),y.size.height=r,y.size.x=0,y.size.y=0,k.debug(`abc95 updating size of ${e.id} children child:${y.id} maxWidth:${c} maxHeight:${r}`));for(const y of e.children)lt(y,t,c,r,i);const l=e.columns??-1;let u=0;for(const y of e.children)u+=y.widthInColumns??1;let h=e.children.length;l>0&&l0?Math.min(e.children.length,l):e.children.length;if(y>0){const v=(b-y*i-i)/y;k.debug("abc95 (growing to fit) width",e.id,b,e.size?.width,v);for(const S of e.children)S.size&&(S.size.width=v)}}e.size={width:b,height:w,x:0,y:0}}k.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}g(lt,"setBlockSizes");function Tt(e,t,a=8){k.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const s=e.columns??-1;if(k.debug("layoutBlocks columns abc95",e.id,"=>",s,e),e.children&&e.children.length>0){const i=e?.children[0]?.size?.width??0,c=e.children.length*i+(e.children.length-1)*a;k.debug("widthOfChildren 88",c,"posX");const r=new Map;{let d=0;for(const b of e.children){if(!b.size)continue;const{py:w}=mt(s,d),y=r.get(w)??0;b.size.height>y&&r.set(w,b.size.height);let v=b?.widthInColumns??1;s>0&&(v=Math.min(v,s-d%s)),d+=v}}const n=new Map;{let d=0;const b=[...r.keys()].sort((w,y)=>w-y);for(const w of b)n.set(w,d),d+=(r.get(w)??0)+a}let l=0;k.debug("abc91 block?.size?.x",e.id,e?.size?.x);let u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-a,h=0;for(const d of e.children){const b=e;if(!d.size)continue;const{width:w,height:y}=d.size,{px:v,py:S}=mt(s,l);if(S!=h&&(h=S,u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-a,k.debug("New row in layout for block",e.id," and child ",d.id,h)),k.debug(`abc89 layout blocks (child) id: ${d.id} Pos: ${l} (px, py) ${v},${S} (${b?.size?.x},${b?.size?.y}) parent: ${b.id} width: ${w}${a}`),b.size){const _=w/2;d.size.x=u+a+_,k.debug(`abc91 layout blocks (calc) px, pyid:${d.id} startingPos=X${u} new startingPosX${d.size.x} ${_} padding=${a} width=${w} halfWidth=${_} => x:${d.size.x} y:${d.size.y} ${d.widthInColumns} (width * (child?.w || 1)) / 2 ${w*(d?.widthInColumns??1)/2}`),u=d.size.x+_;const T=n.get(S)??0,m=r.get(S)??y;d.size.y=b.size.y-b.size.height/2+T+m/2+a,k.debug(`abc88 layout blocks (calc) px, pyid:${d.id}startingPosX${u}${a}${_}=>x:${d.size.x}y:${d.size.y}${d.widthInColumns}(width * (child?.w || 1)) / 2${w*(d?.widthInColumns??1)/2}`)}d.children&&Tt(d,t,a);let N=d?.widthInColumns??1;s>0&&(N=Math.min(N,s-l%s)),l+=N,k.debug("abc88 columnsPos",d,l)}}k.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}g(Tt,"layoutBlocks");function Dt(e,{minX:t,minY:a,maxX:s,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:c,y:r,width:n,height:l}=e.size;c-n/2s&&(s=c+n/2),r+l/2>i&&(i=r+l/2)}if(e.children)for(const c of e.children)({minX:t,minY:a,maxX:s,maxY:i}=Dt(c,{minX:t,minY:a,maxX:s,maxY:i}));return{minX:t,minY:a,maxX:s,maxY:i}}g(Dt,"findBounds");function Qt(e){const t=e.getBlock("root");if(!t)return;const a=R()?.block?.padding??8;lt(t,e,0,0,a),Tt(t,e,a),k.debug("getBlocks",JSON.stringify(t,null,2));const{minX:s,minY:i,maxX:c,maxY:r}=Dt(t),n=r-i,l=c-s;return{x:s,y:i,width:l,height:n}}g(Qt,"layout");var Fr=g(async(e,t,a,s=!1,i=!1)=>{let c=t||"";typeof c=="object"&&(c=c[0]);const r=R(),n=M(r);return await kt(e,c,{style:a,isTitle:s,useHtmlLabels:n,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},r)},"createLabel"),K=Fr,Wr=g((e,t,a,s,i)=>{t.arrowTypeStart&&Mt(e,"start",t.arrowTypeStart,a,s,i),t.arrowTypeEnd&&Mt(e,"end",t.arrowTypeEnd,a,s,i)},"addEdgeMarkers"),Yr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Mt=g((e,t,a,s,i,c)=>{const r=Yr[a];if(!r){k.warn(`Unknown arrow type: ${a}`);return}const n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${s}#${i}_${c}-${r}${n})`)},"addEdgeMarker"),St={},z={},Hr=g(async(e,t)=>{const a=R(),s=M(a),i=e.insert("g").attr("class","edgeLabel"),c=i.insert("g").attr("class","label"),r=t.labelType==="markdown",n=await kt(e,t.label,{style:t.labelStyle,useHtmlLabels:s,addSvgBackground:r,isNode:!1,markdown:r,width:r?void 0:Number.POSITIVE_INFINITY},a);c.node().appendChild(n);let l=n.getBBox(),u=l;if(s){const d=n.children[0],b=D(n);l=d.getBoundingClientRect(),u=l,b.attr("width",l.width),b.attr("height",l.height)}else{const d=D(n).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}c.attr("transform",Q(u,s)),St[t.id]=i,t.width=l.width,t.height=l.height;let h;if(t.startLabelLeft){const d=e.insert("g").attr("class","edgeTerminals"),b=d.insert("g").attr("class","inner"),w=await K(b,t.startLabelLeft,t.labelStyle);h=w;let y=w.getBBox();if(s){const v=w.children[0],S=D(w);y=v.getBoundingClientRect(),S.attr("width",y.width),S.attr("height",y.height)}b.attr("transform",Q(y,s)),z[t.id]||(z[t.id]={}),z[t.id].startLeft=d,tt(h,t.startLabelLeft)}if(t.startLabelRight){const d=e.insert("g").attr("class","edgeTerminals"),b=d.insert("g").attr("class","inner"),w=await K(b,t.startLabelRight,t.labelStyle);h=w;let y=w.getBBox();if(s){const v=w.children[0],S=D(w);y=v.getBoundingClientRect(),S.attr("width",y.width),S.attr("height",y.height)}b.attr("transform",Q(y,s)),z[t.id]||(z[t.id]={}),z[t.id].startRight=d,tt(h,t.startLabelRight)}if(t.endLabelLeft){const d=e.insert("g").attr("class","edgeTerminals"),b=d.insert("g").attr("class","inner"),w=await K(d,t.endLabelLeft,t.labelStyle);h=w;let y=w.getBBox();if(s){const v=w.children[0],S=D(w);y=v.getBoundingClientRect(),S.attr("width",y.width),S.attr("height",y.height)}b.attr("transform",Q(y,s)),z[t.id]||(z[t.id]={}),z[t.id].endLeft=d,tt(h,t.endLabelLeft)}if(t.endLabelRight){const d=e.insert("g").attr("class","edgeTerminals"),b=d.insert("g").attr("class","inner"),w=await K(d,t.endLabelRight,t.labelStyle);h=w;let y=w.getBBox();if(s){const v=w.children[0],S=D(w);y=v.getBoundingClientRect(),S.attr("width",y.width),S.attr("height",y.height)}b.attr("transform",Q(y,s)),z[t.id]||(z[t.id]={}),z[t.id].endRight=d,tt(h,t.endLabelRight)}return n},"insertEdgeLabel");function tt(e,t){M(R())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}g(tt,"setTerminalWidth");var Kr=g((e,t)=>{k.debug("Moving label abc88 ",e.id,e.label,St[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath;const s=R(),{subGraphTitleTotalMargin:i}=Xe(s);if(e.label){const c=St[e.id];let r=e.x,n=e.y;if(a){const l=$.calcLabelPosition(a);k.debug("Moving label "+e.label+" from (",r,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(r=l.x,n=l.y)}c.attr("transform",`translate(${r}, ${n+i/2})`)}if(e.startLabelLeft){const c=z[e.id].startLeft;let r=e.x,n=e.y;if(a){const l=$.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){const c=z[e.id].startRight;let r=e.x,n=e.y;if(a){const l=$.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){const c=z[e.id].endLeft;let r=e.x,n=e.y;if(a){const l=$.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){const c=z[e.id].endRight;let r=e.x,n=e.y;if(a){const l=$.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),Ur=g((e,t)=>{const a=e.x,s=e.y,i=Math.abs(t.x-a),c=Math.abs(t.y-s),r=e.width/2,n=e.height/2;return i>=r||c>=n},"outsideNode"),Xr=g((e,t,a)=>{k.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(t)} + insidePoint : ${JSON.stringify(a)} + node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const s=e.x,i=e.y,c=Math.abs(s-a.x),r=e.width/2;let n=a.xMath.abs(s-t.x)*l){let d=a.y{k.debug("abc88 cutPathAtIntersect",e,t);let a=[],s=e[0],i=!1;return e.forEach(c=>{if(!Ur(t,c)&&!i){const r=Xr(t,s,c);let n=!1;a.forEach(l=>{n=n||l.x===r.x&&l.y===r.y}),a.some(l=>l.x===r.x&&l.y===r.y)||a.push(r),i=!0}else s=c,i||a.push(c)}),a},"cutPathAtIntersect"),Vr=g(function(e,t,a,s,i,c,r){let n=a.points;k.debug("abc88 InsertEdge: edge=",a,"e=",t);let l=!1;const u=c.node(t.v);var h=c.node(t.w);h?.intersect&&u?.intersect&&(n=n.slice(1,a.points.length-1),n.unshift(u.intersect(n[0])),n.push(h.intersect(n[n.length-1]))),a.toCluster&&(k.debug("to cluster abc88",s[a.toCluster]),n=Pt(a.points,s[a.toCluster].node),l=!0),a.fromCluster&&(k.debug("from cluster abc88",s[a.fromCluster]),n=Pt(n.reverse(),s[a.fromCluster].node).reverse(),l=!0);const d=n.filter(m=>!Number.isNaN(m.y));let b=Ke;a.curve&&(i==="graph"||i==="flowchart")&&(b=a.curve);const{x:w,y}=Ye(a),v=He().x(w).y(y).curve(b);let S;switch(a.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-thick";break;default:S=""}switch(a.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break}const N=e.append("path").attr("d",v(d)).attr("id",a.id).attr("class"," "+S+(a.classes?" "+a.classes:"")).attr("style",a.style);let _="";(R().flowchart.arrowMarkerAbsolute||R().state.arrowMarkerAbsolute)&&(_=Ue(!0)),Wr(N,a,_,r,i);let T={};return l&&(T.updatedPath=n),T.originalPath=a.points,T},"insertEdge"),jr=g(e=>{const t=new Set;for(const a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},"expandAndDeduplicateDirections"),Gr=g((e,t,a,s)=>{const i=jr(e),c=2,r=t.height+2*a.padding,n=r/c,l=s??t.width+2*n+a.padding,u=a.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:l/2,y:2*u},{x:l-n,y:0},{x:l,y:0},{x:l,y:-r/3},{x:l+2*u,y:-r/2},{x:l,y:-2*r/3},{x:l,y:-r},{x:l-n,y:-r},{x:l/2,y:-r-2*u},{x:n,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*u,y:-r/2},{x:0,y:-r/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:n,y:0},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:n,y:-r},{x:0,y:-r/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:n,y:-r},{x:l-n,y:-r},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-n},{x:l,y:-r+n},{x:0,y:-r}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-n},{x:0,y:-r+n},{x:l,y:-r}]:i.has("right")&&i.has("left")?[{x:n,y:0},{x:n,y:-u},{x:l-n,y:-u},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:l-n,y:-r+u},{x:n,y:-r+u},{x:n,y:-r},{x:0,y:-r/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:n,y:-u},{x:n,y:-r+u},{x:0,y:-r+u},{x:l/2,y:-r},{x:l,y:-r+u},{x:l-n,y:-r+u},{x:l-n,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-n},{x:0,y:-r}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-r}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-n},{x:l,y:-r}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-r}]:i.has("right")?[{x:n,y:-u},{x:n,y:-u},{x:l-n,y:-u},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:l-n,y:-r+u},{x:n,y:-r+u},{x:n,y:-r+u}]:i.has("left")?[{x:n,y:0},{x:n,y:-u},{x:l-n,y:-u},{x:l-n,y:-r+u},{x:n,y:-r+u},{x:n,y:-r},{x:0,y:-r/2}]:i.has("up")?[{x:n,y:-u},{x:n,y:-r+u},{x:0,y:-r+u},{x:l/2,y:-r},{x:l,y:-r+u},{x:l-n,y:-r+u},{x:l-n,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:n,y:-u},{x:n,y:-r+u},{x:l-n,y:-r+u},{x:l-n,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function $t(e,t){return e.intersect(t)}g($t,"intersectNode");var Zr=$t;function te(e,t,a,s){var i=e.x,c=e.y,r=i-s.x,n=c-s.y,l=Math.sqrt(t*t*n*n+a*a*r*r),u=Math.abs(t*a*r/l);s.x0}g(Lt,"sameSign");var Jr=ae,Qr=se;function se(e,t,a){var s=e.x,i=e.y,c=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(y){r=Math.min(r,y.x),n=Math.min(n,y.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var l=s-e.width/2-r,u=i-e.height/2-n,h=0;h1&&c.sort(function(y,v){var S=y.x-a.x,N=y.y-a.y,_=Math.sqrt(S*S+N*N),T=v.x-a.x,m=v.y-a.y,p=Math.sqrt(T*T+m*m);return _{var a=e.x,s=e.y,i=t.x-a,c=t.y-s,r=e.width/2,n=e.height/2,l,u;return Math.abs(c)*r>Math.abs(i)*n?(c<0&&(n=-n),l=c===0?0:n*i/c,u=n):(i<0&&(r=-r),l=r,u=i===0?0:r*c/i),{x:a+l,y:s+u}},"intersectRect"),ta=$r,B={node:Zr,circle:qr,ellipse:ee,polygon:Qr,rect:ta},A=g(async(e,t,a,s)=>{const i=R();let c;const r=t.useHtmlLabels||M(i);a?c=a:c="node default";const n=e.insert("g").attr("class",c).attr("id",t.domId||t.id),l=n.insert("g").attr("class","label").attr("style",t.labelStyle);let u;t.labelText===void 0?u="":u=typeof t.labelText=="string"?t.labelText:t.labelText[0];let h;t.labelType==="markdown"?h=kt(l,Ct(Ot(u),i),{useHtmlLabels:r,width:t.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await K(l,Ct(Ot(u),i),t.labelStyle,!1,s);let d=h.getBBox();const b=t.padding/2;if(M(i)){const w=h.children[0],y=D(h);await Ge(w,u),d=w.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height)}return r?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:n,bbox:d,halfPadding:b,label:l}},"labelHelper"),I=g((e,t)=>{const a=t.node().getBBox();e.width=a.width,e.height=a.height},"updateNodeBounds");function X(e,t,a,s){return e.insert("polygon",":first-child").attr("points",s.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}g(X,"insertPolygonShape");var ea=g(async(e,t)=>{t.useHtmlLabels||M(R())||(t.centerLabel=!0);const{shapeSvg:s,bbox:i,halfPadding:c}=await A(e,t,"node "+t.classes,!0);k.info("Classes = ",t.classes);const r=s.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-i.width/2-c).attr("y",-i.height/2-c).attr("width",i.width+t.padding).attr("height",i.height+t.padding),I(t,r),t.intersect=function(n){return B.rect(t,n)},s},"note"),ra=ea,Ft=g(e=>e?" "+e:"","formatClass"),Y=g((e,t)=>`${t||"node default"}${Ft(e.classes)} ${Ft(e.class)}`,"getClassesFromNode"),Wt=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=i+c,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];k.info("Question main (Circle)");const l=X(a,r,r,n);return l.attr("style",t.style),I(t,l),t.intersect=function(u){return k.warn("Intersect called"),B.polygon(t,n,u)},a},"question"),aa=g((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=28,i=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}];return a.insert("polygon",":first-child").attr("points",i.map(function(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return B.circle(t,14,r)},a},"choice"),sa=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=4,c=t.positioned?t.height:s.height+t.padding,r=c/i,n=t.positioned?t.width:s.width+2*r+t.padding,l=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-c/2},{x:n-r,y:-c},{x:r,y:-c},{x:0,y:-c/2}],u=X(a,n,c,l);return u.attr("style",t.style),I(t,u),t.intersect=function(h){return B.polygon(t,l,h)},a},"hexagon"),ia=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,void 0,!0),i=2,c=s.height+2*t.padding,r=c/i,n=s.width+2*r+t.padding,u=t.positioned&&(t.widthInColumns??1)>1&&t.width>n?t.width:n,h=Gr(t.directions,s,t,u),d=X(a,u,c,h);return d.attr("style",t.style),I(t,d),t.intersect=function(b){return B.polygon(t,h,b)},a},"block_arrow"),na=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-c/2,y:0},{x:i,y:0},{x:i,y:-c},{x:-c/2,y:-c},{x:0,y:-c/2}];return X(a,i,c,r).attr("style",t.style),t.width=i+c,t.height=c,t.intersect=function(l){return B.polygon(t,r,l)},a},"rect_left_inv_arrow"),ca=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-2*c/6,y:0},{x:i-c/6,y:0},{x:i+2*c/6,y:-c},{x:c/6,y:-c}],n=X(a,i,c,r);return n.attr("style",t.style),I(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"lean_right"),la=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:2*c/6,y:0},{x:i+c/6,y:0},{x:i-2*c/6,y:-c},{x:-c/6,y:-c}],n=X(a,i,c,r);return n.attr("style",t.style),I(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"lean_left"),oa=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-2*c/6,y:0},{x:i+2*c/6,y:0},{x:i-c/6,y:-c},{x:c/6,y:-c}],n=X(a,i,c,r);return n.attr("style",t.style),I(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"trapezoid"),ha=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:c/6,y:0},{x:i-c/6,y:0},{x:i+2*c/6,y:-c},{x:-2*c/6,y:-c}],n=X(a,i,c,r);return n.attr("style",t.style),I(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"inv_trapezoid"),ga=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:0,y:0},{x:i+c/2,y:0},{x:i,y:-c/2},{x:i+c/2,y:-c},{x:0,y:-c}],n=X(a,i,c,r);return n.attr("style",t.style),I(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"rect_right_inv_arrow"),ua=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=i/2,r=c/(2.5+i/50),n=s.height+r+t.padding,l="M 0,"+r+" a "+c+","+r+" 0,0,0 "+i+" 0 a "+c+","+r+" 0,0,0 "+-i+" 0 l 0,"+n+" a "+c+","+r+" 0,0,0 "+i+" 0 l 0,"+-n,u=a.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",l).attr("transform","translate("+-i/2+","+-(n/2+r)+")");return I(t,u),t.intersect=function(h){const d=B.rect(t,h),b=d.x-t.x;if(c!=0&&(Math.abs(b)t.height/2-r)){let w=r*r*(1-b*b/(c*c));w!=0&&(w=Math.sqrt(w)),w=r-w,h.y-t.y>0&&(w=-w),d.y+=w}return d},a},"cylinder"),da=g(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await A(e,t,"node "+t.classes+" "+t.class,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,l=t.positioned?-r/2:-s.width/2-i,u=t.positioned?-n/2:-s.height/2-i;if(c.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",u).attr("width",r).attr("height",n),t.props){const h=new Set(Object.keys(t.props));t.props.borders&&(ot(c,t.props.borders,r,n),h.delete("borders")),h.forEach(d=>{k.warn(`Unknown node property ${d}`)})}return I(t,c),t.intersect=function(h){return B.rect(t,h)},a},"rect"),pa=g(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await A(e,t,"node "+t.classes,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,l=t.positioned?-r/2:-s.width/2-i,u=t.positioned?-n/2:-s.height/2-i;if(c.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",u).attr("width",r).attr("height",n),t.props){const h=new Set(Object.keys(t.props));t.props.borders&&(ot(c,t.props.borders,r,n),h.delete("borders")),h.forEach(d=>{k.warn(`Unknown node property ${d}`)})}return I(t,c),t.intersect=function(h){return B.rect(t,h)},a},"composite"),fa=g(async(e,t)=>{const{shapeSvg:a}=await A(e,t,"label",!0);k.trace("Classes = ",t.class);const s=a.insert("rect",":first-child"),i=0,c=0;if(s.attr("width",i).attr("height",c),a.attr("class","label edgeLabel"),t.props){const r=new Set(Object.keys(t.props));t.props.borders&&(ot(s,t.props.borders,i,c),r.delete("borders")),r.forEach(n=>{k.warn(`Unknown node property ${n}`)})}return I(t,s),t.intersect=function(r){return B.rect(t,r)},a},"labelRect");function ot(e,t,a,s){const i=[],c=g(n=>{i.push(n,0)},"addBorder"),r=g(n=>{i.push(0,n)},"skipBorder");t.includes("t")?(k.debug("add top border"),c(a)):r(a),t.includes("r")?(k.debug("add right border"),c(s)):r(s),t.includes("b")?(k.debug("add bottom border"),c(a)):r(a),t.includes("l")?(k.debug("add left border"),c(s)):r(s),e.attr("stroke-dasharray",i.join(" "))}g(ot,"applyNodePropertyBorders");var xa=g(async(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";const s=e.insert("g").attr("class",a).attr("id",t.domId||t.id),i=s.insert("rect",":first-child"),c=s.insert("line"),r=s.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let l="";typeof n=="object"?l=n[0]:l=n,k.info("Label text abc79",l,n,typeof n=="object");const u=await K(r,l,t.labelStyle,!0,!0);let h={width:0,height:0};if(M(R())){const v=u.children[0],S=D(u);h=v.getBoundingClientRect(),S.attr("width",h.width),S.attr("height",h.height)}k.info("Text 2",n);const d=n.slice(1,n.length);let b=u.getBBox();const w=await K(r,d.join?d.join("
"):d,t.labelStyle,!0,!0);if(M(R())){const v=w.children[0],S=D(w);h=v.getBoundingClientRect(),S.attr("width",h.width),S.attr("height",h.height)}const y=t.padding/2;return D(w).attr("transform","translate( "+(h.width>b.width?0:(b.width-h.width)/2)+", "+(b.height+y+5)+")"),D(u).attr("transform","translate( "+(h.width{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.height+t.padding,c=s.width+i/4+t.padding,r=a.insert("rect",":first-child").attr("style",t.style).attr("rx",i/2).attr("ry",i/2).attr("x",-c/2).attr("y",-i/2).attr("width",c).attr("height",i);return I(t,r),t.intersect=function(n){return B.rect(t,n)},a},"stadium"),ba=g(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await A(e,t,Y(t,void 0),!0),c=a.insert("circle",":first-child");return c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("Circle main"),I(t,c),t.intersect=function(r){return k.info("Circle intersect",t,s.width/2+i,r),B.circle(t,s.width/2+i,r)},a},"circle"),wa=g(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await A(e,t,Y(t,void 0),!0),c=5,r=a.insert("g",":first-child"),n=r.insert("circle"),l=r.insert("circle");return r.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i+c).attr("width",s.width+t.padding+c*2).attr("height",s.height+t.padding+c*2),l.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("DoubleCircle main"),I(t,n),t.intersect=function(u){return k.info("DoubleCircle intersect",t,s.width/2+i+c,u),B.circle(t,s.width/2+i+c,u)},a},"doublecircle"),ma=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:0,y:0},{x:i,y:0},{x:i,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-c},{x:-8,y:-c},{x:-8,y:0}],n=X(a,i,c,r);return n.attr("style",t.style),I(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"subroutine"),Sa=g((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child");return s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),I(t,s),t.intersect=function(i){return B.circle(t,7,i)},a},"start"),Yt=g((e,t,a)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let i=70,c=10;a==="LR"&&(i=10,c=70);const r=s.append("rect").attr("x",-1*i/2).attr("y",-1*c/2).attr("width",i).attr("height",c).attr("class","fork-join");return I(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return B.rect(t,n)},s},"forkJoin"),La=g((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child"),i=a.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),s.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),I(t,i),t.intersect=function(c){return B.circle(t,7,c)},a},"end"),ka=g(async(e,t)=>{const a=t.padding/2,s=4,i=8;let c;t.classes?c="node "+t.classes:c="node default";const r=e.insert("g").attr("class",c).attr("id",t.domId||t.id),n=r.insert("rect",":first-child"),l=r.insert("line"),u=r.insert("line");let h=0,d=s;const b=r.insert("g").attr("class","label");let w=0;const y=t.classData.annotations?.[0],v=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",S=await K(b,v,t.labelStyle,!0,!0);let N=S.getBBox();if(M(R())){const E=S.children[0],o=D(S);N=E.getBoundingClientRect(),o.attr("width",N.width),o.attr("height",N.height)}t.classData.annotations[0]&&(d+=N.height+s,h+=N.width);let _=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(M(R())?_+="<"+t.classData.type+">":_+="<"+t.classData.type+">");const T=await K(b,_,t.labelStyle,!0,!0);D(T).attr("class","classTitle");let m=T.getBBox();if(M(R())){const E=T.children[0],o=D(T);m=E.getBoundingClientRect(),o.attr("width",m.width),o.attr("height",m.height)}d+=m.height+s,m.width>h&&(h=m.width);const p=[];t.classData.members.forEach(async E=>{const o=E.getDisplayDetails();let F=o.displayText;M(R())&&(F=F.replace(//g,">"));const f=await K(b,F,o.cssStyle?o.cssStyle:t.labelStyle,!0,!0);let C=f.getBBox();if(M(R())){const Z=f.children[0],V=D(f);C=Z.getBoundingClientRect(),V.attr("width",C.width),V.attr("height",C.height)}C.width>h&&(h=C.width),d+=C.height+s,p.push(f)}),d+=i;const x=[];if(t.classData.methods.forEach(async E=>{const o=E.getDisplayDetails();let F=o.displayText;M(R())&&(F=F.replace(//g,">"));const f=await K(b,F,o.cssStyle?o.cssStyle:t.labelStyle,!0,!0);let C=f.getBBox();if(M(R())){const Z=f.children[0],V=D(f);C=Z.getBoundingClientRect(),V.attr("width",C.width),V.attr("height",C.height)}C.width>h&&(h=C.width),d+=C.height+s,x.push(f)}),d+=i,y){let E=(h-N.width)/2;D(S).attr("transform","translate( "+(-1*h/2+E)+", "+-1*d/2+")"),w=N.height+s}let L=(h-m.width)/2;return D(T).attr("transform","translate( "+(-1*h/2+L)+", "+(-1*d/2+w)+")"),w+=m.height+s,l.attr("class","divider").attr("x1",-h/2-a).attr("x2",h/2+a).attr("y1",-d/2-a+i+w).attr("y2",-d/2-a+i+w),w+=i,p.forEach(E=>{D(E).attr("transform","translate( "+-h/2+", "+(-1*d/2+w+i/2)+")");const o=E?.getBBox();w+=(o?.height??0)+s}),w+=i,u.attr("class","divider").attr("x1",-h/2-a).attr("x2",h/2+a).attr("y1",-d/2-a+i+w).attr("y2",-d/2-a+i+w),w+=i,x.forEach(E=>{D(E).attr("transform","translate( "+-h/2+", "+(-1*d/2+w)+")");const o=E?.getBBox();w+=(o?.height??0)+s}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-h/2-a).attr("y",-(d/2)-a).attr("width",h+t.padding).attr("height",d+t.padding),I(t,n),t.intersect=function(E){return B.rect(t,E)},r},"class_box"),Ht={rhombus:Wt,composite:pa,question:Wt,rect:da,labelRect:fa,rectWithTitle:xa,choice:aa,circle:ba,doublecircle:wa,stadium:ya,hexagon:sa,block_arrow:ia,rect_left_inv_arrow:na,lean_right:ca,lean_left:la,trapezoid:oa,inv_trapezoid:ha,rect_right_inv_arrow:ga,cylinder:ua,start:Sa,end:La,note:ra,subroutine:ma,fork:Yt,join:Yt,class_box:ka},nt={},ie=g(async(e,t,a)=>{let s,i;if(t.link){let c;R().securityLevel==="sandbox"?c="_top":t.linkTarget&&(c=t.linkTarget||"_blank"),s=e.insert("svg:a").attr("xlink:href",t.link).attr("target",c),i=await Ht[t.shape](s,t,a)}else i=await Ht[t.shape](e,t,a),s=i;return t.tooltip&&i.attr("title",t.tooltip),t.class&&i.attr("class","node default "+t.class),nt[t.id]=s,t.haveCallback&&nt[t.id].attr("class",nt[t.id].attr("class")+" clickable"),s},"insertNode"),va=g(e=>{const t=nt[e.id];k.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const a=8,s=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+s-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),s},"positionNode");function Bt(e,t,a=!1){const s=e;let i="default";(s?.classes?.length||0)>0&&(i=(s?.classes??[]).join(" ")),i=i+" flowchart-label";let c=0,r="",n;switch(s.type){case"round":c=5,r="rect";break;case"composite":c=0,r="composite",n=0;break;case"square":r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"block_arrow":r="block_arrow";break;case"odd":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"rect_left_inv_arrow":r="rect_left_inv_arrow";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"group":r="rect";break;case"doublecircle":r="doublecircle";break;default:r="rect"}const l=je(s?.styles??[]),u=s.label,h=s.size??{width:0,height:0,x:0,y:0},d=t.getDiagramId();return{labelStyle:l.labelStyle,shape:r,labelText:u,rx:c,ry:c,class:i,style:l.style,id:s.id,domId:d?`${d}-${s.id}`:s.id,directions:s.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:a,intersect:void 0,type:s.type,padding:n??rt()?.block?.padding??0,widthInColumns:s.widthInColumns??1}}g(Bt,"getNodeFromBlock");async function ne(e,t,a){const s=Bt(t,a,!1);if(s.type==="group")return;const i=rt(),c=await ie(e,s,{config:i}),r=c.node().getBBox(),n=a.getBlock(s.id);n.size={width:r.width,height:r.height,x:0,y:0,node:c},a.setBlock(n),c.remove()}g(ne,"calculateBlockSize");async function ce(e,t,a){const s=Bt(t,a,!0);if(a.getBlock(s.id).type!=="space"){const c=rt();await ie(e,s,{config:c}),t.intersect=s?.intersect,va(s)}}g(ce,"insertBlockPositioned");async function ht(e,t,a,s){for(const i of t)await s(e,i,a),i.children&&await ht(e,i.children,a,s)}g(ht,"performOperations");async function le(e,t,a){await ht(e,t,a,ne)}g(le,"calculateBlockSizes");async function oe(e,t,a){await ht(e,t,a,ce)}g(oe,"insertBlocks");async function he(e,t,a,s,i){const c=new Ze({multigraph:!0,compound:!0});c.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const r of a)r.size&&c.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(const r of t)if(r.start&&r.end){const n=s.getBlock(r.start),l=s.getBlock(r.end);if(n?.size&&l?.size){const u=n.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],b=i?`${i}-${r.id}`:r.id,w=r.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",y=r.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",v=`${w} ${y} flowchart-link LS-a1 LE-b1`;Vr(e,{v:r.start,w:r.end,name:b},{...r,id:b,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:d,classes:v},void 0,"block",c,i),r.label&&(await Hr(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:d,classes:v}),Kr({...r,x:d[1].x,y:d[1].y},{originalPath:d}))}}}g(he,"insertEdges");var Ea=g(function(e,t){return t.db.getClasses()},"getClasses"),_a=g(async function(e,t,a,s){const{securityLevel:i,block:c}=rt(),r=s.db;r.setDiagramId(t);let n;i==="sandbox"&&(n=D("#i"+t));const l=i==="sandbox"?D(n.nodes()[0].contentDocument.body):D("body"),u=i==="sandbox"?l.select(`[id="${t}"]`):D(`[id="${t}"]`);Mr(u,["point","circle","cross"],s.type,t);const d=r.getBlocks(),b=r.getBlocksFlat(),w=r.getEdges(),y=u.insert("g").attr("class","block");await le(y,d,r);const v=Qt(r);if(await oe(y,d,r),await he(y,w,b,r,t),v){const S=v,N=Math.max(1,Math.round(.125*(S.width/S.height))),_=S.height+N+10,T=S.width+10,{useMaxWidth:m}=c;Pe(u,_,T,!!m),k.debug("Here Bounds",v,S),u.attr("viewBox",`${S.x-5} ${S.y-5} ${S.width+10} ${S.height+10}`)}},"draw"),Ta={draw:_a,getClasses:Ea},Ra={parser:ar,db:kr,renderer:Ta,styles:Er};export{Ra as diagram}; diff --git a/internal/webapp/static/assets/c4Diagram-5PPSVZJV-oXGTev51.js b/internal/webapp/static/assets/c4Diagram-5PPSVZJV-oXGTev51.js new file mode 100644 index 0000000..e433bc8 --- /dev/null +++ b/internal/webapp/static/assets/c4Diagram-5PPSVZJV-oXGTev51.js @@ -0,0 +1,10 @@ +import{g as Se,d as De}from"./chunk-2GRJ4B5K-Bng47RDF.js";import{s as Pe,g as Be,a as Ie,b as Me,_ as y,c as Bt,d as jt,l as de,e as Le,f as Ne,h as Tt,i as ge,j as Ye,w as je,k as $t,m as fe}from"./mermaid.core-B7WVQkyL.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var Ft=(function(){var a=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],r=[1,27],l=[1,28],e=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Qt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],St=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],le=[12,14,33,42],Mt=[12,14,33,42,76,77,79,80],vt=[12,33],Ht=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Dt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},a(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:e,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(Ct,[2,14]),a(Qt,[2,16],{12:[1,76]}),a(Ct,[2,36],{12:[1,77]}),a(St,[2,19]),a(St,[2,20]),{25:[1,78]},{27:[1,79]},a(St,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},a(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},a(Ct,[2,15]),a(Qt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:r,28:l}),a(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:r,28:l,34:e,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(St,[2,21]),a(St,[2,22]),a(T,[2,39]),a(le,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),a(Mt,[2,73]),{78:[1,133]},a(Mt,[2,75]),a(Mt,[2,76]),a(T,[2,40]),a(T,[2,41]),a(T,[2,42]),a(T,[2,43]),a(T,[2,44]),a(T,[2,45]),a(T,[2,46]),a(T,[2,47]),a(T,[2,48]),a(T,[2,49]),a(T,[2,50]),a(T,[2,51]),a(T,[2,52]),a(T,[2,53]),a(T,[2,54]),a(T,[2,55]),a(T,[2,56]),a(T,[2,57]),a(T,[2,58]),a(T,[2,60]),a(T,[2,61]),a(T,[2,62]),a(T,[2,63]),a(T,[2,64]),a(T,[2,65]),a(T,[2,66]),a(T,[2,67]),a(T,[2,68]),a(T,[2,69]),a(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},a(vt,[2,28]),a(vt,[2,29]),a(vt,[2,30]),a(vt,[2,31]),a(vt,[2,32]),a(vt,[2,33]),a(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},a(Qt,[2,18]),a(Ct,[2,38]),a(le,[2,72]),a(Mt,[2,74]),a(T,[2,24]),a(T,[2,35]),a(Ht,[2,25]),a(Ht,[2,26],{12:[1,138]}),a(Ht,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Dt=this.table,f="",Et=0,oe=0,we=2,ce=1,Te=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(At.yy[Gt]=this.yy[Gt]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Kt=D.yylloc;h.push(Kt);var Oe=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Re,"popStack");function he(){var L;return L=b.pop()||D.lex()||ce,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(he,"lex");for(var I,kt,N,Jt,wt={},Nt,W,ue,Yt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=he()),N=Dt[kt]&&Dt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Zt="";Yt=[];for(Nt in Dt[kt])this.terminals_[Nt]&&Nt>we&&Yt.push("'"+this.terminals_[Nt]+"'");D.showPosition?Zt="Parse error on line "+(Et+1)+`: +`+D.showPosition()+` +Expecting `+Yt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Zt="Parse error on line "+(Et+1)+": Unexpected "+(I==ce?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Zt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:Kt,expected:Yt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:E.push(I),R.push(D.yytext),h.push(D.yylloc),E.push(N[1]),I=null,oe=D.yyleng,f=D.yytext,Et=D.yylineno,Kt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},Oe&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Jt=this.performAction.apply(wt,[f,oe,Et,At.yy,N[1],R,h].concat(Te)),typeof Jt<"u")return Jt;W&&(E=E.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),E.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ue=Dt[E[E.length-2]][E[E.length-1]],E.push(ue);break;case 3:return!0}}return!0},"parse")},Ce=(function(){var _t={EOF:1,parseError:y(function(v,E){if(this.yy.parser)this.yy.parser.parseError(v,E);else throw new Error(v)},"parseError"),setInput:y(function(x,v){return this.yy=v||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var v=x.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:y(function(x){var v=x.length,E=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(x){this.unput(this.match.slice(x))},"less"),pastInput:y(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var x=this.pastInput(),v=new Array(x.length+1).join("-");return x+this.upcomingInput()+` +`+v+"^"},"showPosition"),test_match:y(function(x,v){var E,b,R;if(this.options.backtrack_lexer&&(R={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(R.yylloc.range=this.yylloc.range.slice(0))),b=x[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(x[0].length),this.matched+=x[0],E=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var h in R)this[h]=R[h];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,v,E,b;this._more||(this.yytext="",this.match="");for(var R=this._currentRules(),h=0;hv[0].length)){if(v=E,b=h,this.options.backtrack_lexer){if(x=this.test_match(E,R[h]),x!==!1)return x;if(this._backtrack){v=!1;continue}else return!1}else if(!this.options.flex)break}return v?(x=this.test_match(v,R[b]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var v=this.next();return v||this.lex()},"lex"),begin:y(function(v){this.conditionStack.push(v)},"begin"),popState:y(function(){var v=this.conditionStack.length-1;return v>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(v){return v=this.conditionStack.length-1-Math.abs(v||0),v>=0?this.conditionStack[v]:"INITIAL"},"topState"),pushState:y(function(v){this.begin(v)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:y(function(v,E,b,R){switch(b){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return _t})();qt.lexer=Ce;function Lt(){this.yy={}}return y(Lt,"Parser"),Lt.prototype=qt,qt.Parser=Lt,new Lt})();Ft.parser=Ft;var Ue=Ft,V=[],xt=[""],B="global",F="",X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],It=[],ie="",ne=!1,Vt=4,zt=2,be,Fe=y(function(){return be},"getC4Type"),Ve=y(function(a){be=ge(a,Bt())},"setC4Type"),ze=y(function(a,t,s,o,r,l,e,n,i){if(a==null||t===void 0||t===null||s===void 0||s===null||o===void 0||o===null)return;let u={};const d=It.find(p=>p.from===t&&p.to===s);if(d?u=d:It.push(u),u.type=a,u.from=t,u.to=s,u.label={text:o},r==null)u.techn={text:""};else if(typeof r=="object"){let[p,g]=Object.entries(r)[0];u[p]={text:g}}else u.techn={text:r};if(l==null)u.descr={text:""};else if(typeof l=="object"){let[p,g]=Object.entries(l)[0];u[p]={text:g}}else u.descr={text:l};if(typeof e=="object"){let[p,g]=Object.entries(e)[0];u[p]=g}else u.sprite=e;if(typeof n=="object"){let[p,g]=Object.entries(n)[0];u[p]=g}else u.tags=n;if(typeof i=="object"){let[p,g]=Object.entries(i)[0];u[p]=g}else u.link=i;u.wrap=mt()},"addRel"),Xe=y(function(a,t,s,o,r,l,e){if(t===null||s===null)return;let n={};const i=V.find(u=>u.alias===t);if(i&&t===i.alias?n=i:(n.alias=t,V.push(n)),s==null?n.label={text:""}:n.label={text:s},o==null)n.descr={text:""};else if(typeof o=="object"){let[u,d]=Object.entries(o)[0];n[u]={text:d}}else n.descr={text:o};if(typeof r=="object"){let[u,d]=Object.entries(r)[0];n[u]=d}else n.sprite=r;if(typeof l=="object"){let[u,d]=Object.entries(l)[0];n[u]=d}else n.tags=l;if(typeof e=="object"){let[u,d]=Object.entries(e)[0];n[u]=d}else n.link=e;n.typeC4Shape={text:a},n.parentBoundary=B,n.wrap=mt()},"addPersonOrSystem"),We=y(function(a,t,s,o,r,l,e,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.techn={text:o};if(r==null)i.descr={text:""};else if(typeof r=="object"){let[d,p]=Object.entries(r)[0];i[d]={text:p}}else i.descr={text:r};if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]=p}else i.sprite=l;if(typeof e=="object"){let[d,p]=Object.entries(e)[0];i[d]=p}else i.tags=e;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:a},i.parentBoundary=B},"addContainer"),Qe=y(function(a,t,s,o,r,l,e,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.techn={text:o};if(r==null)i.descr={text:""};else if(typeof r=="object"){let[d,p]=Object.entries(r)[0];i[d]={text:p}}else i.descr={text:r};if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]=p}else i.sprite=l;if(typeof e=="object"){let[d,p]=Object.entries(e)[0];i[d]=p}else i.tags=e;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:a},i.parentBoundary=B},"addComponent"),He=y(function(a,t,s,o,r){if(a===null||t===null)return;let l={};const e=X.find(n=>n.alias===a);if(e&&a===e.alias?l=e:(l.alias=a,X.push(l)),t==null?l.label={text:""}:l.label={text:t},s==null)l.type={text:"system"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];l[n]={text:i}}else l.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];l[n]=i}else l.tags=o;if(typeof r=="object"){let[n,i]=Object.entries(r)[0];l[n]=i}else l.link=r;l.parentBoundary=B,l.wrap=mt(),F=B,B=a,xt.push(F)},"addPersonOrSystemBoundary"),qe=y(function(a,t,s,o,r){if(a===null||t===null)return;let l={};const e=X.find(n=>n.alias===a);if(e&&a===e.alias?l=e:(l.alias=a,X.push(l)),t==null?l.label={text:""}:l.label={text:t},s==null)l.type={text:"container"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];l[n]={text:i}}else l.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];l[n]=i}else l.tags=o;if(typeof r=="object"){let[n,i]=Object.entries(r)[0];l[n]=i}else l.link=r;l.parentBoundary=B,l.wrap=mt(),F=B,B=a,xt.push(F)},"addContainerBoundary"),Ge=y(function(a,t,s,o,r,l,e,n){if(t===null||s===null)return;let i={};const u=X.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,X.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.type={text:"node"};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.type={text:o};if(r==null)i.descr={text:""};else if(typeof r=="object"){let[d,p]=Object.entries(r)[0];i[d]={text:p}}else i.descr={text:r};if(typeof e=="object"){let[d,p]=Object.entries(e)[0];i[d]=p}else i.tags=e;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.nodeType=a,i.parentBoundary=B,i.wrap=mt(),F=B,B=t,xt.push(F)},"addDeploymentNode"),Ke=y(function(){B=F,xt.pop(),F=xt.pop(),xt.push(F)},"popBoundaryParseStack"),Je=y(function(a,t,s,o,r,l,e,n,i,u,d){let p=V.find(g=>g.alias===t);if(!(p===void 0&&(p=X.find(g=>g.alias===t),p===void 0))){if(s!=null)if(typeof s=="object"){let[g,m]=Object.entries(s)[0];p[g]=m}else p.bgColor=s;if(o!=null)if(typeof o=="object"){let[g,m]=Object.entries(o)[0];p[g]=m}else p.fontColor=o;if(r!=null)if(typeof r=="object"){let[g,m]=Object.entries(r)[0];p[g]=m}else p.borderColor=r;if(l!=null)if(typeof l=="object"){let[g,m]=Object.entries(l)[0];p[g]=m}else p.shadowing=l;if(e!=null)if(typeof e=="object"){let[g,m]=Object.entries(e)[0];p[g]=m}else p.shape=e;if(n!=null)if(typeof n=="object"){let[g,m]=Object.entries(n)[0];p[g]=m}else p.sprite=n;if(i!=null)if(typeof i=="object"){let[g,m]=Object.entries(i)[0];p[g]=m}else p.techn=i;if(u!=null)if(typeof u=="object"){let[g,m]=Object.entries(u)[0];p[g]=m}else p.legendText=u;if(d!=null)if(typeof d=="object"){let[g,m]=Object.entries(d)[0];p[g]=m}else p.legendSprite=d}},"updateElStyle"),Ze=y(function(a,t,s,o,r,l,e){const n=It.find(i=>i.from===t&&i.to===s);if(n!==void 0){if(o!=null)if(typeof o=="object"){let[i,u]=Object.entries(o)[0];n[i]=u}else n.textColor=o;if(r!=null)if(typeof r=="object"){let[i,u]=Object.entries(r)[0];n[i]=u}else n.lineColor=r;if(l!=null)if(typeof l=="object"){let[i,u]=Object.entries(l)[0];n[i]=parseInt(u)}else n.offsetX=parseInt(l);if(e!=null)if(typeof e=="object"){let[i,u]=Object.entries(e)[0];n[i]=parseInt(u)}else n.offsetY=parseInt(e)}},"updateRelStyle"),$e=y(function(a,t,s){let o=Vt,r=zt;if(typeof t=="object"){const l=Object.values(t)[0];o=parseInt(l)}else o=parseInt(t);if(typeof s=="object"){const l=Object.values(s)[0];r=parseInt(l)}else r=parseInt(s);o>=1&&(Vt=o),r>=1&&(zt=r)},"updateLayoutConfig"),t0=y(function(){return Vt},"getC4ShapeInRow"),e0=y(function(){return zt},"getC4BoundaryInRow"),a0=y(function(){return B},"getCurrentBoundaryParse"),i0=y(function(){return F},"getParentBoundaryParse"),_e=y(function(a){return a==null?V:V.filter(t=>t.parentBoundary===a)},"getC4ShapeArray"),n0=y(function(a){return V.find(t=>t.alias===a)},"getC4Shape"),s0=y(function(a){return Object.keys(_e(a))},"getC4ShapeKeys"),xe=y(function(a){return a==null?X:X.filter(t=>t.parentBoundary===a)},"getBoundaries"),r0=xe,l0=y(function(){return It},"getRels"),o0=y(function(){return ie},"getTitle"),c0=y(function(a){ne=a},"setWrap"),mt=y(function(){return ne},"autoWrap"),h0=y(function(){V=[],X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],F="",B="global",xt=[""],It=[],xt=[""],ie="",ne=!1,Vt=4,zt=2},"clear"),u0={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},d0={FILLED:0,OPEN:1},f0={LEFTOF:0,RIGHTOF:1,OVER:2},p0=y(function(a){ie=ge(a,Bt())},"setTitle"),te={addPersonOrSystem:Xe,addPersonOrSystemBoundary:He,addContainer:We,addContainerBoundary:qe,addComponent:Qe,addDeploymentNode:Ge,popBoundaryParseStack:Ke,addRel:ze,updateElStyle:Je,updateRelStyle:Ze,updateLayoutConfig:$e,autoWrap:mt,setWrap:c0,getC4ShapeArray:_e,getC4Shape:n0,getC4ShapeKeys:s0,getBoundaries:xe,getBoundarys:r0,getCurrentBoundaryParse:a0,getParentBoundaryParse:i0,getRels:l0,getTitle:o0,getC4Type:Fe,getC4ShapeInRow:t0,getC4BoundaryInRow:e0,setAccTitle:Me,getAccTitle:Ie,getAccDescription:Be,setAccDescription:Pe,getConfig:y(()=>Bt().c4,"getConfig"),clear:h0,LINETYPE:u0,ARROWTYPE:d0,PLACEMENT:f0,setTitle:p0,setC4Type:Ve},se=y(function(a,t){return De(a,t)},"drawRect"),me=y(function(a,t,s,o,r,l){const e=a.append("image");e.attr("width",t),e.attr("height",s),e.attr("x",o),e.attr("y",r);let n=l.startsWith("data:image/png;base64")?l:Ye.sanitizeUrl(l);e.attr("xlink:href",n)},"drawImage"),y0=y((a,t,s,o)=>{const r=a.append("g");let l=0;for(let e of t){let n=e.textColor?e.textColor:"#444444",i=e.lineColor?e.lineColor:"#444444",u=e.offsetX?parseInt(e.offsetX):0,d=e.offsetY?parseInt(e.offsetY):0,p="";if(l===0){let m=r.append("line");m.attr("x1",e.startPoint.x),m.attr("y1",e.startPoint.y),m.attr("x2",e.endPoint.x),m.attr("y2",e.endPoint.y),m.attr("stroke-width","1"),m.attr("stroke",i),m.style("fill","none"),e.type!=="rel_b"&&m.attr("marker-end","url("+p+"#"+o+"-arrowhead)"),(e.type==="birel"||e.type==="rel_b")&&m.attr("marker-start","url("+p+"#"+o+"-arrowend)"),l=-1}else{let m=r.append("path");m.attr("fill","none").attr("stroke-width","1").attr("stroke",i).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",e.startPoint.x).replaceAll("starty",e.startPoint.y).replaceAll("controlx",e.startPoint.x+(e.endPoint.x-e.startPoint.x)/2-(e.endPoint.x-e.startPoint.x)/4).replaceAll("controly",e.startPoint.y+(e.endPoint.y-e.startPoint.y)/2).replaceAll("stopx",e.endPoint.x).replaceAll("stopy",e.endPoint.y)),e.type!=="rel_b"&&m.attr("marker-end","url("+p+"#"+o+"-arrowhead)"),(e.type==="birel"||e.type==="rel_b")&&m.attr("marker-start","url("+p+"#"+o+"-arrowend)")}let g=s.messageFont();Q(s)(e.label.text,r,Math.min(e.startPoint.x,e.endPoint.x)+Math.abs(e.endPoint.x-e.startPoint.x)/2+u,Math.min(e.startPoint.y,e.endPoint.y)+Math.abs(e.endPoint.y-e.startPoint.y)/2+d,e.label.width,e.label.height,{fill:n},g),e.techn&&e.techn.text!==""&&(g=s.messageFont(),Q(s)("["+e.techn.text+"]",r,Math.min(e.startPoint.x,e.endPoint.x)+Math.abs(e.endPoint.x-e.startPoint.x)/2+u,Math.min(e.startPoint.y,e.endPoint.y)+Math.abs(e.endPoint.y-e.startPoint.y)/2+s.messageFontSize+5+d,Math.max(e.label.width,e.techn.width),e.techn.height,{fill:n,"font-style":"italic"},g))}},"drawRels"),g0=y(function(a,t,s){const o=a.append("g");let r=t.bgColor?t.bgColor:"none",l=t.borderColor?t.borderColor:"#444444",e=t.fontColor?t.fontColor:"black",n={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};t.nodeType&&(n={"stroke-width":1});let i={x:t.x,y:t.y,fill:r,stroke:l,width:t.width,height:t.height,rx:2.5,ry:2.5,attrs:n};se(o,i);let u=s.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=e,Q(s)(t.label.text,o,t.x,t.y+t.label.Y,t.width,t.height,{fill:"#444444"},u),t.type&&t.type.text!==""&&(u=s.boundaryFont(),u.fontColor=e,Q(s)(t.type.text,o,t.x,t.y+t.type.Y,t.width,t.height,{fill:"#444444"},u)),t.descr&&t.descr.text!==""&&(u=s.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=e,Q(s)(t.descr.text,o,t.x,t.y+t.descr.Y,t.width,t.height,{fill:"#444444"},u))},"drawBoundary"),b0=y(function(a,t,s){let o=t.bgColor?t.bgColor:s[t.typeC4Shape.text+"_bg_color"],r=t.borderColor?t.borderColor:s[t.typeC4Shape.text+"_border_color"],l=t.fontColor?t.fontColor:"#FFFFFF",e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(t.typeC4Shape.text){case"person":e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const n=a.append("g");n.attr("class","person-man");const i=Se();switch(t.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":i.x=t.x,i.y=t.y,i.fill=o,i.width=t.width,i.height=t.height,i.stroke=r,i.rx=2.5,i.ry=2.5,i.attrs={"stroke-width":.5},se(n,i);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",r).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2).replaceAll("height",t.height)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",r).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",r).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("width",t.width).replaceAll("half",t.height/2)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",r).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",t.x+t.width).replaceAll("starty",t.y).replaceAll("half",t.height/2));break}let u=C0(s,t.typeC4Shape.text);switch(n.append("text").attr("fill",l).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",t.typeC4Shape.width).attr("x",t.x+t.width/2-t.typeC4Shape.width/2).attr("y",t.y+t.typeC4Shape.Y).text("<<"+t.typeC4Shape.text+">>"),t.typeC4Shape.text){case"person":case"external_person":me(n,48,48,t.x+t.width/2-24,t.y+t.image.Y,e);break}let d=s[t.typeC4Shape.text+"Font"]();return d.fontWeight="bold",d.fontSize=d.fontSize+2,d.fontColor=l,Q(s)(t.label.text,n,t.x,t.y+t.label.Y,t.width,t.height,{fill:l},d),d=s[t.typeC4Shape.text+"Font"](),d.fontColor=l,t.techn&&t.techn?.text!==""?Q(s)(t.techn.text,n,t.x,t.y+t.techn.Y,t.width,t.height,{fill:l,"font-style":"italic"},d):t.type&&t.type.text!==""&&Q(s)(t.type.text,n,t.x,t.y+t.type.Y,t.width,t.height,{fill:l,"font-style":"italic"},d),t.descr&&t.descr.text!==""&&(d=s.personFont(),d.fontColor=l,Q(s)(t.descr.text,n,t.x,t.y+t.descr.Y,t.width,t.height,{fill:l},d)),t.height},"drawC4Shape"),_0=y(function(a,t){a.append("defs").append("symbol").attr("id",t+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),x0=y(function(a,t){a.append("defs").append("symbol").attr("id",t+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),m0=y(function(a,t){a.append("defs").append("symbol").attr("id",t+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),v0=y(function(a,t){a.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),E0=y(function(a,t){a.append("defs").append("marker").attr("id",t+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),A0=y(function(a,t){a.append("defs").append("marker").attr("id",t+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),k0=y(function(a,t){const o=a.append("defs").append("marker").attr("id",t+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);o.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),o.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),C0=y((a,t)=>({fontFamily:a[t+"FontFamily"],fontSize:a[t+"FontSize"],fontWeight:a[t+"FontWeight"]}),"getC4ShapeFont"),Q=(function(){function a(r,l,e,n,i,u,d){const p=l.append("text").attr("x",e+i/2).attr("y",n+u/2+5).style("text-anchor","middle").text(r);o(p,d)}y(a,"byText");function t(r,l,e,n,i,u,d,p){const{fontSize:g,fontFamily:m,fontWeight:O}=p,S=r.split($t.lineBreakRegex);for(let P=0;P=this.data.widthLimit||o>=this.data.widthLimit||this.nextData.cnt>ve)&&(s=this.nextData.startx+t.margin+_.nextLinePaddingX,r=this.nextData.stopy+t.margin*2,this.nextData.stopx=o=s+t.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=l=r+t.height,this.nextData.cnt=1),t.x=s,t.y=r,this.updateVal(this.data,"startx",s,Math.min),this.updateVal(this.data,"starty",r,Math.min),this.updateVal(this.data,"stopx",o,Math.max),this.updateVal(this.data,"stopy",l,Math.max),this.updateVal(this.nextData,"startx",s,Math.min),this.updateVal(this.nextData,"starty",r,Math.min),this.updateVal(this.nextData,"stopx",o,Math.max),this.updateVal(this.nextData,"stopy",l,Math.max)}init(t){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},ae(t.db.getConfig())}bumpLastMargin(t){this.data.stopx+=t,this.data.stopy+=t}},y(Ot,"Bounds"),Ot),ae=y(function(a){Ne(_,a),a.fontFamily&&(_.personFontFamily=_.systemFontFamily=_.messageFontFamily=a.fontFamily),a.fontSize&&(_.personFontSize=_.systemFontSize=_.messageFontSize=a.fontSize),a.fontWeight&&(_.personFontWeight=_.systemFontWeight=_.messageFontWeight=a.fontWeight)},"setConf"),Pt=y((a,t)=>({fontFamily:a[t+"FontFamily"],fontSize:a[t+"FontSize"],fontWeight:a[t+"FontWeight"]}),"c4ShapeFont"),Ut=y(a=>({fontFamily:a.boundaryFontFamily,fontSize:a.boundaryFontSize,fontWeight:a.boundaryFontWeight}),"boundaryFont"),w0=y(a=>({fontFamily:a.messageFontFamily,fontSize:a.messageFontSize,fontWeight:a.messageFontWeight}),"messageFont");function j(a,t,s,o,r){if(!t[a].width)if(s)t[a].text=je(t[a].text,r,o),t[a].textLines=t[a].text.split($t.lineBreakRegex).length,t[a].width=r,t[a].height=fe(t[a].text,o);else{let l=t[a].text.split($t.lineBreakRegex);t[a].textLines=l.length;let e=0;t[a].height=0,t[a].width=0;for(const n of l)t[a].width=Math.max(Tt(n,o),t[a].width),e=fe(n,o),t[a].height=t[a].height+e}}y(j,"calcC4ShapeTextWH");var Ae=y(function(a,t,s){t.x=s.data.startx,t.y=s.data.starty,t.width=s.data.stopx-s.data.startx,t.height=s.data.stopy-s.data.starty,t.label.y=_.c4ShapeMargin-35;let o=t.wrap&&_.wrap,r=Ut(_);r.fontSize=r.fontSize+2,r.fontWeight="bold";let l=Tt(t.label.text,r);j("label",t,o,r,l),z.drawBoundary(a,t,_)},"drawBoundary"),ke=y(function(a,t,s,o){let r=0;for(const l of o){r=0;const e=s[l];let n=Pt(_,e.typeC4Shape.text);switch(n.fontSize=n.fontSize-2,e.typeC4Shape.width=Tt("«"+e.typeC4Shape.text+"»",n),e.typeC4Shape.height=n.fontSize+2,e.typeC4Shape.Y=_.c4ShapePadding,r=e.typeC4Shape.Y+e.typeC4Shape.height-4,e.image={width:0,height:0,Y:0},e.typeC4Shape.text){case"person":case"external_person":e.image.width=48,e.image.height=48,e.image.Y=r,r=e.image.Y+e.image.height;break}e.sprite&&(e.image.width=48,e.image.height=48,e.image.Y=r,r=e.image.Y+e.image.height);let i=e.wrap&&_.wrap,u=_.width-_.c4ShapePadding*2,d=Pt(_,e.typeC4Shape.text);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",e,i,d,u),e.label.Y=r+8,r=e.label.Y+e.label.height,e.type&&e.type.text!==""){e.type.text="["+e.type.text+"]";let m=Pt(_,e.typeC4Shape.text);j("type",e,i,m,u),e.type.Y=r+5,r=e.type.Y+e.type.height}else if(e.techn&&e.techn.text!==""){e.techn.text="["+e.techn.text+"]";let m=Pt(_,e.techn.text);j("techn",e,i,m,u),e.techn.Y=r+5,r=e.techn.Y+e.techn.height}let p=r,g=e.label.width;if(e.descr&&e.descr.text!==""){let m=Pt(_,e.typeC4Shape.text);j("descr",e,i,m,u),e.descr.Y=r+20,r=e.descr.Y+e.descr.height,g=Math.max(e.label.width,e.descr.width),p=r-e.descr.textLines*5}g=g+_.c4ShapePadding,e.width=Math.max(e.width||_.width,g,_.width),e.height=Math.max(e.height||_.height,p,_.height),e.margin=e.margin||_.c4ShapeMargin,a.insert(e),z.drawC4Shape(t,e,_)}a.bumpLastMargin(_.c4ShapeMargin)},"drawC4ShapeArray"),Rt,Y=(Rt=class{constructor(t,s){this.x=t,this.y=s}},y(Rt,"Point"),Rt),pe=y(function(a,t){let s=a.x,o=a.y,r=t.x,l=t.y,e=s+a.width/2,n=o+a.height/2,i=Math.abs(s-r),u=Math.abs(o-l),d=u/i,p=a.height/a.width,g=null;return o==l&&sr?g=new Y(s,n):s==r&&ol&&(g=new Y(e,o)),s>r&&o=d?g=new Y(s,n+d*a.width/2):g=new Y(e-i/u*a.height/2,o+a.height):s=d?g=new Y(s+a.width,n+d*a.width/2):g=new Y(e+i/u*a.height/2,o+a.height):sl?p>=d?g=new Y(s+a.width,n-d*a.width/2):g=new Y(e+a.height/2*i/u,o):s>r&&o>l&&(p>=d?g=new Y(s,n-a.width/2*d):g=new Y(e-a.height/2*i/u,o)),g},"getIntersectPoint"),T0=y(function(a,t){let s={x:0,y:0};s.x=t.x+t.width/2,s.y=t.y+t.height/2;let o=pe(a,s);s.x=a.x+a.width/2,s.y=a.y+a.height/2;let r=pe(t,s);return{startPoint:o,endPoint:r}},"getIntersectPoints"),O0=y(function(a,t,s,o,r){let l=0;for(let e of t){l=l+1;let n=e.wrap&&_.wrap,i=w0(_);o.db.getC4Type()==="C4Dynamic"&&(e.label.text=l+": "+e.label.text);let d=Tt(e.label.text,i);j("label",e,n,i,d),e.techn&&e.techn.text!==""&&(d=Tt(e.techn.text,i),j("techn",e,n,i,d)),e.descr&&e.descr.text!==""&&(d=Tt(e.descr.text,i),j("descr",e,n,i,d));let p=s(e.from),g=s(e.to),m=T0(p,g);e.startPoint=m.startPoint,e.endPoint=m.endPoint}z.drawRels(a,t,_,r)},"drawRels");function re(a,t,s,o,r){let l=new Ee(r);l.data.widthLimit=s.data.widthLimit/Math.min(ee,o.length);for(let[e,n]of o.entries()){let i=0;n.image={width:0,height:0,Y:0},n.sprite&&(n.image.width=48,n.image.height=48,n.image.Y=i,i=n.image.Y+n.image.height);let u=n.wrap&&_.wrap,d=Ut(_);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",n,u,d,l.data.widthLimit),n.label.Y=i+8,i=n.label.Y+n.label.height,n.type&&n.type.text!==""){n.type.text="["+n.type.text+"]";let O=Ut(_);j("type",n,u,O,l.data.widthLimit),n.type.Y=i+5,i=n.type.Y+n.type.height}if(n.descr&&n.descr.text!==""){let O=Ut(_);O.fontSize=O.fontSize-2,j("descr",n,u,O,l.data.widthLimit),n.descr.Y=i+20,i=n.descr.Y+n.descr.height}if(e==0||e%ee===0){let O=s.data.startx+_.diagramMarginX,S=s.data.stopy+_.diagramMarginY+i;l.setData(O,O,S,S)}else{let O=l.data.stopx!==l.data.startx?l.data.stopx+_.diagramMarginX:l.data.startx,S=l.data.starty;l.setData(O,O,S,S)}l.name=n.alias;let p=r.db.getC4ShapeArray(n.alias),g=r.db.getC4ShapeKeys(n.alias);g.length>0&&ke(l,a,p,g),t=n.alias;let m=r.db.getBoundaries(t);m.length>0&&re(a,t,l,m,r),n.alias!=="global"&&Ae(a,n,l),s.data.stopy=Math.max(l.data.stopy+_.c4ShapeMargin,s.data.stopy),s.data.stopx=Math.max(l.data.stopx+_.c4ShapeMargin,s.data.stopx),Xt=Math.max(Xt,s.data.stopx),Wt=Math.max(Wt,s.data.stopy)}}y(re,"drawInsideBoundary");var R0=y(function(a,t,s,o){_=Bt().c4;const r=Bt().securityLevel;let l;r==="sandbox"&&(l=jt("#i"+t));const e=r==="sandbox"?jt(l.nodes()[0].contentDocument.body):jt("body");let n=o.db;o.db.setWrap(_.wrap),ve=n.getC4ShapeInRow(),ee=n.getC4BoundaryInRow(),de.debug(`C:${JSON.stringify(_,null,2)}`);const i=r==="sandbox"?e.select(`[id="${t}"]`):jt(`[id="${t}"]`);z.insertComputerIcon(i,t),z.insertDatabaseIcon(i,t),z.insertClockIcon(i,t);let u=new Ee(o);u.setData(_.diagramMarginX,_.diagramMarginX,_.diagramMarginY,_.diagramMarginY),u.data.widthLimit=screen.availWidth,Xt=_.diagramMarginX,Wt=_.diagramMarginY;const d=o.db.getTitle();let p=o.db.getBoundaries("");re(i,"",u,p,o),z.insertArrowHead(i,t),z.insertArrowEnd(i,t),z.insertArrowCrossHead(i,t),z.insertArrowFilledHead(i,t),O0(i,o.db.getRels(),o.db.getC4Shape,o,t),u.data.stopx=Xt,u.data.stopy=Wt;const g=u.data;let O=g.stopy-g.starty+2*_.diagramMarginY;const P=g.stopx-g.startx+2*_.diagramMarginX;d&&i.append("text").text(d).attr("x",(g.stopx-g.startx)/2-4*_.diagramMarginX).attr("y",g.starty+_.diagramMarginY),Le(i,O,P,_.useMaxWidth);const M=d?60:0;i.attr("viewBox",g.startx-_.diagramMarginX+" -"+(_.diagramMarginY+M)+" "+P+" "+(O+M)),de.debug("models:",g)},"draw"),ye={drawPersonOrSystemArray:ke,drawBoundary:Ae,setConf:ae,draw:R0},S0=y(a=>`.person { + stroke: ${a.personBorder}; + fill: ${a.personBkg}; + } +`,"getStyles"),D0=S0,L0={parser:Ue,db:te,renderer:ye,styles:D0,init:y(({c4:a,wrap:t})=>{ye.setConf(a),te.setWrap(t)},"init")};export{L0 as diagram}; diff --git a/internal/webapp/static/assets/channel-BphRH4Sr.js b/internal/webapp/static/assets/channel-BphRH4Sr.js new file mode 100644 index 0000000..ea41a23 --- /dev/null +++ b/internal/webapp/static/assets/channel-BphRH4Sr.js @@ -0,0 +1 @@ +import{ag as o,ah as n}from"./mermaid.core-B7WVQkyL.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c}; diff --git a/internal/webapp/static/assets/chunk-2GRJ4B5K-Bng47RDF.js b/internal/webapp/static/assets/chunk-2GRJ4B5K-Bng47RDF.js new file mode 100644 index 0000000..8799b48 --- /dev/null +++ b/internal/webapp/static/assets/chunk-2GRJ4B5K-Bng47RDF.js @@ -0,0 +1 @@ +import{_ as i,d as l,S as d,j as o}from"./mermaid.core-B7WVQkyL.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,g as c,x as d,m as e,w as f,h as g,y as h}; diff --git a/internal/webapp/static/assets/chunk-2Q5K7J3B-Krb_H4ce.js b/internal/webapp/static/assets/chunk-2Q5K7J3B-Krb_H4ce.js new file mode 100644 index 0000000..56ab384 --- /dev/null +++ b/internal/webapp/static/assets/chunk-2Q5K7J3B-Krb_H4ce.js @@ -0,0 +1 @@ +import{_ as s}from"./mermaid.core-B7WVQkyL.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I}; diff --git a/internal/webapp/static/assets/chunk-5RXB4S5H-D-7tWSyr.js b/internal/webapp/static/assets/chunk-5RXB4S5H-D-7tWSyr.js new file mode 100644 index 0000000..dbd886c --- /dev/null +++ b/internal/webapp/static/assets/chunk-5RXB4S5H-D-7tWSyr.js @@ -0,0 +1,231 @@ +import{g as ee}from"./chunk-XXDRQBXY-BXTWinaX.js";import{s as se}from"./chunk-KBJHAD2P-CHI3y1em.js";import{_ as p,l as b,c as $,v as ie,x as re,a as ae,b as ne,g as oe,s as le,n as ce,o as he,R as ue,k as j,p as de,d as kt,N as fe}from"./mermaid.core-B7WVQkyL.js";import{f as pe}from"./chunk-2GRJ4B5K-Bng47RDF.js";var Ct=(function(){var t=p(function(V,o,u,a){for(u=u||{},a=V.length;a--;u[V[a]]=o);return u},"o"),e=[1,2],s=[1,3],n=[1,4],r=[2,4],c=[1,9],d=[1,11],S=[1,16],f=[1,17],T=[1,18],E=[1,19],m=[1,33],L=[1,20],D=[1,21],h=[1,22],I=[1,23],w=[1,24],C=[1,26],F=[1,27],A=[1,28],P=[1,29],N=[1,30],z=[1,31],rt=[1,32],at=[1,35],nt=[1,36],ot=[1,37],lt=[1,38],K=[1,34],y=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],ct=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],Lt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],gt={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:p(function(o,u,a,g,_,i,B){var l=i.length-1;switch(_){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Z=i[l-1];Z.description=g.trimColon(i[l]),this.$=Z;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const Tt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:Tt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],X=i[l-2].trim();if(i[l].match(":")){var ut=i[l].split(":");Y=ut[0],X=[X,ut[1]]}this.$={stmt:"state",id:Y,type:"default",description:X};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:n},{1:[3]},{3:5,4:e,5:s,6:n},{3:6,4:e,5:s,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:c,5:d,8:8,9:10,10:12,11:13,12:14,13:15,16:S,17:f,19:T,22:E,24:m,25:L,26:D,27:h,28:I,29:w,32:25,33:C,35:F,37:A,38:P,41:N,45:z,48:rt,51:at,52:nt,53:ot,54:lt,57:K},t(y,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:S,17:f,19:T,22:E,24:m,25:L,26:D,27:h,28:I,29:w,32:25,33:C,35:F,37:A,38:P,41:N,45:z,48:rt,51:at,52:nt,53:ot,54:lt,57:K},t(y,[2,7]),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(y,[2,11]),t(y,[2,12],{14:[1,40],15:[1,41]}),t(y,[2,16]),{18:[1,42]},t(y,[2,18],{20:[1,43]}),{23:[1,44]},t(y,[2,22]),t(y,[2,23]),t(y,[2,24]),t(y,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(y,[2,28]),{34:[1,49]},{36:[1,50]},t(y,[2,31]),{13:51,24:m,57:K},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ct,[2,44],{58:[1,56]}),t(ct,[2,45],{58:[1,57]}),t(y,[2,38]),t(y,[2,39]),t(y,[2,40]),t(y,[2,41]),t(y,[2,6]),t(y,[2,13]),{13:58,24:m,57:K},t(y,[2,17]),t(Lt,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(y,[2,29]),t(y,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(y,[2,14],{14:[1,71]}),{4:c,5:d,8:8,9:10,10:12,11:13,12:14,13:15,16:S,17:f,19:T,21:[1,72],22:E,24:m,25:L,26:D,27:h,28:I,29:w,32:25,33:C,35:F,37:A,38:P,41:N,45:z,48:rt,51:at,52:nt,53:ot,54:lt,57:K},t(y,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),t(y,[2,37]),t(ct,[2,46]),t(ct,[2,47]),t(y,[2,15]),t(y,[2,19]),t(Lt,r,{7:78}),t(y,[2,26]),t(y,[2,27]),{5:[1,79]},{5:[1,80]},{4:c,5:d,8:8,9:10,10:12,11:13,12:14,13:15,16:S,17:f,19:T,21:[1,81],22:E,24:m,25:L,26:D,27:h,28:I,29:w,32:25,33:C,35:F,37:A,38:P,41:N,45:z,48:rt,51:at,52:nt,53:ot,54:lt,57:K},t(y,[2,32]),t(y,[2,33]),t(y,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:p(function(o,u){if(u.recoverable)this.trace(o);else{var a=new Error(o);throw a.hash=u,a}},"parseError"),parse:p(function(o){var u=this,a=[0],g=[],_=[null],i=[],B=this.table,l="",Y=0,X=0,ut=2,Z=1,Tt=i.slice.call(arguments,1),k=Object.create(this.lexer),U={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(U.yy[Et]=this.yy[Et]);k.setInput(o,U.yy),U.yy.lexer=k,U.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var _t=k.yylloc;i.push(_t);var Zt=k.options&&k.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function te(R){a.length=a.length-2*R,_.length=_.length-R,i.length=i.length-R}p(te,"popStack");function It(){var R;return R=g.pop()||k.lex()||Z,typeof R!="number"&&(R instanceof Array&&(g=R,R=g.pop()),R=u.symbols_[R]||R),R}p(It,"lex");for(var x,W,O,mt,J={},dt,G,wt,ft;;){if(W=a[a.length-1],this.defaultActions[W]?O=this.defaultActions[W]:((x===null||typeof x>"u")&&(x=It()),O=B[W]&&B[W][x]),typeof O>"u"||!O.length||!O[0]){var bt="";ft=[];for(dt in B[W])this.terminals_[dt]&&dt>ut&&ft.push("'"+this.terminals_[dt]+"'");k.showPosition?bt="Parse error on line "+(Y+1)+`: +`+k.showPosition()+` +Expecting `+ft.join(", ")+", got '"+(this.terminals_[x]||x)+"'":bt="Parse error on line "+(Y+1)+": Unexpected "+(x==Z?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(bt,{text:k.match,token:this.terminals_[x]||x,line:k.yylineno,loc:_t,expected:ft})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+x);switch(O[0]){case 1:a.push(x),_.push(k.yytext),i.push(k.yylloc),a.push(O[1]),x=null,X=k.yyleng,l=k.yytext,Y=k.yylineno,_t=k.yylloc;break;case 2:if(G=this.productions_[O[1]][1],J.$=_[_.length-G],J._$={first_line:i[i.length-(G||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(G||1)].first_column,last_column:i[i.length-1].last_column},Zt&&(J._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),mt=this.performAction.apply(J,[l,X,Y,U.yy,O[1],_,i].concat(Tt)),typeof mt<"u")return mt;G&&(a=a.slice(0,-1*G*2),_=_.slice(0,-1*G),i=i.slice(0,-1*G)),a.push(this.productions_[O[1]][0]),_.push(J.$),i.push(J._$),wt=B[a[a.length-2]][a[a.length-1]],a.push(wt);break;case 3:return!0}}return!0},"parse")},Qt=(function(){var V={EOF:1,parseError:p(function(u,a){if(this.yy.parser)this.yy.parser.parseError(u,a);else throw new Error(u)},"parseError"),setInput:p(function(o,u){return this.yy=u||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:p(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var u=o.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:p(function(o){var u=o.length,a=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===g.length?this.yylloc.first_column:0)+g[g.length-a.length].length-a[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:p(function(o){this.unput(this.match.slice(o))},"less"),pastInput:p(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var o=this.pastInput(),u=new Array(o.length+1).join("-");return o+this.upcomingInput()+` +`+u+"^"},"showPosition"),test_match:p(function(o,u){var a,g,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),g=o[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],a=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var i in _)this[i]=_[i];return!1}return!1},"test_match"),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,u,a,g;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),i=0;i<_.length;i++)if(a=this._input.match(this.rules[_[i]]),a&&(!u||a[0].length>u[0].length)){if(u=a,g=i,this.options.backtrack_lexer){if(o=this.test_match(a,_[i]),o!==!1)return o;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(o=this.test_match(u,_[g]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:p(function(){var u=this.next();return u||this.lex()},"lex"),begin:p(function(u){this.conditionStack.push(u)},"begin"),popState:p(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:p(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:p(function(u){this.begin(u)},"pushState"),stateStackSize:p(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:p(function(u,a,g,_){function i(){const B=a.yytext.indexOf("%%");if(B===0)return!1;if(B>0){const l=a.yytext.slice(0,B),Y=a.yytext.slice(B);Y&&u.lexer.unput(Y),a.yytext=l}return!0}switch(p(i,"processId"),g){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),a.yytext=a.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),a.yytext=a.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return i()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+a.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return i()?(this.popState(),"ID"):void 0;case 66:return i()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),a.yytext=a.yytext.substr(2).trim(),31;case 68:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return i()?24:void 0;case 74:return a.yytext=a.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return V})();gt.lexer=Qt;function ht(){this.yy={}}return p(ht,"Parser"),ht.prototype=gt,gt.Parser=ht,new ht})();Ct.parser=Ct;var We=Ct,Se="TB",Yt="TB",Nt="dir",Q="state",q="root",At="relation",ye="classDef",ge="style",Te="applyClass",st="default",Gt="divider",Vt="fill:none",Mt="fill: #333",Ut="c",Wt="markdown",jt="normal",Dt="rect",vt="rectWithTitle",Ee="stateStart",_e="stateEnd",Rt="divider",Ot="roundedWithTitle",me="note",be="noteGroup",it="statediagram",ke="state",De=`${it}-${ke}`,Ht="transition",ve="note",Ce="note-edge",Ae=`${Ht} ${Ce}`,xe=`${it}-${ve}`,Le="cluster",Ie=`${it}-${Le}`,we="cluster-alt",Ne=`${it}-${we}`,zt="parent",Kt="note",Re="state",xt="----",Oe=`${xt}${Kt}`,$t=`${xt}${zt}`,Xt=p((t,e=Yt)=>{if(!t.doc)return e;let s=e;for(const n of t.doc)n.stmt==="dir"&&(s=n.value);return s},"getDir"),$e=p(function(t,e){return e.db.getClasses()},"getClasses"),Fe=p(async function(t,e,s,n){b.info("REF0:"),b.info("Drawing state diagram (v2)",e);const{securityLevel:r,state:c,layout:d}=$();n.db.extract(n.db.getRootDocV2());const S=n.db.getData(),f=ee(e,r);S.type=n.type,S.layoutAlgorithm=d,S.nodeSpacing=c?.nodeSpacing||50,S.rankSpacing=c?.rankSpacing||50,$().look==="neo"?S.markers=["barbNeo"]:S.markers=["barb"],S.diagramId=e,await ie(S,f);const E=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((L,D)=>{const h=typeof D=="string"?D:typeof D?.id=="string"?D.id:"",I=S.nodes.find(N=>N.id===h);if(!h){b.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(D));return}const w=f.node()?.querySelectorAll("g.node, g.rough-node");let C;if(w?.forEach(N=>{const z=N.textContent?.trim();(N.id===I?.domId||z===h)&&(C=N)}),!C){b.warn("⚠️ Could not find node matching text:",h);return}const F=C.parentNode;if(!F){b.warn("⚠️ Node has no parent, cannot wrap:",h);return}const A=document.createElementNS("http://www.w3.org/2000/svg","a"),P=L.url.replace(/^"+|"+$/g,"");if(A.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",P),A.setAttribute("target","_blank"),L.tooltip){const N=L.tooltip.replace(/^"+|"+$/g,"");A.setAttribute("title",N),C.setAttribute("title",N)}F.replaceChild(A,C),A.appendChild(C),b.info("🔗 Wrapped node in tag for:",h,L.url)})}catch(m){b.error("❌ Error injecting clickable links:",m)}re.insertTitle(f,"statediagramTitleText",c?.titleTopMargin??25,n.db.getDiagramTitle()),se(f,E,it,c?.useMaxWidth??!0)},"draw"),je={getClasses:$e,draw:Fe,getDir:Xt},St=new Map,M=0;function yt(t="",e=0,s="",n=xt){const r=s!==null&&s.length>0?`${n}${s}`:"";return`${Re}-${t}${r}-${e}`}p(yt,"stateDomId");var Pe=p((t,e,s,n,r,c,d,S)=>{b.trace("items",e),e.forEach(f=>{switch(f.stmt){case Q:et(t,f,s,n,r,c,d,S);break;case st:et(t,f,s,n,r,c,d,S);break;case At:{et(t,f.state1,s,n,r,c,d,S),et(t,f.state2,s,n,r,c,d,S);const T=d==="neo",E={id:"edge"+M,start:f.state1.id,end:f.state2.id,arrowhead:"normal",arrowTypeEnd:T?"arrow_barb_neo":"arrow_barb",style:Vt,labelStyle:"",label:j.sanitizeText(f.description??"",$()),arrowheadStyle:Mt,labelpos:Ut,labelType:Wt,thickness:jt,classes:Ht,look:d};r.push(E),M++}break}})},"setupDoc"),Ft=p((t,e=Yt)=>{let s=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(s=n.value);return s},"getDir");function tt(t,e,s){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(r=>{const c=s.get(r);c&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...c.styles])}));const n=t.find(r=>r.id===e.id);n?Object.assign(n,e):t.push(e)}p(tt,"insertOrUpdateNode");function Jt(t){return t?.classes?.join(" ")??""}p(Jt,"getClassesFromDbInfo");function qt(t){return t?.styles??[]}p(qt,"getStylesFromDbInfo");var et=p((t,e,s,n,r,c,d,S)=>{const f=e.id,T=s.get(f),E=Jt(T),m=qt(T),L=$();if(b.info("dataFetcher parsedItem",e,T,m),f!=="root"){let D=Dt;e.start===!0?D=Ee:e.start===!1&&(D=_e),e.type!==st&&(D=e.type),St.get(f)||St.set(f,{id:f,shape:D,description:j.sanitizeText(f,L),cssClasses:`${E} ${De}`,cssStyles:m});const h=St.get(f);e.description&&(Array.isArray(h.description)?(h.shape=vt,h.description.push(e.description)):h.description?.length&&h.description.length>0?(h.shape=vt,h.description===f?h.description=[e.description]:h.description=[h.description,e.description]):(h.shape=Dt,h.description=e.description),h.description=j.sanitizeTextOrArray(h.description,L)),h.description?.length===1&&h.shape===vt&&(h.type==="group"?h.shape=Ot:h.shape=Dt),!h.type&&e.doc&&(b.info("Setting cluster for XCX",f,Ft(e)),h.type="group",h.isGroup=!0,h.dir=Ft(e),h.explicitDir=e.doc.some(w=>w.stmt==="dir"),h.shape=e.type===Gt?Rt:Ot,h.cssClasses=`${h.cssClasses} ${Ie} ${c?Ne:""}`);const I={labelStyle:"",shape:h.shape,label:h.description,cssClasses:h.cssClasses,cssCompiledStyles:[],cssStyles:h.cssStyles,id:f,dir:h.dir,domId:yt(f,M),type:h.type,isGroup:h.type==="group",padding:8,rx:10,ry:10,look:d,labelType:"markdown"};if(I.shape===Rt&&(I.label=""),t&&t.id!=="root"&&(b.trace("Setting node ",f," to be child of its parent ",t.id),I.parentId=t.id),I.centerLabel=!0,e.note){const w={labelStyle:"",shape:me,label:e.note.text,labelType:"markdown",cssClasses:xe,cssStyles:[],cssCompiledStyles:[],id:f+Oe+"-"+M,domId:yt(f,M,Kt),type:h.type,isGroup:h.type==="group",padding:L.flowchart?.padding,look:d,position:e.note.position},C=f+$t,F={labelStyle:"",shape:be,label:e.note.text,cssClasses:h.cssClasses,cssStyles:[],id:f+$t,domId:yt(f,M,zt),type:"group",isGroup:!0,padding:16,look:d,position:e.note.position};M++,F.id=C,w.parentId=C,tt(n,F,S),tt(n,w,S),tt(n,I,S);let A=f,P=w.id;e.note.position==="left of"&&(A=w.id,P=f),r.push({id:A+"-"+P,start:A,end:P,arrowhead:"none",arrowTypeEnd:"",style:Vt,labelStyle:"",classes:Ae,arrowheadStyle:Mt,labelpos:Ut,labelType:Wt,thickness:jt,look:d})}else tt(n,I,S)}e.doc&&(b.trace("Adding nodes children "),Pe(e,e.doc,s,n,r,!c,d,S))},"dataFetcher"),Be=p(()=>{St.clear(),M=0},"reset"),v={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Pt=p(()=>new Map,"newClassesList"),Bt=p(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),pt=p(t=>JSON.parse(JSON.stringify(t)),"clone"),H,He=(H=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Pt(),this.documents={root:Bt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=ae,this.setAccTitle=ne,this.getAccDescription=oe,this.setAccDescription=le,this.setDiagramTitle=ce,this.getDiagramTitle=he,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}extract(e){this.clear(!0);for(const r of Array.isArray(e)?e:e.doc)switch(r.stmt){case Q:this.addState(r.id.trim(),r.type,r.doc,r.description,r.note);break;case At:this.addRelation(r.state1,r.state2,r.description);break;case ye:this.addStyleClass(r.id.trim(),r.classes);break;case ge:this.handleStyleDef(r);break;case Te:this.setCssClass(r.id.trim(),r.styleClass);break;case"click":this.addLink(r.id,r.url,r.tooltip);break}const s=this.getStates(),n=$();Be(),et(void 0,this.getRootDocV2(),s,this.nodes,this.edges,!0,n.look,this.classes);for(const r of this.nodes)if(Array.isArray(r.label)){if(r.description=r.label.slice(1),r.isGroup&&r.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${r.id}]`);r.label=r.label[0]}}handleStyleDef(e){const s=e.id.trim().split(","),n=e.styleClass.split(",");for(const r of s){let c=this.getState(r);if(!c){const d=r.trim();this.addState(d),c=this.getState(d)}c&&(c.styles=n.map(d=>d.replace(/;/g,"")?.trim()))}}setRootDoc(e){b.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,s,n){if(s.stmt===At){this.docTranslator(e,s.state1,!0),this.docTranslator(e,s.state2,!1);return}if(s.stmt===Q&&(s.id===v.START_NODE?(s.id=e.id+(n?"_start":"_end"),s.start=n):s.id=s.id.trim()),s.stmt!==q&&s.stmt!==Q||!s.doc)return;const r=[];let c=[];for(const d of s.doc)if(d.type===Gt){const S=pt(d);S.doc=pt(c),r.push(S),c=[]}else c.push(d);if(r.length>0&&c.length>0){const d={stmt:Q,id:ue(),type:"divider",doc:pt(c)};r.push(pt(d)),s.doc=r}s.doc.forEach(d=>this.docTranslator(s,d,!0))}getRootDocV2(){return this.docTranslator({id:q,stmt:q},{id:q,stmt:q,doc:this.rootDoc},!0),{id:q,doc:this.rootDoc}}addState(e,s=st,n=void 0,r=void 0,c=void 0,d=void 0,S=void 0,f=void 0){const T=e?.trim();if(!this.currentDocument.states.has(T))b.info("Adding state ",T,r),this.currentDocument.states.set(T,{stmt:Q,id:T,descriptions:[],type:s,doc:n,note:c,classes:[],styles:[],textStyles:[]});else{const E=this.currentDocument.states.get(T);if(!E)throw new Error(`State not found: ${T}`);E.doc||(E.doc=n),E.type||(E.type=s)}if(r&&(b.info("Setting state description",T,r),(Array.isArray(r)?r:[r]).forEach(m=>this.addDescription(T,m.trim()))),c){const E=this.currentDocument.states.get(T);if(!E)throw new Error(`State not found: ${T}`);E.note=c,E.note.text=j.sanitizeText(E.note.text,$())}d&&(b.info("Setting state classes",T,d),(Array.isArray(d)?d:[d]).forEach(m=>this.setCssClass(T,m.trim()))),S&&(b.info("Setting state styles",T,S),(Array.isArray(S)?S:[S]).forEach(m=>this.setStyle(T,m.trim()))),f&&(b.info("Setting state styles",T,S),(Array.isArray(f)?f:[f]).forEach(m=>this.setTextStyle(T,m.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Bt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Pt(),e||(this.links=new Map,de())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){b.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,s,n){this.links.set(e,{url:s,tooltip:n}),b.warn("Adding link",e,s,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===v.START_NODE?(this.startEndCount++,`${v.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",s=st){return e===v.START_NODE?v.START_TYPE:s}endIdIfNeeded(e=""){return e===v.END_NODE?(this.startEndCount++,`${v.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",s=st){return e===v.END_NODE?v.END_TYPE:s}addRelationObjs(e,s,n=""){const r=this.startIdIfNeeded(e.id.trim()),c=this.startTypeIfNeeded(e.id.trim(),e.type),d=this.startIdIfNeeded(s.id.trim()),S=this.startTypeIfNeeded(s.id.trim(),s.type);this.addState(r,c,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(d,S,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles),this.currentDocument.relations.push({id1:r,id2:d,relationTitle:j.sanitizeText(n,$())})}addRelation(e,s,n){if(typeof e=="object"&&typeof s=="object")this.addRelationObjs(e,s,n);else if(typeof e=="string"&&typeof s=="string"){const r=this.startIdIfNeeded(e.trim()),c=this.startTypeIfNeeded(e),d=this.endIdIfNeeded(s.trim()),S=this.endTypeIfNeeded(s);this.addState(r,c),this.addState(d,S),this.currentDocument.relations.push({id1:r,id2:d,relationTitle:n?j.sanitizeText(n,$()):void 0})}}addDescription(e,s){const n=this.currentDocument.states.get(e),r=s.startsWith(":")?s.replace(":","").trim():s;n?.descriptions?.push(j.sanitizeText(r,$()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,s=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);s&&n&&s.split(v.STYLECLASS_SEP).forEach(r=>{const c=r.replace(/([^;]*);/,"$1").trim();if(RegExp(v.COLOR_KEYWORD).exec(r)){const S=c.replace(v.FILL_KEYWORD,v.BG_FILL).replace(v.COLOR_KEYWORD,v.FILL_KEYWORD);n.textStyles.push(S)}n.styles.push(c)})}getClasses(){return this.classes}setupToolTips(e){const s=pe();kt(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",c=>{const d=kt(c.currentTarget),S=d.attr("title");if(S===null)return;const f=c.currentTarget?.getBoundingClientRect();s.transition().duration(200).style("opacity",".9"),s.style("left",window.scrollX+f.left+(f.right-f.left)/2+"px").style("top",window.scrollY+f.bottom+"px"),s.html(fe.sanitize(S)),d.classed("hover",!0)}).on("mouseout",c=>{s.transition().duration(500).style("opacity",0),kt(c.currentTarget).classed("hover",!1)})}setCssClass(e,s){e.split(",").forEach(n=>{let r=this.getState(n);if(!r){const c=n.trim();this.addState(c),r=this.getState(c)}r?.classes?.push(s)})}setStyle(e,s){this.getState(e)?.styles?.push(s)}setTextStyle(e,s){this.getState(e)?.textStyles?.push(s)}bindFunctions(e){this.funs.forEach(s=>{s(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===Nt)}getDirection(){return this.getDirectionStatement()?.value??Se}setDirection(e){const s=this.getDirectionStatement();s?s.value=e:this.rootDoc.unshift({stmt:Nt,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=$();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Xt(this.getRootDocV2())}}getConfig(){return $().state}},p(H,"StateDB"),H.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},H),Ye=p(t=>` +defs [id$="-barbEnd"] { + fill: ${t.transitionColor}; + stroke: ${t.transitionColor}; + } +g.stateGroup text { + fill: ${t.nodeBorder}; + stroke: none; + font-size: 10px; +} +g.stateGroup text { + fill: ${t.textColor}; + stroke: none; + font-size: 10px; + +} +g.stateGroup .state-title { + font-weight: bolder; + fill: ${t.stateLabelColor}; +} + +g.stateGroup rect { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; +} + +g.stateGroup line { + stroke: ${t.lineColor}; + stroke-width: ${t.strokeWidth||1}; +} + +.transition { + stroke: ${t.transitionColor}; + stroke-width: ${t.strokeWidth||1}; + fill: none; +} + +.stateGroup .composit { + fill: ${t.background}; + border-bottom: 1px +} + +.stateGroup .alt-composit { + fill: #e0e0e0; + border-bottom: 1px +} + +.state-note { + stroke: ${t.noteBorderColor}; + fill: ${t.noteBkgColor}; + + text { + fill: ${t.noteTextColor}; + stroke: none; + font-size: 10px; + } +} + +.stateLabel .box { + stroke: none; + stroke-width: 0; + fill: ${t.mainBkg}; + opacity: 0.5; +} + +.edgeLabel .label rect { + fill: ${t.labelBackgroundColor}; + opacity: 0.5; +} +.edgeLabel { + background-color: ${t.edgeLabelBackground}; + p { + background-color: ${t.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${t.edgeLabelBackground}; + fill: ${t.edgeLabelBackground}; + } + text-align: center; +} +.edgeLabel .label text { + fill: ${t.transitionLabelColor||t.tertiaryTextColor}; +} +.label div .edgeLabel { + color: ${t.transitionLabelColor||t.tertiaryTextColor}; +} + +.stateLabel text { + fill: ${t.stateLabelColor}; + font-size: 10px; + font-weight: bold; +} + +.node circle.state-start { + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; +} + +.node .fork-join { + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; +} + +.node circle.state-end { + fill: ${t.innerEndBackground}; + stroke: ${t.background}; + stroke-width: 1.5 +} +.end-state-inner { + fill: ${t.compositeBackground||t.background}; + // stroke: ${t.background}; + stroke-width: 1.5 +} + +.node rect { + fill: ${t.stateBkg||t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth||1}px; +} +.node polygon { + fill: ${t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder};; + stroke-width: ${t.strokeWidth||1}px; +} +[id$="-barbEnd"] { + fill: ${t.lineColor}; +} + +.statediagram-cluster rect { + fill: ${t.compositeTitleBackground}; + stroke: ${t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth||1}px; +} + +.cluster-label, .nodeLabel { + color: ${t.stateLabelColor}; + // line-height: 1; +} + +.statediagram-cluster rect.outer { + rx: 5px; + ry: 5px; +} +.statediagram-state .divider { + stroke: ${t.stateBorder||t.nodeBorder}; +} + +.statediagram-state .title-state { + rx: 5px; + ry: 5px; +} +.statediagram-cluster.statediagram-cluster .inner { + fill: ${t.compositeBackground||t.background}; +} +.statediagram-cluster.statediagram-cluster-alt .inner { + fill: ${t.altBackground?t.altBackground:"#efefef"}; +} + +.statediagram-cluster .inner { + rx:0; + ry:0; +} + +.statediagram-state rect.basic { + rx: 5px; + ry: 5px; +} +.statediagram-state rect.divider { + stroke-dasharray: 10,10; + fill: ${t.altBackground?t.altBackground:"#efefef"}; +} + +.note-edge { + stroke-dasharray: 5; +} + +.statediagram-note rect { + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} +.statediagram-note rect { + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} + +.statediagram-note text { + fill: ${t.noteTextColor}; +} + +.statediagram-note .nodeLabel { + color: ${t.noteTextColor}; +} +.statediagram .edgeLabel { + color: red; // ${t.noteTextColor}; +} + +[id$="-dependencyStart"], [id$="-dependencyEnd"] { + fill: ${t.lineColor}; + stroke: ${t.lineColor}; + stroke-width: ${t.strokeWidth||1}; +} + +.statediagramTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.textColor}; +} + +[data-look="neo"].statediagram-cluster rect { + fill: ${t.mainBkg}; + stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth??1}; +} +[data-look="neo"].statediagram-cluster rect.outer { + rx: ${t.radius}px; + ry: ${t.radius}px; + filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} +} +`,"getStyles"),ze=Ye;export{He as S,We as a,je as b,ze as s}; diff --git a/internal/webapp/static/assets/chunk-5VM5RSS4-DJhOL3Lj.js b/internal/webapp/static/assets/chunk-5VM5RSS4-DJhOL3Lj.js new file mode 100644 index 0000000..f51fed2 --- /dev/null +++ b/internal/webapp/static/assets/chunk-5VM5RSS4-DJhOL3Lj.js @@ -0,0 +1,15 @@ +import{_ as e}from"./mermaid.core-B7WVQkyL.js";var l=e(()=>` + /* Font Awesome icon styling - consolidated */ + .label-icon { + display: inline-block; + height: 1em; + overflow: visible; + vertical-align: -0.125em; + } + + .node .label-icon path { + fill: currentColor; + stroke: revert; + stroke-width: revert; + } +`,"getIconStyles");export{l as g}; diff --git a/internal/webapp/static/assets/chunk-6Q2QTUOP-C7qNvbCj.js b/internal/webapp/static/assets/chunk-6Q2QTUOP-C7qNvbCj.js new file mode 100644 index 0000000..7db85ca --- /dev/null +++ b/internal/webapp/static/assets/chunk-6Q2QTUOP-C7qNvbCj.js @@ -0,0 +1,88 @@ +import{_ as p,l as C,D as H,y as B,p as q,E as G,e as U,i as j,c as K}from"./mermaid.core-B7WVQkyL.js";var A="",M="",O="",D=[],b=new Map,v=p(e=>j(e,K()),"sanitizeText"),y=p(e=>{switch(e.type){case"terminal":return{...e,value:v(e.value)};case"nonterminal":return{...e,name:v(e.name)};case"sequence":return{...e,elements:e.elements.map(y)};case"choice":return{...e,alternatives:e.alternatives.map(y)};case"optional":return{...e,element:y(e.element)};case"repetition":return{...e,element:y(e.element),separator:e.separator?y(e.separator):void 0};case"special":return{...e,text:v(e.text)}}},"sanitizeAstNode"),J=p(()=>{A="",M="",O="",D.length=0,b.clear(),q(),C.debug("[Railroad] Database cleared")},"clear"),Y=p(e=>{A=v(e),C.debug("[Railroad] Title set:",e)},"setTitle"),P=p(()=>A,"getTitle"),Q=p(e=>{const i={...e,name:v(e.name),definition:y(e.definition),comment:e.comment?v(e.comment):void 0};C.debug("[Railroad] Adding rule:",i.name),b.has(i.name)&&C.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),D.push(i),b.set(i.name,i)},"addRule"),Z=p(()=>D,"getRules"),V=p(e=>b.get(e),"getRule"),ee=p(e=>{M=v(e).replace(/^\s+/g,""),C.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),te=p(()=>M,"getAccTitle"),re=p(e=>{O=v(e).replace(/\n\s+/g,` +`),C.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ie=p(()=>O,"getAccDescription"),ne=Y,ae=P,oe={clear:J,setTitle:Y,getTitle:P,addRule:Q,getRules:Z,getRule:V,setAccTitle:ee,getAccTitle:te,setAccDescription:re,getAccDescription:ie,setDiagramTitle:ne,getDiagramTitle:ae},f={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},le=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,se=/^[\w "',.-]+$/,de=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),L=p(e=>e?Object.keys(e).every(i=>i==="railroad"||de.has(i)):!1,"isRailroadStyleOptions"),ce=p(e=>e?"railroad"in e&&e.railroad?e.railroad:L(e)?e:{}:{},"extractRailroadOverrides"),me=p(e=>{if(!e||L(e))return{};const{railroad:i,svgId:a,theme:n,look:t,...r}=e;return r},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return le.test(a)?a:i},"sanitizeColorValue"),I=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return se.test(a)?a:i},"sanitizeFontFamilyValue"),F=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),he=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),pe=p(e=>{const i=I(e.fontFamily,f.fontFamily),a=he(e.fontSize)??f.fontSize;return{...f,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,f.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,f.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,f.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,f.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,f.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,f.nonTerminalTextColor),lineColor:m(e.lineColor,f.lineColor),markerFill:m(e.lineColor,f.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,f.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,f.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,f.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,f.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,f.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,f.ruleNameColor)}},"buildThemeDefaults"),E=p(e=>{const i=B(),a={...G(),...i.themeVariables??{},...me(e)},n=pe(a),t={...i.railroad??{},...ce(e)};return{compactMode:t.compactMode??n.compactMode,padding:F(t.padding,n.padding),verticalSeparation:F(t.verticalSeparation,n.verticalSeparation),horizontalSeparation:F(t.horizontalSeparation,n.horizontalSeparation),arcRadius:F(t.arcRadius,n.arcRadius),fontSize:F(t.fontSize,n.fontSize),fontFamily:I(t.fontFamily,n.fontFamily),terminalFill:m(t.terminalFill,n.terminalFill),terminalStroke:m(t.terminalStroke,n.terminalStroke),terminalTextColor:m(t.terminalTextColor,n.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:m(t.lineColor,n.lineColor),strokeWidth:F(t.strokeWidth,n.strokeWidth),markerFill:m(t.markerFill,n.markerFill),commentFill:m(t.commentFill,n.commentFill),commentStroke:m(t.commentStroke,n.commentStroke),commentTextColor:m(t.commentTextColor,n.commentTextColor),specialFill:m(t.specialFill,n.specialFill),specialStroke:m(t.specialStroke,n.specialStroke),ruleNameColor:m(t.ruleNameColor,n.ruleNameColor),showMarkers:t.showMarkers??n.showMarkers,markerRadius:F(t.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),Te=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:n,terminalStroke:t,terminalTextColor:r,nonTerminalFill:o,nonTerminalStroke:g,nonTerminalTextColor:l,lineColor:s,strokeWidth:h,markerFill:u,commentFill:c,commentStroke:w,commentTextColor:d,specialFill:T,specialStroke:z,ruleNameColor:S}=E(e);return` + .railroad-diagram { + font-family: ${i}; + font-size: ${a}px; + } + + .railroad-terminal rect { + fill: ${n}; + stroke: ${t}; + stroke-width: ${h}px; + } + + .railroad-terminal text { + fill: ${r}; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-nonterminal rect { + fill: ${o}; + stroke: ${g}; + stroke-width: ${h}px; + } + + .railroad-nonterminal text { + fill: ${l}; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-line { + stroke: ${s}; + stroke-width: ${h}px; + fill: none; + } + + .railroad-start circle, + .railroad-end circle { + fill: ${u}; + } + + .railroad-comment ellipse { + fill: ${c}; + stroke: ${w}; + stroke-width: ${h}px; + } + + .railroad-comment text { + fill: ${d}; + font-style: italic; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-special rect { + fill: ${T}; + stroke: ${z}; + stroke-width: ${h}px; + stroke-dasharray: 5,3; + } + + .railroad-special text { + fill: ${l}; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-rule-name { + font-weight: bold; + fill: ${S}; + font-family: ${i}; + font-size: ${a}px; + } + + .railroad-group { + /* Grouping container, no specific styles */ + } +`},"getStyles"),R,x=(R=class{constructor(){this.d=""}moveTo(i,a){return this.d+=`M ${i} ${a} `,this}lineTo(i,a){return this.d+=`L ${i} ${a} `,this}horizontalTo(i){return this.d+=`H ${i} `,this}verticalTo(i){return this.d+=`V ${i} `,this}arcTo(i,a,n,t,r,o,g){return this.d+=`A ${i} ${a} ${n} ${t?1:0} ${r?1:0} ${o} ${g} `,this}build(){return this.d.trim()}},p(R,"PathBuilder"),R),$,ue=($=class{constructor(i,a=E()){this.textCache=new Map,this.svg=i,this.config=a}measureText(i){if(this.textCache.has(i))return this.textCache.get(i);const a=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(i),n=a.node().getBBox(),t={width:n.width,height:n.height};return a.remove(),this.textCache.set(i,t),t}renderTerminal(i,a){const n=this.measureText(a),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-terminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r).attr("rx",10).attr("ry",10),o.append("text").attr("x",t/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderNonTerminal(i,a){const n=this.measureText(a),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-nonterminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r),o.append("text").attr("x",t/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderSequence(i,a){const n=a.map(s=>this.renderExpression(i,s));let t=0,r=0,o=0;for(const s of n)t+=s.dimensions.width,r=Math.max(r,s.dimensions.up),o=Math.max(o,s.dimensions.down);t+=(n.length-1)*this.config.horizontalSeparation;const g=i.append("g").attr("class","railroad-sequence");let l=0;for(let s=0;sthis.renderExpression(i,c));let t=0,r=0;for(const c of n)t=Math.max(t,c.dimensions.width),r+=c.dimensions.height;r+=(n.length-1)*this.config.verticalSeparation;const o=this.config.arcRadius,g=o*4,l=t+g,s=i.append("g").attr("class","railroad-choice");let h=0;const u=r/2;for(const c of n){const w=h,d=w+c.dimensions.up,T=o*2+(t-c.dimensions.width)/2;s.node().appendChild(c.element).setAttribute("transform",`translate(${T}, ${w})`);const S=new x,k=d>u;d===u?S.moveTo(0,u).lineTo(T,d):S.moveTo(0,u).arcTo(o,o,0,!1,k,o,u+(k?o:-o)).lineTo(o,d-(k?o:-o)).arcTo(o,o,0,!1,!k,o*2,d).lineTo(T,d),s.append("path").attr("class","railroad-line").attr("d",S.build());const N=new x,_=T+c.dimensions.width,X=l-o*2;d===u?N.moveTo(_,d).lineTo(l,u):N.moveTo(_,d).lineTo(X,d).arcTo(o,o,0,!1,!k,l-o,d+(k?-o:o)).lineTo(l-o,u+(k?o:-o)).arcTo(o,o,0,!1,k,l,u),s.append("path").attr("class","railroad-line").attr("d",N.build()),h+=c.dimensions.height+this.config.verticalSeparation}return{element:s.node(),dimensions:{width:l,height:r,up:u,down:r-u}}}renderOptional(i,a){const n=this.renderExpression(i,a),t=this.config.arcRadius,r=t*2,o=n.dimensions.width+t*4,g=n.dimensions.height+r,l=i.append("g").attr("class","railroad-optional"),s=t*2,h=r;l.node().appendChild(n.element).setAttribute("transform",`translate(${s}, ${h})`);const c=h+n.dimensions.up,w=new x().moveTo(0,c).lineTo(t*2,c);l.append("path").attr("class","railroad-line").attr("d",w.build());const d=new x().moveTo(s+n.dimensions.width,c).lineTo(o,c);l.append("path").attr("class","railroad-line").attr("d",d.build());const T=new x().moveTo(0,c).arcTo(t,t,0,!1,!1,t,c-t).lineTo(t,t).arcTo(t,t,0,!1,!0,t*2,0).lineTo(o-t*2,0).arcTo(t,t,0,!1,!0,o-t,t).lineTo(o-t,c-t).arcTo(t,t,0,!1,!1,o,c);return l.append("path").attr("class","railroad-line").attr("d",T.build()),{element:l.node(),dimensions:{width:o,height:g,up:c,down:g-c}}}renderRepetition(i,a,n){const t=this.renderExpression(i,a),r=this.config.arcRadius,o=r*2,g=t.dimensions.width+r*4,l=n===0,s=t.dimensions.height+o+(l?o:0),h=i.append("g").attr("class","railroad-repetition"),u=r*2,c=l?o:0;h.node().appendChild(t.element).setAttribute("transform",`translate(${u}, ${c})`);const d=c+t.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new x().moveTo(0,d).lineTo(r*2,d).build()),h.append("path").attr("class","railroad-line").attr("d",new x().moveTo(u+t.dimensions.width,d).lineTo(g,d).build());const T=c+t.dimensions.height+r,z=new x().moveTo(u+t.dimensions.width,d).arcTo(r,r,0,!1,!0,u+t.dimensions.width+r,d+r).lineTo(u+t.dimensions.width+r,T).arcTo(r,r,0,!1,!0,u+t.dimensions.width,T+r).lineTo(r*2,T+r).arcTo(r,r,0,!1,!0,r,T).lineTo(r,d+r).arcTo(r,r,0,!1,!0,r*2,d);if(h.append("path").attr("class","railroad-line").attr("d",z.build()),l){const S=new x().moveTo(0,d).arcTo(r,r,0,!1,!1,r,d-r).lineTo(r,r).arcTo(r,r,0,!1,!0,r*2,0).lineTo(g-r*2,0).arcTo(r,r,0,!1,!0,g-r,r).lineTo(g-r,d-r).arcTo(r,r,0,!1,!1,g,d);h.append("path").attr("class","railroad-line").attr("d",S.build())}return{element:h.node(),dimensions:{width:g,height:s,up:d,down:s-d}}}renderSpecial(i,a){const n=this.measureText("? "+a+" ?"),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-special");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r),o.append("text").attr("x",t/2).attr("y",r/2).text("? "+a+" ?"),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderExpression(i,a){switch(a.type){case"terminal":return this.renderTerminal(i,a.value);case"nonterminal":return this.renderNonTerminal(i,a.name);case"sequence":return this.renderSequence(i,a.elements);case"choice":return this.renderChoice(i,a.alternatives);case"optional":return this.renderOptional(i,a.element);case"repetition":return this.renderRepetition(i,a.element,a.min);case"special":return this.renderSpecial(i,a.text);default:throw new Error(`Unknown node type: ${a.type}`)}}renderRule(i,a){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${a})`),t=i.name+" =",r=this.measureText(t).width+20,o=r+20,g=n.append("g"),l=this.renderExpression(g,i.definition),s=Math.max(20,l.dimensions.up),h=s-l.dimensions.up;return g.attr("transform",`translate(${o}, ${h})`),n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",s).text(t),n.append("g").attr("class","railroad-start").append("circle").attr("cx",r).attr("cy",s).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",o+l.dimensions.width+10).attr("cy",s).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new x().moveTo(r+this.config.markerRadius,s).lineTo(o,s).build()),n.append("path").attr("class","railroad-line").attr("d",new x().moveTo(o+l.dimensions.width,s).lineTo(o+l.dimensions.width+10-this.config.markerRadius,s).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:o+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(i){let a=this.config.padding,n=0;for(const t of i){const r=this.renderRule(t,a);a+=r.height+this.config.verticalSeparation,n=Math.max(n,r.width)}return{width:n+this.config.padding*2,height:a+this.config.padding}}},p($,"RailroadRenderer"),$),W=p((e,i,a)=>{U(e,i.height,i.width,a),e.attr("viewBox",`0 0 ${i.width} ${i.height}`)},"configureRailroadSvgSize"),ge=p((e,i,a)=>{C.debug(`[Railroad] Rendering diagram +`+e);try{const n=H(i);n.attr("class","railroad-diagram");const r=B().railroad?.useMaxWidth??!0,o=oe.getRules();if(C.debug(`[Railroad] Rendering ${o.length} rules`),o.length===0){C.warn("[Railroad] No rules to render"),W(n,{height:100,width:200},r);return}const l=new ue(n,E()).renderDiagram(o);W(n,l,r),C.debug("[Railroad] Render complete")}catch(n){throw C.error("[Railroad] Render error:",n),n}},"draw"),xe={draw:ge};export{oe as d,Te as g,xe as r}; diff --git a/internal/webapp/static/assets/chunk-GF5L2VYU-DJ222bgi.js b/internal/webapp/static/assets/chunk-GF5L2VYU-DJ222bgi.js new file mode 100644 index 0000000..f407114 --- /dev/null +++ b/internal/webapp/static/assets/chunk-GF5L2VYU-DJ222bgi.js @@ -0,0 +1,206 @@ +import{g as st}from"./chunk-5VM5RSS4-DJhOL3Lj.js";import{g as it}from"./chunk-XXDRQBXY-BXTWinaX.js";import{s as at}from"./chunk-KBJHAD2P-CHI3y1em.js";import{_ as f,l as we,c as F,u as nt,v as rt,x as Ve,d as Ae,N as ut,b as lt,a as ct,s as ot,g as ht,n as dt,o as pt,k as I,p as At,q as ft,i as gt,O as U}from"./mermaid.core-B7WVQkyL.js";import{f as mt}from"./chunk-2GRJ4B5K-Bng47RDF.js";var Pe=(function(){var s=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],ge=[1,34],b=[1,45],me=[1,35],Ce=[1,36],be=[1,37],ke=[1,38],Ee=[1,27],Te=[1,28],ye=[1,29],De=[1,30],Fe=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],Be=[1,9],A=[1,8,9],ee=[1,58],te=[1,59],se=[1,60],ie=[1,61],ae=[1,62],_e=[1,63],Se=[1,64],_=[1,8,9,41],Me=[1,77],R=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ne=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],re=[13,60,86,100,102,103],Y=[13,60,73,74,86,100,102,103],Re=[13,60,68,69,70,71,72,86,100,102,103],ue=[1,103],K=[1,121],W=[1,117],Q=[1,113],j=[1,119],X=[1,114],q=[1,115],H=[1,116],J=[1,118],Z=[1,120],Ge=[22,50,60,61,82,86,87,88,89,90],Ue=[1,128],le=[12,39],Ne=[1,8,9,39,41,44,46],ce=[1,8,9,22],ze=[1,153],Ye=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Le={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,$){var t=e.length-1;switch(C){case 8:this.$=e[t-1];break;case 9:case 10:case 13:case 15:this.$=e[t];break;case 11:case 14:this.$=e[t-2]+"."+e[t];break;case 12:case 16:this.$=e[t-1]+e[t];break;case 17:case 18:this.$=e[t-1]+"~"+e[t]+"~";break;case 19:l.addRelation(e[t]);break;case 20:e[t-1].title=l.cleanupLabel(e[t]),l.addRelation(e[t-1]);break;case 31:this.$=e[t].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[t].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[t-3],e[t-1][0],e[t-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[t-4],e[t-1][0],e[t-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[t]);break;case 37:this.$=l.addNamespace(e[t-1],e[t]);break;case 38:this.$=[[e[t]],[]];break;case 39:this.$=[[e[t-1]],[]];break;case 40:e[t][0].unshift(e[t-2]),this.$=e[t];break;case 41:this.$=[[],[e[t]]];break;case 42:this.$=[[],[e[t-1]]];break;case 43:e[t][1].unshift(e[t-2]),this.$=e[t];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[t];break;case 48:l.setCssClass(e[t-2],e[t]);break;case 49:l.addMembers(e[t-3],e[t-1]);break;case 51:l.setCssClass(e[t-5],e[t-3]),l.addMembers(e[t-5],e[t-1]);break;case 52:l.addAnnotation(e[t-3],e[t-1]);break;case 53:l.addAnnotation(e[t-6],e[t-4]),l.addMembers(e[t-6],e[t-1]);break;case 54:l.addAnnotation(e[t-5],e[t-3]);break;case 55:this.$=e[t],l.addClass(e[t]);break;case 56:this.$=e[t-1],l.addClass(e[t-1]),l.setClassLabel(e[t-1],e[t]);break;case 60:l.addAnnotation(e[t],e[t-2]);break;case 61:case 74:this.$=[e[t]];break;case 62:e[t].push(e[t-1]),this.$=e[t];break;case 63:break;case 64:l.addMember(e[t-1],l.cleanupLabel(e[t]));break;case 65:break;case 66:break;case 67:this.$={id1:e[t-2],id2:e[t],relation:e[t-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[t-3],id2:e[t],relation:e[t-1],relationTitle1:e[t-2],relationTitle2:"none"};break;case 69:this.$={id1:e[t-3],id2:e[t],relation:e[t-2],relationTitle1:"none",relationTitle2:e[t-1]};break;case 70:this.$={id1:e[t-4],id2:e[t],relation:e[t-2],relationTitle1:e[t-3],relationTitle2:e[t-1]};break;case 71:this.$=l.addNote(e[t],e[t-1]);break;case 72:this.$=l.addNote(e[t]);break;case 73:this.$=e[t-2],l.defineClass(e[t-1],e[t]);break;case 75:this.$=e[t-2].concat([e[t]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[t-2],type2:e[t],lineType:e[t-1]};break;case 81:this.$={type1:"none",type2:e[t],lineType:e[t-1]};break;case 82:this.$={type1:e[t-1],type2:"none",lineType:e[t]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[t]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[t-2],l.setClickEvent(e[t-1],e[t]);break;case 92:case 98:this.$=e[t-3],l.setClickEvent(e[t-2],e[t-1]),l.setTooltip(e[t-2],e[t]);break;case 93:this.$=e[t-2],l.setLink(e[t-1],e[t]);break;case 94:this.$=e[t-3],l.setLink(e[t-2],e[t-1],e[t]);break;case 95:this.$=e[t-3],l.setLink(e[t-2],e[t-1]),l.setTooltip(e[t-2],e[t]);break;case 96:this.$=e[t-4],l.setLink(e[t-3],e[t-2],e[t]),l.setTooltip(e[t-3],e[t-1]);break;case 99:this.$=e[t-3],l.setClickEvent(e[t-2],e[t-1],e[t]);break;case 100:this.$=e[t-4],l.setClickEvent(e[t-3],e[t-2],e[t-1]),l.setTooltip(e[t-3],e[t]);break;case 101:this.$=e[t-3],l.setLink(e[t-2],e[t]);break;case 102:this.$=e[t-4],l.setLink(e[t-3],e[t-1],e[t]);break;case 103:this.$=e[t-4],l.setLink(e[t-3],e[t-1]),l.setTooltip(e[t-3],e[t]);break;case 104:this.$=e[t-5],l.setLink(e[t-4],e[t-2],e[t]),l.setTooltip(e[t-4],e[t-1]);break;case 105:this.$=e[t-2],l.setCssStyle(e[t-1],e[t]);break;case 106:l.setCssClass(e[t-1],e[t]);break;case 107:this.$=[e[t]];break;case 108:e[t-2].push(e[t]),this.$=e[t-2];break;case 110:this.$=e[t-1]+e[t];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:ge,60:b,62:me,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},s(Be,[2,5],{8:[1,48]}),{8:[1,49]},s(A,[2,19],{22:[1,50]}),s(A,[2,21]),s(A,[2,22]),s(A,[2,23]),s(A,[2,24]),s(A,[2,25]),s(A,[2,26]),s(A,[2,27]),s(A,[2,28]),s(A,[2,29]),s(A,[2,30]),{34:[1,51]},{36:[1,52]},s(A,[2,33]),s(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:ee,69:te,70:se,71:ie,72:ae,73:_e,74:Se}),{39:[1,65]},s(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),s(A,[2,65]),s(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Me,55:76},{58:78,60:[1,79]},s(A,[2,76]),s(A,[2,77]),s(A,[2,78]),s(A,[2,79]),s(R,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),s(R,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},s(ne,[2,133]),s(ne,[2,134]),s(ne,[2,135]),s(ne,[2,136]),s([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),s(Be,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:ge,60:b,62:me,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:ge,60:b,62:me,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y},s(A,[2,20]),s(A,[2,31]),s(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:ee,69:te,70:se,71:ie,72:ae,73:_e,74:Se},s(A,[2,64]),{67:93,73:_e,74:Se},s(re,[2,83],{66:94,68:ee,69:te,70:se,71:ie,72:ae}),s(Y,[2,84]),s(Y,[2,85]),s(Y,[2,86]),s(Y,[2,87]),s(Y,[2,88]),s(Re,[2,89]),s(Re,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ue},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:K,50:W,59:110,60:Q,82:j,84:111,85:112,86:X,87:q,88:H,89:J,90:Z},{60:[1,122]},{13:Me,55:123},s(_,[2,72]),s(_,[2,138]),{22:K,50:W,59:124,60:Q,61:[1,125],82:j,84:111,85:112,86:X,87:q,88:H,89:J,90:Z},s(Ge,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},s(R,[2,16]),s(R,[2,17]),s(R,[2,18]),{11:127,12:Ue,39:[2,36]},s(le,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),s(le,[2,10]),s(Ne,[2,55],{11:131,12:Ue}),s(Be,[2,7]),{9:[1,132]},s(ce,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},s(re,[2,82],{66:136,68:ee,69:te,70:se,71:ie,72:ae}),s(re,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},s(_,[2,48],{39:[1,142]}),{41:[1,143]},s(_,[2,50]),{41:[2,61],45:144,51:ue},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},s(A,[2,91],{13:[1,147]}),s(A,[2,93],{13:[1,149],77:[1,148]}),s(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},s(A,[2,105],{61:ze}),s(Ye,[2,107],{85:154,22:K,50:W,60:Q,82:j,86:X,87:q,88:H,89:J,90:Z}),s(x,[2,109]),s(x,[2,111]),s(x,[2,112]),s(x,[2,113]),s(x,[2,114]),s(x,[2,115]),s(x,[2,116]),s(x,[2,117]),s(x,[2,118]),s(x,[2,119]),s(A,[2,106]),s(_,[2,71]),s(A,[2,73],{61:ze}),{60:[1,155]},s(R,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},s(le,[2,12]),s(Ne,[2,56]),{1:[2,4]},s(ce,[2,69]),s(ce,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},s(re,[2,80]),s(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ue},s(_,[2,49]),{41:[2,62]},s(_,[2,52],{39:[1,164]}),s(A,[2,60]),s(A,[2,92]),s(A,[2,94]),s(A,[2,95],{77:[1,165]}),s(A,[2,98]),s(A,[2,99],{13:[1,166]}),s(A,[2,101],{13:[1,168],77:[1,167]}),{22:K,50:W,60:Q,82:j,84:169,85:112,86:X,87:q,88:H,89:J,90:Z},s(x,[2,110]),s(Ge,[2,75]),{14:[1,170]},s(le,[2,11]),s(ce,[2,70]),s(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ue},s(A,[2,96]),s(A,[2,100]),s(A,[2,102]),s(A,[2,103],{77:[1,174]}),s(Ye,[2,108],{85:154,22:K,50:W,60:Q,82:j,86:X,87:q,88:H,89:J,90:Z}),s(Ne,[2,8]),s(_,[2,51]),{41:[1,175]},s(_,[2,54]),s(A,[2,104]),s(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],$=this.table,t="",he=0,Ke=0,Ze=2,We=1,$e=e.slice.call(arguments,1),D=Object.create(this.lexer),V={yy:{}};for(var xe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,xe)&&(V.yy[xe]=this.yy[xe]);D.setInput(o,V.yy),V.yy.lexer=D,V.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var ve=D.yylloc;e.push(ve);var et=D.options&&D.options.ranges;typeof V.yy.parseError=="function"?this.parseError=V.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tt(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(tt,"popStack");function Qe(){var S;return S=l.pop()||D.lex()||We,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(Qe,"lex");for(var B,P,L,Ie,G={},de,v,je,pe;;){if(P=p[p.length-1],this.defaultActions[P]?L=this.defaultActions[P]:((B===null||typeof B>"u")&&(B=Qe()),L=$[P]&&$[P][B]),typeof L>"u"||!L.length||!L[0]){var Oe="";pe=[];for(de in $[P])this.terminals_[de]&&de>Ze&&pe.push("'"+this.terminals_[de]+"'");D.showPosition?Oe="Parse error on line "+(he+1)+`: +`+D.showPosition()+` +Expecting `+pe.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Oe="Parse error on line "+(he+1)+": Unexpected "+(B==We?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Oe,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:ve,expected:pe})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+B);switch(L[0]){case 1:p.push(B),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),B=null,Ke=D.yyleng,t=D.yytext,he=D.yylineno,ve=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],G.$=C[C.length-v],G._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},et&&(G._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),Ie=this.performAction.apply(G,[t,Ke,he,V.yy,L[1],C,e].concat($e)),typeof Ie<"u")return Ie;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(G.$),e.push(G._$),je=$[p[p.length-2]][p[p.length-1]],p.push(je);break;case 3:return!0}}return!0},"parse")},Je=(function(){var O={EOF:1,parseError:f(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:f(function(o,h){return this.yy=h||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:f(function(o){var h=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===l.length?this.yylloc.first_column:0)+l[l.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(o){this.unput(this.match.slice(o))},"less"),pastInput:f(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var o=this.pastInput(),h=new Array(o.length+1).join("-");return o+this.upcomingInput()+` +`+h+"^"},"showPosition"),test_match:f(function(o,h){var p,l,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),l=o[0].match(/(?:\r\n?|\n).*/g),l&&(this.yylineno+=l.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:l?l[l.length-1].length-l[l.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var e in C)this[e]=C[e];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,h,p,l;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),e=0;eh[0].length)){if(h=p,l=e,this.options.backtrack_lexer){if(o=this.test_match(p,C[e]),o!==!1)return o;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(o=this.test_match(h,C[l]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var h=this.next();return h||this.lex()},"lex"),begin:f(function(h){this.conditionStack.push(h)},"begin"),popState:f(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:f(function(h){this.begin(h)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:f(function(h,p,l,C){switch(l){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return O})();Le.lexer=Je;function oe(){this.yy={}}return f(oe,"Parser"),oe.prototype=Le,Le.Parser=oe,new oe})();Pe.parser=Pe;var _t=Pe,Xe=["#","+","~","-",""],z,qe=(z=class{constructor(i,a){this.memberType=a,this.visibility="",this.classifier="",this.text="";const n=gt(i,F());this.parseMember(n)}getDisplayDetails(){let i=this.visibility+U(this.id);this.memberType==="method"&&(i+=`(${U(this.parameters.trim())})`,this.returnType&&(i+=" : "+U(this.returnType))),i=i.trim();const a=this.parseClassifier();return{displayText:i,cssStyle:a}}parseMember(i){let a="";if(this.memberType==="method"){const c=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(i);if(c){const u=c[1]?c[1].trim():"";if(Xe.includes(u)&&(this.visibility=u),this.id=c[2],this.parameters=c[3]?c[3].trim():"",a=c[4]?c[4].trim():"",this.returnType=c[5]?c[5].trim():"",a===""){const d=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(d)&&(a=d,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const r=i.length,c=i.substring(0,1),u=i.substring(r-1);Xe.includes(c)&&(this.visibility=c),/[$*]/.exec(u)&&(a=u),this.id=i.substring(this.visibility===""?0:1,a===""?r:r-1)}this.classifier=a,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${U(this.id)}${this.memberType==="method"?`(${U(this.parameters)})${this.returnType?" : "+U(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},f(z,"ClassMember"),z),fe="classId-",He=0,M=f(s=>I.sanitizeText(s,F()),"sanitizeText"),w,St=(w=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=f(i=>{const a=mt();Ae(i).select("svg").selectAll("g").filter(function(){return Ae(this).attr("title")!==null}).on("mouseover",c=>{const u=Ae(c.currentTarget),d=u.attr("title");if(!d)return;const m=c.currentTarget.getBoundingClientRect();a.transition().duration(200).style("opacity",".9"),a.html(ut.sanitize(d)).style("left",`${window.scrollX+m.left+m.width/2}px`).style("top",`${window.scrollY+m.bottom+4}px`),u.classed("hover",!0)}).on("mouseout",c=>{a.transition().duration(500).style("opacity",0),Ae(c.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=lt,this.getAccTitle=ct,this.setAccDescription=ot,this.getAccDescription=ht,this.setDiagramTitle=dt,this.getDiagramTitle=pt,this.getConfig=f(()=>F().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(i){const a=I.sanitizeText(i,F());let n="",r=a;if(a.indexOf("~")>0){const c=a.split("~");r=M(c[0]),n=M(c[1])}return{className:r,type:n}}setClassLabel(i,a){const n=I.sanitizeText(i,F());a&&(a=M(a));const{className:r}=this.splitClassNameAndType(n);this.classes.get(r).label=a,this.classes.get(r).text=`${a}${this.classes.get(r).type?`<${this.classes.get(r).type}>`:""}`}addClass(i){const a=I.sanitizeText(i,F()),{className:n,type:r}=this.splitClassNameAndType(a);if(this.classes.has(n))return;const c=I.sanitizeText(n,F());this.classes.set(c,{id:c,type:r,label:c,text:`${c}${r?`<${r}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:fe+c+"-"+He}),He++}addInterface(i,a){const n={id:`interface${this.interfaces.length}`,label:i,classId:a};this.interfaces.push(n)}setDiagramId(i){this.diagramId=i}lookUpDomId(i){const a=I.sanitizeText(i,F());if(this.classes.has(a)){const n=this.classes.get(a).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+a)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",At()}getClass(i){return this.classes.get(i)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(i){const a=typeof i=="number"?`note${i}`:i;return this.notes.get(a)}getNotes(){return this.notes}addRelation(i){we.debug("Adding relation: "+JSON.stringify(i));const a=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];i.relation.type1===this.relationType.LOLLIPOP&&!a.includes(i.relation.type2)?(this.addClass(i.id2),this.addInterface(i.id1,i.id2),i.id1=`interface${this.interfaces.length-1}`):i.relation.type2===this.relationType.LOLLIPOP&&!a.includes(i.relation.type1)?(this.addClass(i.id1),this.addInterface(i.id2,i.id1),i.id2=`interface${this.interfaces.length-1}`):(this.addClass(i.id1),this.addClass(i.id2)),i.id1=this.splitClassNameAndType(i.id1).className,i.id2=this.splitClassNameAndType(i.id2).className,i.relationTitle1=I.sanitizeText(i.relationTitle1.trim(),F()),i.relationTitle2=I.sanitizeText(i.relationTitle2.trim(),F()),this.relations.push(i)}addAnnotation(i,a){const n=this.splitClassNameAndType(i).className;this.classes.get(n).annotations.push(a)}addMember(i,a){this.addClass(i);const n=this.splitClassNameAndType(i).className,r=this.classes.get(n);if(typeof a=="string"){const c=a.trim();c.startsWith("<<")&&c.endsWith(">>")?r.annotations.push(M(c.substring(2,c.length-2))):c.indexOf(")")>0?r.methods.push(new qe(c,"method")):c&&r.members.push(new qe(c,"attribute"))}}addMembers(i,a){Array.isArray(a)&&(a.reverse(),a.forEach(n=>this.addMember(i,n)))}addNote(i,a){const n=this.notes.size,r={id:`note${n}`,class:a,text:i,index:n};return this.notes.set(r.id,r),r.id}cleanupLabel(i){return i.startsWith(":")&&(i=i.substring(1)),M(i.trim())}setCssClass(i,a){i.split(",").forEach(n=>{let r=n;/\d/.exec(n[0])&&(r=fe+r),r=this.splitClassNameAndType(r).className;const c=this.classes.get(r);c&&(c.cssClasses+=" "+a)})}defineClass(i,a){for(const n of i){let r=this.styleClasses.get(n);r===void 0&&(r={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,r)),a&&a.forEach(c=>{if(/color/.exec(c)){const u=c.replace("fill","bgFill");r.textStyles.push(u)}r.styles.push(c)}),this.classes.forEach(c=>{c.cssClasses.includes(n)&&c.styles.push(...a.flatMap(u=>u.split(",")))})}}setTooltip(i,a){i.split(",").forEach(n=>{if(a!==void 0){const r=this.splitClassNameAndType(n).className,c=this.classes.get(r);c&&(c.tooltip=M(a))}})}getTooltip(i,a){return a&&this.namespaces.has(a)?this.namespaces.get(a).classes.get(i).tooltip:this.classes.get(i).tooltip}setLink(i,a,n){const r=F();i.split(",").forEach(c=>{let u=c;/\d/.exec(c[0])&&(u=fe+u),u=this.splitClassNameAndType(u).className;const d=this.classes.get(u);d&&(d.link=Ve.formatUrl(a,r),r.securityLevel==="sandbox"?d.linkTarget="_top":typeof n=="string"?d.linkTarget=M(n):d.linkTarget="_blank")}),this.setCssClass(i,"clickable")}setClickEvent(i,a,n){i.split(",").forEach(r=>{this.setClickFunc(r,a,n);const c=this.splitClassNameAndType(r).className,u=this.classes.get(c);u&&(u.haveCallback=!0)}),this.setCssClass(i,"clickable")}setClickFunc(i,a,n){const r=I.sanitizeText(i,F());if(F().securityLevel!=="loose"||a===void 0)return;const u=this.splitClassNameAndType(r).className;if(this.classes.has(u)){let d=[];if(typeof n=="string"){d=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let m=0;m{const m=this.lookUpDomId(u),g=document.querySelector(`[id="${m}"]`);g!==null&&g.addEventListener("click",()=>{Ve.runFunc(a,...d)},!1)})}}bindFunctions(i){this.functions.forEach(a=>{a(i)})}escapeHtml(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(i){this.direction=i}static resolveQualifiedId(i,a){const n=a.at(-1);return n?`${n}.${i}`:i}static getAncestorIds(i){const a=i.split("."),n=new Array(a.length);n[0]=a[0];for(let r=1;r0?c[u-1]:void 0,g=u===c.length-1,N=g&&a?a:r[u];this.namespaces.has(d)?g&&(this.namespaces.get(d).explicit=!0):this.namespaces.set(d,this.createNamespaceNode(d,N,m,g)),m&&this.linkParentChild(m,d)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(i){return this.namespaces.get(i)}getNamespaces(){return this.namespaces}addClassesToNamespace(i,a,n){if(this.namespaces.has(i)){for(const r of a){const{className:c}=this.splitClassNameAndType(r),u=this.getClass(c);u.parent=i,this.namespaces.get(i).classes.set(c,u)}for(const r of n){const c=this.getNote(r);c.parent=i,this.namespaces.get(i).notes.set(r,c)}}}setCssStyle(i,a){const n=this.classes.get(i);if(!(!a||!n))for(const r of a)r.includes(",")?n.styles.push(...r.split(",")):n.styles.push(r)}getArrowMarker(i){let a;switch(i){case 0:a="aggregation";break;case 1:a="extension";break;case 2:a="composition";break;case 3:a="dependency";break;case 4:a="lollipop";break;default:a="none"}return a}resolveExplicitAncestor(i){let a=i;for(;a;){const n=this.namespaces.get(a);if(!n)return;if(n.explicit)return a;a=n.parent}}getData(){const i=[],a=[],n=F(),r=n.class?.hierarchicalNamespaces??!0;for(const u of this.namespaces.values()){if(!r&&!u.explicit)continue;const d={id:u.id,label:r?u.label:u.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:r?u.parent:void 0};i.push(d)}for(const u of this.classes.values()){const d=r?u.parent:this.resolveExplicitAncestor(u.parent),m={...u,type:void 0,isGroup:!1,parentId:d,look:n.look};i.push(m)}for(const u of this.notes.values()){const d=r?u.parent:this.resolveExplicitAncestor(u.parent),m={id:u.id,label:u.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:d,labelType:"markdown"};i.push(m);const g=this.classes.get(u.class)?.id;if(g){const N={id:`edgeNote${u.index}`,start:u.id,end:g,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};a.push(N)}}for(const u of this.interfaces){const d={id:u.id,label:u.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};i.push(d)}let c=0;for(const u of this.relations){c++;const d={id:ft(u.id1,u.id2,{prefix:"id",counter:c}),start:u.id1,end:u.id2,type:"normal",label:u.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(u.relation.type1),arrowTypeEnd:this.getArrowMarker(u.relation.type2),startLabelRight:u.relationTitle1==="none"?"":u.relationTitle1,endLabelLeft:u.relationTitle2==="none"?"":u.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:u.style||"",pattern:u.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};a.push(d)}return{nodes:i,edges:a,other:{},config:n,direction:this.getDirection()}}},f(w,"ClassDB"),w),Ct=f(s=>`g.classGroup text { + fill: ${s.nodeBorder||s.classText}; + stroke: none; + font-family: ${s.fontFamily}; + font-size: 10px; + + .title { + font-weight: bolder; + } + +} + + .cluster-label text { + fill: ${s.titleColor}; + } + .cluster-label span { + color: ${s.titleColor}; + } + .cluster-label span p { + background-color: transparent; + } + + .cluster rect { + fill: ${s.clusterBkg}; + stroke: ${s.clusterBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${s.titleColor}; + } + + .cluster span { + color: ${s.titleColor}; + } + +.nodeLabel, .edgeLabel { + color: ${s.classText}; +} + +.noteLabel .nodeLabel, .noteLabel .edgeLabel { + color: ${s.noteTextColor}; +} +.edgeLabel .label rect { + fill: ${s.mainBkg}; +} +.label text { + fill: ${s.classText}; +} + +.labelBkg { + background: ${s.mainBkg}; +} +.edgeLabel .label span { + background: ${s.mainBkg}; +} + +.classTitle { + font-weight: bolder; +} +.node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${s.mainBkg}; + stroke: ${s.nodeBorder}; + stroke-width: ${s.strokeWidth}; + } + + +.divider { + stroke: ${s.nodeBorder}; + stroke-width: 1; +} + +g.clickable { + cursor: pointer; +} + +g.classGroup rect { + fill: ${s.mainBkg}; + stroke: ${s.nodeBorder}; +} + +g.classGroup line { + stroke: ${s.nodeBorder}; + stroke-width: 1; +} + +.classLabel .box { + stroke: none; + stroke-width: 0; + fill: ${s.mainBkg}; + opacity: 0.5; +} + +.classLabel .label { + fill: ${s.nodeBorder}; + font-size: 10px; +} + +.relation { + stroke: ${s.lineColor}; + stroke-width: ${s.strokeWidth}; + fill: none; +} + +.dashed-line{ + stroke-dasharray: 3; +} + +.dotted-line{ + stroke-dasharray: 1 2; +} + +[id$="-compositionStart"], .composition { + fill: ${s.lineColor} !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +[id$="-compositionEnd"], .composition { + fill: ${s.lineColor} !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +[id$="-dependencyStart"], .dependency { + fill: ${s.lineColor} !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +[id$="-dependencyEnd"], .dependency { + fill: ${s.lineColor} !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +[id$="-extensionStart"], .extension { + fill: transparent !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +[id$="-extensionEnd"], .extension { + fill: transparent !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +[id$="-aggregationStart"], .aggregation { + fill: transparent !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +[id$="-aggregationEnd"], .aggregation { + fill: transparent !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +[id$="-lollipopStart"], .lollipop { + fill: ${s.mainBkg} !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +[id$="-lollipopEnd"], .lollipop { + fill: ${s.mainBkg} !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +.edgeTerminals { + font-size: 11px; + line-height: initial; +} + +.classTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${s.textColor}; +} + +.edgeLabel[data-look="neo"] { + background-color: ${s.edgeLabelBackground}; + p { + background-color: ${s.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${s.edgeLabelBackground}; + fill: ${s.edgeLabelBackground}; + } + text-align: center; +} + ${st()} +`,"getStyles"),Nt=Ct,bt=f((s,i="TB")=>{if(!s.doc)return i;let a=i;for(const n of s.doc)n.stmt==="dir"&&(a=n.value);return a},"getDir"),kt=f(function(s,i){return i.db.getClasses()},"getClasses"),Et=f(async function(s,i,a,n){we.info("REF0:"),we.info("Drawing class diagram (v3)",i);const{securityLevel:r,state:c,layout:u}=F();n.db.setDiagramId(i);const d=n.db.getData(),m=it(i,r);d.type=n.type,d.layoutAlgorithm=nt(u),d.nodeSpacing=c?.nodeSpacing||50,d.rankSpacing=c?.rankSpacing||50,d.markers=["aggregation","extension","composition","dependency","lollipop"],d.diagramId=i,await rt(d,m);const g=8;Ve.insertTitle(m,"classDiagramTitleText",c?.titleTopMargin??25,n.db.getDiagramTitle()),at(m,g,"classDiagram",c?.useMaxWidth??!0)},"draw"),Lt={getClasses:kt,draw:Et,getDir:bt};export{St as C,_t as a,Lt as c,Nt as s}; diff --git a/internal/webapp/static/assets/chunk-JWPE2WC7-Czg53Rx5.js b/internal/webapp/static/assets/chunk-JWPE2WC7-Czg53Rx5.js new file mode 100644 index 0000000..a827d6e --- /dev/null +++ b/internal/webapp/static/assets/chunk-JWPE2WC7-Czg53Rx5.js @@ -0,0 +1 @@ +import{_ as i}from"./mermaid.core-B7WVQkyL.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; diff --git a/internal/webapp/static/assets/chunk-KBJHAD2P-CHI3y1em.js b/internal/webapp/static/assets/chunk-KBJHAD2P-CHI3y1em.js new file mode 100644 index 0000000..c9d2db2 --- /dev/null +++ b/internal/webapp/static/assets/chunk-KBJHAD2P-CHI3y1em.js @@ -0,0 +1 @@ +import{_ as a,e as w,l as x}from"./mermaid.core-B7WVQkyL.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; diff --git a/internal/webapp/static/assets/chunk-RYQCIY6F-xkrp9DIm.js b/internal/webapp/static/assets/chunk-RYQCIY6F-xkrp9DIm.js new file mode 100644 index 0000000..bd0aa2d --- /dev/null +++ b/internal/webapp/static/assets/chunk-RYQCIY6F-xkrp9DIm.js @@ -0,0 +1 @@ +import{_ as u,l as i}from"./mermaid.core-B7WVQkyL.js";import{i as m,G as y}from"./graph-DOmOIIwC.js";import{b as _,m as X}from"./map-DxJ2ADlA.js";var j=4;function p(e){return _(e,j)}function C(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:F(e),edges:M(e)};return m(e.graph())||(r.value=p(e.graph())),r}function F(e){return X(e.nodes(),function(r){var n=e.node(r),s=e.parent(r),t={v:r};return m(n)||(t.value=n),m(s)||(t.parent=s),t})}function M(e){return X(e.edges(),function(r){var n=e.edge(r),s={v:r.v,w:r.w};return m(r.name)||(s.name=r.name),m(n)||(s.value=n),s})}var c=new Map,w=new Map,A=new Map,J=u(()=>{w.clear(),A.clear(),c.clear()},"clear"),v=u((e,r)=>{const n=w.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),R=u((e,r)=>{const n=w.get(r)||[];return i.info("Descendants of ",r," is ",n),i.info("Edge is ",e),e.v===r||e.w===r?!1:n?n.includes(e.v)||v(e.v,r)||v(e.w,r)||n.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),b=u((e,r,n,s)=>{i.warn("Copying children of ",e,"root",s,"data",r.node(e),s);const t=r.children(e)||[];e!==s&&t.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",t),t.forEach(o=>{if(r.children(o).length>0)b(o,r,n,s);else{const l=r.node(o);i.info("cp ",o," to ",s," with parent ",e),n.setNode(o,l),s!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o))),e!==s&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",s,"data",r.node(e),s),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==s,"node!==clusterId",o!==e));const f=r.edges(o);i.debug("Copying Edges",f),f.forEach(a=>{i.info("Edge",a);const d=r.edge(a.v,a.w,a.name);i.info("Edge data",d,s);try{if(R(a,s)){const g=w.get(s)||[],E=g.includes(a.v)||v(a.v,s)||a.v===s,x=g.includes(a.w)||v(a.w,s)||a.w===s;if(E&&x)i.info("Copying as ",a.v,a.w,d,a.name),n.setEdge(a.v,a.w,d,a.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else{const N=E?s:a.v,h=x?s:a.w;i.info("Rebinding cross-boundary edge as ",N,h,d,a.name),r.setEdge(N,h,d,a.name)}}else i.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",s," clusterId:",e)}catch(g){i.error(g)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=u((e,r)=>{const n=r.children(e);let s=[...n];for(const t of n)A.set(t,e),s=[...s,...O(t,r)];return s},"extractDescendants"),P=u((e,r,n)=>{const s=e.edges().filter(a=>a.v===r||a.w===r),t=e.edges().filter(a=>a.v===n||a.w===n),o=s.map(a=>({v:a.v===r?n:a.v,w:a.w===r?r:a.w})),l=t.map(a=>({v:a.v,w:a.w}));return o.filter(a=>l.some(d=>a.v===d.v&&a.w===d.w))},"findCommonEdges"),D=u((e,r,n)=>{const s=r.children(e);if(i.trace("Searching children of id ",e,s),s.length<1)return e;let t;for(const o of s){const l=D(o,r,n),f=P(r,n,l);if(l)if(f.length>0)t=l;else return l}return t},"findNonClusterChild"),S=u(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),U=u((e,r)=>{if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),w.set(n,O(n,e)),c.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const s=e.children(n),t=e.edges();s.length>0?(i.debug("Cluster identified",n,w),t.forEach(o=>{const l=v(o.v,n),f=v(o.w,n);l^f&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",w.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,w)});for(let n of c.keys()){const s=c.get(n).id,t=e.parent(s);t!==n&&c.has(t)&&!c.get(t).externalConnections&&(c.get(n).id=t);const o=e.edges().some(l=>l.v===n);if(s&&c.get(n)?.externalConnections&&o&&L(e,s,n)){const l=T(e,n,e.parent(s));l&&(c.get(n).id=l)}}e.edges().forEach(function(n){const s=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let t=n.v,o=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),t=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name),t!==n.v){const l=e.parent(t);c.get(l).externalConnections=!0,s.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);c.get(l).externalConnections=!0,s.toCluster=n.w}i.warn("Fix Replacing with XXX",t,o,n.name),e.setEdge(t,o,s,n.name)}}),i.warn("Adjusted Graph",C(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=u((e,r)=>{if(i.warn("extractor - ",r,C(e),e.children("D")),r>10){i.error("Bailing out");return}let n=e.nodes(),s=!1;for(const t of n){const o=e.children(t);s=s||o.length>0}if(!s){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,r);for(const t of n)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if(c.get(t)?.clusterData?.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const o=c.get(t).clusterData.dir,l=new y({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,l,t);const f=e.node(t)||{};e.setNode(t,{...f,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:l}),i.warn("Subgraph for cluster with explicit dir created:",t,C(l))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let l=e.graph().rankdir==="TB"?"LR":"TB";c.get(t)?.clusterData?.dir&&(l=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,l));const f=new y({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,f,t);const a=e.node(t)||{};e.setNode(t,{...a,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:f}),i.debug("Old graph after copy",C(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);n=e.nodes(),i.warn("New list of nodes",n);for(const t of n){const o=e.node(t);i.warn(" Now next level",t,o),o?.clusterNode&&k(o.graph,r+1)}},"extractor"),B=u((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach(s=>{const t=e.children(s),o=B(e,t);n=[...n,...o]}),n},"sorter"),W=u(e=>B(e,e.children()),"sortNodesByHierarchy"),L=u((e,r,n)=>{let s=e.parent(r);for(;s&&s!==n;){const t=c.get(s);if(t&&!t.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),T=u((e,r,n)=>{const s=e.children(r)??[];for(const t of s){if(t===n||v(t,n))continue;const o=D(t,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{U as a,c as b,J as c,D as f,W as s,C as w}; diff --git a/internal/webapp/static/assets/chunk-XXDRQBXY-BXTWinaX.js b/internal/webapp/static/assets/chunk-XXDRQBXY-BXTWinaX.js new file mode 100644 index 0000000..4e63638 --- /dev/null +++ b/internal/webapp/static/assets/chunk-XXDRQBXY-BXTWinaX.js @@ -0,0 +1 @@ +import{_ as a,d as o}from"./mermaid.core-B7WVQkyL.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; diff --git a/internal/webapp/static/assets/classDiagram-JCYQIIEL-Bca3rNfW.js b/internal/webapp/static/assets/classDiagram-JCYQIIEL-Bca3rNfW.js new file mode 100644 index 0000000..a9249d9 --- /dev/null +++ b/internal/webapp/static/assets/classDiagram-JCYQIIEL-Bca3rNfW.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-GF5L2VYU-DJ222bgi.js";import{_ as i}from"./mermaid.core-B7WVQkyL.js";import"./chunk-5VM5RSS4-DJhOL3Lj.js";import"./chunk-XXDRQBXY-BXTWinaX.js";import"./chunk-KBJHAD2P-CHI3y1em.js";import"./chunk-2GRJ4B5K-Bng47RDF.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/internal/webapp/static/assets/classDiagram-v2-OCEON4UE-Bca3rNfW.js b/internal/webapp/static/assets/classDiagram-v2-OCEON4UE-Bca3rNfW.js new file mode 100644 index 0000000..a9249d9 --- /dev/null +++ b/internal/webapp/static/assets/classDiagram-v2-OCEON4UE-Bca3rNfW.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-GF5L2VYU-DJ222bgi.js";import{_ as i}from"./mermaid.core-B7WVQkyL.js";import"./chunk-5VM5RSS4-DJhOL3Lj.js";import"./chunk-XXDRQBXY-BXTWinaX.js";import"./chunk-KBJHAD2P-CHI3y1em.js";import"./chunk-2GRJ4B5K-Bng47RDF.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/internal/webapp/static/assets/cose-bilkent-JH36ORCC-BZgxHURk.js b/internal/webapp/static/assets/cose-bilkent-JH36ORCC-BZgxHURk.js new file mode 100644 index 0000000..323a3d2 --- /dev/null +++ b/internal/webapp/static/assets/cose-bilkent-JH36ORCC-BZgxHURk.js @@ -0,0 +1 @@ +import{_ as V,l as k,d as lt}from"./mermaid.core-B7WVQkyL.js";import{c as tt}from"./cytoscape.esm-D3_iZ_3b.js";import{g as gt}from"./_commonjsHelpers-CqkleIqs.js";import"./mermaid-CP2pUOT9.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(Z)),Z.exports}var yt=vt();const Et=gt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=lt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render}; diff --git a/internal/webapp/static/assets/cynefin-VYW2F7L2-CdOzebfq.js b/internal/webapp/static/assets/cynefin-VYW2F7L2-CdOzebfq.js new file mode 100644 index 0000000..e871bdf --- /dev/null +++ b/internal/webapp/static/assets/cynefin-VYW2F7L2-CdOzebfq.js @@ -0,0 +1,166 @@ +import{_ as ut}from"./mermaid-CP2pUOT9.js";var fk=Object.create,Lu=Object.defineProperty,dk=Object.getOwnPropertyDescriptor,vh=Object.getOwnPropertyNames,pk=Object.getPrototypeOf,mk=Object.prototype.hasOwnProperty,s=(t,e)=>Lu(t,"name",{value:e,configurable:!0}),hk=(t,e)=>function(){return t&&(e=(0,t[vh(t)[0]])(t=0)),e},X=(t,e)=>function(){return e||(0,t[vh(t)[0]])((e={exports:{}}).exports,e),e.exports},en=(t,e)=>{for(var r in e)Lu(t,r,{get:e[r],enumerable:!0})},Th=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of vh(e))!mk.call(t,a)&&a!==r&&Lu(t,a,{get:()=>e[a],enumerable:!(n=dk(e,a))||n.enumerable});return t},kf=(t,e,r)=>(Th(t,e,"default"),r),$h=(t,e,r)=>(r=t!=null?fk(pk(t)):{},Th(Lu(r,"default",{value:t,enumerable:!0}),t)),Rh=t=>Th(Lu({},"__esModule",{value:!0}),t),Of={};en(Of,{AnnotatedTextEdit:()=>Ar,ChangeAnnotation:()=>pn,ChangeAnnotationIdentifier:()=>et,CodeAction:()=>Zp,CodeActionContext:()=>Jp,CodeActionKind:()=>Xp,CodeActionTriggerKind:()=>Yl,CodeDescription:()=>wp,CodeLens:()=>Qp,Color:()=>Ac,ColorInformation:()=>Ap,ColorPresentation:()=>Ep,Command:()=>dn,CompletionItem:()=>Gp,CompletionItemKind:()=>kp,CompletionItemLabelDetails:()=>Mp,CompletionItemTag:()=>Lp,CompletionList:()=>Fp,CreateFile:()=>Ca,DeleteFile:()=>Sa,Diagnostic:()=>Wl,DiagnosticRelatedInformation:()=>Ec,DiagnosticSeverity:()=>_p,DiagnosticTag:()=>Sp,DocumentHighlight:()=>Kp,DocumentHighlightKind:()=>Up,DocumentLink:()=>tm,DocumentSymbol:()=>Yp,DocumentUri:()=>Tp,EOL:()=>x$,FoldingRange:()=>Cp,FoldingRangeKind:()=>bp,FormattingOptions:()=>em,Hover:()=>zp,InlayHint:()=>cm,InlayHintKind:()=>_c,InlayHintLabelPart:()=>Sc,InlineCompletionContext:()=>ym,InlineCompletionItem:()=>dm,InlineCompletionList:()=>pm,InlineCompletionTriggerKind:()=>mm,InlineValueContext:()=>um,InlineValueEvaluatableExpression:()=>lm,InlineValueText:()=>sm,InlineValueVariableLookup:()=>om,InsertReplaceEdit:()=>Dp,InsertTextFormat:()=>Op,InsertTextMode:()=>xp,Location:()=>Kl,LocationLink:()=>Rp,MarkedString:()=>Hl,MarkupContent:()=>wa,MarkupKind:()=>Cc,OptionalVersionedTextDocumentIdentifier:()=>ql,ParameterInformation:()=>jp,Position:()=>oe,Range:()=>te,RenameFile:()=>_a,SelectedCompletionInfo:()=>hm,SelectionRange:()=>rm,SemanticTokenModifiers:()=>am,SemanticTokenTypes:()=>nm,SemanticTokens:()=>im,SignatureInformation:()=>Bp,StringValue:()=>fm,SymbolInformation:()=>qp,SymbolKind:()=>Wp,SymbolTag:()=>Vp,TextDocument:()=>vm,TextDocumentEdit:()=>Vl,TextDocumentIdentifier:()=>Ip,TextDocumentItem:()=>Pp,TextEdit:()=>ar,URI:()=>Rc,VersionedTextDocumentIdentifier:()=>Np,WorkspaceChange:()=>D$,WorkspaceEdit:()=>bc,WorkspaceFolder:()=>gm,WorkspaceSymbol:()=>Hp,integer:()=>$p,uinteger:()=>Ul});var Tp,Rc,$p,Ul,oe,te,Kl,Rp,Ac,Ap,Ep,bp,Cp,Ec,_p,Sp,wp,Wl,dn,ar,pn,et,Ar,Vl,Ca,_a,Sa,bc,Pl,Bd,D$,Ip,Np,ql,Pp,Cc,wa,kp,Op,Lp,Dp,xp,Mp,Gp,Fp,Hl,zp,jp,Bp,Up,Kp,Wp,Vp,qp,Hp,Yp,Xp,Yl,Jp,Zp,Qp,em,tm,rm,nm,am,im,sm,om,lm,um,_c,Sc,cm,fm,dm,pm,mm,hm,ym,gm,x$,vm,av,E,Du=hk({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(a){function i(o){return typeof o=="string"}s(i,"is"),a.is=i})(Tp||(Tp={})),(function(a){function i(o){return typeof o=="string"}s(i,"is"),a.is=i})(Rc||(Rc={})),(function(a){a.MIN_VALUE=-2147483648,a.MAX_VALUE=2147483647;function i(o){return typeof o=="number"&&a.MIN_VALUE<=o&&o<=a.MAX_VALUE}s(i,"is"),a.is=i})($p||($p={})),(function(a){a.MIN_VALUE=0,a.MAX_VALUE=2147483647;function i(o){return typeof o=="number"&&a.MIN_VALUE<=o&&o<=a.MAX_VALUE}s(i,"is"),a.is=i})(Ul||(Ul={})),(function(a){function i(u,l){return u===Number.MAX_VALUE&&(u=Ul.MAX_VALUE),l===Number.MAX_VALUE&&(l=Ul.MAX_VALUE),{line:u,character:l}}s(i,"create"),a.create=i;function o(u){let l=u;return E.objectLiteral(l)&&E.uinteger(l.line)&&E.uinteger(l.character)}s(o,"is"),a.is=o})(oe||(oe={})),(function(a){function i(u,l,c,f){if(E.uinteger(u)&&E.uinteger(l)&&E.uinteger(c)&&E.uinteger(f))return{start:oe.create(u,l),end:oe.create(c,f)};if(oe.is(u)&&oe.is(l))return{start:u,end:l};throw new Error(`Range#create called with invalid arguments[${u}, ${l}, ${c}, ${f}]`)}s(i,"create"),a.create=i;function o(u){let l=u;return E.objectLiteral(l)&&oe.is(l.start)&&oe.is(l.end)}s(o,"is"),a.is=o})(te||(te={})),(function(a){function i(u,l){return{uri:u,range:l}}s(i,"create"),a.create=i;function o(u){let l=u;return E.objectLiteral(l)&&te.is(l.range)&&(E.string(l.uri)||E.undefined(l.uri))}s(o,"is"),a.is=o})(Kl||(Kl={})),(function(a){function i(u,l,c,f){return{targetUri:u,targetRange:l,targetSelectionRange:c,originSelectionRange:f}}s(i,"create"),a.create=i;function o(u){let l=u;return E.objectLiteral(l)&&te.is(l.targetRange)&&E.string(l.targetUri)&&te.is(l.targetSelectionRange)&&(te.is(l.originSelectionRange)||E.undefined(l.originSelectionRange))}s(o,"is"),a.is=o})(Rp||(Rp={})),(function(a){function i(u,l,c,f){return{red:u,green:l,blue:c,alpha:f}}s(i,"create"),a.create=i;function o(u){const l=u;return E.objectLiteral(l)&&E.numberRange(l.red,0,1)&&E.numberRange(l.green,0,1)&&E.numberRange(l.blue,0,1)&&E.numberRange(l.alpha,0,1)}s(o,"is"),a.is=o})(Ac||(Ac={})),(function(a){function i(u,l){return{range:u,color:l}}s(i,"create"),a.create=i;function o(u){const l=u;return E.objectLiteral(l)&&te.is(l.range)&&Ac.is(l.color)}s(o,"is"),a.is=o})(Ap||(Ap={})),(function(a){function i(u,l,c){return{label:u,textEdit:l,additionalTextEdits:c}}s(i,"create"),a.create=i;function o(u){const l=u;return E.objectLiteral(l)&&E.string(l.label)&&(E.undefined(l.textEdit)||ar.is(l))&&(E.undefined(l.additionalTextEdits)||E.typedArray(l.additionalTextEdits,ar.is))}s(o,"is"),a.is=o})(Ep||(Ep={})),(function(a){a.Comment="comment",a.Imports="imports",a.Region="region"})(bp||(bp={})),(function(a){function i(u,l,c,f,d,p){const y={startLine:u,endLine:l};return E.defined(c)&&(y.startCharacter=c),E.defined(f)&&(y.endCharacter=f),E.defined(d)&&(y.kind=d),E.defined(p)&&(y.collapsedText=p),y}s(i,"create"),a.create=i;function o(u){const l=u;return E.objectLiteral(l)&&E.uinteger(l.startLine)&&E.uinteger(l.startLine)&&(E.undefined(l.startCharacter)||E.uinteger(l.startCharacter))&&(E.undefined(l.endCharacter)||E.uinteger(l.endCharacter))&&(E.undefined(l.kind)||E.string(l.kind))}s(o,"is"),a.is=o})(Cp||(Cp={})),(function(a){function i(u,l){return{location:u,message:l}}s(i,"create"),a.create=i;function o(u){let l=u;return E.defined(l)&&Kl.is(l.location)&&E.string(l.message)}s(o,"is"),a.is=o})(Ec||(Ec={})),(function(a){a.Error=1,a.Warning=2,a.Information=3,a.Hint=4})(_p||(_p={})),(function(a){a.Unnecessary=1,a.Deprecated=2})(Sp||(Sp={})),(function(a){function i(o){const u=o;return E.objectLiteral(u)&&E.string(u.href)}s(i,"is"),a.is=i})(wp||(wp={})),(function(a){function i(u,l,c,f,d,p){let y={range:u,message:l};return E.defined(c)&&(y.severity=c),E.defined(f)&&(y.code=f),E.defined(d)&&(y.source=d),E.defined(p)&&(y.relatedInformation=p),y}s(i,"create"),a.create=i;function o(u){var l;let c=u;return E.defined(c)&&te.is(c.range)&&E.string(c.message)&&(E.number(c.severity)||E.undefined(c.severity))&&(E.integer(c.code)||E.string(c.code)||E.undefined(c.code))&&(E.undefined(c.codeDescription)||E.string((l=c.codeDescription)===null||l===void 0?void 0:l.href))&&(E.string(c.source)||E.undefined(c.source))&&(E.undefined(c.relatedInformation)||E.typedArray(c.relatedInformation,Ec.is))}s(o,"is"),a.is=o})(Wl||(Wl={})),(function(a){function i(u,l,...c){let f={title:u,command:l};return E.defined(c)&&c.length>0&&(f.arguments=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return E.defined(l)&&E.string(l.title)&&E.string(l.command)}s(o,"is"),a.is=o})(dn||(dn={})),(function(a){function i(c,f){return{range:c,newText:f}}s(i,"replace"),a.replace=i;function o(c,f){return{range:{start:c,end:c},newText:f}}s(o,"insert"),a.insert=o;function u(c){return{range:c,newText:""}}s(u,"del"),a.del=u;function l(c){const f=c;return E.objectLiteral(f)&&E.string(f.newText)&&te.is(f.range)}s(l,"is"),a.is=l})(ar||(ar={})),(function(a){function i(u,l,c){const f={label:u};return l!==void 0&&(f.needsConfirmation=l),c!==void 0&&(f.description=c),f}s(i,"create"),a.create=i;function o(u){const l=u;return E.objectLiteral(l)&&E.string(l.label)&&(E.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(E.string(l.description)||l.description===void 0)}s(o,"is"),a.is=o})(pn||(pn={})),(function(a){function i(o){const u=o;return E.string(u)}s(i,"is"),a.is=i})(et||(et={})),(function(a){function i(c,f,d){return{range:c,newText:f,annotationId:d}}s(i,"replace"),a.replace=i;function o(c,f,d){return{range:{start:c,end:c},newText:f,annotationId:d}}s(o,"insert"),a.insert=o;function u(c,f){return{range:c,newText:"",annotationId:f}}s(u,"del"),a.del=u;function l(c){const f=c;return ar.is(f)&&(pn.is(f.annotationId)||et.is(f.annotationId))}s(l,"is"),a.is=l})(Ar||(Ar={})),(function(a){function i(u,l){return{textDocument:u,edits:l}}s(i,"create"),a.create=i;function o(u){let l=u;return E.defined(l)&&ql.is(l.textDocument)&&Array.isArray(l.edits)}s(o,"is"),a.is=o})(Vl||(Vl={})),(function(a){function i(u,l,c){let f={kind:"create",uri:u};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(f.options=l),c!==void 0&&(f.annotationId=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return l&&l.kind==="create"&&E.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||E.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||E.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||et.is(l.annotationId))}s(o,"is"),a.is=o})(Ca||(Ca={})),(function(a){function i(u,l,c,f){let d={kind:"rename",oldUri:u,newUri:l};return c!==void 0&&(c.overwrite!==void 0||c.ignoreIfExists!==void 0)&&(d.options=c),f!==void 0&&(d.annotationId=f),d}s(i,"create"),a.create=i;function o(u){let l=u;return l&&l.kind==="rename"&&E.string(l.oldUri)&&E.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||E.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||E.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||et.is(l.annotationId))}s(o,"is"),a.is=o})(_a||(_a={})),(function(a){function i(u,l,c){let f={kind:"delete",uri:u};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(f.options=l),c!==void 0&&(f.annotationId=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return l&&l.kind==="delete"&&E.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||E.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||E.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||et.is(l.annotationId))}s(o,"is"),a.is=o})(Sa||(Sa={})),(function(a){function i(o){let u=o;return u&&(u.changes!==void 0||u.documentChanges!==void 0)&&(u.documentChanges===void 0||u.documentChanges.every(l=>E.string(l.kind)?Ca.is(l)||_a.is(l)||Sa.is(l):Vl.is(l)))}s(i,"is"),a.is=i})(bc||(bc={})),Pl=(t=class{constructor(i,o){this.edits=i,this.changeAnnotations=o}insert(i,o,u){let l,c;if(u===void 0?l=ar.insert(i,o):et.is(u)?(c=u,l=Ar.insert(i,o,u)):(this.assertChangeAnnotations(this.changeAnnotations),c=this.changeAnnotations.manage(u),l=Ar.insert(i,o,c)),this.edits.push(l),c!==void 0)return c}replace(i,o,u){let l,c;if(u===void 0?l=ar.replace(i,o):et.is(u)?(c=u,l=Ar.replace(i,o,u)):(this.assertChangeAnnotations(this.changeAnnotations),c=this.changeAnnotations.manage(u),l=Ar.replace(i,o,c)),this.edits.push(l),c!==void 0)return c}delete(i,o){let u,l;if(o===void 0?u=ar.del(i):et.is(o)?(l=o,u=Ar.del(i,o)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(o),u=Ar.del(i,l)),this.edits.push(u),l!==void 0)return l}add(i){this.edits.push(i)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(i){if(i===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},s(t,"TextEditChangeImpl"),t),Bd=(e=class{constructor(i){this._annotations=i===void 0?Object.create(null):i,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(i,o){let u;if(et.is(i)?u=i:(u=this.nextId(),o=i),this._annotations[u]!==void 0)throw new Error(`Id ${u} is already in use.`);if(o===void 0)throw new Error(`No annotation provided for id ${u}`);return this._annotations[u]=o,this._size++,u}nextId(){return this._counter++,this._counter.toString()}},s(e,"ChangeAnnotations"),e),D$=(r=class{constructor(i){this._textEditChanges=Object.create(null),i!==void 0?(this._workspaceEdit=i,i.documentChanges?(this._changeAnnotations=new Bd(i.changeAnnotations),i.changeAnnotations=this._changeAnnotations.all(),i.documentChanges.forEach(o=>{if(Vl.is(o)){const u=new Pl(o.edits,this._changeAnnotations);this._textEditChanges[o.textDocument.uri]=u}})):i.changes&&Object.keys(i.changes).forEach(o=>{const u=new Pl(i.changes[o]);this._textEditChanges[o]=u})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(i){if(ql.is(i)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const o={uri:i.uri,version:i.version};let u=this._textEditChanges[o.uri];if(!u){const l=[],c={textDocument:o,edits:l};this._workspaceEdit.documentChanges.push(c),u=new Pl(l,this._changeAnnotations),this._textEditChanges[o.uri]=u}return u}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let o=this._textEditChanges[i];if(!o){let u=[];this._workspaceEdit.changes[i]=u,o=new Pl(u),this._textEditChanges[i]=o}return o}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Bd,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(i,o,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;pn.is(o)||et.is(o)?l=o:u=o;let c,f;if(l===void 0?c=Ca.create(i,u):(f=et.is(l)?l:this._changeAnnotations.manage(l),c=Ca.create(i,u,f)),this._workspaceEdit.documentChanges.push(c),f!==void 0)return f}renameFile(i,o,u,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let c;pn.is(u)||et.is(u)?c=u:l=u;let f,d;if(c===void 0?f=_a.create(i,o,l):(d=et.is(c)?c:this._changeAnnotations.manage(c),f=_a.create(i,o,l,d)),this._workspaceEdit.documentChanges.push(f),d!==void 0)return d}deleteFile(i,o,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;pn.is(o)||et.is(o)?l=o:u=o;let c,f;if(l===void 0?c=Sa.create(i,u):(f=et.is(l)?l:this._changeAnnotations.manage(l),c=Sa.create(i,u,f)),this._workspaceEdit.documentChanges.push(c),f!==void 0)return f}},s(r,"WorkspaceChange"),r),(function(a){function i(u){return{uri:u}}s(i,"create"),a.create=i;function o(u){let l=u;return E.defined(l)&&E.string(l.uri)}s(o,"is"),a.is=o})(Ip||(Ip={})),(function(a){function i(u,l){return{uri:u,version:l}}s(i,"create"),a.create=i;function o(u){let l=u;return E.defined(l)&&E.string(l.uri)&&E.integer(l.version)}s(o,"is"),a.is=o})(Np||(Np={})),(function(a){function i(u,l){return{uri:u,version:l}}s(i,"create"),a.create=i;function o(u){let l=u;return E.defined(l)&&E.string(l.uri)&&(l.version===null||E.integer(l.version))}s(o,"is"),a.is=o})(ql||(ql={})),(function(a){function i(u,l,c,f){return{uri:u,languageId:l,version:c,text:f}}s(i,"create"),a.create=i;function o(u){let l=u;return E.defined(l)&&E.string(l.uri)&&E.string(l.languageId)&&E.integer(l.version)&&E.string(l.text)}s(o,"is"),a.is=o})(Pp||(Pp={})),(function(a){a.PlainText="plaintext",a.Markdown="markdown";function i(o){const u=o;return u===a.PlainText||u===a.Markdown}s(i,"is"),a.is=i})(Cc||(Cc={})),(function(a){function i(o){const u=o;return E.objectLiteral(o)&&Cc.is(u.kind)&&E.string(u.value)}s(i,"is"),a.is=i})(wa||(wa={})),(function(a){a.Text=1,a.Method=2,a.Function=3,a.Constructor=4,a.Field=5,a.Variable=6,a.Class=7,a.Interface=8,a.Module=9,a.Property=10,a.Unit=11,a.Value=12,a.Enum=13,a.Keyword=14,a.Snippet=15,a.Color=16,a.File=17,a.Reference=18,a.Folder=19,a.EnumMember=20,a.Constant=21,a.Struct=22,a.Event=23,a.Operator=24,a.TypeParameter=25})(kp||(kp={})),(function(a){a.PlainText=1,a.Snippet=2})(Op||(Op={})),(function(a){a.Deprecated=1})(Lp||(Lp={})),(function(a){function i(u,l,c){return{newText:u,insert:l,replace:c}}s(i,"create"),a.create=i;function o(u){const l=u;return l&&E.string(l.newText)&&te.is(l.insert)&&te.is(l.replace)}s(o,"is"),a.is=o})(Dp||(Dp={})),(function(a){a.asIs=1,a.adjustIndentation=2})(xp||(xp={})),(function(a){function i(o){const u=o;return u&&(E.string(u.detail)||u.detail===void 0)&&(E.string(u.description)||u.description===void 0)}s(i,"is"),a.is=i})(Mp||(Mp={})),(function(a){function i(o){return{label:o}}s(i,"create"),a.create=i})(Gp||(Gp={})),(function(a){function i(o,u){return{items:o||[],isIncomplete:!!u}}s(i,"create"),a.create=i})(Fp||(Fp={})),(function(a){function i(u){return u.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}s(i,"fromPlainText"),a.fromPlainText=i;function o(u){const l=u;return E.string(l)||E.objectLiteral(l)&&E.string(l.language)&&E.string(l.value)}s(o,"is"),a.is=o})(Hl||(Hl={})),(function(a){function i(o){let u=o;return!!u&&E.objectLiteral(u)&&(wa.is(u.contents)||Hl.is(u.contents)||E.typedArray(u.contents,Hl.is))&&(o.range===void 0||te.is(o.range))}s(i,"is"),a.is=i})(zp||(zp={})),(function(a){function i(o,u){return u?{label:o,documentation:u}:{label:o}}s(i,"create"),a.create=i})(jp||(jp={})),(function(a){function i(o,u,...l){let c={label:o};return E.defined(u)&&(c.documentation=u),E.defined(l)?c.parameters=l:c.parameters=[],c}s(i,"create"),a.create=i})(Bp||(Bp={})),(function(a){a.Text=1,a.Read=2,a.Write=3})(Up||(Up={})),(function(a){function i(o,u){let l={range:o};return E.number(u)&&(l.kind=u),l}s(i,"create"),a.create=i})(Kp||(Kp={})),(function(a){a.File=1,a.Module=2,a.Namespace=3,a.Package=4,a.Class=5,a.Method=6,a.Property=7,a.Field=8,a.Constructor=9,a.Enum=10,a.Interface=11,a.Function=12,a.Variable=13,a.Constant=14,a.String=15,a.Number=16,a.Boolean=17,a.Array=18,a.Object=19,a.Key=20,a.Null=21,a.EnumMember=22,a.Struct=23,a.Event=24,a.Operator=25,a.TypeParameter=26})(Wp||(Wp={})),(function(a){a.Deprecated=1})(Vp||(Vp={})),(function(a){function i(o,u,l,c,f){let d={name:o,kind:u,location:{uri:c,range:l}};return f&&(d.containerName=f),d}s(i,"create"),a.create=i})(qp||(qp={})),(function(a){function i(o,u,l,c){return c!==void 0?{name:o,kind:u,location:{uri:l,range:c}}:{name:o,kind:u,location:{uri:l}}}s(i,"create"),a.create=i})(Hp||(Hp={})),(function(a){function i(u,l,c,f,d,p){let y={name:u,detail:l,kind:c,range:f,selectionRange:d};return p!==void 0&&(y.children=p),y}s(i,"create"),a.create=i;function o(u){let l=u;return l&&E.string(l.name)&&E.number(l.kind)&&te.is(l.range)&&te.is(l.selectionRange)&&(l.detail===void 0||E.string(l.detail))&&(l.deprecated===void 0||E.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}s(o,"is"),a.is=o})(Yp||(Yp={})),(function(a){a.Empty="",a.QuickFix="quickfix",a.Refactor="refactor",a.RefactorExtract="refactor.extract",a.RefactorInline="refactor.inline",a.RefactorRewrite="refactor.rewrite",a.Source="source",a.SourceOrganizeImports="source.organizeImports",a.SourceFixAll="source.fixAll"})(Xp||(Xp={})),(function(a){a.Invoked=1,a.Automatic=2})(Yl||(Yl={})),(function(a){function i(u,l,c){let f={diagnostics:u};return l!=null&&(f.only=l),c!=null&&(f.triggerKind=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return E.defined(l)&&E.typedArray(l.diagnostics,Wl.is)&&(l.only===void 0||E.typedArray(l.only,E.string))&&(l.triggerKind===void 0||l.triggerKind===Yl.Invoked||l.triggerKind===Yl.Automatic)}s(o,"is"),a.is=o})(Jp||(Jp={})),(function(a){function i(u,l,c){let f={title:u},d=!0;return typeof l=="string"?(d=!1,f.kind=l):dn.is(l)?f.command=l:f.edit=l,d&&c!==void 0&&(f.kind=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return l&&E.string(l.title)&&(l.diagnostics===void 0||E.typedArray(l.diagnostics,Wl.is))&&(l.kind===void 0||E.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||dn.is(l.command))&&(l.isPreferred===void 0||E.boolean(l.isPreferred))&&(l.edit===void 0||bc.is(l.edit))}s(o,"is"),a.is=o})(Zp||(Zp={})),(function(a){function i(u,l){let c={range:u};return E.defined(l)&&(c.data=l),c}s(i,"create"),a.create=i;function o(u){let l=u;return E.defined(l)&&te.is(l.range)&&(E.undefined(l.command)||dn.is(l.command))}s(o,"is"),a.is=o})(Qp||(Qp={})),(function(a){function i(u,l){return{tabSize:u,insertSpaces:l}}s(i,"create"),a.create=i;function o(u){let l=u;return E.defined(l)&&E.uinteger(l.tabSize)&&E.boolean(l.insertSpaces)}s(o,"is"),a.is=o})(em||(em={})),(function(a){function i(u,l,c){return{range:u,target:l,data:c}}s(i,"create"),a.create=i;function o(u){let l=u;return E.defined(l)&&te.is(l.range)&&(E.undefined(l.target)||E.string(l.target))}s(o,"is"),a.is=o})(tm||(tm={})),(function(a){function i(u,l){return{range:u,parent:l}}s(i,"create"),a.create=i;function o(u){let l=u;return E.objectLiteral(l)&&te.is(l.range)&&(l.parent===void 0||a.is(l.parent))}s(o,"is"),a.is=o})(rm||(rm={})),(function(a){a.namespace="namespace",a.type="type",a.class="class",a.enum="enum",a.interface="interface",a.struct="struct",a.typeParameter="typeParameter",a.parameter="parameter",a.variable="variable",a.property="property",a.enumMember="enumMember",a.event="event",a.function="function",a.method="method",a.macro="macro",a.keyword="keyword",a.modifier="modifier",a.comment="comment",a.string="string",a.number="number",a.regexp="regexp",a.operator="operator",a.decorator="decorator"})(nm||(nm={})),(function(a){a.declaration="declaration",a.definition="definition",a.readonly="readonly",a.static="static",a.deprecated="deprecated",a.abstract="abstract",a.async="async",a.modification="modification",a.documentation="documentation",a.defaultLibrary="defaultLibrary"})(am||(am={})),(function(a){function i(o){const u=o;return E.objectLiteral(u)&&(u.resultId===void 0||typeof u.resultId=="string")&&Array.isArray(u.data)&&(u.data.length===0||typeof u.data[0]=="number")}s(i,"is"),a.is=i})(im||(im={})),(function(a){function i(u,l){return{range:u,text:l}}s(i,"create"),a.create=i;function o(u){const l=u;return l!=null&&te.is(l.range)&&E.string(l.text)}s(o,"is"),a.is=o})(sm||(sm={})),(function(a){function i(u,l,c){return{range:u,variableName:l,caseSensitiveLookup:c}}s(i,"create"),a.create=i;function o(u){const l=u;return l!=null&&te.is(l.range)&&E.boolean(l.caseSensitiveLookup)&&(E.string(l.variableName)||l.variableName===void 0)}s(o,"is"),a.is=o})(om||(om={})),(function(a){function i(u,l){return{range:u,expression:l}}s(i,"create"),a.create=i;function o(u){const l=u;return l!=null&&te.is(l.range)&&(E.string(l.expression)||l.expression===void 0)}s(o,"is"),a.is=o})(lm||(lm={})),(function(a){function i(u,l){return{frameId:u,stoppedLocation:l}}s(i,"create"),a.create=i;function o(u){const l=u;return E.defined(l)&&te.is(u.stoppedLocation)}s(o,"is"),a.is=o})(um||(um={})),(function(a){a.Type=1,a.Parameter=2;function i(o){return o===1||o===2}s(i,"is"),a.is=i})(_c||(_c={})),(function(a){function i(u){return{value:u}}s(i,"create"),a.create=i;function o(u){const l=u;return E.objectLiteral(l)&&(l.tooltip===void 0||E.string(l.tooltip)||wa.is(l.tooltip))&&(l.location===void 0||Kl.is(l.location))&&(l.command===void 0||dn.is(l.command))}s(o,"is"),a.is=o})(Sc||(Sc={})),(function(a){function i(u,l,c){const f={position:u,label:l};return c!==void 0&&(f.kind=c),f}s(i,"create"),a.create=i;function o(u){const l=u;return E.objectLiteral(l)&&oe.is(l.position)&&(E.string(l.label)||E.typedArray(l.label,Sc.is))&&(l.kind===void 0||_c.is(l.kind))&&l.textEdits===void 0||E.typedArray(l.textEdits,ar.is)&&(l.tooltip===void 0||E.string(l.tooltip)||wa.is(l.tooltip))&&(l.paddingLeft===void 0||E.boolean(l.paddingLeft))&&(l.paddingRight===void 0||E.boolean(l.paddingRight))}s(o,"is"),a.is=o})(cm||(cm={})),(function(a){function i(o){return{kind:"snippet",value:o}}s(i,"createSnippet"),a.createSnippet=i})(fm||(fm={})),(function(a){function i(o,u,l,c){return{insertText:o,filterText:u,range:l,command:c}}s(i,"create"),a.create=i})(dm||(dm={})),(function(a){function i(o){return{items:o}}s(i,"create"),a.create=i})(pm||(pm={})),(function(a){a.Invoked=0,a.Automatic=1})(mm||(mm={})),(function(a){function i(o,u){return{range:o,text:u}}s(i,"create"),a.create=i})(hm||(hm={})),(function(a){function i(o,u){return{triggerKind:o,selectedCompletionInfo:u}}s(i,"create"),a.create=i})(ym||(ym={})),(function(a){function i(o){const u=o;return E.objectLiteral(u)&&Rc.is(u.uri)&&E.string(u.name)}s(i,"is"),a.is=i})(gm||(gm={})),x$=[` +`,`\r +`,"\r"],(function(a){function i(c,f,d,p){return new av(c,f,d,p)}s(i,"create"),a.create=i;function o(c){let f=c;return!!(E.defined(f)&&E.string(f.uri)&&(E.undefined(f.languageId)||E.string(f.languageId))&&E.uinteger(f.lineCount)&&E.func(f.getText)&&E.func(f.positionAt)&&E.func(f.offsetAt))}s(o,"is"),a.is=o;function u(c,f){let d=c.getText(),p=l(f,(h,T)=>{let b=h.range.start.line-T.range.start.line;return b===0?h.range.start.character-T.range.start.character:b}),y=d.length;for(let h=p.length-1;h>=0;h--){let T=p[h],b=c.offsetAt(T.range.start),v=c.offsetAt(T.range.end);if(v<=y)d=d.substring(0,b)+T.newText+d.substring(v,d.length);else throw new Error("Overlapping edit");y=b}return d}s(u,"applyEdits"),a.applyEdits=u;function l(c,f){if(c.length<=1)return c;const d=c.length/2|0,p=c.slice(0,d),y=c.slice(d);l(p,f),l(y,f);let h=0,T=0,b=0;for(;h0&&i.push(o.length),this._lineOffsets=i}return this._lineOffsets}positionAt(i){i=Math.max(Math.min(i,this._content.length),0);let o=this.getLineOffsets(),u=0,l=o.length;if(l===0)return oe.create(0,i);for(;ui?l=f:u=f+1}let c=u-1;return oe.create(c,i-o[c])}offsetAt(i){let o=this.getLineOffsets();if(i.line>=o.length)return this._content.length;if(i.line<0)return 0;let u=o[i.line],l=i.line+1"u"}s(u,"undefined"),a.undefined=u;function l(v){return v===!0||v===!1}s(l,"boolean"),a.boolean=l;function c(v){return i.call(v)==="[object String]"}s(c,"string"),a.string=c;function f(v){return i.call(v)==="[object Number]"}s(f,"number"),a.number=f;function d(v,w,C){return i.call(v)==="[object Number]"&&w<=v&&v<=C}s(d,"numberRange"),a.numberRange=d;function p(v){return i.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}s(p,"integer"),a.integer=p;function y(v){return i.call(v)==="[object Number]"&&0<=v&&v<=2147483647}s(y,"uinteger"),a.uinteger=y;function h(v){return i.call(v)==="[object Function]"}s(h,"func"),a.func=h;function T(v){return v!==null&&typeof v=="object"}s(T,"objectLiteral"),a.objectLiteral=T;function b(v,w){return Array.isArray(v)&&v.every(w)}s(b,"typedArray"),a.typedArray=b})(E||(E={}))}}),Wn=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}s(r,"RAL"),(function(n){function a(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");e=i}s(a,"install"),n.install=a})(r||(r={})),t.default=r}}),xu=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}s(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}s(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}s(n,"number"),t.number=n;function a(l){return l instanceof Error}s(a,"error"),t.error=a;function i(l){return typeof l=="function"}s(i,"func"),t.func=i;function o(l){return Array.isArray(l)}s(o,"array"),t.array=o;function u(l){return o(l)&&l.every(c=>r(c))}s(u,"stringArray"),t.stringArray=u}}),nl=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=Wn(),r;(function(u){const l={dispose(){}};u.None=function(){return l}})(r||(t.Event=r={}));var n=(i=class{add(l,c=null,f){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(c),Array.isArray(f)&&f.push({dispose:s(()=>this.remove(l,c),"dispose")})}remove(l,c=null){if(!this._callbacks)return;let f=!1;for(let d=0,p=this._callbacks.length;d{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,c);const d={dispose:s(()=>{this._callbacks&&(this._callbacks.remove(l,c),d.dispose=o._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(f)&&f.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},s(o,"Emitter"),o);t.Emitter=a,a._noop=function(){}}}),Lf=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,c;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=Wn(),r=xu(),n=nl(),a;(function(f){f.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),f.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function d(p){const y=p;return y&&(y===f.None||y===f.Cancelled||r.boolean(y.isCancellationRequested)&&!!y.onCancellationRequested)}s(d,"is"),f.is=d})(a||(t.CancellationToken=a={}));var i=Object.freeze(function(f,d){const p=(0,e.default)().timer.setTimeout(f.bind(d),0);return{dispose(){p.dispose()}}}),o=(l=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},s(l,"MutableToken"),l),u=(c=class{get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token.cancel():this._token=a.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=a.None}},s(c,"CancellationTokenSource"),c);t.CancellationTokenSource=u}}),M$=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var k,_,$,I,R,A,S,L,x,O,z,M,Y,q,Z,ae,Oe,pe,Ee,Ve,Le,ee,Qe,ce,qe;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var e=xu(),r;(function(ge){ge.ParseError=-32700,ge.InvalidRequest=-32600,ge.MethodNotFound=-32601,ge.InvalidParams=-32602,ge.InternalError=-32603,ge.jsonrpcReservedErrorRangeStart=-32099,ge.serverErrorStart=-32099,ge.MessageWriteError=-32099,ge.MessageReadError=-32098,ge.PendingResponseRejected=-32097,ge.ConnectionInactive=-32096,ge.ServerNotInitialized=-32002,ge.UnknownErrorCode=-32001,ge.jsonrpcReservedErrorRangeEnd=-32e3,ge.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(k=class extends Error{constructor(G,je,Qt){super(je),this.code=e.number(G)?G:r.UnknownErrorCode,this.data=Qt,Object.setPrototypeOf(this,k.prototype)}toJson(){const G={code:this.code,message:this.message};return this.data!==void 0&&(G.data=this.data),G}},s(k,"ResponseError"),k);t.ResponseError=n;var a=(_=class{constructor(G){this.kind=G}static is(G){return G===_.auto||G===_.byName||G===_.byPosition}toString(){return this.kind}},s(_,"ParameterStructures"),_);t.ParameterStructures=a,a.auto=new a("auto"),a.byPosition=new a("byPosition"),a.byName=new a("byName");var i=($=class{constructor(G,je){this.method=G,this.numberOfParams=je}get parameterStructures(){return a.auto}},s($,"AbstractMessageSignature"),$);t.AbstractMessageSignature=i;var o=(I=class extends i{constructor(G){super(G,0)}},s(I,"RequestType0"),I);t.RequestType0=o;var u=(R=class extends i{constructor(G,je=a.auto){super(G,1),this._parameterStructures=je}get parameterStructures(){return this._parameterStructures}},s(R,"RequestType"),R);t.RequestType=u;var l=(A=class extends i{constructor(G,je=a.auto){super(G,1),this._parameterStructures=je}get parameterStructures(){return this._parameterStructures}},s(A,"RequestType1"),A);t.RequestType1=l;var c=(S=class extends i{constructor(G){super(G,2)}},s(S,"RequestType2"),S);t.RequestType2=c;var f=(L=class extends i{constructor(G){super(G,3)}},s(L,"RequestType3"),L);t.RequestType3=f;var d=(x=class extends i{constructor(G){super(G,4)}},s(x,"RequestType4"),x);t.RequestType4=d;var p=(O=class extends i{constructor(G){super(G,5)}},s(O,"RequestType5"),O);t.RequestType5=p;var y=(z=class extends i{constructor(G){super(G,6)}},s(z,"RequestType6"),z);t.RequestType6=y;var h=(M=class extends i{constructor(G){super(G,7)}},s(M,"RequestType7"),M);t.RequestType7=h;var T=(Y=class extends i{constructor(G){super(G,8)}},s(Y,"RequestType8"),Y);t.RequestType8=T;var b=(q=class extends i{constructor(G){super(G,9)}},s(q,"RequestType9"),q);t.RequestType9=b;var v=(Z=class extends i{constructor(G,je=a.auto){super(G,1),this._parameterStructures=je}get parameterStructures(){return this._parameterStructures}},s(Z,"NotificationType"),Z);t.NotificationType=v;var w=(ae=class extends i{constructor(G){super(G,0)}},s(ae,"NotificationType0"),ae);t.NotificationType0=w;var C=(Oe=class extends i{constructor(G,je=a.auto){super(G,1),this._parameterStructures=je}get parameterStructures(){return this._parameterStructures}},s(Oe,"NotificationType1"),Oe);t.NotificationType1=C;var N=(pe=class extends i{constructor(G){super(G,2)}},s(pe,"NotificationType2"),pe);t.NotificationType2=N;var B=(Ee=class extends i{constructor(G){super(G,3)}},s(Ee,"NotificationType3"),Ee);t.NotificationType3=B;var ne=(Ve=class extends i{constructor(G){super(G,4)}},s(Ve,"NotificationType4"),Ve);t.NotificationType4=ne;var J=(Le=class extends i{constructor(G){super(G,5)}},s(Le,"NotificationType5"),Le);t.NotificationType5=J;var he=(ee=class extends i{constructor(G){super(G,6)}},s(ee,"NotificationType6"),ee);t.NotificationType6=he;var Ae=(Qe=class extends i{constructor(G){super(G,7)}},s(Qe,"NotificationType7"),Qe);t.NotificationType7=Ae;var ye=(ce=class extends i{constructor(G){super(G,8)}},s(ce,"NotificationType8"),ce);t.NotificationType8=ye;var ue=(qe=class extends i{constructor(G){super(G,9)}},s(qe,"NotificationType9"),qe);t.NotificationType9=ue;var ot;(function(ge){function G(Dt){const ve=Dt;return ve&&e.string(ve.method)&&(e.string(ve.id)||e.number(ve.id))}s(G,"isRequest"),ge.isRequest=G;function je(Dt){const ve=Dt;return ve&&e.string(ve.method)&&Dt.id===void 0}s(je,"isNotification"),ge.isNotification=je;function Qt(Dt){const ve=Dt;return ve&&(ve.result!==void 0||!!ve.error)&&(e.string(ve.id)||e.number(ve.id)||ve.id===null)}s(Qt,"isResponse"),ge.isResponse=Qt})(ot||(t.Message=ot={}))}}),G$=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var i,o;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(u){u.None=0,u.First=1,u.AsOld=u.First,u.Last=2,u.AsNew=u.Last})(r||(t.Touch=r={}));var n=(i=class{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(l){return this._map.has(l)}get(l,c=r.None){const f=this._map.get(l);if(f)return c!==r.None&&this.touch(f,c),f.value}set(l,c,f=r.None){let d=this._map.get(l);if(d)d.value=c,f!==r.None&&this.touch(d,f);else{switch(d={key:l,value:c,next:void 0,previous:void 0},f){case r.None:this.addItemLast(d);break;case r.First:this.addItemFirst(d);break;case r.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(l,d),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const c=this._map.get(l);if(c)return this._map.delete(l),this.removeItem(c),this._size--,c.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,c){const f=this._state;let d=this._head;for(;d;){if(c?l.bind(c)(d.value,d.key,this):l(d.value,d.key,this),this._state!==f)throw new Error("LinkedMap got modified during iteration.");d=d.next}}keys(){const l=this._state;let c=this._head;const f={[Symbol.iterator]:()=>f,next:s(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(c){const d={value:c.key,done:!1};return c=c.next,d}else return{value:void 0,done:!0}},"next")};return f}values(){const l=this._state;let c=this._head;const f={[Symbol.iterator]:()=>f,next:s(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(c){const d={value:c.value,done:!1};return c=c.next,d}else return{value:void 0,done:!0}},"next")};return f}entries(){const l=this._state;let c=this._head;const f={[Symbol.iterator]:()=>f,next:s(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(c){const d={value:[c.key,c.value],done:!1};return c=c.next,d}else return{value:void 0,done:!0}},"next")};return f}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let c=this._head,f=this.size;for(;c&&f>l;)this._map.delete(c.key),c=c.next,f--;this._head=c,this._size=f,c&&(c.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const c=l.next,f=l.previous;if(!c||!f)throw new Error("Invalid list");c.previous=f,f.next=c}l.next=void 0,l.previous=void 0,this._state++}touch(l,c){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(c!==r.First&&c!==r.Last)){if(c===r.First){if(l===this._head)return;const f=l.next,d=l.previous;l===this._tail?(d.next=void 0,this._tail=d):(f.previous=d,d.next=f),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(c===r.Last){if(l===this._tail)return;const f=l.next,d=l.previous;l===this._head?(f.previous=void 0,this._head=f):(f.previous=d,d.next=f),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((c,f)=>{l.push([f,c])}),l}fromJSON(l){this.clear();for(const[c,f]of l)this.set(c,f)}},s(i,"LinkedMap"),i);t.LinkedMap=n;var a=(o=class extends n{constructor(l,c=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,c),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,c=r.AsNew){return super.get(l,c)}peek(l){return super.get(l,r.None)}set(l,c){return super.set(l,c,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},s(o,"LRUCache"),o);t.LRUCache=a}}),yk=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function n(a){return{dispose:a}}s(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),gk=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var u,l,c,f;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=Lf(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(u=class{constructor(){this.buffers=new Map}enableCancellation(p){if(p.id===null)return;const y=new SharedArrayBuffer(4),h=new Int32Array(y,0,1);h[0]=r.Continue,this.buffers.set(p.id,y),p.$cancellationData=y}async sendCancellation(p,y){const h=this.buffers.get(y);if(h===void 0)return;const T=new Int32Array(h,0,1);Atomics.store(T,0,r.Cancelled)}cleanup(p){this.buffers.delete(p)}dispose(){this.buffers.clear()}},s(u,"SharedArraySenderStrategy"),u);t.SharedArraySenderStrategy=n;var a=(l=class{constructor(p){this.data=new Int32Array(p,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},s(l,"SharedArrayBufferCancellationToken"),l),i=(c=class{constructor(p){this.token=new a(p)}cancel(){}dispose(){}},s(c,"SharedArrayBufferCancellationTokenSource"),c),o=(f=class{constructor(){this.kind="request"}createCancellationTokenSource(p){const y=p.$cancellationData;return y===void 0?new e.CancellationTokenSource:new i(y)}},s(f,"SharedArrayReceiverStrategy"),f);t.SharedArrayReceiverStrategy=o}}),F$=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var e=Wn(),r=(n=class{constructor(i=1){if(i<=0)throw new Error("Capacity must be greater than 0");this._capacity=i,this._active=0,this._waiting=[]}lock(i){return new Promise((o,u)=>{this._waiting.push({thunk:i,resolve:o,reject:u}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const i=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const o=i.thunk();o instanceof Promise?o.then(u=>{this._active--,i.resolve(u),this.runNext()},u=>{this._active--,i.reject(u),this.runNext()}):(this._active--,i.resolve(o),this.runNext())}catch(o){this._active--,i.reject(o),this.runNext()}}},s(n,"Semaphore"),n);t.Semaphore=r}}),vk=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var c,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=Wn(),r=xu(),n=nl(),a=F$(),i;(function(d){function p(y){let h=y;return h&&r.func(h.listen)&&r.func(h.dispose)&&r.func(h.onError)&&r.func(h.onClose)&&r.func(h.onPartialMessage)}s(p,"is"),d.is=p})(i||(t.MessageReader=i={}));var o=(c=class{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(p){this.errorEmitter.fire(this.asError(p))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(p){this.partialMessageEmitter.fire(p)}asError(p){return p instanceof Error?p:new Error(`Reader received error. Reason: ${r.string(p.message)?p.message:"unknown"}`)}},s(c,"AbstractMessageReader"),c);t.AbstractMessageReader=o;var u;(function(d){function p(y){let h,T;const b=new Map;let v;const w=new Map;if(y===void 0||typeof y=="string")h=y??"utf-8";else{if(h=y.charset??"utf-8",y.contentDecoder!==void 0&&(T=y.contentDecoder,b.set(T.name,T)),y.contentDecoders!==void 0)for(const C of y.contentDecoders)b.set(C.name,C);if(y.contentTypeDecoder!==void 0&&(v=y.contentTypeDecoder,w.set(v.name,v)),y.contentTypeDecoders!==void 0)for(const C of y.contentTypeDecoders)w.set(C.name,C)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,w.set(v.name,v)),{charset:h,contentDecoder:T,contentDecoders:b,contentTypeDecoder:v,contentTypeDecoders:w}}s(p,"fromOptions"),d.fromOptions=p})(u||(u={}));var l=(f=class extends o{constructor(p,y){super(),this.readable=p,this.options=u.fromOptions(y),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new a.Semaphore(1)}set partialMessageTimeout(p){this._partialMessageTimeout=p}get partialMessageTimeout(){return this._partialMessageTimeout}listen(p){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=p;const y=this.readable.onData(h=>{this.onData(h)});return this.readable.onError(h=>this.fireError(h)),this.readable.onClose(()=>this.fireClose()),y}onData(p){try{for(this.buffer.append(p);;){if(this.nextMessageLength===-1){const h=this.buffer.tryReadHeaders(!0);if(!h)return;const T=h.get("content-length");if(!T){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(h))}`));return}const b=parseInt(T);if(isNaN(b)){this.fireError(new Error(`Content-Length value must be a number. Got ${T}`));return}this.nextMessageLength=b}const y=this.buffer.tryReadBody(this.nextMessageLength);if(y===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const h=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(y):y,T=await this.options.contentTypeDecoder.decode(h,this.options);this.callback(T)}).catch(h=>{this.fireError(h)})}}catch(y){this.fireError(y)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((p,y)=>{this.partialMessageTimer=void 0,p===this.messageToken&&(this.firePartialMessage({messageToken:p,waitingTime:y}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},s(f,"ReadableStreamMessageReader"),f);t.ReadableStreamMessageReader=l}}),Tk=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,p;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=Wn(),r=xu(),n=F$(),a=nl(),i="Content-Length: ",o=`\r +`,u;(function(y){function h(T){let b=T;return b&&r.func(b.dispose)&&r.func(b.onClose)&&r.func(b.onError)&&r.func(b.write)}s(h,"is"),y.is=h})(u||(t.MessageWriter=u={}));var l=(d=class{constructor(){this.errorEmitter=new a.Emitter,this.closeEmitter=new a.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(h,T,b){this.errorEmitter.fire([this.asError(h),T,b])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(h){return h instanceof Error?h:new Error(`Writer received error. Reason: ${r.string(h.message)?h.message:"unknown"}`)}},s(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var c;(function(y){function h(T){return T===void 0||typeof T=="string"?{charset:T??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:T.charset??"utf-8",contentEncoder:T.contentEncoder,contentTypeEncoder:T.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}s(h,"fromOptions"),y.fromOptions=h})(c||(c={}));var f=(p=class extends l{constructor(h,T){super(),this.writable=h,this.options=c.fromOptions(T),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(b=>this.fireError(b)),this.writable.onClose(()=>this.fireClose())}async write(h){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(h,this.options).then(b=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(b):b).then(b=>{const v=[];return v.push(i,b.byteLength.toString(),o),v.push(o),this.doWrite(h,v,b)},b=>{throw this.fireError(b),b}))}async doWrite(h,T,b){try{return await this.writable.write(T.join(""),"ascii"),this.writable.write(b)}catch(v){return this.handleError(v,h),Promise.reject(v)}}handleError(h,T){this.errorCount++,this.fireError(h,T,this.errorCount)}end(){this.writable.end()}},s(p,"WriteableStreamMessageWriter"),p);t.WriteableStreamMessageWriter=f}}),$k=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r +`,a=(i=class{constructor(u="utf-8"){this._encoding=u,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(u){const l=typeof u=="string"?this.fromString(u,this._encoding):u;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(u=!1){if(this._chunks.length===0)return;let l=0,c=0,f=0,d=0;e:for(;cthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===u){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=u,this.asNative(d)}if(this._chunks[0].byteLength>u){const d=this._chunks[0],p=this.asNative(d,u);return this._chunks[0]=d.slice(u),this._totalLength-=u,p}const l=this.allocNative(u);let c=0,f=0;for(;u>0;){const d=this._chunks[f];if(d.byteLength>u){const p=d.slice(0,u);l.set(p,c),c+=u,this._chunks[f]=d.slice(u),this._totalLength-=u,u-=u}else l.set(d,c),c+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,u-=d.byteLength}return l}},s(i,"AbstractMessageBuffer"),i);t.AbstractMessageBuffer=a}}),Rk=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var k,_;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=Wn(),r=xu(),n=M$(),a=G$(),i=nl(),o=Lf(),u;(function($){$.type=new n.NotificationType("$/cancelRequest")})(u||(u={}));var l;(function($){function I(R){return typeof R=="string"||typeof R=="number"}s(I,"is"),$.is=I})(l||(t.ProgressToken=l={}));var c;(function($){$.type=new n.NotificationType("$/progress")})(c||(c={}));var f=(k=class{constructor(){}},s(k,"ProgressType"),k);t.ProgressType=f;var d;(function($){function I(R){return r.func(R)}s(I,"is"),$.is=I})(d||(d={})),t.NullLogger=Object.freeze({error:s(()=>{},"error"),warn:s(()=>{},"warn"),info:s(()=>{},"info"),log:s(()=>{},"log")});var p;(function($){$[$.Off=0]="Off",$[$.Messages=1]="Messages",$[$.Compact=2]="Compact",$[$.Verbose=3]="Verbose"})(p||(t.Trace=p={}));var y;(function($){$.Off="off",$.Messages="messages",$.Compact="compact",$.Verbose="verbose"})(y||(t.TraceValues=y={})),(function($){function I(A){if(!r.string(A))return $.Off;switch(A=A.toLowerCase(),A){case"off":return $.Off;case"messages":return $.Messages;case"compact":return $.Compact;case"verbose":return $.Verbose;default:return $.Off}}s(I,"fromString"),$.fromString=I;function R(A){switch(A){case $.Off:return"off";case $.Messages:return"messages";case $.Compact:return"compact";case $.Verbose:return"verbose";default:return"off"}}s(R,"toString"),$.toString=R})(p||(t.Trace=p={}));var h;(function($){$.Text="text",$.JSON="json"})(h||(t.TraceFormat=h={})),(function($){function I(R){return r.string(R)?(R=R.toLowerCase(),R==="json"?$.JSON:$.Text):$.Text}s(I,"fromString"),$.fromString=I})(h||(t.TraceFormat=h={}));var T;(function($){$.type=new n.NotificationType("$/setTrace")})(T||(t.SetTraceNotification=T={}));var b;(function($){$.type=new n.NotificationType("$/logTrace")})(b||(t.LogTraceNotification=b={}));var v;(function($){$[$.Closed=1]="Closed",$[$.Disposed=2]="Disposed",$[$.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var w=(_=class extends Error{constructor(I,R){super(R),this.code=I,Object.setPrototypeOf(this,_.prototype)}},s(_,"ConnectionError"),_);t.ConnectionError=w;var C;(function($){function I(R){const A=R;return A&&r.func(A.cancelUndispatched)}s(I,"is"),$.is=I})(C||(t.ConnectionStrategy=C={}));var N;(function($){function I(R){const A=R;return A&&(A.kind===void 0||A.kind==="id")&&r.func(A.createCancellationTokenSource)&&(A.dispose===void 0||r.func(A.dispose))}s(I,"is"),$.is=I})(N||(t.IdCancellationReceiverStrategy=N={}));var B;(function($){function I(R){const A=R;return A&&A.kind==="request"&&r.func(A.createCancellationTokenSource)&&(A.dispose===void 0||r.func(A.dispose))}s(I,"is"),$.is=I})(B||(t.RequestCancellationReceiverStrategy=B={}));var ne;(function($){$.Message=Object.freeze({createCancellationTokenSource(R){return new o.CancellationTokenSource}});function I(R){return N.is(R)||B.is(R)}s(I,"is"),$.is=I})(ne||(t.CancellationReceiverStrategy=ne={}));var J;(function($){$.Message=Object.freeze({sendCancellation(R,A){return R.sendNotification(u.type,{id:A})},cleanup(R){}});function I(R){const A=R;return A&&r.func(A.sendCancellation)&&r.func(A.cleanup)}s(I,"is"),$.is=I})(J||(t.CancellationSenderStrategy=J={}));var he;(function($){$.Message=Object.freeze({receiver:ne.Message,sender:J.Message});function I(R){const A=R;return A&&ne.is(A.receiver)&&J.is(A.sender)}s(I,"is"),$.is=I})(he||(t.CancellationStrategy=he={}));var Ae;(function($){function I(R){const A=R;return A&&r.func(A.handleMessage)}s(I,"is"),$.is=I})(Ae||(t.MessageStrategy=Ae={}));var ye;(function($){function I(R){const A=R;return A&&(he.is(A.cancellationStrategy)||C.is(A.connectionStrategy)||Ae.is(A.messageStrategy))}s(I,"is"),$.is=I})(ye||(t.ConnectionOptions=ye={}));var ue;(function($){$[$.New=1]="New",$[$.Listening=2]="Listening",$[$.Closed=3]="Closed",$[$.Disposed=4]="Disposed"})(ue||(ue={}));function ot($,I,R,A){const S=R!==void 0?R:t.NullLogger;let L=0,x=0,O=0;const z="2.0";let M;const Y=new Map;let q;const Z=new Map,ae=new Map;let Oe,pe=new a.LinkedMap,Ee=new Map,Ve=new Set,Le=new Map,ee=p.Off,Qe=h.Text,ce,qe=ue.New;const ge=new i.Emitter,G=new i.Emitter,je=new i.Emitter,Qt=new i.Emitter,Dt=new i.Emitter,ve=A&&A.cancellationStrategy?A.cancellationStrategy:he.Message;function da(g){if(g===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+g.toString()}s(da,"createRequestQueueKey");function ml(g){return g===null?"res-unknown-"+(++O).toString():"res-"+g.toString()}s(ml,"createResponseQueueKey");function hl(){return"not-"+(++x).toString()}s(hl,"createNotificationQueueKey");function yl(g,P){n.Message.isRequest(P)?g.set(da(P.id),P):n.Message.isResponse(P)?g.set(ml(P.id),P):g.set(hl(),P)}s(yl,"addMessageToQueue");function gl(g){}s(gl,"cancelUndispatched");function pa(){return qe===ue.Listening}s(pa,"isListening");function ma(){return qe===ue.Closed}s(ma,"isClosed");function er(){return qe===ue.Disposed}s(er,"isDisposed");function ha(){(qe===ue.New||qe===ue.Listening)&&(qe=ue.Closed,G.fire(void 0))}s(ha,"closeHandler");function vl(g){ge.fire([g,void 0,void 0])}s(vl,"readErrorHandler");function Tl(g){ge.fire(g)}s(Tl,"writeErrorHandler"),$.onClose(ha),$.onError(vl),I.onClose(ha),I.onError(Tl);function ya(){Oe||pe.size===0||(Oe=(0,e.default)().timer.setImmediate(()=>{Oe=void 0,$l()}))}s(ya,"triggerMessageQueue");function ga(g){n.Message.isRequest(g)?Rl(g):n.Message.isNotification(g)?El(g):n.Message.isResponse(g)?Al(g):bl(g)}s(ga,"handleMessage");function $l(){if(pe.size===0)return;const g=pe.shift();try{const P=A?.messageStrategy;Ae.is(P)?P.handleMessage(g,ga):ga(g)}finally{ya()}}s($l,"processMessageQueue");const rc=s(g=>{try{if(n.Message.isNotification(g)&&g.method===u.type.method){const P=g.params.id,D=da(P),F=pe.get(D);if(n.Message.isRequest(F)){const me=A?.connectionStrategy,De=me&&me.cancelUndispatched?me.cancelUndispatched(F,gl):void 0;if(De&&(De.error!==void 0||De.result!==void 0)){pe.delete(D),Le.delete(P),De.id=F.id,jr(De,g.method,Date.now()),I.write(De).catch(()=>S.error("Sending response for canceled message failed."));return}}const be=Le.get(P);if(be!==void 0){be.cancel(),sn(g);return}else Ve.add(P)}yl(pe,g)}finally{ya()}},"callback");function Rl(g){if(er())return;function P(ie,Ne,fe){const Ue={jsonrpc:z,id:g.id};ie instanceof n.ResponseError?Ue.error=ie.toJson():Ue.result=ie===void 0?null:ie,jr(Ue,Ne,fe),I.write(Ue).catch(()=>S.error("Sending response failed."))}s(P,"reply");function D(ie,Ne,fe){const Ue={jsonrpc:z,id:g.id,error:ie.toJson()};jr(Ue,Ne,fe),I.write(Ue).catch(()=>S.error("Sending response failed."))}s(D,"replyError");function F(ie,Ne,fe){ie===void 0&&(ie=null);const Ue={jsonrpc:z,id:g.id,result:ie};jr(Ue,Ne,fe),I.write(Ue).catch(()=>S.error("Sending response failed."))}s(F,"replySuccess"),Sl(g);const be=Y.get(g.method);let me,De;be&&(me=be.type,De=be.handler);const Ge=Date.now();if(De||M){const ie=g.id??String(Date.now()),Ne=N.is(ve.receiver)?ve.receiver.createCancellationTokenSource(ie):ve.receiver.createCancellationTokenSource(g);g.id!==null&&Ve.has(g.id)&&Ne.cancel(),g.id!==null&&Le.set(ie,Ne);try{let fe;if(De)if(g.params===void 0){if(me!==void 0&&me.numberOfParams!==0){D(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${g.method} defines ${me.numberOfParams} params but received none.`),g.method,Ge);return}fe=De(Ne.token)}else if(Array.isArray(g.params)){if(me!==void 0&&me.parameterStructures===n.ParameterStructures.byName){D(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${g.method} defines parameters by name but received parameters by position`),g.method,Ge);return}fe=De(...g.params,Ne.token)}else{if(me!==void 0&&me.parameterStructures===n.ParameterStructures.byPosition){D(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${g.method} defines parameters by position but received parameters by name`),g.method,Ge);return}fe=De(g.params,Ne.token)}else M&&(fe=M(g.method,g.params,Ne.token));const Ue=fe;fe?Ue.then?Ue.then(lt=>{Le.delete(ie),P(lt,g.method,Ge)},lt=>{Le.delete(ie),lt instanceof n.ResponseError?D(lt,g.method,Ge):lt&&r.string(lt.message)?D(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${g.method} failed with message: ${lt.message}`),g.method,Ge):D(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${g.method} failed unexpectedly without providing any details.`),g.method,Ge)}):(Le.delete(ie),P(fe,g.method,Ge)):(Le.delete(ie),F(fe,g.method,Ge))}catch(fe){Le.delete(ie),fe instanceof n.ResponseError?P(fe,g.method,Ge):fe&&r.string(fe.message)?D(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${g.method} failed with message: ${fe.message}`),g.method,Ge):D(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${g.method} failed unexpectedly without providing any details.`),g.method,Ge)}}else D(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${g.method}`),g.method,Ge)}s(Rl,"handleRequest");function Al(g){if(!er())if(g.id===null)g.error?S.error(`Received response message without id: Error is: +${JSON.stringify(g.error,void 0,4)}`):S.error("Received response message without id. No further error information provided.");else{const P=g.id,D=Ee.get(P);if(wl(g,D),D!==void 0){Ee.delete(P);try{if(g.error){const F=g.error;D.reject(new n.ResponseError(F.code,F.message,F.data))}else if(g.result!==void 0)D.resolve(g.result);else throw new Error("Should never happen.")}catch(F){F.message?S.error(`Response handler '${D.method}' failed with message: ${F.message}`):S.error(`Response handler '${D.method}' failed unexpectedly.`)}}}}s(Al,"handleResponse");function El(g){if(er())return;let P,D;if(g.method===u.type.method){const F=g.params.id;Ve.delete(F),sn(g);return}else{const F=Z.get(g.method);F&&(D=F.handler,P=F.type)}if(D||q)try{if(sn(g),D)if(g.params===void 0)P!==void 0&&P.numberOfParams!==0&&P.parameterStructures!==n.ParameterStructures.byName&&S.error(`Notification ${g.method} defines ${P.numberOfParams} params but received none.`),D();else if(Array.isArray(g.params)){const F=g.params;g.method===c.type.method&&F.length===2&&l.is(F[0])?D({token:F[0],value:F[1]}):(P!==void 0&&(P.parameterStructures===n.ParameterStructures.byName&&S.error(`Notification ${g.method} defines parameters by name but received parameters by position`),P.numberOfParams!==g.params.length&&S.error(`Notification ${g.method} defines ${P.numberOfParams} params but received ${F.length} arguments`)),D(...F))}else P!==void 0&&P.parameterStructures===n.ParameterStructures.byPosition&&S.error(`Notification ${g.method} defines parameters by position but received parameters by name`),D(g.params);else q&&q(g.method,g.params)}catch(F){F.message?S.error(`Notification handler '${g.method}' failed with message: ${F.message}`):S.error(`Notification handler '${g.method}' failed unexpectedly.`)}else je.fire(g)}s(El,"handleNotification");function bl(g){if(!g){S.error("Received empty message.");return}S.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(g,null,4)}`);const P=g;if(r.string(P.id)||r.number(P.id)){const D=P.id,F=Ee.get(D);F&&F.reject(new Error("The received response has neither a result nor an error property."))}}s(bl,"handleInvalidMessage");function xt(g){if(g!=null)switch(ee){case p.Verbose:return JSON.stringify(g,null,4);case p.Compact:return JSON.stringify(g);default:return}}s(xt,"stringifyTrace");function Cl(g){if(!(ee===p.Off||!ce))if(Qe===h.Text){let P;(ee===p.Verbose||ee===p.Compact)&&g.params&&(P=`Params: ${xt(g.params)} + +`),ce.log(`Sending request '${g.method} - (${g.id})'.`,P)}else tr("send-request",g)}s(Cl,"traceSendingRequest");function _l(g){if(!(ee===p.Off||!ce))if(Qe===h.Text){let P;(ee===p.Verbose||ee===p.Compact)&&(g.params?P=`Params: ${xt(g.params)} + +`:P=`No parameters provided. + +`),ce.log(`Sending notification '${g.method}'.`,P)}else tr("send-notification",g)}s(_l,"traceSendingNotification");function jr(g,P,D){if(!(ee===p.Off||!ce))if(Qe===h.Text){let F;(ee===p.Verbose||ee===p.Compact)&&(g.error&&g.error.data?F=`Error data: ${xt(g.error.data)} + +`:g.result?F=`Result: ${xt(g.result)} + +`:g.error===void 0&&(F=`No result returned. + +`)),ce.log(`Sending response '${P} - (${g.id})'. Processing request took ${Date.now()-D}ms`,F)}else tr("send-response",g)}s(jr,"traceSendingResponse");function Sl(g){if(!(ee===p.Off||!ce))if(Qe===h.Text){let P;(ee===p.Verbose||ee===p.Compact)&&g.params&&(P=`Params: ${xt(g.params)} + +`),ce.log(`Received request '${g.method} - (${g.id})'.`,P)}else tr("receive-request",g)}s(Sl,"traceReceivedRequest");function sn(g){if(!(ee===p.Off||!ce||g.method===b.type.method))if(Qe===h.Text){let P;(ee===p.Verbose||ee===p.Compact)&&(g.params?P=`Params: ${xt(g.params)} + +`:P=`No parameters provided. + +`),ce.log(`Received notification '${g.method}'.`,P)}else tr("receive-notification",g)}s(sn,"traceReceivedNotification");function wl(g,P){if(!(ee===p.Off||!ce))if(Qe===h.Text){let D;if((ee===p.Verbose||ee===p.Compact)&&(g.error&&g.error.data?D=`Error data: ${xt(g.error.data)} + +`:g.result?D=`Result: ${xt(g.result)} + +`:g.error===void 0&&(D=`No result returned. + +`)),P){const F=g.error?` Request failed: ${g.error.message} (${g.error.code}).`:"";ce.log(`Received response '${P.method} - (${g.id})' in ${Date.now()-P.timerStart}ms.${F}`,D)}else ce.log(`Received response ${g.id} without active response promise.`,D)}else tr("receive-response",g)}s(wl,"traceReceivedResponse");function tr(g,P){if(!ce||ee===p.Off)return;const D={isLSPMessage:!0,type:g,message:P,timestamp:Date.now()};ce.log(D)}s(tr,"logLSPMessage");function Tr(){if(ma())throw new w(v.Closed,"Connection is closed.");if(er())throw new w(v.Disposed,"Connection is disposed.")}s(Tr,"throwIfClosedOrDisposed");function Il(){if(pa())throw new w(v.AlreadyListening,"Connection is already listening")}s(Il,"throwIfListening");function Nl(){if(!pa())throw new Error("Call listen() first.")}s(Nl,"throwIfNotListening");function m(g){return g===void 0?null:g}s(m,"undefinedToNull");function le(g){if(g!==null)return g}s(le,"nullToUndefined");function we(g){return g!=null&&!Array.isArray(g)&&typeof g=="object"}s(we,"isNamedParam");function H(g,P){switch(g){case n.ParameterStructures.auto:return we(P)?le(P):[m(P)];case n.ParameterStructures.byName:if(!we(P))throw new Error("Received parameters by name but param is not an object literal.");return le(P);case n.ParameterStructures.byPosition:return[m(P)];default:throw new Error(`Unknown parameter structure ${g.toString()}`)}}s(H,"computeSingleParam");function Ie(g,P){let D;const F=g.numberOfParams;switch(F){case 0:D=void 0;break;case 1:D=H(g.parameterStructures,P[0]);break;default:D=[];for(let be=0;be{Tr();let D,F;if(r.string(g)){D=g;const me=P[0];let De=0,Ge=n.ParameterStructures.auto;n.ParameterStructures.is(me)&&(De=1,Ge=me);let ie=P.length;const Ne=ie-De;switch(Ne){case 0:F=void 0;break;case 1:F=H(Ge,P[De]);break;default:if(Ge===n.ParameterStructures.byName)throw new Error(`Received ${Ne} parameters for 'by Name' notification parameter structure.`);F=P.slice(De,ie).map(fe=>m(fe));break}}else{const me=P;D=g.method,F=Ie(g,me)}const be={jsonrpc:z,method:D,params:F};return _l(be),I.write(be).catch(me=>{throw S.error("Sending notification failed."),me})},"sendNotification"),onNotification:s((g,P)=>{Tr();let D;return r.func(g)?q=g:P&&(r.string(g)?(D=g,Z.set(g,{type:void 0,handler:P})):(D=g.method,Z.set(g.method,{type:g,handler:P}))),{dispose:s(()=>{D!==void 0?Z.delete(D):q=void 0},"dispose")}},"onNotification"),onProgress:s((g,P,D)=>{if(ae.has(P))throw new Error(`Progress handler for token ${P} already registered`);return ae.set(P,D),{dispose:s(()=>{ae.delete(P)},"dispose")}},"onProgress"),sendProgress:s((g,P,D)=>va.sendNotification(c.type,{token:P,value:D}),"sendProgress"),onUnhandledProgress:Qt.event,sendRequest:s((g,...P)=>{Tr(),Nl();let D,F,be;if(r.string(g)){D=g;const ie=P[0],Ne=P[P.length-1];let fe=0,Ue=n.ParameterStructures.auto;n.ParameterStructures.is(ie)&&(fe=1,Ue=ie);let lt=P.length;o.CancellationToken.is(Ne)&&(lt=lt-1,be=Ne);const rr=lt-fe;switch(rr){case 0:F=void 0;break;case 1:F=H(Ue,P[fe]);break;default:if(Ue===n.ParameterStructures.byName)throw new Error(`Received ${rr} parameters for 'by Name' request parameter structure.`);F=P.slice(fe,lt).map(ck=>m(ck));break}}else{const ie=P;D=g.method,F=Ie(g,ie);const Ne=g.numberOfParams;be=o.CancellationToken.is(ie[Ne])?ie[Ne]:void 0}const me=L++;let De;be&&(De=be.onCancellationRequested(()=>{const ie=ve.sender.sendCancellation(va,me);return ie===void 0?(S.log(`Received no promise from cancellation strategy when cancelling id ${me}`),Promise.resolve()):ie.catch(()=>{S.log(`Sending cancellation messages for id ${me} failed`)})}));const Ge={jsonrpc:z,id:me,method:D,params:F};return Cl(Ge),typeof ve.sender.enableCancellation=="function"&&ve.sender.enableCancellation(Ge),new Promise(async(ie,Ne)=>{const fe=s(rr=>{ie(rr),ve.sender.cleanup(me),De?.dispose()},"resolveWithCleanup"),Ue=s(rr=>{Ne(rr),ve.sender.cleanup(me),De?.dispose()},"rejectWithCleanup"),lt={method:D,timerStart:Date.now(),resolve:fe,reject:Ue};try{await I.write(Ge),Ee.set(me,lt)}catch(rr){throw S.error("Sending request failed."),lt.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,rr.message?rr.message:"Unknown reason")),rr}})},"sendRequest"),onRequest:s((g,P)=>{Tr();let D=null;return d.is(g)?(D=void 0,M=g):r.string(g)?(D=null,P!==void 0&&(D=g,Y.set(g,{handler:P,type:void 0}))):P!==void 0&&(D=g.method,Y.set(g.method,{type:g,handler:P})),{dispose:s(()=>{D!==null&&(D!==void 0?Y.delete(D):M=void 0)},"dispose")}},"onRequest"),hasPendingResponse:s(()=>Ee.size>0,"hasPendingResponse"),trace:s(async(g,P,D)=>{let F=!1,be=h.Text;D!==void 0&&(r.boolean(D)?F=D:(F=D.sendNotification||!1,be=D.traceFormat||h.Text)),ee=g,Qe=be,ee===p.Off?ce=void 0:ce=P,F&&!ma()&&!er()&&await va.sendNotification(T.type,{value:p.toString(g)})},"trace"),onError:ge.event,onClose:G.event,onUnhandledNotification:je.event,onDispose:Dt.event,end:s(()=>{I.end()},"end"),dispose:s(()=>{if(er())return;qe=ue.Disposed,Dt.fire(void 0);const g=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const P of Ee.values())P.reject(g);Ee=new Map,Le=new Map,Ve=new Set,pe=new a.LinkedMap,r.func(I.dispose)&&I.dispose(),r.func($.dispose)&&$.dispose()},"dispose"),listen:s(()=>{Tr(),Il(),qe=ue.Listening,$.listen(rc)},"listen"),inspect:s(()=>{(0,e.default)().console.log("inspect")},"inspect")};return va.onNotification(b.type,g=>{if(ee===p.Off||!ce)return;const P=ee===p.Verbose||ee===p.Compact;ce.log(g.message,P?g.verbose:void 0)}),va.onNotification(c.type,g=>{const P=ae.get(g.token);P?P(g.value):Qt.fire(g)}),va}s(ot,"createMessageConnection"),t.createMessageConnection=ot}}),Tm=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;var e=M$();Object.defineProperty(t,"Message",{enumerable:!0,get:s(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:s(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:s(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:s(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:s(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:s(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:s(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:s(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:s(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:s(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:s(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:s(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:s(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:s(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:s(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:s(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:s(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:s(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:s(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:s(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:s(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:s(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:s(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:s(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:s(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:s(function(){return e.ParameterStructures},"get")});var r=G$();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:s(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:s(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:s(function(){return r.Touch},"get")});var n=yk();Object.defineProperty(t,"Disposable",{enumerable:!0,get:s(function(){return n.Disposable},"get")});var a=nl();Object.defineProperty(t,"Event",{enumerable:!0,get:s(function(){return a.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:s(function(){return a.Emitter},"get")});var i=Lf();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:s(function(){return i.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:s(function(){return i.CancellationToken},"get")});var o=gk();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:s(function(){return o.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:s(function(){return o.SharedArrayReceiverStrategy},"get")});var u=vk();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:s(function(){return u.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:s(function(){return u.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:s(function(){return u.ReadableStreamMessageReader},"get")});var l=Tk();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:s(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:s(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:s(function(){return l.WriteableStreamMessageWriter},"get")});var c=$k();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:s(function(){return c.AbstractMessageBuffer},"get")});var f=Rk();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:s(function(){return f.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:s(function(){return f.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:s(function(){return f.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:s(function(){return f.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:s(function(){return f.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:s(function(){return f.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:s(function(){return f.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:s(function(){return f.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:s(function(){return f.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:s(function(){return f.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:s(function(){return f.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:s(function(){return f.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:s(function(){return f.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:s(function(){return f.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:s(function(){return f.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:s(function(){return f.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:s(function(){return f.MessageStrategy},"get")});var d=Wn();t.RAL=d.default}}),Ak=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,c,f;Object.defineProperty(t,"__esModule",{value:!0});var e=Tm(),r=(l=class extends e.AbstractMessageBuffer{constructor(p="utf-8"){super(p),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return l.emptyBuffer}fromString(p,y){return new TextEncoder().encode(p)}toString(p,y){return y==="ascii"?this.asciiDecoder.decode(p):new TextDecoder(y).decode(p)}asNative(p,y){return y===void 0?p:p.slice(0,y)}allocNative(p){return new Uint8Array(p)}},s(l,"MessageBuffer"),l);r.emptyBuffer=new Uint8Array(0);var n=(c=class{constructor(p){this.socket=p,this._onData=new e.Emitter,this._messageListener=y=>{y.data.arrayBuffer().then(T=>{this._onData.fire(new Uint8Array(T))},()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(p){return this.socket.addEventListener("close",p),e.Disposable.create(()=>this.socket.removeEventListener("close",p))}onError(p){return this.socket.addEventListener("error",p),e.Disposable.create(()=>this.socket.removeEventListener("error",p))}onEnd(p){return this.socket.addEventListener("end",p),e.Disposable.create(()=>this.socket.removeEventListener("end",p))}onData(p){return this._onData.event(p)}},s(c,"ReadableStreamWrapper"),c),a=(f=class{constructor(p){this.socket=p}onClose(p){return this.socket.addEventListener("close",p),e.Disposable.create(()=>this.socket.removeEventListener("close",p))}onError(p){return this.socket.addEventListener("error",p),e.Disposable.create(()=>this.socket.removeEventListener("error",p))}onEnd(p){return this.socket.addEventListener("end",p),e.Disposable.create(()=>this.socket.removeEventListener("end",p))}write(p,y){if(typeof p=="string"){if(y!==void 0&&y!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${y}`);this.socket.send(p)}else this.socket.send(p);return Promise.resolve()}end(){this.socket.close()}},s(f,"WritableStreamWrapper"),f),i=new TextEncoder,o=Object.freeze({messageBuffer:Object.freeze({create:s(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:s((d,p)=>{if(p.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${p.charset}`);return Promise.resolve(i.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:s((d,p)=>{if(!(d instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(p.charset).decode(d)))},"decode")})}),stream:Object.freeze({asReadableStream:s(d=>new n(d),"asReadableStream"),asWritableStream:s(d=>new a(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,p,...y){const h=setTimeout(d,p,...y);return{dispose:s(()=>clearTimeout(h),"dispose")}},setImmediate(d,...p){const y=setTimeout(d,0,...p);return{dispose:s(()=>clearTimeout(y),"dispose")}},setInterval(d,p,...y){const h=setInterval(d,p,...y);return{dispose:s(()=>clearInterval(h),"dispose")}}})});function u(){return o}s(u,"RIL"),(function(d){function p(){e.RAL.install(o)}s(p,"install"),d.install=p})(u||(u={})),t.default=u}}),al=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(t){var l,c;var e=t&&t.__createBinding||(Object.create?(function(f,d,p,y){y===void 0&&(y=p);var h=Object.getOwnPropertyDescriptor(d,p);(!h||("get"in h?!d.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:s(function(){return d[p]},"get")}),Object.defineProperty(f,y,h)}):(function(f,d,p,y){y===void 0&&(y=p),f[y]=d[p]})),r=t&&t.__exportStar||function(f,d){for(var p in f)p!=="default"&&!Object.prototype.hasOwnProperty.call(d,p)&&e(d,f,p)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=Ak();n.default.install();var a=Tm();r(Tm(),t);var i=(l=class extends a.AbstractMessageReader{constructor(d){super(),this._onData=new a.Emitter,this._messageListener=p=>{this._onData.fire(p.data)},d.addEventListener("error",p=>this.fireError(p)),d.onmessage=this._messageListener}listen(d){return this._onData.event(d)}},s(l,"BrowserMessageReader"),l);t.BrowserMessageReader=i;var o=(c=class extends a.AbstractMessageWriter{constructor(d){super(),this.port=d,this.errorCount=0,d.addEventListener("error",p=>this.fireError(p))}write(d){try{return this.port.postMessage(d),Promise.resolve()}catch(p){return this.handleError(p,d),Promise.reject(p)}}handleError(d,p){this.errorCount++,this.fireError(d,p,this.errorCount)}end(){}},s(c,"BrowserMessageWriter"),c);t.BrowserMessageWriter=o;function u(f,d,p,y){return p===void 0&&(p=a.NullLogger),a.ConnectionStrategy.is(y)&&(y={connectionStrategy:y}),(0,a.createMessageConnection)(f,d,p,y)}s(u,"createMessageConnection"),t.createMessageConnection=u}}),iv=X({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=al()}}),ke=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,c,f,d,p;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=al(),r;(function(y){y.clientToServer="clientToServer",y.serverToClient="serverToClient",y.both="both"})(r||(t.MessageDirection=r={}));var n=(l=class{constructor(h){this.method=h}},s(l,"RegistrationType"),l);t.RegistrationType=n;var a=(c=class extends e.RequestType0{constructor(h){super(h)}},s(c,"ProtocolRequestType0"),c);t.ProtocolRequestType0=a;var i=(f=class extends e.RequestType{constructor(h){super(h,e.ParameterStructures.byName)}},s(f,"ProtocolRequestType"),f);t.ProtocolRequestType=i;var o=(d=class extends e.NotificationType0{constructor(h){super(h)}},s(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=o;var u=(p=class extends e.NotificationType{constructor(h){super(h,e.ParameterStructures.byName)}},s(p,"ProtocolNotificationType"),p);t.ProtocolNotificationType=u}}),Ah=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(f){return f===!0||f===!1}s(e,"boolean"),t.boolean=e;function r(f){return typeof f=="string"||f instanceof String}s(r,"string"),t.string=r;function n(f){return typeof f=="number"||f instanceof Number}s(n,"number"),t.number=n;function a(f){return f instanceof Error}s(a,"error"),t.error=a;function i(f){return typeof f=="function"}s(i,"func"),t.func=i;function o(f){return Array.isArray(f)}s(o,"array"),t.array=o;function u(f){return o(f)&&f.every(d=>r(d))}s(u,"stringArray"),t.stringArray=u;function l(f,d){return Array.isArray(f)&&f.every(d)}s(l,"typedArray"),t.typedArray=l;function c(f){return f!==null&&typeof f=="object"}s(c,"objectLiteral"),t.objectLiteral=c}}),Ek=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;var e=ke(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),bk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;var e=ke(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),Ck=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;var e=ke(),r;(function(a){a.method="workspace/workspaceFolders",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(r||(t.WorkspaceFoldersRequest=r={}));var n;(function(a){a.method="workspace/didChangeWorkspaceFolders",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(n||(t.DidChangeWorkspaceFoldersNotification=n={}))}}),_k=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;var e=ke(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),Sk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;var e=ke(),r;(function(a){a.method="textDocument/documentColor",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.DocumentColorRequest=r={}));var n;(function(a){a.method="textDocument/colorPresentation",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.ColorPresentationRequest=n={}))}}),wk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;var e=ke(),r;(function(a){a.method="textDocument/foldingRange",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.FoldingRangeRequest=r={}));var n;(function(a){a.method="workspace/foldingRange/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(n||(t.FoldingRangeRefreshRequest=n={}))}}),Ik=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;var e=ke(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),Nk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;var e=ke(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),Pk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;var e=al(),r=ke(),n;(function(o){o.type=new e.ProgressType;function u(l){return l===o.type}s(u,"is"),o.is=u})(n||(t.WorkDoneProgress=n={}));var a;(function(o){o.method="window/workDoneProgress/create",o.messageDirection=r.MessageDirection.serverToClient,o.type=new r.ProtocolRequestType(o.method)})(a||(t.WorkDoneProgressCreateRequest=a={}));var i;(function(o){o.method="window/workDoneProgress/cancel",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolNotificationType(o.method)})(i||(t.WorkDoneProgressCancelNotification=i={}))}}),kk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;var e=ke(),r;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var a;(function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(a||(t.CallHierarchyOutgoingCallsRequest=a={}))}}),Ok=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;var e=ke(),r;(function(l){l.Relative="relative"})(r||(t.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new e.RegistrationType(l.method)})(n||(t.SemanticTokensRegistrationType=n={}));var a;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensRequest=a={}));var i;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(t.SemanticTokensDeltaRequest=i={}));var o;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(o||(t.SemanticTokensRangeRequest=o={}));var u;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(u||(t.SemanticTokensRefreshRequest=u={}))}}),Lk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;var e=ke(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),Dk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;var e=ke(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),xk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;var e=ke(),r;(function(c){c.file="file",c.folder="folder"})(r||(t.FileOperationPatternKind=r={}));var n;(function(c){c.method="workspace/willCreateFiles",c.messageDirection=e.MessageDirection.clientToServer,c.type=new e.ProtocolRequestType(c.method)})(n||(t.WillCreateFilesRequest=n={}));var a;(function(c){c.method="workspace/didCreateFiles",c.messageDirection=e.MessageDirection.clientToServer,c.type=new e.ProtocolNotificationType(c.method)})(a||(t.DidCreateFilesNotification=a={}));var i;(function(c){c.method="workspace/willRenameFiles",c.messageDirection=e.MessageDirection.clientToServer,c.type=new e.ProtocolRequestType(c.method)})(i||(t.WillRenameFilesRequest=i={}));var o;(function(c){c.method="workspace/didRenameFiles",c.messageDirection=e.MessageDirection.clientToServer,c.type=new e.ProtocolNotificationType(c.method)})(o||(t.DidRenameFilesNotification=o={}));var u;(function(c){c.method="workspace/didDeleteFiles",c.messageDirection=e.MessageDirection.clientToServer,c.type=new e.ProtocolNotificationType(c.method)})(u||(t.DidDeleteFilesNotification=u={}));var l;(function(c){c.method="workspace/willDeleteFiles",c.messageDirection=e.MessageDirection.clientToServer,c.type=new e.ProtocolRequestType(c.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),Mk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;var e=ke(),r;(function(i){i.document="document",i.project="project",i.group="group",i.scheme="scheme",i.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(i){i.$import="import",i.$export="export",i.local="local"})(n||(t.MonikerKind=n={}));var a;(function(i){i.method="textDocument/moniker",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(a||(t.MonikerRequest=a={}))}}),Gk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=ke(),r;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var a;(function(i){i.method="typeHierarchy/subtypes",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(a||(t.TypeHierarchySubtypesRequest=a={}))}}),Fk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;var e=ke(),r;(function(a){a.method="textDocument/inlineValue",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.InlineValueRequest=r={}));var n;(function(a){a.method="workspace/inlineValue/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(n||(t.InlineValueRefreshRequest=n={}))}}),zk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;var e=ke(),r;(function(i){i.method="textDocument/inlayHint",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.InlayHintRequest=r={}));var n;(function(i){i.method="inlayHint/resolve",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.InlayHintResolveRequest=n={}));var a;(function(i){i.method="workspace/inlayHint/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(a||(t.InlayHintRefreshRequest=a={}))}}),jk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;var e=al(),r=Ah(),n=ke(),a;(function(c){function f(d){const p=d;return p&&r.boolean(p.retriggerRequest)}s(f,"is"),c.is=f})(a||(t.DiagnosticServerCancellationData=a={}));var i;(function(c){c.Full="full",c.Unchanged="unchanged"})(i||(t.DocumentDiagnosticReportKind=i={}));var o;(function(c){c.method="textDocument/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new e.ProgressType})(o||(t.DocumentDiagnosticRequest=o={}));var u;(function(c){c.method="workspace/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new e.ProgressType})(u||(t.WorkspaceDiagnosticRequest=u={}));var l;(function(c){c.method="workspace/diagnostic/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)})(l||(t.DiagnosticRefreshRequest=l={}))}}),Bk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;var e=(Du(),Rh(Of)),r=Ah(),n=ke(),a;(function(h){h.Markup=1,h.Code=2;function T(b){return b===1||b===2}s(T,"is"),h.is=T})(a||(t.NotebookCellKind=a={}));var i;(function(h){function T(w,C){const N={executionOrder:w};return(C===!0||C===!1)&&(N.success=C),N}s(T,"create"),h.create=T;function b(w){const C=w;return r.objectLiteral(C)&&e.uinteger.is(C.executionOrder)&&(C.success===void 0||r.boolean(C.success))}s(b,"is"),h.is=b;function v(w,C){return w===C?!0:w==null||C===null||C===void 0?!1:w.executionOrder===C.executionOrder&&w.success===C.success}s(v,"equals"),h.equals=v})(i||(t.ExecutionSummary=i={}));var o;(function(h){function T(C,N){return{kind:C,document:N}}s(T,"create"),h.create=T;function b(C){const N=C;return r.objectLiteral(N)&&a.is(N.kind)&&e.DocumentUri.is(N.document)&&(N.metadata===void 0||r.objectLiteral(N.metadata))}s(b,"is"),h.is=b;function v(C,N){const B=new Set;return C.document!==N.document&&B.add("document"),C.kind!==N.kind&&B.add("kind"),C.executionSummary!==N.executionSummary&&B.add("executionSummary"),(C.metadata!==void 0||N.metadata!==void 0)&&!w(C.metadata,N.metadata)&&B.add("metadata"),(C.executionSummary!==void 0||N.executionSummary!==void 0)&&!i.equals(C.executionSummary,N.executionSummary)&&B.add("executionSummary"),B}s(v,"diff"),h.diff=v;function w(C,N){if(C===N)return!0;if(C==null||N===null||N===void 0||typeof C!=typeof N||typeof C!="object")return!1;const B=Array.isArray(C),ne=Array.isArray(N);if(B!==ne)return!1;if(B&&ne){if(C.length!==N.length)return!1;for(let J=0;J0}s(le,"hasId"),m.hasId=le})(A||(t.StaticRegistrationOptions=A={}));var S;(function(m){function le(we){const H=we;return H&&(H.documentSelector===null||ot.is(H.documentSelector))}s(le,"is"),m.is=le})(S||(t.TextDocumentRegistrationOptions=S={}));var L;(function(m){function le(H){const Ie=H;return n.objectLiteral(Ie)&&(Ie.workDoneProgress===void 0||n.boolean(Ie.workDoneProgress))}s(le,"is"),m.is=le;function we(H){const Ie=H;return Ie&&n.boolean(Ie.workDoneProgress)}s(we,"hasWorkDoneProgress"),m.hasWorkDoneProgress=we})(L||(t.WorkDoneProgressOptions=L={}));var x;(function(m){m.method="initialize",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(x||(t.InitializeRequest=x={}));var O;(function(m){m.unknownProtocolVersion=1})(O||(t.InitializeErrorCodes=O={}));var z;(function(m){m.method="initialized",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(z||(t.InitializedNotification=z={}));var M;(function(m){m.method="shutdown",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType0(m.method)})(M||(t.ShutdownRequest=M={}));var Y;(function(m){m.method="exit",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType0(m.method)})(Y||(t.ExitNotification=Y={}));var q;(function(m){m.method="workspace/didChangeConfiguration",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(q||(t.DidChangeConfigurationNotification=q={}));var Z;(function(m){m.Error=1,m.Warning=2,m.Info=3,m.Log=4,m.Debug=5})(Z||(t.MessageType=Z={}));var ae;(function(m){m.method="window/showMessage",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(ae||(t.ShowMessageNotification=ae={}));var Oe;(function(m){m.method="window/showMessageRequest",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})(Oe||(t.ShowMessageRequest=Oe={}));var pe;(function(m){m.method="window/logMessage",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(pe||(t.LogMessageNotification=pe={}));var Ee;(function(m){m.method="telemetry/event",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(Ee||(t.TelemetryEventNotification=Ee={}));var Ve;(function(m){m.None=0,m.Full=1,m.Incremental=2})(Ve||(t.TextDocumentSyncKind=Ve={}));var Le;(function(m){m.method="textDocument/didOpen",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(Le||(t.DidOpenTextDocumentNotification=Le={}));var ee;(function(m){function le(H){let Ie=H;return Ie!=null&&typeof Ie.text=="string"&&Ie.range!==void 0&&(Ie.rangeLength===void 0||typeof Ie.rangeLength=="number")}s(le,"isIncremental"),m.isIncremental=le;function we(H){let Ie=H;return Ie!=null&&typeof Ie.text=="string"&&Ie.range===void 0&&Ie.rangeLength===void 0}s(we,"isFull"),m.isFull=we})(ee||(t.TextDocumentContentChangeEvent=ee={}));var Qe;(function(m){m.method="textDocument/didChange",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(Qe||(t.DidChangeTextDocumentNotification=Qe={}));var ce;(function(m){m.method="textDocument/didClose",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(ce||(t.DidCloseTextDocumentNotification=ce={}));var qe;(function(m){m.method="textDocument/didSave",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(qe||(t.DidSaveTextDocumentNotification=qe={}));var ge;(function(m){m.Manual=1,m.AfterDelay=2,m.FocusOut=3})(ge||(t.TextDocumentSaveReason=ge={}));var G;(function(m){m.method="textDocument/willSave",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(G||(t.WillSaveTextDocumentNotification=G={}));var je;(function(m){m.method="textDocument/willSaveWaitUntil",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(je||(t.WillSaveTextDocumentWaitUntilRequest=je={}));var Qt;(function(m){m.method="workspace/didChangeWatchedFiles",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(Qt||(t.DidChangeWatchedFilesNotification=Qt={}));var Dt;(function(m){m.Created=1,m.Changed=2,m.Deleted=3})(Dt||(t.FileChangeType=Dt={}));var ve;(function(m){function le(we){const H=we;return n.objectLiteral(H)&&(r.URI.is(H.baseUri)||r.WorkspaceFolder.is(H.baseUri))&&n.string(H.pattern)}s(le,"is"),m.is=le})(ve||(t.RelativePattern=ve={}));var da;(function(m){m.Create=1,m.Change=2,m.Delete=4})(da||(t.WatchKind=da={}));var ml;(function(m){m.method="textDocument/publishDiagnostics",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(ml||(t.PublishDiagnosticsNotification=ml={}));var hl;(function(m){m.Invoked=1,m.TriggerCharacter=2,m.TriggerForIncompleteCompletions=3})(hl||(t.CompletionTriggerKind=hl={}));var yl;(function(m){m.method="textDocument/completion",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(yl||(t.CompletionRequest=yl={}));var gl;(function(m){m.method="completionItem/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(gl||(t.CompletionResolveRequest=gl={}));var pa;(function(m){m.method="textDocument/hover",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(pa||(t.HoverRequest=pa={}));var ma;(function(m){m.Invoked=1,m.TriggerCharacter=2,m.ContentChange=3})(ma||(t.SignatureHelpTriggerKind=ma={}));var er;(function(m){m.method="textDocument/signatureHelp",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(er||(t.SignatureHelpRequest=er={}));var ha;(function(m){m.method="textDocument/definition",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ha||(t.DefinitionRequest=ha={}));var vl;(function(m){m.method="textDocument/references",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(vl||(t.ReferencesRequest=vl={}));var Tl;(function(m){m.method="textDocument/documentHighlight",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Tl||(t.DocumentHighlightRequest=Tl={}));var ya;(function(m){m.method="textDocument/documentSymbol",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ya||(t.DocumentSymbolRequest=ya={}));var ga;(function(m){m.method="textDocument/codeAction",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ga||(t.CodeActionRequest=ga={}));var $l;(function(m){m.method="codeAction/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})($l||(t.CodeActionResolveRequest=$l={}));var rc;(function(m){m.method="workspace/symbol",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(rc||(t.WorkspaceSymbolRequest=rc={}));var Rl;(function(m){m.method="workspaceSymbol/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Rl||(t.WorkspaceSymbolResolveRequest=Rl={}));var Al;(function(m){m.method="textDocument/codeLens",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Al||(t.CodeLensRequest=Al={}));var El;(function(m){m.method="codeLens/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(El||(t.CodeLensResolveRequest=El={}));var bl;(function(m){m.method="workspace/codeLens/refresh",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType0(m.method)})(bl||(t.CodeLensRefreshRequest=bl={}));var xt;(function(m){m.method="textDocument/documentLink",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(xt||(t.DocumentLinkRequest=xt={}));var Cl;(function(m){m.method="documentLink/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Cl||(t.DocumentLinkResolveRequest=Cl={}));var _l;(function(m){m.method="textDocument/formatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(_l||(t.DocumentFormattingRequest=_l={}));var jr;(function(m){m.method="textDocument/rangeFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(jr||(t.DocumentRangeFormattingRequest=jr={}));var Sl;(function(m){m.method="textDocument/rangesFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Sl||(t.DocumentRangesFormattingRequest=Sl={}));var sn;(function(m){m.method="textDocument/onTypeFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(sn||(t.DocumentOnTypeFormattingRequest=sn={}));var wl;(function(m){m.Identifier=1})(wl||(t.PrepareSupportDefaultBehavior=wl={}));var tr;(function(m){m.method="textDocument/rename",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(tr||(t.RenameRequest=tr={}));var Tr;(function(m){m.method="textDocument/prepareRename",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Tr||(t.PrepareRenameRequest=Tr={}));var Il;(function(m){m.method="workspace/executeCommand",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Il||(t.ExecuteCommandRequest=Il={}));var Nl;(function(m){m.method="workspace/applyEdit",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType("workspace/applyEdit")})(Nl||(t.ApplyWorkspaceEditRequest=Nl={}))}}),Wk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var e=al();function r(n,a,i,o){return e.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),(0,e.createMessageConnection)(n,a,i,o)}s(r,"createProtocolConnection"),t.createProtocolConnection=r}}),Vk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(t){var e=t&&t.__createBinding||(Object.create?(function(i,o,u,l){l===void 0&&(l=u);var c=Object.getOwnPropertyDescriptor(o,u);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:s(function(){return o[u]},"get")}),Object.defineProperty(i,l,c)}):(function(i,o,u,l){l===void 0&&(l=u),i[l]=o[u]})),r=t&&t.__exportStar||function(i,o){for(var u in i)u!=="default"&&!Object.prototype.hasOwnProperty.call(o,u)&&e(o,i,u)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(al(),t),r((Du(),Rh(Of)),t),r(ke(),t),r(Kk(),t);var n=Wk();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:s(function(){return n.createProtocolConnection},"get")});var a;(function(i){i.lspReservedErrorRangeStart=-32899,i.RequestFailed=-32803,i.ServerCancelled=-32802,i.ContentModified=-32801,i.RequestCancelled=-32800,i.lspReservedErrorRangeEnd=-32800})(a||(t.LSPErrorCodes=a={}))}}),qk=X({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(t){var e=t&&t.__createBinding||(Object.create?(function(i,o,u,l){l===void 0&&(l=u);var c=Object.getOwnPropertyDescriptor(o,u);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:s(function(){return o[u]},"get")}),Object.defineProperty(i,l,c)}):(function(i,o,u,l){l===void 0&&(l=u),i[l]=o[u]})),r=t&&t.__exportStar||function(i,o){for(var u in i)u!=="default"&&!Object.prototype.hasOwnProperty.call(o,u)&&e(o,i,u)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=iv();r(iv(),t),r(Vk(),t);function a(i,o,u,l){return(0,n.createMessageConnection)(i,o,u,l)}s(a,"createProtocolConnection"),t.createProtocolConnection=a}}),z$={};en(z$,{AbstractAstReflection:()=>Ch,AbstractCstNode:()=>Sg,AbstractLangiumParser:()=>Ig,AbstractParserErrorMessageProvider:()=>SN,AbstractThreadedAsyncParser:()=>gB,AstUtils:()=>_h,BiMap:()=>wf,Cancellation:()=>$e,CompositeCstNodeImpl:()=>Nd,ContextCache:()=>Md,CstNodeBuilder:()=>bN,CstUtils:()=>Eh,DEFAULT_TOKENIZE_OPTIONS:()=>qg,DONE_RESULT:()=>ct,DatatypeSymbol:()=>bf,DefaultAstNodeDescriptionProvider:()=>nP,DefaultAstNodeLocator:()=>iP,DefaultAsyncParser:()=>EP,DefaultCommentProvider:()=>AP,DefaultConfigurationProvider:()=>sP,DefaultDocumentBuilder:()=>oP,DefaultDocumentValidator:()=>rP,DefaultHydrator:()=>CP,DefaultIndexManager:()=>lP,DefaultJsonSerializer:()=>ZN,DefaultLangiumDocumentFactory:()=>UN,DefaultLangiumDocuments:()=>KN,DefaultLangiumProfiler:()=>AB,DefaultLexer:()=>Hg,DefaultLexerErrorMessageProvider:()=>cP,DefaultLinker:()=>WN,DefaultNameProvider:()=>VN,DefaultReferenceDescriptionProvider:()=>aP,DefaultReferences:()=>qN,DefaultScopeComputation:()=>HN,DefaultScopeProvider:()=>JN,DefaultServiceRegistry:()=>QN,DefaultTokenBuilder:()=>Od,DefaultValueConverter:()=>xg,DefaultWorkspaceLock:()=>bP,DefaultWorkspaceManager:()=>uP,Deferred:()=>Dr,Disposable:()=>Gn,DisposableCache:()=>xd,DocumentCache:()=>XN,DocumentState:()=>Q,DocumentValidator:()=>Mt,EMPTY_SCOPE:()=>pB,EMPTY_STREAM:()=>Vo,EmptyFileSystem:()=>st,EmptyFileSystemProvider:()=>wP,ErrorWithLocation:()=>Uf,GrammarAST:()=>U$,GrammarUtils:()=>ry,IndentationAwareLexer:()=>TB,IndentationAwareTokenBuilder:()=>SP,JSDocDocumentationProvider:()=>RP,LangiumCompletionParser:()=>wN,LangiumParser:()=>_N,LangiumParserErrorMessageProvider:()=>Ng,LeafCstNodeImpl:()=>Ef,LexingMode:()=>xn,MapScope:()=>dB,Module:()=>Qm,MultiMap:()=>xr,MultiMapScope:()=>YN,OperationCancelled:()=>cr,ParserWorker:()=>vB,ProfilingTask:()=>NP,Reduction:()=>vu,RefResolving:()=>gn,RegExpUtils:()=>ay,RootCstNodeImpl:()=>wg,SimpleCache:()=>Bg,StreamImpl:()=>ur,StreamScope:()=>Ym,TextDocument:()=>_f,TreeStreamImpl:()=>qo,URI:()=>It,UriTrie:()=>zg,UriUtils:()=>dt,VALIDATE_EACH_NODE:()=>tP,ValidationCategory:()=>If,ValidationRegistry:()=>eP,ValueConverter:()=>or,WorkspaceCache:()=>Ug,assertCondition:()=>ny,assertUnreachable:()=>tn,createCompletionParser:()=>Og,createDefaultCoreModule:()=>Xe,createDefaultSharedCoreModule:()=>Je,createGrammarConfig:()=>Ay,createLangiumParser:()=>Lg,createParser:()=>Pd,delayNextTick:()=>Ld,diagnosticData:()=>Dn,eagerLoad:()=>tv,getDiagnosticRange:()=>Wg,indentationBuilderDefaultOptions:()=>th,inject:()=>re,interruptAndCheck:()=>Ye,isAstNode:()=>Be,isAstNodeDescription:()=>bh,isAstNodeWithComment:()=>Kg,isCompositeCstNode:()=>Sr,isIMultiModeLexerDefinition:()=>zd,isJSDoc:()=>Xg,isLeafCstNode:()=>Vn,isLinkingError:()=>Rn,isMultiReference:()=>fr,isNamed:()=>jg,isOperationCancelled:()=>fa,isReference:()=>ft,isRootCstNode:()=>Df,isTokenTypeArray:()=>Fd,isTokenTypeDictionary:()=>Nf,loadGrammarFromJson:()=>Ze,parseJSDoc:()=>Yg,prepareLangiumParser:()=>Dg,setInterruptionPeriod:()=>Mg,startCancelableOperation:()=>Dd,stream:()=>de,toDiagnosticData:()=>Vg,toDiagnosticSeverity:()=>yu});var Eh={};en(Eh,{DefaultNameRegexp:()=>Jh,RangeComparison:()=>lr,compareRange:()=>Yh,findCommentNode:()=>Zh,findDeclarationNodeAtOffset:()=>lR,findLeafNodeAtOffset:()=>Bf,findLeafNodeBeforeOffset:()=>Qh,flattenCst:()=>oR,getDatatypeNode:()=>sR,getInteriorNodes:()=>fR,getNextNode:()=>uR,getPreviousNode:()=>ty,getStartlineNode:()=>cR,inRange:()=>Xh,isChildNode:()=>Hh,isCommentNode:()=>of,streamCst:()=>Jo,toDocumentSegment:()=>Zo,tokenToRange:()=>Tu});function Be(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}s(Be,"isAstNode");function ft(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}s(ft,"isReference");function fr(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}s(fr,"isMultiReference");function bh(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}s(bh,"isAstNodeDescription");function Rn(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}s(Rn,"isLinkingError");var Za,Ch=(Za=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=r.properties[e.property]?.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Be(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const a=n[r];if(a!==void 0)return a;{const i=this.types[e],o=i?i.superTypes.some(u=>this.isSubtype(u,r)):!1;return n[r]=o,o}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),a=[];for(const i of n)this.isSubtype(i,e)&&a.push(i);return this.allSubtypes[e]=a,a}}},s(Za,"AbstractAstReflection"),Za);function Sr(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}s(Sr,"isCompositeCstNode");function Vn(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}s(Vn,"isLeafCstNode");function Df(t){return Sr(t)&&typeof t.fullText=="string"}s(Df,"isRootCstNode");var Et,ur=(Et=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:s(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(a=>[e?e(a):a,r?r(a):a]);return new Map(n)}toString(){return this.join()}concat(e){return new Et(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return ct})}join(e=","){const r=this.iterator();let n="",a,i=!1;do a=r.next(),a.done||(i&&(n+=e),n+=j$(a.value)),i=!0;while(!a.done);return n}indexOf(e,r=0){const n=this.iterator();let a=0,i=n.next();for(;!i.done;){if(a>=r&&i.value===e)return a;i=n.next(),a++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,a=r.next();for(;!a.done;)e(a.value,n),a=r.next(),n++}map(e){return new Et(this.startFn,r=>{const{done:n,value:a}=this.nextFn(r);return n?ct:{done:!1,value:e(a)}})}filter(e){return new Et(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return ct})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let a=r,i=n.next();for(;!i.done;)a===void 0?a=i.value:a=e(a,i.value),i=n.next();return a}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const a=e.next();if(a.done)return n;const i=this.recursiveReduce(e,r,n);return i===void 0?a.value:r(i,a.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,a=r.next();for(;!a.done;){if(e(a.value))return n;a=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new Et(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const i=r.iterator.next();if(i.done)r.iterator=void 0;else return i}const{done:n,value:a}=this.nextFn(r.this);if(!n){const i=e(a);if(gu(i))r.iterator=i[Symbol.iterator]();else return{done:!1,value:i}}}while(r.iterator);return ct})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new Et(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const o=n.iterator.next();if(o.done)n.iterator=void 0;else return o}const{done:a,value:i}=r.nextFn(n.this);if(!a)if(gu(i))n.iterator=i[Symbol.iterator]();else return{done:!1,value:i}}while(n.iterator);return ct})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new Et(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?ct:this.nextFn(r.state)))}distinct(e){return new Et(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const a=e?e(n.value):n.value;if(!r.set.has(a))return r.set.add(a),n}while(!n.done);return ct})}exclude(e,r){const n=new Set;for(const a of e){const i=r?r(a):a;n.add(i)}return this.filter(a=>{const i=r?r(a):a;return!n.has(i)})}},s(Et,"StreamImpl"),Et);function j$(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}s(j$,"toString");function gu(t){return!!t&&typeof t[Symbol.iterator]=="function"}s(gu,"isIterable");var Vo=new ur(()=>{},()=>ct),ct=Object.freeze({done:!0,value:void 0});function de(...t){if(t.length===1){const e=t[0];if(e instanceof ur)return e;if(gu(e))return new ur(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new ur(()=>({index:0}),r=>r.index1?new ur(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:n?.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),a=>{for(a.pruned&&(a.iterators.pop(),a.pruned=!1);a.iterators.length>0;){const o=a.iterators[a.iterators.length-1].next();if(o.done)a.iterators.pop();else return a.iterators.push(r(o.value)[Symbol.iterator]()),o}return ct})}iterator(){const e={state:this.startFn(),next:s(()=>this.nextFn(e.state),"next"),prune:s(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},s(Qa,"TreeStreamImpl"),Qa),vu;(function(t){function e(i){return i.reduce((o,u)=>o+u,0)}s(e,"sum"),t.sum=e;function r(i){return i.reduce((o,u)=>o*u,0)}s(r,"product"),t.product=r;function n(i){return i.reduce((o,u)=>Math.min(o,u))}s(n,"min"),t.min=n;function a(i){return i.reduce((o,u)=>Math.max(o,u))}s(a,"max"),t.max=a})(vu||(vu={}));var _h={};en(_h,{assignMandatoryProperties:()=>Sh,copyAstNode:()=>Vc,findRootNode:()=>Ha,getContainerOfType:()=>qn,getDocument:()=>Vt,getReferenceNodes:()=>Kc,hasContainerOfType:()=>B$,linkContentToContainer:()=>Ho,streamAllContents:()=>Mr,streamAst:()=>qt,streamContents:()=>Mu,streamReferences:()=>Yo});function Ho(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((a,i)=>{Be(a)&&(a.$container=t,a.$containerProperty=r,a.$containerIndex=i,e.deep&&Ho(a,e))}):Be(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&Ho(n,e)))}s(Ho,"linkContentToContainer");function qn(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}s(qn,"getContainerOfType");function B$(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}s(B$,"hasContainerOfType");function Vt(t){const r=Ha(t).$document;if(!r)throw new Error("AST node has no document.");return r}s(Vt,"getDocument");function Ha(t){for(;t.$container;)t=t.$container;return t}s(Ha,"findRootNode");function Kc(t){return ft(t)?t.ref?[t.ref]:[]:fr(t)?t.items.map(e=>e.ref):[]}s(Kc,"getReferenceNodes");function Mu(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e?.range;return new ur(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexMu(r,e))}s(Mr,"streamAllContents");function qt(t,e){if(t){if(e?.range&&!Wc(t,e.range))return new qo(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new qo(t,r=>Mu(r,e),{includeRoot:!0})}s(qt,"streamAst");function Wc(t,e){if(!e)return!0;const r=t.$cstNode?.range;return r?Xh(r,e):!1}s(Wc,"isAstNodeInRange");function Yo(t){return new ur(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexRt,AbstractParserRule:()=>ru,AbstractRule:()=>za,AbstractType:()=>wt,Action:()=>Ur,Alternatives:()=>nu,ArrayLiteral:()=>qc,ArrayType:()=>Hc,Assignment:()=>Kr,BooleanLiteral:()=>Yc,CharacterRange:()=>Wr,Condition:()=>Vr,Conjunction:()=>au,CrossReference:()=>qr,Disjunction:()=>iu,EndOfFile:()=>Xc,Grammar:()=>br,GrammarImport:()=>Jc,Group:()=>An,InferredType:()=>Zc,InfixRule:()=>sr,InfixRuleOperatorList:()=>su,InfixRuleOperators:()=>Qc,Interface:()=>ja,Keyword:()=>Ba,LangiumGrammarAstReflection:()=>qh,LangiumGrammarTerminals:()=>Hk,NamedArgument:()=>Ua,NegatedToken:()=>En,Negation:()=>ef,NumberLiteral:()=>tf,Parameter:()=>Ka,ParameterReference:()=>rf,ParserRule:()=>Ut,ReferenceType:()=>ou,RegexToken:()=>bn,ReturnType:()=>nf,RuleCall:()=>Cn,SimpleType:()=>Wa,StringLiteral:()=>af,TerminalAlternatives:()=>_n,TerminalElement:()=>At,TerminalGroup:()=>Sn,TerminalRule:()=>Cr,TerminalRuleCall:()=>wn,Type:()=>lu,TypeAttribute:()=>In,TypeDefinition:()=>Nn,UnionType:()=>sf,UnorderedGroup:()=>uu,UntilToken:()=>Pn,ValueLiteral:()=>kn,Wildcard:()=>Va,isAbstractElement:()=>xf,isAbstractParserRule:()=>Hn,isAbstractRule:()=>K$,isAbstractType:()=>W$,isAction:()=>Yr,isAlternatives:()=>Mf,isArrayLiteral:()=>V$,isArrayType:()=>Ih,isAssignment:()=>wr,isBooleanLiteral:()=>Nh,isCharacterRange:()=>Ph,isCondition:()=>q$,isConjunction:()=>kh,isCrossReference:()=>Yn,isDisjunction:()=>Oh,isEndOfFile:()=>Lh,isGrammar:()=>H$,isGrammarImport:()=>Y$,isGroup:()=>Xn,isInferredType:()=>Gu,isInfixRule:()=>Xo,isInfixRuleOperatorList:()=>X$,isInfixRuleOperators:()=>J$,isInterface:()=>Dh,isKeyword:()=>Ir,isNamedArgument:()=>Z$,isNegatedToken:()=>xh,isNegation:()=>Mh,isNumberLiteral:()=>Q$,isParameter:()=>eR,isParameterReference:()=>Gh,isParserRule:()=>mt,isReferenceType:()=>Fh,isRegexToken:()=>zh,isReturnType:()=>jh,isRuleCall:()=>Nr,isSimpleType:()=>Gf,isStringLiteral:()=>tR,isTerminalAlternatives:()=>Bh,isTerminalElement:()=>rR,isTerminalGroup:()=>Uh,isTerminalRule:()=>jt,isTerminalRuleCall:()=>Ff,isType:()=>zf,isTypeAttribute:()=>nR,isTypeDefinition:()=>aR,isUnionType:()=>Kh,isUnorderedGroup:()=>jf,isUntilToken:()=>Wh,isValueLiteral:()=>iR,isWildcard:()=>Vh,reflection:()=>U});var Hk={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},Rt={$type:"AbstractElement",cardinality:"cardinality"};function xf(t){return U.isInstance(t,Rt.$type)}s(xf,"isAbstractElement");var ru={$type:"AbstractParserRule"};function Hn(t){return U.isInstance(t,ru.$type)}s(Hn,"isAbstractParserRule");var za={$type:"AbstractRule"};function K$(t){return U.isInstance(t,za.$type)}s(K$,"isAbstractRule");var wt={$type:"AbstractType"};function W$(t){return U.isInstance(t,wt.$type)}s(W$,"isAbstractType");var Ur={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Yr(t){return U.isInstance(t,Ur.$type)}s(Yr,"isAction");var nu={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Mf(t){return U.isInstance(t,nu.$type)}s(Mf,"isAlternatives");var qc={$type:"ArrayLiteral",elements:"elements"};function V$(t){return U.isInstance(t,qc.$type)}s(V$,"isArrayLiteral");var Hc={$type:"ArrayType",elementType:"elementType"};function Ih(t){return U.isInstance(t,Hc.$type)}s(Ih,"isArrayType");var Kr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function wr(t){return U.isInstance(t,Kr.$type)}s(wr,"isAssignment");var Yc={$type:"BooleanLiteral",true:"true"};function Nh(t){return U.isInstance(t,Yc.$type)}s(Nh,"isBooleanLiteral");var Wr={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Ph(t){return U.isInstance(t,Wr.$type)}s(Ph,"isCharacterRange");var Vr={$type:"Condition"};function q$(t){return U.isInstance(t,Vr.$type)}s(q$,"isCondition");var au={$type:"Conjunction",left:"left",right:"right"};function kh(t){return U.isInstance(t,au.$type)}s(kh,"isConjunction");var qr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Yn(t){return U.isInstance(t,qr.$type)}s(Yn,"isCrossReference");var iu={$type:"Disjunction",left:"left",right:"right"};function Oh(t){return U.isInstance(t,iu.$type)}s(Oh,"isDisjunction");var Xc={$type:"EndOfFile",cardinality:"cardinality"};function Lh(t){return U.isInstance(t,Xc.$type)}s(Lh,"isEndOfFile");var br={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function H$(t){return U.isInstance(t,br.$type)}s(H$,"isGrammar");var Jc={$type:"GrammarImport",path:"path"};function Y$(t){return U.isInstance(t,Jc.$type)}s(Y$,"isGrammarImport");var An={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Xn(t){return U.isInstance(t,An.$type)}s(Xn,"isGroup");var Zc={$type:"InferredType",name:"name"};function Gu(t){return U.isInstance(t,Zc.$type)}s(Gu,"isInferredType");var sr={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Xo(t){return U.isInstance(t,sr.$type)}s(Xo,"isInfixRule");var su={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function X$(t){return U.isInstance(t,su.$type)}s(X$,"isInfixRuleOperatorList");var Qc={$type:"InfixRuleOperators",precedences:"precedences"};function J$(t){return U.isInstance(t,Qc.$type)}s(J$,"isInfixRuleOperators");var ja={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Dh(t){return U.isInstance(t,ja.$type)}s(Dh,"isInterface");var Ba={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Ir(t){return U.isInstance(t,Ba.$type)}s(Ir,"isKeyword");var Ua={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function Z$(t){return U.isInstance(t,Ua.$type)}s(Z$,"isNamedArgument");var En={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function xh(t){return U.isInstance(t,En.$type)}s(xh,"isNegatedToken");var ef={$type:"Negation",value:"value"};function Mh(t){return U.isInstance(t,ef.$type)}s(Mh,"isNegation");var tf={$type:"NumberLiteral",value:"value"};function Q$(t){return U.isInstance(t,tf.$type)}s(Q$,"isNumberLiteral");var Ka={$type:"Parameter",name:"name"};function eR(t){return U.isInstance(t,Ka.$type)}s(eR,"isParameter");var rf={$type:"ParameterReference",parameter:"parameter"};function Gh(t){return U.isInstance(t,rf.$type)}s(Gh,"isParameterReference");var Ut={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function mt(t){return U.isInstance(t,Ut.$type)}s(mt,"isParserRule");var ou={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function Fh(t){return U.isInstance(t,ou.$type)}s(Fh,"isReferenceType");var bn={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function zh(t){return U.isInstance(t,bn.$type)}s(zh,"isRegexToken");var nf={$type:"ReturnType",name:"name"};function jh(t){return U.isInstance(t,nf.$type)}s(jh,"isReturnType");var Cn={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Nr(t){return U.isInstance(t,Cn.$type)}s(Nr,"isRuleCall");var Wa={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function Gf(t){return U.isInstance(t,Wa.$type)}s(Gf,"isSimpleType");var af={$type:"StringLiteral",value:"value"};function tR(t){return U.isInstance(t,af.$type)}s(tR,"isStringLiteral");var _n={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Bh(t){return U.isInstance(t,_n.$type)}s(Bh,"isTerminalAlternatives");var At={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function rR(t){return U.isInstance(t,At.$type)}s(rR,"isTerminalElement");var Sn={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Uh(t){return U.isInstance(t,Sn.$type)}s(Uh,"isTerminalGroup");var Cr={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function jt(t){return U.isInstance(t,Cr.$type)}s(jt,"isTerminalRule");var wn={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function Ff(t){return U.isInstance(t,wn.$type)}s(Ff,"isTerminalRuleCall");var lu={$type:"Type",name:"name",type:"type"};function zf(t){return U.isInstance(t,lu.$type)}s(zf,"isType");var In={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function nR(t){return U.isInstance(t,In.$type)}s(nR,"isTypeAttribute");var Nn={$type:"TypeDefinition"};function aR(t){return U.isInstance(t,Nn.$type)}s(aR,"isTypeDefinition");var sf={$type:"UnionType",types:"types"};function Kh(t){return U.isInstance(t,sf.$type)}s(Kh,"isUnionType");var uu={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function jf(t){return U.isInstance(t,uu.$type)}s(jf,"isUnorderedGroup");var Pn={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Wh(t){return U.isInstance(t,Pn.$type)}s(Wh,"isUntilToken");var kn={$type:"ValueLiteral"};function iR(t){return U.isInstance(t,kn.$type)}s(iR,"isValueLiteral");var Va={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Vh(t){return U.isInstance(t,Va.$type)}s(Vh,"isWildcard");var ei,qh=(ei=class extends Ch{constructor(){super(...arguments),this.types={AbstractElement:{name:Rt.$type,properties:{cardinality:{name:Rt.cardinality}},superTypes:[]},AbstractParserRule:{name:ru.$type,properties:{},superTypes:[za.$type,wt.$type]},AbstractRule:{name:za.$type,properties:{},superTypes:[]},AbstractType:{name:wt.$type,properties:{},superTypes:[]},Action:{name:Ur.$type,properties:{cardinality:{name:Ur.cardinality},feature:{name:Ur.feature},inferredType:{name:Ur.inferredType},operator:{name:Ur.operator},type:{name:Ur.type,referenceType:wt.$type}},superTypes:[Rt.$type]},Alternatives:{name:nu.$type,properties:{cardinality:{name:nu.cardinality},elements:{name:nu.elements,defaultValue:[]}},superTypes:[Rt.$type]},ArrayLiteral:{name:qc.$type,properties:{elements:{name:qc.elements,defaultValue:[]}},superTypes:[kn.$type]},ArrayType:{name:Hc.$type,properties:{elementType:{name:Hc.elementType}},superTypes:[Nn.$type]},Assignment:{name:Kr.$type,properties:{cardinality:{name:Kr.cardinality},feature:{name:Kr.feature},operator:{name:Kr.operator},predicate:{name:Kr.predicate},terminal:{name:Kr.terminal}},superTypes:[Rt.$type]},BooleanLiteral:{name:Yc.$type,properties:{true:{name:Yc.true,defaultValue:!1}},superTypes:[Vr.$type,kn.$type]},CharacterRange:{name:Wr.$type,properties:{cardinality:{name:Wr.cardinality},left:{name:Wr.left},lookahead:{name:Wr.lookahead},parenthesized:{name:Wr.parenthesized,defaultValue:!1},right:{name:Wr.right}},superTypes:[At.$type]},Condition:{name:Vr.$type,properties:{},superTypes:[]},Conjunction:{name:au.$type,properties:{left:{name:au.left},right:{name:au.right}},superTypes:[Vr.$type]},CrossReference:{name:qr.$type,properties:{cardinality:{name:qr.cardinality},deprecatedSyntax:{name:qr.deprecatedSyntax,defaultValue:!1},isMulti:{name:qr.isMulti,defaultValue:!1},terminal:{name:qr.terminal},type:{name:qr.type,referenceType:wt.$type}},superTypes:[Rt.$type]},Disjunction:{name:iu.$type,properties:{left:{name:iu.left},right:{name:iu.right}},superTypes:[Vr.$type]},EndOfFile:{name:Xc.$type,properties:{cardinality:{name:Xc.cardinality}},superTypes:[Rt.$type]},Grammar:{name:br.$type,properties:{imports:{name:br.imports,defaultValue:[]},interfaces:{name:br.interfaces,defaultValue:[]},isDeclared:{name:br.isDeclared,defaultValue:!1},name:{name:br.name},rules:{name:br.rules,defaultValue:[]},types:{name:br.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Jc.$type,properties:{path:{name:Jc.path}},superTypes:[]},Group:{name:An.$type,properties:{cardinality:{name:An.cardinality},elements:{name:An.elements,defaultValue:[]},guardCondition:{name:An.guardCondition},predicate:{name:An.predicate}},superTypes:[Rt.$type]},InferredType:{name:Zc.$type,properties:{name:{name:Zc.name}},superTypes:[wt.$type]},InfixRule:{name:sr.$type,properties:{call:{name:sr.call},dataType:{name:sr.dataType},inferredType:{name:sr.inferredType},name:{name:sr.name},operators:{name:sr.operators},parameters:{name:sr.parameters,defaultValue:[]},returnType:{name:sr.returnType,referenceType:wt.$type}},superTypes:[ru.$type]},InfixRuleOperatorList:{name:su.$type,properties:{associativity:{name:su.associativity},operators:{name:su.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:Qc.$type,properties:{precedences:{name:Qc.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:ja.$type,properties:{attributes:{name:ja.attributes,defaultValue:[]},name:{name:ja.name},superTypes:{name:ja.superTypes,defaultValue:[],referenceType:wt.$type}},superTypes:[wt.$type]},Keyword:{name:Ba.$type,properties:{cardinality:{name:Ba.cardinality},predicate:{name:Ba.predicate},value:{name:Ba.value}},superTypes:[Rt.$type]},NamedArgument:{name:Ua.$type,properties:{calledByName:{name:Ua.calledByName,defaultValue:!1},parameter:{name:Ua.parameter,referenceType:Ka.$type},value:{name:Ua.value}},superTypes:[]},NegatedToken:{name:En.$type,properties:{cardinality:{name:En.cardinality},lookahead:{name:En.lookahead},parenthesized:{name:En.parenthesized,defaultValue:!1},terminal:{name:En.terminal}},superTypes:[At.$type]},Negation:{name:ef.$type,properties:{value:{name:ef.value}},superTypes:[Vr.$type]},NumberLiteral:{name:tf.$type,properties:{value:{name:tf.value}},superTypes:[kn.$type]},Parameter:{name:Ka.$type,properties:{name:{name:Ka.name}},superTypes:[]},ParameterReference:{name:rf.$type,properties:{parameter:{name:rf.parameter,referenceType:Ka.$type}},superTypes:[Vr.$type]},ParserRule:{name:Ut.$type,properties:{dataType:{name:Ut.dataType},definition:{name:Ut.definition},entry:{name:Ut.entry,defaultValue:!1},fragment:{name:Ut.fragment,defaultValue:!1},inferredType:{name:Ut.inferredType},name:{name:Ut.name},parameters:{name:Ut.parameters,defaultValue:[]},returnType:{name:Ut.returnType,referenceType:wt.$type}},superTypes:[ru.$type]},ReferenceType:{name:ou.$type,properties:{isMulti:{name:ou.isMulti,defaultValue:!1},referenceType:{name:ou.referenceType}},superTypes:[Nn.$type]},RegexToken:{name:bn.$type,properties:{cardinality:{name:bn.cardinality},lookahead:{name:bn.lookahead},parenthesized:{name:bn.parenthesized,defaultValue:!1},regex:{name:bn.regex}},superTypes:[At.$type]},ReturnType:{name:nf.$type,properties:{name:{name:nf.name}},superTypes:[]},RuleCall:{name:Cn.$type,properties:{arguments:{name:Cn.arguments,defaultValue:[]},cardinality:{name:Cn.cardinality},predicate:{name:Cn.predicate},rule:{name:Cn.rule,referenceType:za.$type}},superTypes:[Rt.$type]},SimpleType:{name:Wa.$type,properties:{primitiveType:{name:Wa.primitiveType},stringType:{name:Wa.stringType},typeRef:{name:Wa.typeRef,referenceType:wt.$type}},superTypes:[Nn.$type]},StringLiteral:{name:af.$type,properties:{value:{name:af.value}},superTypes:[kn.$type]},TerminalAlternatives:{name:_n.$type,properties:{cardinality:{name:_n.cardinality},elements:{name:_n.elements,defaultValue:[]},lookahead:{name:_n.lookahead},parenthesized:{name:_n.parenthesized,defaultValue:!1}},superTypes:[At.$type]},TerminalElement:{name:At.$type,properties:{cardinality:{name:At.cardinality},lookahead:{name:At.lookahead},parenthesized:{name:At.parenthesized,defaultValue:!1}},superTypes:[Rt.$type]},TerminalGroup:{name:Sn.$type,properties:{cardinality:{name:Sn.cardinality},elements:{name:Sn.elements,defaultValue:[]},lookahead:{name:Sn.lookahead},parenthesized:{name:Sn.parenthesized,defaultValue:!1}},superTypes:[At.$type]},TerminalRule:{name:Cr.$type,properties:{definition:{name:Cr.definition},fragment:{name:Cr.fragment,defaultValue:!1},hidden:{name:Cr.hidden,defaultValue:!1},name:{name:Cr.name},type:{name:Cr.type}},superTypes:[za.$type]},TerminalRuleCall:{name:wn.$type,properties:{cardinality:{name:wn.cardinality},lookahead:{name:wn.lookahead},parenthesized:{name:wn.parenthesized,defaultValue:!1},rule:{name:wn.rule,referenceType:Cr.$type}},superTypes:[At.$type]},Type:{name:lu.$type,properties:{name:{name:lu.name},type:{name:lu.type}},superTypes:[wt.$type]},TypeAttribute:{name:In.$type,properties:{defaultValue:{name:In.defaultValue},isOptional:{name:In.isOptional,defaultValue:!1},name:{name:In.name},type:{name:In.type}},superTypes:[]},TypeDefinition:{name:Nn.$type,properties:{},superTypes:[]},UnionType:{name:sf.$type,properties:{types:{name:sf.types,defaultValue:[]}},superTypes:[Nn.$type]},UnorderedGroup:{name:uu.$type,properties:{cardinality:{name:uu.cardinality},elements:{name:uu.elements,defaultValue:[]}},superTypes:[Rt.$type]},UntilToken:{name:Pn.$type,properties:{cardinality:{name:Pn.cardinality},lookahead:{name:Pn.lookahead},parenthesized:{name:Pn.parenthesized,defaultValue:!1},terminal:{name:Pn.terminal}},superTypes:[At.$type]},ValueLiteral:{name:kn.$type,properties:{},superTypes:[]},Wildcard:{name:Va.$type,properties:{cardinality:{name:Va.cardinality},lookahead:{name:Va.lookahead},parenthesized:{name:Va.parenthesized,defaultValue:!1}},superTypes:[At.$type]}}}},s(ei,"LangiumGrammarAstReflection"),ei),U=new qh;function sR(t){let e=t,r=!1;for(;e;){const n=qn(e.grammarSource,mt);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}s(sR,"getDatatypeNode");function Jo(t){return new qo(t,e=>Sr(e)?e.content:[],{includeRoot:!0})}s(Jo,"streamCst");function oR(t){return Jo(t).filter(Vn)}s(oR,"flattenCst");function Hh(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}s(Hh,"isChildNode");function Tu(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}s(Tu,"tokenToRange");function Zo(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}s(Zo,"toDocumentSegment");var lr;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(lr||(lr={}));function Yh(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return lr.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.linelr.After}s(Xh,"inRange");var Jh=/^[\w\p{L}]$/u;function lR(t,e,r=Jh){if(t){if(e>0){const n=e-t.offset,a=t.text.charAt(n);r.test(a)||e--}return Bf(t,e)}}s(lR,"findDeclarationNodeAtOffset");function Zh(t,e){if(t){const r=ty(t,!0);if(r&&of(r,e))return r;if(Df(t)){const n=t.content.findIndex(a=>!a.hidden);for(let a=n-1;a>=0;a--){const i=t.content[a];if(of(i,e))return i}}}}s(Zh,"findCommentNode");function of(t,e){return Vn(t)&&e.includes(t.tokenType.name)}s(of,"isCommentNode");function Bf(t,e){if(Vn(t))return t;if(Sr(t)){const r=ey(t,e,!1);if(r)return Bf(r,e)}}s(Bf,"findLeafNodeAtOffset");function Qh(t,e){if(Vn(t))return t;if(Sr(t)){const r=ey(t,e,!0);if(r)return Qh(r,e)}}s(Qh,"findLeafNodeBeforeOffset");function ey(t,e,r){let n=0,a=t.content.length-1,i;for(;n<=a;){const o=Math.floor((n+a)/2),u=t.content[o];if(u.offset<=e&&u.end>e)return u;u.end<=e?(i=r?u:void 0,n=o+1):a=o-1}return i}s(ey,"binarySearch");function ty(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const a=r.content[n];if(e||!a.hidden)return a}t=r}}s(ty,"getPreviousNode");function uR(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const a=r.content.length-1;for(;nhy,findNameAssignment:()=>Xf,findNodeForKeyword:()=>my,findNodeForProperty:()=>qf,findNodesForKeyword:()=>$R,findNodesForKeywordInternal:()=>Yf,findNodesForProperty:()=>py,getActionAtElement:()=>gy,getActionType:()=>Ty,getAllReachableRules:()=>Vf,getAllRulesUsedForCrossReferences:()=>TR,getCrossReferenceTerminal:()=>fy,getEntryRule:()=>ly,getExplicitRuleType:()=>zu,getHiddenRules:()=>uy,getRuleType:()=>$y,getRuleTypeName:()=>CR,getTypeName:()=>jn,isArrayCardinality:()=>AR,isArrayOperator:()=>ER,isCommentTerminal:()=>dy,isDataType:()=>bR,isDataTypeRule:()=>Fu,isOptionalCardinality:()=>RR,terminalRegex:()=>ju});var ti,Uf=(ti=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},s(ti,"ErrorWithLocation"),ti);function tn(t,e="Error: Got unexpected value."){throw new Error(e)}s(tn,"assertUnreachable");function ny(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}s(ny,"assertCondition");var ay={};en(ay,{NEWLINE_REGEXP:()=>hR,escapeRegExp:()=>il,getTerminalParts:()=>gR,isMultilineComment:()=>iy,isWhitespace:()=>Wf,partialMatches:()=>sy,partialRegExp:()=>oy,whitespaceCharacters:()=>vR});function W(t){return t.charCodeAt(0)}s(W,"cc");function wc(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}s(wc,"insertToSet");function Ia(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}s(Ia,"addFlag");function mn(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}s(mn,"ASSERT_EXISTS");function pR(){throw Error("Internal Error - Should never get here!")}s(pR,"ASSERT_NEVER_REACH_HERE");function Rm(t){return t.type==="Character"}s(Rm,"isCharacter");var lf=[];for(let t=W("0");t<=W("9");t++)lf.push(t);var uf=[W("_")].concat(lf);for(let t=W("a");t<=W("z");t++)uf.push(t);for(let t=W("A");t<=W("Z");t++)uf.push(t);var sv=[W(" "),W("\f"),W(` +`),W("\r"),W(" "),W("\v"),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W("\u2028"),W("\u2029"),W(" "),W(" "),W(" "),W("\uFEFF")],Yk=/[0-9a-fA-F]/,nc=/[0-9]/,Xk=/[1-9]/,ri,mR=(ri=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ia(n,"global");break;case"i":Ia(n,"ignoreCase");break;case"m":Ia(n,"multiLine");break;case"u":Ia(n,"unicode");break;case"y":Ia(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}mn(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return pR()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const a=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:a,atMost:a};break;case",":let i;this.isDigit()?(i=this.integerIncludingZero(),r={atLeast:a,atMost:i}):r={atLeast:a,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;mn(r);break}if(!(e===!0&&r===void 0)&&mn(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),mn(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[W(` +`),W("\r"),W("\u2028"),W("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=lf;break;case"D":e=lf,r=!0;break;case"s":e=sv;break;case"S":e=sv,r=!0;break;case"w":e=uf;break;case"W":e=uf,r=!0;break}if(mn(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=W("\f");break;case"n":e=W(` +`);break;case"r":e=W("\r");break;case"t":e=W(" ");break;case"v":e=W("\v");break}if(mn(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:W("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:W(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` +`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:W(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,Rm(n)&&this.isRangeDash()){this.consumeChar("-");const a=this.classAtom();if(a.type,Rm(a)){if(a.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},s(ri,"RegExpParser"),ri),ni,Kf=(ni=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(a=>{this.visit(a)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},s(ni,"BaseRegExpVisitor"),ni),hR=/\r?\n/gm,yR=new mR,ai,Jk=(ai=class extends Kf{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===` +`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=il(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!` +`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},s(ai,"TerminalRegExpVisitor"),ai),On=new Jk;function gR(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=yR.pattern(t),r=[];for(const n of e.value.value)On.reset(t),On.visit(n),r.push({start:On.startRegexp,end:On.endRegex});return r}catch{return[]}}s(gR,"getTerminalParts");function iy(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),On.reset(t),On.visit(yR.pattern(t)),On.multiline}catch{return!1}}s(iy,"isMultilineComment");var vR=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function Wf(t){const e=typeof t=="string"?new RegExp(t):t;return vR.some(r=>e.test(r))}s(Wf,"isWhitespace");function il(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(il,"escapeRegExp");function sy(t,e){const r=oy(t),n=e.match(r);return!!n&&n[0].length>0}s(sy,"partialMatches");function oy(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function a(){let i="",o;function u(c){i+=r.substr(n,c),n+=c}s(u,"appendRaw");function l(c){i+="(?:"+r.substr(n,c)+"|$)",n+=c}for(s(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=n,o=o.exec(r)||[],l(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":u(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=n,o=o.exec(r),o?u(o[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":i+="(?:",n+=3,i+=a()+"|$)";break;case"=":i+="(?=",n+=3,i+=a()+")";break;case"!":o=n,n+=3,a(),i+=r.substr(o,n-o);break;case"<":switch(r[n+3]){case"=":case"!":o=n,n+=4,a(),i+=r.substr(o,n-o);break;default:u(r.indexOf(">",n)-n+1),i+=a()+"|$)";break}break}else u(1),i+=a()+"|$)";break;case")":return++n,i;default:l(1);break}return i}return s(a,"process"),new RegExp(a(),t.flags)}s(oy,"partialRegExp");function ly(t){return t.rules.find(e=>mt(e)&&e.entry)}s(ly,"getEntryRule");function uy(t){return t.rules.filter(e=>jt(e)&&e.hidden)}s(uy,"getHiddenRules");function Vf(t,e){const r=new Set,n=ly(t);if(!n)return new Set(t.rules);const a=[n].concat(uy(t));for(const o of a)cy(o,r,e);const i=new Set;for(const o of t.rules)(r.has(o.name)||jt(o)&&o.hidden)&&i.add(o);return i}s(Vf,"getAllReachableRules");function cy(t,e,r){e.add(t.name),Mr(t).forEach(n=>{if(Nr(n)||r&&Ff(n)){const a=n.rule.ref;a&&!e.has(a.name)&&cy(a,e,r)}})}s(cy,"ruleDfs");function TR(t){const e=new Set;return Mr(t).forEach(r=>{Yn(r)&&(mt(r.type.ref)&&e.add(r.type.ref),Gu(r.type.ref)&&mt(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}s(TR,"getAllRulesUsedForCrossReferences");function fy(t){if(t.terminal)return t.terminal;if(t.type.ref)return Xf(t.type.ref)?.terminal}s(fy,"getCrossReferenceTerminal");function dy(t){return t.hidden&&!Wf(ju(t))}s(dy,"isCommentTerminal");function py(t,e){return!t||!e?[]:Hf(t,e,t.astNode,!0)}s(py,"findNodesForProperty");function qf(t,e,r){if(!t||!e)return;const n=Hf(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}s(qf,"findNodeForProperty");function Hf(t,e,r,n){if(!n){const a=qn(t.grammarSource,wr);if(a&&a.feature===e)return[t]}return Sr(t)&&t.astNode===r?t.content.flatMap(a=>Hf(a,e,r,!1)):[]}s(Hf,"findNodesForPropertyInternal");function $R(t,e){return t?Yf(t,e,t?.astNode):[]}s($R,"findNodesForKeyword");function my(t,e,r){if(!t)return;const n=Yf(t,e,t?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}s(my,"findNodeForKeyword");function Yf(t,e,r){if(t.astNode!==r)return[];if(Ir(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=Jo(t).iterator();let a;const i=[];do if(a=n.next(),!a.done){const o=a.value;o.astNode===r?Ir(o.grammarSource)&&o.grammarSource.value===e&&i.push(o):n.prune()}while(!a.done);return i}s(Yf,"findNodesForKeywordInternal");function hy(t){const e=t.astNode;for(;e===t.container?.astNode;){const r=qn(t.grammarSource,wr);if(r)return r;t=t.container}}s(hy,"findAssignment");function Xf(t){let e=t;return Gu(e)&&(Yr(e.$container)?e=e.$container.$container:Hn(e.$container)?e=e.$container:tn(e.$container)),yy(t,e,new Map)}s(Xf,"findNameAssignment");function yy(t,e,r){function n(a,i){let o;return qn(a,wr)||(o=yy(i,i,r)),r.set(t,o),o}if(s(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of Mr(e)){if(wr(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Nr(a)&&mt(a.rule.ref))return n(a,a.rule.ref);if(Gf(a)&&a.typeRef?.ref)return n(a,a.typeRef.ref)}}s(yy,"findNameAssignmentInternal");function gy(t){const e=t.$container;if(Xn(e)){const r=e.elements,n=r.indexOf(t);for(let a=n-1;a>=0;a--){const i=r[a];if(Yr(i))return i;{const o=Mr(r[a]).find(Yr);if(o)return o}}}if(xf(e))return gy(e)}s(gy,"getActionAtElement");function RR(t,e){return t==="?"||t==="*"||Xn(e)&&!!e.guardCondition}s(RR,"isOptionalCardinality");function AR(t){return t==="*"||t==="+"}s(AR,"isArrayCardinality");function ER(t){return t==="+="}s(ER,"isArrayOperator");function Fu(t){return vy(t,new Set)}s(Fu,"isDataTypeRule");function vy(t,e){if(e.has(t))return!0;e.add(t);for(const r of Mr(t))if(Nr(r)){if(!r.rule.ref||mt(r.rule.ref)&&!vy(r.rule.ref,e)||Xo(r.rule.ref))return!1}else{if(wr(r))return!1;if(Yr(r))return!1}return!!t.definition}s(vy,"isDataTypeRuleInternal");function bR(t){return cf(t.type,new Set)}s(bR,"isDataType");function cf(t,e){if(e.has(t))return!0;if(e.add(t),Ih(t))return!1;if(Fh(t))return!1;if(Kh(t))return t.types.every(r=>cf(r,e));if(Gf(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const r=t.typeRef.ref;return zf(r)?cf(r.type,e):!1}else return!1}else return!1}s(cf,"isDataTypeInternal");function zu(t){if(!jt(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}s(zu,"getExplicitRuleType");function jn(t){if(Hn(t))return mt(t)&&Fu(t)?t.name:zu(t)??t.name;if(Dh(t)||zf(t)||jh(t))return t.name;if(Yr(t)){const e=Ty(t);if(e)return e}else if(Gu(t))return t.name;throw new Error("Cannot get name of Unknown Type")}s(jn,"getTypeName");function Ty(t){if(t.inferredType)return t.inferredType.name;if(t.type?.ref)return jn(t.type.ref)}s(Ty,"getActionType");function CR(t){return jt(t)?t.type?.name??"string":mt(t)&&Fu(t)?t.name:zu(t)??t.name}s(CR,"getRuleTypeName");function $y(t){return jt(t)?t.type?.name??"string":zu(t)??t.name}s($y,"getRuleType");function ju(t){const e={s:!1,i:!1,u:!1},r=Jn(t.definition,e),n=Object.entries(e).filter(([,a])=>a).map(([a])=>a).join("");return new RegExp(r,n)}s(ju,"terminalRegex");var Ry=/[\s\S]/.source;function Jn(t,e){if(Bh(t))return _R(t);if(Uh(t))return SR(t);if(Ph(t))return NR(t);if(Ff(t)){const r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return dr(Jn(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(xh(t))return IR(t);if(Wh(t))return wR(t);if(zh(t)){const r=t.regex.lastIndexOf("/"),n=t.regex.substring(1,r),a=t.regex.substring(r+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),dr(n,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(Vh(t))return dr(Ry,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t?.$type}, ${t?.$cstNode?.text}`)}}}s(Jn,"abstractElementToRegex");function _R(t){return dr(t.elements.map(e=>Jn(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}s(_R,"terminalAlternativesToRegex");function SR(t){return dr(t.elements.map(e=>Jn(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}s(SR,"terminalGroupToRegex");function wR(t){return dr(`${Ry}*?${Jn(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}s(wR,"untilTokenToRegex");function IR(t){return dr(`(?!${Jn(t.terminal)})${Ry}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}s(IR,"negateTokenToRegex");function NR(t){return t.right?dr(`[${Ic(t.left)}-${Ic(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):dr(Ic(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}s(NR,"characterRangeToRegex");function Ic(t){return il(t.value)}s(Ic,"keywordToRegex");function dr(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}s(dr,"withCardinality");function Ay(t){const e=[],r=t.Grammar;for(const n of r.rules)jt(n)&&dy(n)&&iy(ju(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:Jh}}s(Ay,"createGrammarConfig");var Zk=typeof global=="object"&&global&&global.Object===Object&&global,PR=Zk,Qk=typeof self=="object"&&self&&self.Object===Object&&self,eO=PR||Qk||Function("return this")(),mr=eO,tO=mr.Symbol,Ft=tO,kR=Object.prototype,rO=kR.hasOwnProperty,nO=kR.toString,kl=Ft?Ft.toStringTag:void 0;function OR(t){var e=rO.call(t,kl),r=t[kl];try{t[kl]=void 0;var n=!0}catch{}var a=nO.call(t);return n&&(e?t[kl]=r:delete t[kl]),a}s(OR,"getRawTag");var aO=OR,iO=Object.prototype,sO=iO.toString;function LR(t){return sO.call(t)}s(LR,"objectToString");var oO=LR,lO="[object Null]",uO="[object Undefined]",ov=Ft?Ft.toStringTag:void 0;function DR(t){return t==null?t===void 0?uO:lO:ov&&ov in Object(t)?aO(t):oO(t)}s(DR,"baseGetTag");var rn=DR;function xR(t){return t!=null&&typeof t=="object"}s(xR,"isObjectLike");var Xt=xR,cO="[object Symbol]";function MR(t){return typeof t=="symbol"||Xt(t)&&rn(t)==cO}s(MR,"isSymbol");var Jf=MR;function GR(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r0){if(++e>=VO)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}s(tA,"shortOut");var YO=tA;function rA(t){return function(){return t}}s(rA,"constant");var XO=rA,JO=(function(){try{var t=Qn(Object,"defineProperty");return t({},"",{}),t}catch{}})(),ff=JO,ZO=ff?function(t,e){return ff(t,"toString",{configurable:!0,enumerable:!1,value:XO(e),writable:!0})}:Ku,QO=ZO,e0=YO(QO),t0=e0;function nA(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}s(cA,"arrayIncludes");var fA=cA,a0=9007199254740991,i0=/^(?:0|[1-9]\d*)$/;function dA(t,e){var r=typeof t;return e=e??a0,!!e&&(r=="number"||r!="symbol"&&i0.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=u0}s(TA,"isLength");var Sy=TA;function $A(t){return t!=null&&Sy(t.length)&&!Gr(t)}s($A,"isArrayLike");var hr=$A;function RA(t,e,r){if(!zt(r))return!1;var n=typeof e;return(n=="number"?hr(r)&&Zf(e,r.length):n=="string"&&e in r)?Wu(r[e],t):!1}s(RA,"isIterateeCall");var ed=RA;function AA(t){return _y(function(e,r){var n=-1,a=r.length,i=a>1?r[a-1]:void 0,o=a>2?r[2]:void 0;for(i=t.length>3&&typeof i=="function"?(a--,i):void 0,o&&ed(r[0],r[1],o)&&(i=a<3?void 0:i,a=1),e=Object(e);++n-1}s(ZA,"listCacheHas");var SL=ZA;function QA(t,e){var r=this.__data__,n=nd(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}s(QA,"listCacheSet");var wL=QA;function ta(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(u)?e>1?ky(u,e-1,r,n,a):Py(a,u):n||(a[a.length]=u)}return a}s(ky,"baseFlatten");var Oy=ky;function hE(t){var e=t==null?0:t.length;return e?Oy(t,1):[]}s(hE,"flatten");var Ht=hE,qL=DA(Object.getPrototypeOf,Object),yE=qL;function gE(t,e,r){var n=-1,a=t.length;e<0&&(e=-e>a?0:a+e),r=r>a?a:r,r<0&&(r+=a),a=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(a);++nu))return!1;var c=i.get(t),f=i.get(e);if(c&&f)return c==e&&f==t;var d=-1,p=!0,y=r&Mx?new My:void 0;for(i.set(t,e),i.set(e,t);++d2?e[2]:void 0;for(a&&ed(e[0],e[1],a)&&(n=1);++r=NM&&(i=Gy,o=!1,e=new My(e));e:for(;++a-1?a[i?e[o]:o]:void 0}}s(Zb,"createFind");var xM=Zb,MM=Math.max;function Qb(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var a=r==null?0:Uu(r);return a<0&&(a=MM(n+a,0)),sA(t,yr(e),a)}s(Qb,"findIndex");var GM=Qb,FM=xM(GM),el=FM;function eC(t){return t&&t.length?t[0]:void 0}s(eC,"head");var Jt=eC;function tC(t,e){var r=-1,n=hr(t)?Array(t.length):[];return aa(t,function(a,i,o){n[++r]=e(a,i,o)}),n}s(tC,"baseMap");var zM=tC;function rC(t,e){var r=se(t)?Bu:zM;return r(t,yr(e))}s(rC,"map");var j=rC;function nC(t,e){return Oy(j(t,e),1)}s(nC,"flatMap");var Gt=nC,jM=Object.prototype,BM=jM.hasOwnProperty,UM=SM(function(t,e,r){BM.call(t,r)?t[r].push(e):Cy(t,r,[e])}),KM=UM,WM=Object.prototype,VM=WM.hasOwnProperty;function aC(t,e){return t!=null&&VM.call(t,e)}s(aC,"baseHas");var qM=aC;function iC(t,e){return t!=null&&Eb(t,e,qM)}s(iC,"has");var K=iC,HM="[object String]";function sC(t){return typeof t=="string"||!se(t)&&Xt(t)&&rn(t)==HM}s(sC,"isString");var bt=sC;function oC(t,e){return Bu(e,function(r){return t[r]})}s(oC,"baseValues");var YM=oC;function lC(t){return t==null?[]:YM(t,Nt(t))}s(lC,"values");var Ke=lC,XM=Math.max;function uC(t,e,r,n){t=hr(t)?t:Ke(t),r=r&&!n?Uu(r):0;var a=t.length;return r<0&&(r=XM(a+r,0)),bt(t)?r<=a&&t.indexOf(e,r)>-1:!!a&&by(t,e,r)>-1}s(uC,"includes");var vt=uC,JM=Math.max;function cC(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var a=r==null?0:Uu(r);return a<0&&(a=JM(n+a,0)),by(t,e,a)}s(cC,"indexOf");var Fv=cC,ZM="[object Map]",QM="[object Set]",e1=Object.prototype,t1=e1.hasOwnProperty;function fC(t){if(t==null)return!0;if(hr(t)&&(se(t)||typeof t=="string"||typeof t.splice=="function"||$u(t)||wy(t)||td(t)))return!t.length;var e=Qo(t);if(e==ZM||e==QM)return!t.size;if(qu(t))return!MA(t).length;for(var r in t)if(t1.call(t,r))return!1;return!0}s(fC,"isEmpty");var Re=fC,r1="[object RegExp]";function dC(t){return Xt(t)&&rn(t)==r1}s(dC,"baseIsRegExp");var n1=dC,zv=Xr&&Xr.isRegExp,a1=zv?Hu(zv):n1,Pr=a1;function pC(t){return t===void 0}s(pC,"isUndefined");var kr=pC,i1="Expected a function";function mC(t){if(typeof t!="function")throw new TypeError(i1);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}s(mC,"negate");var s1=mC;function hC(t,e,r,n){if(!zt(t))return t;e=ld(e,t);for(var a=-1,i=e.length,o=i-1,u=t;u!=null&&++a=m1){var c=e?null:p1(t);if(c)return Fy(c);o=!1,a=Gy,l=new My}else l=e?[]:u;e:for(;++n{r.accept(e)})}},s(ii,"AbstractProduction"),ii),si,ht=(si=class extends gr{constructor(e){super([]),this.idx=1,Pt(this,Zt(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},s(si,"NonTerminal"),si),oi,sl=(oi=class extends gr{constructor(e){super(e.definition),this.orgText="",Pt(this,Zt(e,r=>r!==void 0))}},s(oi,"Rule"),oi),li,Ct=(li=class extends gr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Pt(this,Zt(e,r=>r!==void 0))}},s(li,"Alternative"),li),ui,at=(ui=class extends gr{constructor(e){super(e.definition),this.idx=1,Pt(this,Zt(e,r=>r!==void 0))}},s(ui,"Option"),ui),ci,Ot=(ci=class extends gr{constructor(e){super(e.definition),this.idx=1,Pt(this,Zt(e,r=>r!==void 0))}},s(ci,"RepetitionMandatory"),ci),fi,Lt=(fi=class extends gr{constructor(e){super(e.definition),this.idx=1,Pt(this,Zt(e,r=>r!==void 0))}},s(fi,"RepetitionMandatoryWithSeparator"),fi),di,xe=(di=class extends gr{constructor(e){super(e.definition),this.idx=1,Pt(this,Zt(e,r=>r!==void 0))}},s(di,"Repetition"),di),pi,_t=(pi=class extends gr{constructor(e){super(e.definition),this.idx=1,Pt(this,Zt(e,r=>r!==void 0))}},s(pi,"RepetitionWithSeparator"),pi),mi,St=(mi=class extends gr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Pt(this,Zt(e,r=>r!==void 0))}},s(mi,"Alternation"),mi),hi,Se=(hi=class{constructor(e){this.idx=1,Pt(this,Zt(e,r=>r!==void 0))}accept(e){e.visit(this)}},s(hi,"Terminal"),hi);function wC(t){return j(t,pu)}s(wC,"serializeGrammar");function pu(t){function e(r){return j(r,pu)}if(s(e,"convertDefinition"),t instanceof ht){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return bt(t.label)&&(r.label=t.label),r}else{if(t instanceof Ct)return{type:"Alternative",definition:e(t.definition)};if(t instanceof at)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Ot)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Lt)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:pu(new Se({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof _t)return{type:"RepetitionWithSeparator",idx:t.idx,separator:pu(new Se({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof xe)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof St)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Se){const r={type:"Terminal",name:t.terminalType.name,label:_C(t.terminalType),idx:t.idx};bt(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Pr(n)?n.source:n),r}else{if(t instanceof sl)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}s(pu,"serializeProduction");var yi,ol=(yi=class{visit(e){const r=e;switch(r.constructor){case ht:return this.visitNonTerminal(r);case Ct:return this.visitAlternative(r);case at:return this.visitOption(r);case Ot:return this.visitRepetitionMandatory(r);case Lt:return this.visitRepetitionMandatoryWithSeparator(r);case _t:return this.visitRepetitionWithSeparator(r);case xe:return this.visitRepetition(r);case St:return this.visitAlternation(r);case Se:return this.visitTerminal(r);case sl:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},s(yi,"GAstVisitor"),yi);function IC(t){return t instanceof Ct||t instanceof at||t instanceof xe||t instanceof Ot||t instanceof Lt||t instanceof _t||t instanceof Se||t instanceof sl}s(IC,"isSequenceProd");function Cu(t,e=[]){return t instanceof at||t instanceof xe||t instanceof _t?!0:t instanceof St?EC(t.definition,n=>Cu(n,e)):t instanceof ht&&vt(e,t)?!1:t instanceof gr?(t instanceof ht&&e.push(t),Yt(t.definition,n=>Cu(n,e))):!1}s(Cu,"isOptionalProd");function NC(t){return t instanceof St}s(NC,"isBranchingProd");function Kt(t){if(t instanceof ht)return"SUBRULE";if(t instanceof at)return"OPTION";if(t instanceof St)return"OR";if(t instanceof Ot)return"AT_LEAST_ONE";if(t instanceof Lt)return"AT_LEAST_ONE_SEP";if(t instanceof _t)return"MANY_SEP";if(t instanceof xe)return"MANY";if(t instanceof Se)return"CONSUME";throw Error("non exhaustive match")}s(Kt,"getProductionDslName");var gi,fd=(gi=class{walk(e,r=[]){V(e.definition,(n,a)=>{const i=nt(e.definition,a+1);if(n instanceof ht)this.walkProdRef(n,i,r);else if(n instanceof Se)this.walkTerminal(n,i,r);else if(n instanceof Ct)this.walkFlat(n,i,r);else if(n instanceof at)this.walkOption(n,i,r);else if(n instanceof Ot)this.walkAtLeastOne(n,i,r);else if(n instanceof Lt)this.walkAtLeastOneSep(n,i,r);else if(n instanceof _t)this.walkManySep(n,i,r);else if(n instanceof xe)this.walkMany(n,i,r);else if(n instanceof St)this.walkOr(n,i,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const a=r.concat(n);this.walk(e,a)}walkOption(e,r,n){const a=r.concat(n);this.walk(e,a)}walkAtLeastOne(e,r,n){const a=[new at({definition:e.definition})].concat(r,n);this.walk(e,a)}walkAtLeastOneSep(e,r,n){const a=_m(e,r,n);this.walk(e,a)}walkMany(e,r,n){const a=[new at({definition:e.definition})].concat(r,n);this.walk(e,a)}walkManySep(e,r,n){const a=_m(e,r,n);this.walk(e,a)}walkOr(e,r,n){const a=r.concat(n);V(e.definition,i=>{const o=new Ct({definition:[i]});this.walk(o,a)})}},s(gi,"RestWalker"),gi);function _m(t,e,r){return[new at({definition:[new Se({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}s(_m,"restForRepetitionWithSeparator");function ll(t){if(t instanceof ht)return ll(t.referencedRule);if(t instanceof Se)return OC(t);if(IC(t))return PC(t);if(NC(t))return kC(t);throw Error("non exhaustive match")}s(ll,"first");function PC(t){let e=[];const r=t.definition;let n=0,a=r.length>n,i,o=!0;for(;a&&o;)i=r[n],o=Cu(i),e=e.concat(ll(i)),n=n+1,a=r.length>n;return By(e)}s(PC,"firstForSequence");function kC(t){const e=j(t.definition,r=>ll(r));return By(Ht(e))}s(kC,"firstForBranching");function OC(t){return[t.terminalType]}s(OC,"firstForTerminal");var LC="_~IN~_",vi,y1=(vi=class extends fd{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const a=xC(e.referencedRule,e.idx)+this.topProd.name,i=r.concat(n),o=new Ct({definition:i}),u=ll(o);this.follows[a]=u}},s(vi,"ResyncFollowsWalker"),vi);function DC(t){const e={};return V(t,r=>{const n=new y1(r).startWalking();Pt(e,n)}),e}s(DC,"computeAllProdsFollows");function xC(t,e){return t.name+e+LC}s(xC,"buildBetweenProdsFollowPrefix");var Nc={},g1=new mR;function Ju(t){const e=t.toString();if(Nc.hasOwnProperty(e))return Nc[e];{const r=g1.pattern(e);return Nc[e]=r,r}}s(Ju,"getRegExpAst");function MC(){Nc={}}s(MC,"clearRegExpParserCache");var GC="Complement Sets are not supported for first char optimization",mf=`Unable to use "first char" lexer optimizations: +`;function FC(t,e=!1){try{const r=Ju(t);return hf(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===GC)e&&Uy(`${mf} Unable to optimize: < ${t.toString()} > + Complement Sets cannot be automatically optimized. + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=` + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),pf(`${mf} + Failed parsing: < ${t.toString()} > + Using the @chevrotain/regexp-to-ast library + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}s(FC,"getOptimizedStartCodesIndices");function hf(t,e,r){switch(t.type){case"Disjunction":for(let a=0;a{if(typeof l=="number")Xl(l,e,r);else{const c=l;if(r===!0)for(let f=c.from;f<=c.to;f++)Xl(f,e,r);else{for(let f=c.from;f<=c.to&&f=Zl){const f=c.from>=Zl?c.from:Zl,d=c.to,p=Or(f),y=Or(d);for(let h=p;h<=y;h++)e[h]=h}}}});break;case"Group":hf(o.value,e,r);break;default:throw Error("Non Exhaustive Match")}const u=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&yf(o)===!1||o.type!=="Group"&&u===!1)break}break;default:throw Error("non exhaustive match!")}return Ke(e)}s(hf,"firstCharOptimizedIndices");function Xl(t,e,r){const n=Or(t);e[n]=n,r===!0&&zC(t,e)}s(Xl,"addOptimizedIdxToResult");function zC(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const a=Or(n.charCodeAt(0));e[a]=a}else{const a=r.toLowerCase();if(a!==r){const i=Or(a.charCodeAt(0));e[i]=i}}}s(zC,"handleIgnoreCase");function Sm(t,e){return el(t.value,r=>{if(typeof r=="number")return vt(e,r);{const n=r;return el(e,a=>n.from<=a&&a<=n.to)!==void 0}})}s(Sm,"findCode");function yf(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?se(t.value)?Yt(t.value,yf):yf(t.value):!1}s(yf,"isWholeOptional");var Ti,v1=(Ti=class extends Kf{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){vt(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Sm(e,this.targetCharCodes)===void 0&&(this.found=!0):Sm(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},s(Ti,"CharCodeFinder"),Ti);function dd(t,e){if(e instanceof RegExp){const r=Ju(e),n=new v1(t);return n.visit(r),n.found}else return el(e,r=>vt(t,r.charCodeAt(0)))!==void 0}s(dd,"canMatchCharCode");var Un="PATTERN",Jl="defaultMode",ic="modes";function jC(t,e){e=jy(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:s((w,C)=>C(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{l_()});let n;r("Reject Lexer.NA",()=>{n=cd(t,w=>w[Un]===pt.NA)});let a=!1,i;r("Transform Patterns",()=>{a=!1,i=j(n,w=>{const C=w[Un];if(Pr(C)){const N=C.source;return N.length===1&&N!=="^"&&N!=="$"&&N!=="."&&!C.ignoreCase?N:N.length===2&&N[0]==="\\"&&!vt(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],N[1])?N[1]:wm(C)}else{if(Gr(C))return a=!0,{exec:C};if(typeof C=="object")return a=!0,C;if(typeof C=="string"){if(C.length===1)return C;{const N=C.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),B=new RegExp(N);return wm(B)}}else throw Error("non exhaustive match")}})});let o,u,l,c,f;r("misc mapping",()=>{o=j(n,w=>w.tokenTypeIdx),u=j(n,w=>{const C=w.GROUP;if(C!==pt.SKIPPED){if(bt(C))return C;if(kr(C))return!1;throw Error("non exhaustive match")}}),l=j(n,w=>{const C=w.LONGER_ALT;if(C)return se(C)?j(C,B=>Fv(n,B)):[Fv(n,C)]}),c=j(n,w=>w.PUSH_MODE),f=j(n,w=>K(w,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const w=Hy(e.lineTerminatorCharacters);d=j(n,C=>!1),e.positionTracking!=="onlyOffset"&&(d=j(n,C=>K(C,"LINE_BREAKS")?!!C.LINE_BREAKS:qy(C,w)===!1&&dd(w,C.PATTERN)))});let p,y,h,T;r("Misc Mapping #2",()=>{p=j(n,Vy),y=j(i,s_),h=kt(n,(w,C)=>{const N=C.GROUP;return bt(N)&&N!==pt.SKIPPED&&(w[N]=[]),w},{}),T=j(i,(w,C)=>({pattern:i[C],longerAlt:l[C],canLineTerminator:d[C],isCustom:p[C],short:y[C],group:u[C],push:c[C],pop:f[C],tokenTypeIdx:o[C],tokenType:n[C]}))});let b=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=kt(n,(w,C,N)=>{if(typeof C.PATTERN=="string"){const B=C.PATTERN.charCodeAt(0),ne=Or(B);Pc(w,ne,T[N])}else if(se(C.START_CHARS_HINT)){let B;V(C.START_CHARS_HINT,ne=>{const J=typeof ne=="string"?ne.charCodeAt(0):ne,he=Or(J);B!==he&&(B=he,Pc(w,he,T[N]))})}else if(Pr(C.PATTERN))if(C.PATTERN.unicode)b=!1,e.ensureOptimizations&&pf(`${mf} Unable to analyze < ${C.PATTERN.toString()} > pattern. + The regexp unicode flag is not currently supported by the regexp-to-ast library. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const B=FC(C.PATTERN,e.ensureOptimizations);Re(B)&&(b=!1),V(B,ne=>{Pc(w,ne,T[N])})}else e.ensureOptimizations&&pf(`${mf} TokenType: <${C.name}> is using a custom token pattern without providing parameter. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),b=!1;return w},[])}),{emptyGroups:h,patternIdxToConfig:T,charCodeToPatternIdxToConfig:v,hasCustom:a,canBeOptimized:b}}s(jC,"analyzeTokenTypes");function BC(t,e){let r=[];const n=KC(t);r=r.concat(n.errors);const a=WC(n.valid),i=a.valid;return r=r.concat(a.errors),r=r.concat(UC(i)),r=r.concat(JC(i)),r=r.concat(ZC(i,e)),r=r.concat(QC(i)),r}s(BC,"validatePatterns");function UC(t){let e=[];const r=Bt(t,n=>Pr(n[Un]));return e=e.concat(VC(r)),e=e.concat(HC(r)),e=e.concat(YC(r)),e=e.concat(XC(r)),e=e.concat(qC(r)),e}s(UC,"validateRegExpPattern");function KC(t){const e=Bt(t,a=>!K(a,Un)),r=j(e,a=>({message:"Token Type: ->"+a.name+"<- missing static 'PATTERN' property",type:Me.MISSING_PATTERN,tokenTypes:[a]})),n=ud(t,e);return{errors:r,valid:n}}s(KC,"findMissingPatterns");function WC(t){const e=Bt(t,a=>{const i=a[Un];return!Pr(i)&&!Gr(i)&&!K(i,"exec")&&!bt(i)}),r=j(e,a=>({message:"Token Type: ->"+a.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Me.INVALID_PATTERN,tokenTypes:[a]})),n=ud(t,e);return{errors:r,valid:n}}s(WC,"findInvalidPatterns");var T1=/[^\\][$]/;function VC(t){const a=class a extends Kf{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}};s(a,"EndAnchorFinder");let e=a;const r=Bt(t,i=>{const o=i.PATTERN;try{const u=Ju(o),l=new e;return l.visit(u),l.found}catch{return T1.test(o.source)}});return j(r,i=>({message:`Unexpected RegExp Anchor Error: + Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$' + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Me.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}s(VC,"findEndOfInputAnchor");function qC(t){const e=Bt(t,n=>n.PATTERN.test(""));return j(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Me.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}s(qC,"findEmptyMatchRegExps");var $1=/[^\\[][\^]|^\^/;function HC(t){const a=class a extends Kf{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}};s(a,"StartAnchorFinder");let e=a;const r=Bt(t,i=>{const o=i.PATTERN;try{const u=Ju(o),l=new e;return l.visit(u),l.found}catch{return $1.test(o.source)}});return j(r,i=>({message:`Unexpected RegExp Anchor Error: + Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^' + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Me.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}s(HC,"findStartOfInputAnchor");function YC(t){const e=Bt(t,n=>{const a=n[Un];return a instanceof RegExp&&(a.multiline||a.global)});return j(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Me.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}s(YC,"findUnsupportedFlags");function XC(t){const e=[];let r=j(t,i=>kt(t,(o,u)=>(i.PATTERN.source===u.PATTERN.source&&!vt(e,u)&&u.PATTERN!==pt.NA&&(e.push(u),o.push(u)),o),[]));r=Xu(r);const n=Bt(r,i=>i.length>1);return j(n,i=>{const o=j(i,l=>l.name);return{message:`The same RegExp pattern ->${Jt(i).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:Me.DUPLICATE_PATTERNS_FOUND,tokenTypes:i}})}s(XC,"findDuplicatePatterns");function JC(t){const e=Bt(t,n=>{if(!K(n,"GROUP"))return!1;const a=n.GROUP;return a!==pt.SKIPPED&&a!==pt.NA&&!bt(a)});return j(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Me.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}s(JC,"findInvalidGroupType");function ZC(t,e){const r=Bt(t,a=>a.PUSH_MODE!==void 0&&!vt(e,a.PUSH_MODE));return j(r,a=>({message:`Token Type: ->${a.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${a.PUSH_MODE}<-which does not exist`,type:Me.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[a]}))}s(ZC,"findModesThatDoNotExist");function QC(t){const e=[],r=kt(t,(n,a,i)=>{const o=a.PATTERN;return o===pt.NA||(bt(o)?n.push({str:o,idx:i,tokenType:a}):Pr(o)&&t_(o)&&n.push({str:o.source,idx:i,tokenType:a})),n},[]);return V(t,(n,a)=>{V(r,({str:i,idx:o,tokenType:u})=>{if(a${u.name}<- can never be matched. +Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition. +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:Me.UNREACHABLE_PATTERN,tokenTypes:[n,u]})}})}),e}s(QC,"findUnreachablePatterns");function e_(t,e){if(Pr(e)){if(r_(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(Gr(e))return e(t,0,[],{});if(K(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}s(e_,"tryToMatchStrToPattern");function t_(t){return el([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}s(t_,"noMetaChar");function r_(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition +`,type:Me.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),K(t,ic)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+ic+`> property in its definition +`,type:Me.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),K(t,ic)&&K(t,Jl)&&!K(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Jl}: <${t.defaultMode}>which does not exist +`,type:Me.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),K(t,ic)&&V(t.modes,(a,i)=>{V(a,(o,u)=>{if(kr(o))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${i}> at index: <${u}> +`,type:Me.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(K(o,"LONGER_ALT")){const l=se(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];V(l,c=>{!kr(c)&&!vt(a,c)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${o.name}> outside of mode <${i}> +`,type:Me.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}s(n_,"performRuntimeChecks");function a_(t,e,r){const n=[];let a=!1;const i=Xu(Ht(Ke(t.modes))),o=cd(i,l=>l[Un]===pt.NA),u=Hy(r);return e&&V(o,l=>{const c=qy(l,u);if(c!==!1){const d={message:o_(l,c),type:c.issue,tokenType:l};n.push(d)}else K(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(a=!0):dd(u,l.PATTERN)&&(a=!0)}),e&&!a&&n.push({message:`Warning: No LINE_BREAKS Found. + This Lexer has been defined to track line and column information, + But none of the Token Types can be identified as matching a line terminator. + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS + for details.`,type:Me.NO_LINE_BREAKS_FLAGS}),n}s(a_,"performWarningRuntimeChecks");function i_(t){const e={},r=Nt(t);return V(r,n=>{const a=t[n];if(se(a))e[n]=[];else throw Error("non exhaustive match")}),e}s(i_,"cloneEmptyGroups");function Vy(t){const e=t.PATTERN;if(Pr(e))return!1;if(Gr(e))return!0;if(K(e,"exec"))return!0;if(bt(e))return!1;throw Error("non exhaustive match")}s(Vy,"isCustomPattern");function s_(t){return bt(t)&&t.length===1?t.charCodeAt(0):!1}s(s_,"isShortPattern");var R1={test:s(function(t){const e=t.length;for(let r=this.lastIndex;r Token Type + Root cause: ${e.errMsg}. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Me.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. + The problem is in the <${t.name}> Token Type + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}s(o_,"buildLineBreakIssueMessage");function Hy(t){return j(t,r=>bt(r)?r.charCodeAt(0):r)}s(Hy,"getCharCodes");function Pc(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}s(Pc,"addToMapOfArrays");var Zl=256,kc=[];function Or(t){return t255?255+~~(t/255):t}}s(l_,"initCharCodeToOptimizedIndexMap");function ul(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}s(ul,"tokenStructuredMatcher");function _u(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}s(_u,"tokenStructuredMatcherNoCategories");var jv=1,u_={};function cl(t){const e=c_(t);f_(e),p_(e),d_(e),V(e,r=>{r.isParent=r.categoryMatches.length>0})}s(cl,"augmentTokenTypes");function c_(t){let e=it(t),r=t,n=!0;for(;n;){r=Xu(Ht(j(r,i=>i.CATEGORIES)));const a=ud(r,e);e=e.concat(a),Re(a)?n=!1:r=a}return e}s(c_,"expandCategories");function f_(t){V(t,e=>{Xy(e)||(u_[jv]=e,e.tokenTypeIdx=jv++),Im(e)&&!se(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Im(e)||(e.CATEGORIES=[]),m_(e)||(e.categoryMatches=[]),h_(e)||(e.categoryMatchesMap={})})}s(f_,"assignTokenDefaultProps");function d_(t){V(t,e=>{e.categoryMatches=[],V(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(u_[n].tokenTypeIdx)})})}s(d_,"assignCategoriesTokensProp");function p_(t){V(t,e=>{Yy([],e)})}s(p_,"assignCategoriesMapProp");function Yy(t,e){V(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),V(e.CATEGORIES,r=>{const n=t.concat(e);vt(n,r)||Yy(n,r)})}s(Yy,"singleAssignCategoriesToksMap");function Xy(t){return K(t,"tokenTypeIdx")}s(Xy,"hasShortKeyProperty");function Im(t){return K(t,"CATEGORIES")}s(Im,"hasCategoriesProperty");function m_(t){return K(t,"categoryMatches")}s(m_,"hasExtendingTokensTypesProperty");function h_(t){return K(t,"categoryMatchesMap")}s(h_,"hasExtendingTokensTypesMapProperty");function y_(t){return K(t,"tokenTypeIdx")}s(y_,"isTokenType");var Nm={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,a,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},Me;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Me||(Me={}));var Ql={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` +`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Nm,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Ql);var $i,pt=($i=class{constructor(e,r=Ql){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(a,i)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const o=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${a}>`);const{time:u,value:l}=Ky(i),c=u>10?console.warn:console.log;return this.traceInitIndent time: ${u}ms`),this.traceInitIndent--,l}else return i()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. +a boolean 2nd argument is no longer supported`);this.config=Pt({},Ql,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let a,i=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Ql.lineTerminatorsPattern)this.config.lineTerminatorsPattern=R1;else if(this.config.lineTerminatorCharacters===Ql.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),se(e)?a={modes:{defaultMode:it(e)},defaultMode:Jl}:(i=!1,a=it(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(n_(a,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(a_(a,this.trackStartLines,this.config.lineTerminatorCharacters))})),a.modes=a.modes?a.modes:{},V(a.modes,(u,l)=>{a.modes[l]=cd(u,c=>kr(c))});const o=Nt(a.modes);if(V(a.modes,(u,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(BC(u,o))}),Re(this.lexerDefinitionErrors)){cl(u);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=jC(u,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=c.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=c.charCodeToPatternIdxToConfig,this.emptyGroups=Pt({},this.emptyGroups,c.emptyGroups),this.hasCustom=c.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=c.canBeOptimized}})}),this.defaultMode=a.defaultMode,!Re(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=j(this.lexerDefinitionErrors,c=>c.message).join(`----------------------- +`);throw new Error(`Errors detected in definition of Lexer: +`+l)}V(this.lexerDefinitionWarning,u=>{Uy(u.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(i&&(this.handleModes=He),this.trackStartLines===!1&&(this.computeNewColumn=Ku),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=He),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const u=kt(this.canModeBeOptimized,(l,c,f)=>(c===!1&&l.push(f),l),[]);if(r.ensureOptimizations&&!Re(u))throw Error(`Lexer Modes: < ${u.join(", ")} > cannot be optimized. + Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. + Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{MC()}),this.TRACE_INIT("toFastProperties",()=>{Wy(this)})})}tokenize(e,r=this.defaultMode){if(!Re(this.lexerDefinitionErrors)){const a=j(this.lexerDefinitionErrors,i=>i.message).join(`----------------------- +`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: +`+a)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,a,i,o,u,l,c,f,d,p,y,h,T,b,v;const w=e,C=w.length;let N=0,B=0;const ne=this.hasCustom?0:Math.floor(e.length/10),J=new Array(ne),he=[];let Ae=this.trackStartLines?1:void 0,ye=this.trackStartLines?1:void 0;const ue=i_(this.emptyGroups),ot=this.trackStartLines,k=this.config.lineTerminatorsPattern;let _=0,$=[],I=[];const R=[],A=[];Object.freeze(A);let S=!1;const L=s(M=>{if(R.length===1&&M.tokenType.PUSH_MODE===void 0){const Y=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(M);he.push({offset:M.startOffset,line:M.startLine,column:M.startColumn,length:M.image.length,message:Y})}else{R.pop();const Y=Bn(R);$=this.patternIdxToConfig[Y],I=this.charCodeToPatternIdxToConfig[Y],_=$.length;const q=this.canModeBeOptimized[Y]&&this.config.safeMode===!1;I&&q?S=!0:S=!1}},"pop_mode");function x(M){R.push(M),I=this.charCodeToPatternIdxToConfig[M],$=this.patternIdxToConfig[M],_=$.length,_=$.length;const Y=this.canModeBeOptimized[M]&&this.config.safeMode===!1;I&&Y?S=!0:S=!1}s(x,"push_mode"),x.call(this,r);let O;const z=this.config.recoveryEnabled;for(;Nl.length){l=o,d=o.length,c=f,O=pe;break}}}break}}if(d!==-1){if(p=O.group,p!==void 0&&(l=l!==null?l:e.substring(N,N+d),y=O.tokenTypeIdx,h=this.createTokenInstance(l,N,y,O.tokenType,Ae,ye,d),this.handlePayload(h,c),p===!1?B=this.addToken(J,B,h):ue[p].push(h)),ot===!0&&O.canLineTerminator===!0){let Z=0,ae,Oe;k.lastIndex=0;do l=l!==null?l:e.substring(N,N+d),ae=k.test(l),ae===!0&&(Oe=k.lastIndex-1,Z++);while(ae===!0);Z!==0?(Ae=Ae+Z,ye=d-Oe,this.updateTokenEndLineColumnLocation(h,p,Oe,Z,Ae,ye,d)):ye=this.computeNewColumn(ye,d)}else ye=this.computeNewColumn(ye,d);N=N+d,this.handleModes(O,L,x,h)}else{const Z=N,ae=Ae,Oe=ye;let pe=z===!1;for(;pe===!1&&N ${Mn(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:a}){const i="Expecting: ",u=` +but found: '`+Jt(e).image+"'";if(n)return i+n+u;{const l=kt(t,(p,y)=>p.concat(y),[]),c=j(l,p=>`[${j(p,y=>Mn(y)).join(", ")}]`),d=`one of these possible Token sequences: +${j(c,(p,y)=>` ${y+1}. ${p}`).join(` +`)}`;return i+d+u}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const a="Expecting: ",o=` +but found: '`+Jt(e).image+"'";if(r)return a+r+o;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: + <${j(t,c=>`[${j(c,f=>Mn(f)).join(",")}]`).join(" ,")}>`;return a+l+o}}};Object.freeze(qa);var E1={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- +inside top level rule: ->`+t.name+"<-"}},Ln={buildDuplicateFoundError(t,e){function r(f){return f instanceof Se?f.terminalType.name:f instanceof ht?f.nonTerminalName:""}s(r,"getExtraProductionArgument");const n=t.name,a=Jt(e),i=a.idx,o=Kt(a),u=r(a),l=i>0;let c=`->${o}${l?i:""}<- ${u?`with argument: ->${u}<-`:""} + appears more than once (${e.length} times) in the top level rule: ->${n}<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,` +`),c},buildNamespaceConflictError(t){return`Namespace conflict found in grammar. +The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>. +To resolve this make sure each Terminal and Non-Terminal names are unique +This is easy to accomplish by using the convention that Terminal names start with an uppercase letter +and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=j(t.prefixPath,a=>Mn(a)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix +in inside <${t.topLevelRule.name}> Rule, +<${e}> may appears as a prefix path in all these alternatives. +See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX +For Further details.`},buildAlternationAmbiguityError(t){const e=t.alternation.idx===0?"":t.alternation.idx,r=t.prefixPath.length===0;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in inside <${t.topLevelRule.name}> Rule, +`;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable. +Only the last alternative may be empty. +`;else{const a=j(t.prefixPath,i=>Mn(i)).join(", ");n+=`<${a}> may appears as a prefix path in all these alternatives. +`}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`,n},buildEmptyRepetitionError(t){let e=Kt(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens. +This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in inside <${t.topLevelRule.name}> Rule. +Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives: + inside <${t.topLevelRule.name}> Rule. + has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=j(t.leftRecursionPath,i=>i.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar. +rule: <${e}> can be invoked from itself (directly or indirectly) +without consuming any Tokens. The grammar path that causes this is: + ${n} + To fix this refactor your grammar to remove the left recursion. +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof sl?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function v_(t,e){const r=new b1(t,e);return r.resolveRefs(),r.errors}s(v_,"resolveGrammar");var Ri,b1=(Ri=class extends ol{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){V(Ke(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:yt.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},s(Ri,"GastRefResolverVisitor"),Ri),Ai,C1=(Ai=class extends fd{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=it(this.path.ruleStack).reverse(),this.occurrenceStack=it(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const a=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,a)}}updateExpectedNext(){Re(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},s(Ai,"AbstractNextPossibleTokensWalker"),Ai),Ei,_1=(Ei=class extends C1{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const a=r.concat(n),i=new Ct({definition:a});this.possibleTokTypes=ll(i),this.found=!0}}},s(Ei,"NextAfterTokenWalker"),Ei),bi,pd=(bi=class extends fd{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},s(bi,"AbstractNextTerminalAfterProductionWalker"),bi),Ci,S1=(Ci=class extends pd{walkMany(e,r,n){if(e.idx===this.occurrence){const a=Jt(r.concat(n));this.result.isEndOfRule=a===void 0,a instanceof Se&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else super.walkMany(e,r,n)}},s(Ci,"NextTerminalAfterManyWalker"),Ci),_i,Xv=(_i=class extends pd{walkManySep(e,r,n){if(e.idx===this.occurrence){const a=Jt(r.concat(n));this.result.isEndOfRule=a===void 0,a instanceof Se&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else super.walkManySep(e,r,n)}},s(_i,"NextTerminalAfterManySepWalker"),_i),Si,w1=(Si=class extends pd{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const a=Jt(r.concat(n));this.result.isEndOfRule=a===void 0,a instanceof Se&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else super.walkAtLeastOne(e,r,n)}},s(Si,"NextTerminalAfterAtLeastOneWalker"),Si),wi,Jv=(wi=class extends pd{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const a=Jt(r.concat(n));this.result.isEndOfRule=a===void 0,a instanceof Se&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else super.walkAtLeastOneSep(e,r,n)}},s(wi,"NextTerminalAfterAtLeastOneSepWalker"),wi);function gf(t,e,r=[]){r=it(r);let n=[],a=0;function i(u){return u.concat(nt(t,a+1))}s(i,"remainingPathWith");function o(u){const l=gf(i(u),e,r);return n.concat(l)}for(s(o,"getAlternativesForProd");r.length{Re(l.definition)===!1&&(n=o(l.definition))}),n;if(u instanceof Se)r.push(u.terminalType);else throw Error("non exhaustive match")}a++}return n.push({partialPath:r,suffixDef:nt(t,a)}),n}s(gf,"possiblePathsFrom");function Qy(t,e,r,n){const a="EXIT_NONE_TERMINAL",i=[a],o="EXIT_ALTERNATIVE";let u=!1;const l=e.length,c=l-n-1,f=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Re(d);){const p=d.pop();if(p===o){u&&Bn(d).idx<=c&&d.pop();continue}const y=p.def,h=p.idx,T=p.ruleStack,b=p.occurrenceStack;if(Re(y))continue;const v=y[0];if(v===a){const w={idx:h,def:nt(y),ruleStack:bu(T),occurrenceStack:bu(b)};d.push(w)}else if(v instanceof Se)if(h=0;w--){const C=v.definition[w],N={idx:h,def:C.definition.concat(nt(y)),ruleStack:T,occurrenceStack:b};d.push(N),d.push(o)}else if(v instanceof Ct)d.push({idx:h,def:v.definition.concat(nt(y)),ruleStack:T,occurrenceStack:b});else if(v instanceof sl)d.push(T_(v,h,T,b));else throw Error("non exhaustive match")}return f}s(Qy,"nextPossibleTokensAfter");function T_(t,e,r,n){const a=it(r);a.push(t.name);const i=it(n);return i.push(1),{idx:e,def:t.definition,ruleStack:a,occurrenceStack:i}}s(T_,"expandTopLevelRule");var Pe;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(Pe||(Pe={}));function md(t){if(t instanceof at||t==="Option")return Pe.OPTION;if(t instanceof xe||t==="Repetition")return Pe.REPETITION;if(t instanceof Ot||t==="RepetitionMandatory")return Pe.REPETITION_MANDATORY;if(t instanceof Lt||t==="RepetitionMandatoryWithSeparator")return Pe.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof _t||t==="RepetitionWithSeparator")return Pe.REPETITION_WITH_SEPARATOR;if(t instanceof St||t==="Alternation")return Pe.ALTERNATION;throw Error("non exhaustive match")}s(md,"getProdType");function Pm(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:a}=t,i=md(n);return i===Pe.ALTERNATION?Qu(e,r,a):ec(e,r,i,a)}s(Pm,"getLookaheadPaths");function $_(t,e,r,n,a,i){const o=Qu(t,e,r),u=tg(o)?_u:ul;return i(o,n,u,a)}s($_,"buildLookaheadFuncForOr");function R_(t,e,r,n,a,i){const o=ec(t,e,a,r),u=tg(o)?_u:ul;return i(o[0],u,n)}s(R_,"buildLookaheadFuncForOptionalProd");function A_(t,e,r,n){const a=t.length,i=Yt(t,o=>Yt(o,u=>u.length===1));if(e)return function(o){const u=j(o,l=>l.GATE);for(let l=0;lHt(l)),u=kt(o,(l,c,f)=>(V(c,d=>{K(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=f),V(d.categoryMatches,p=>{K(l,p)||(l[p]=f)})}),l),{});return function(){const l=this.LA(1);return u[l.tokenTypeIdx]}}else return function(){for(let o=0;oi.length===1),a=t.length;if(n&&!r){const i=Ht(t);if(i.length===1&&Re(i[0].categoryMatches)){const u=i[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===u}}else{const o=kt(i,(u,l,c)=>(u[l.tokenTypeIdx]=!0,V(l.categoryMatches,f=>{u[f]=!0}),u),[]);return function(){const u=this.LA(1);return o[u.tokenTypeIdx]===!0}}}else return function(){e:for(let i=0;igf([o],1)),n=km(r.length),a=j(r,o=>{const u={};return V(o,l=>{const c=Oc(l.partialPath);V(c,f=>{u[f]=!0})}),u});let i=r;for(let o=1;o<=e;o++){const u=i;i=km(u.length);for(let l=0;l{const v=Oc(b.partialPath);V(v,w=>{a[l][w]=!0})})}}}}return n}s(eg,"lookAheadSequenceFromAlternatives");function Qu(t,e,r,n){const a=new b_(t,Pe.ALTERNATION,n);return e.accept(a),eg(a.result,r)}s(Qu,"getLookaheadPathsForOr");function ec(t,e,r,n){const a=new b_(t,r);e.accept(a);const i=a.result,u=new I1(e,t,r).startWalking(),l=new Ct({definition:i}),c=new Ct({definition:u});return eg([l,c],n)}s(ec,"getLookaheadPathsForOptionalProd");function vf(t,e){e:for(let r=0;r{const a=e[n];return r===a||a.categoryMatchesMap[r.tokenTypeIdx]})}s(__,"isStrictPrefixOfPath");function tg(t){return Yt(t,e=>Yt(e,r=>Yt(r,n=>Re(n.categoryMatches))))}s(tg,"areTokenCategoriesNotUsed");function S_(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return j(e,r=>Object.assign({type:yt.CUSTOM_LOOKAHEAD_VALIDATION},r))}s(S_,"validateLookahead");function w_(t,e,r,n){const a=Gt(t,l=>I_(l,r)),i=F_(t,e,r),o=Gt(t,l=>D_(l,r)),u=Gt(t,l=>P_(l,t,n,r));return a.concat(i,o,u)}s(w_,"validateGrammar");function I_(t,e){const r=new N1;t.accept(r);const n=r.allProductions,a=KM(n,N_),i=Zt(a,u=>u.length>1);return j(Ke(i),u=>{const l=Jt(u),c=e.buildDuplicateFoundError(t,u),f=Kt(l),d={message:c,type:yt.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:f,occurrence:l.idx},p=rg(l);return p&&(d.parameter=p),d})}s(I_,"validateDuplicateProductions");function N_(t){return`${Kt(t)}_#_${t.idx}_#_${rg(t)}`}s(N_,"identifyProductionForDuplicates");function rg(t){return t instanceof Se?t.terminalType.name:t instanceof ht?t.nonTerminalName:""}s(rg,"getExtraProductionArgument");var Pi,N1=(Pi=class extends ol{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},s(Pi,"OccurrenceValidationCollector"),Pi);function P_(t,e,r,n){const a=[];if(kt(e,(o,u)=>u.name===t.name?o+1:o,0)>1){const o=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});a.push({message:o,type:yt.DUPLICATE_RULE_NAME,ruleName:t.name})}return a}s(P_,"validateRuleDoesNotAlreadyExist");function k_(t,e,r){const n=[];let a;return vt(e,t)||(a=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:a,type:yt.INVALID_RULE_OVERRIDE,ruleName:t})),n}s(k_,"validateRuleIsOverridden");function ng(t,e,r,n=[]){const a=[],i=mu(e.definition);if(Re(i))return[];{const o=t.name;vt(i,t)&&a.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:yt.LEFT_RECURSION,ruleName:o});const l=ud(i,n.concat([t])),c=Gt(l,f=>{const d=it(n);return d.push(f),ng(t,f,r,d)});return a.concat(c)}}s(ng,"validateNoLeftRecursion");function mu(t){let e=[];if(Re(t))return e;const r=Jt(t);if(r instanceof ht)e.push(r.referencedRule);else if(r instanceof Ct||r instanceof at||r instanceof Ot||r instanceof Lt||r instanceof _t||r instanceof xe)e=e.concat(mu(r.definition));else if(r instanceof St)e=Ht(j(r.definition,i=>mu(i.definition)));else if(!(r instanceof Se))throw Error("non exhaustive match");const n=Cu(r),a=t.length>1;if(n&&a){const i=nt(t);return e.concat(mu(i))}else return e}s(mu,"getFirstNoneTerminal");var ki,ag=(ki=class extends ol{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},s(ki,"OrCollector"),ki);function O_(t,e){const r=new ag;t.accept(r);const n=r.alternations;return Gt(n,i=>{const o=bu(i.definition);return Gt(o,(u,l)=>{const c=Qy([u],[],ul,1);return Re(c)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:i,emptyChoiceIdx:l}),type:yt.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:i.idx,alternative:l+1}]:[]})})}s(O_,"validateEmptyOrAlternative");function L_(t,e,r){const n=new ag;t.accept(n);let a=n.alternations;return a=cd(a,o=>o.ignoreAmbiguities===!0),Gt(a,o=>{const u=o.idx,l=o.maxLookahead||e,c=Qu(u,t,l,o),f=M_(c,o,t,r),d=G_(c,o,t,r);return f.concat(d)})}s(L_,"validateAmbiguousAlternationAlternatives");var Oi,P1=(Oi=class extends ol{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},s(Oi,"RepetitionCollector"),Oi);function D_(t,e){const r=new ag;t.accept(r);const n=r.alternations;return Gt(n,i=>i.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:i}),type:yt.TOO_MANY_ALTS,ruleName:t.name,occurrence:i.idx}]:[])}s(D_,"validateTooManyAlts");function x_(t,e,r){const n=[];return V(t,a=>{const i=new P1;a.accept(i);const o=i.allProductions;V(o,u=>{const l=md(u),c=u.maxLookahead||e,f=u.idx,p=ec(f,a,l,c)[0];if(Re(Ht(p))){const y=r.buildEmptyRepetitionError({topLevelRule:a,repetition:u});n.push({message:y,type:yt.NO_NON_EMPTY_LOOKAHEAD,ruleName:a.name})}})}),n}s(x_,"validateSomeNonEmptyLookaheadPath");function M_(t,e,r,n){const a=[],i=kt(t,(u,l,c)=>(e.definition[c].ignoreAmbiguities===!0||V(l,f=>{const d=[c];V(t,(p,y)=>{c!==y&&vf(p,f)&&e.definition[y].ignoreAmbiguities!==!0&&d.push(y)}),d.length>1&&!vf(a,f)&&(a.push(f),u.push({alts:d,path:f}))}),u),[]);return j(i,u=>{const l=j(u.alts,f=>f+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:u.path}),type:yt.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:u.alts}})}s(M_,"checkAlternativesAmbiguities");function G_(t,e,r,n){const a=kt(t,(o,u,l)=>{const c=j(u,f=>({idx:l,path:f}));return o.concat(c)},[]);return Xu(Gt(a,o=>{if(e.definition[o.idx].ignoreAmbiguities===!0)return[];const l=o.idx,c=o.path,f=Bt(a,p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx{const y=[p.idx+1,l+1],h=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:y,prefixPath:p.path}),type:yt.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:h,alternatives:y}})}))}s(G_,"checkPrefixAlternativesAmbiguities");function F_(t,e,r){const n=[],a=j(e,i=>i.name);return V(t,i=>{const o=i.name;if(vt(a,o)){const u=r.buildNamespaceConflictError(i);n.push({message:u,type:yt.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),n}s(F_,"checkTerminalAndNoneTerminalsNameSpace");function z_(t){const e=jy(t,{errMsgProvider:E1}),r={};return V(t.rules,n=>{r[n.name]=n}),v_(r,e.errMsgProvider)}s(z_,"resolveGrammar");function j_(t){return t=jy(t,{errMsgProvider:Ln}),w_(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}s(j_,"validateGrammar");var B_="MismatchedTokenException",U_="NoViableAltException",K_="EarlyExitException",W_="NotAllInputParsedException",V_=[B_,U_,K_,W_];Object.freeze(V_);function Su(t){return vt(V_,t.name)}s(Su,"isRecognitionException");var Li,hd=(Li=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},s(Li,"RecognitionException"),Li),Di,q_=(Di=class extends hd{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=B_}},s(Di,"MismatchedTokenException"),Di),xi,k1=(xi=class extends hd{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=U_}},s(xi,"NoViableAltException"),xi),Mi,O1=(Mi=class extends hd{constructor(e,r){super(e,r),this.name=W_}},s(Mi,"NotAllInputParsedException"),Mi),Gi,L1=(Gi=class extends hd{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=K_}},s(Gi,"EarlyExitException"),Gi),Vd={},H_="InRuleRecoveryException",Fi,D1=(Fi=class extends Error{constructor(e){super(e),this.name=H_}},s(Fi,"InRuleRecoveryException"),Fi),zi,x1=(zi=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=K(e,"recoveryEnabled")?e.recoveryEnabled:Lr.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Y_)}getTokenToInsert(e){const r=Zu(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,a){const i=this.findReSyncTokenType(),o=this.exportLexerState(),u=[];let l=!1;const c=this.LA(1);let f=this.LA(1);const d=s(()=>{const p=this.LA(0),y=this.errorMessageProvider.buildMismatchTokenMessage({expected:a,actual:c,previous:p,ruleName:this.getCurrRuleFullName()}),h=new q_(y,c,this.LA(0));h.resyncedTokens=bu(u),this.SAVE_ERROR(h)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(f,a)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(f,i)?l=!0:(f=this.SKIP_TOKEN(),this.addToResyncTokens(f,u));this.importLexerState(o)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new D1("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Re(r))return!1;const n=this.LA(1);return el(r,i=>this.tokenMatcher(n,i))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return vt(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const a=el(e,i=>Zy(r,i));if(a!==void 0)return a;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Vd;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return j(e,(n,a)=>a===0?Vd:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[a],inRule:this.shortRuleNameToFullName(e[a-1])})}flattenFollowSet(){const e=j(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Ht(e)}getFollowSetFromFollowKey(e){if(e===Vd)return[Jr];const r=e.ruleName+e.idxInCallingRule+LC+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Jr)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return bu(r)}attemptInRepetitionRecovery(e,r,n,a,i,o,u){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),a=it(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:a,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return j(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},s(zi,"Recoverable"),zi);function Y_(t,e,r,n,a,i,o){const u=this.getKeyForAutomaticLookahead(n,a);let l=this.firstAfterRepMap[u];if(l===void 0){const p=this.getCurrRuleFullName(),y=this.getGAstProductions()[p];l=new i(y,a).startWalking(),this.firstAfterRepMap[u]=l}let c=l.token,f=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&c===void 0&&(c=Jr,f=1),!(c===void 0||f===void 0)&&this.shouldInRepetitionRecoveryBeTried(c,f,o)&&this.tryInRepetitionRecovery(t,e,r,c)}s(Y_,"attemptInRepetitionRecovery");var M1=4,nn=8,X_=1<ng(r,r,Ln))}validateEmptyOrAlternatives(e){return Gt(e,r=>O_(r,Ln))}validateAmbiguousAlternationAlternatives(e,r){return Gt(e,n=>L_(n,r,Ln))}validateSomeNonEmptyLookaheadPath(e,r){return x_(e,r,Ln)}buildLookaheadForAlternation(e){return $_(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,A_)}buildLookaheadForOptional(e){return R_(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,md(e.prodType),E_)}},s(ji,"LLkLookaheadStrategy"),ji),Bi,G1=(Bi=class{initLooksAhead(e){this.dynamicTokensEnabled=K(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Lr.dynamicTokensEnabled,this.maxLookahead=K(e,"maxLookahead")?e.maxLookahead:Lr.maxLookahead,this.lookaheadStrategy=K(e,"lookaheadStrategy")?e.lookaheadStrategy:new ig({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){V(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:a,option:i,repetitionMandatory:o,repetitionMandatoryWithSeparator:u,repetitionWithSeparator:l}=Z_(r);V(n,c=>{const f=c.idx===0?"":c.idx;this.TRACE_INIT(`${Kt(c)}${f}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:r,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=Dc(this.fullRuleNameToShort[r.name],X_,c.idx);this.setLaFuncCache(p,d)})}),V(a,c=>{this.computeLookaheadFunc(r,c.idx,Om,"Repetition",c.maxLookahead,Kt(c))}),V(i,c=>{this.computeLookaheadFunc(r,c.idx,J_,"Option",c.maxLookahead,Kt(c))}),V(o,c=>{this.computeLookaheadFunc(r,c.idx,Lm,"RepetitionMandatory",c.maxLookahead,Kt(c))}),V(u,c=>{this.computeLookaheadFunc(r,c.idx,Lc,"RepetitionMandatoryWithSeparator",c.maxLookahead,Kt(c))}),V(l,c=>{this.computeLookaheadFunc(r,c.idx,Dm,"RepetitionWithSeparator",c.maxLookahead,Kt(c))})})})}computeLookaheadFunc(e,r,n,a,i,o){this.TRACE_INIT(`${o}${r===0?"":r}`,()=>{const u=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:a}),l=Dc(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,u)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return Dc(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},s(Bi,"LooksAhead"),Bi),Ui,F1=(Ui=class extends ol{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},s(Ui,"DslMethodsCollectorVisitor"),Ui),sc=new F1;function Z_(t){sc.reset(),t.accept(sc);const e=sc.dslMethods;return sc.reset(),e}s(Z_,"collectMethods");function xm(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffseto.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: + ${i.join(` + +`).replace(/\n/g,` + `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}s(rS,"createBaseSemanticVisitorConstructor");function nS(t,e,r){const n=s(function(){},"derivedConstructor");sg(n,t+"BaseSemanticsWithDefaults");const a=Object.create(r.prototype);return V(e,i=>{a[i]=tS}),n.prototype=a,n.prototype.constructor=n,n}s(nS,"createBaseVisitorConstructorWithDefaults");var Gm;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Gm||(Gm={}));function aS(t,e){return iS(t,e)}s(aS,"validateVisitor");function iS(t,e){const r=Bt(e,a=>Gr(t[a])===!1),n=j(r,a=>({msg:`Missing visitor method: <${a}> on ${t.constructor.name} CST Visitor.`,type:Gm.MISSING_METHOD,methodName:a}));return Xu(n)}s(iS,"validateMissingCstMethods");var Ki,j1=(Ki=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=K(e,"nodeLocationTracking")?e.nodeLocationTracking:Lr.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=He,this.cstFinallyStateUpdate=He,this.cstPostTerminal=He,this.cstPostNonTerminal=He,this.cstPostRule=He;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Mm,this.setNodeLocationFromNode=Mm,this.cstPostRule=He,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=He,this.setNodeLocationFromNode=He,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=xm,this.setNodeLocationFromNode=xm,this.cstPostRule=He,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=He,this.setNodeLocationFromNode=He,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=He,this.setNodeLocationFromNode=He,this.cstPostRule=He,this.setInitialNodeLocation=He;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];Q_(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];eS(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(kr(this.baseCstVisitorConstructor)){const e=rS(this.className,Nt(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(kr(this.baseCstVisitorWithDefaultsConstructor)){const e=nS(this.className,Nt(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},s(Ki,"TreeBuilder"),Ki),Wi,B1=(Wi=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Tf}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Tf:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},s(Wi,"LexerAdapter"),Wi),Vi,U1=(Vi=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=$f){if(vt(this.definedRulesNames,e)){const o={message:Ln.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:yt.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);const a=this.defineRule(e,r,n);return this[e]=a,a}OVERRIDE_RULE(e,r,n=$f){const a=k_(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(a);const i=this.defineRule(e,r,n);return this[e]=i,i}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(a){if(Su(a))return!1;throw a}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return wC(Ke(this.gastProductionsCache))}},s(Vi,"RecognizerApi"),Vi),qi,K1=(qi=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=_u,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},K(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 + For Further details.`);if(se(e)){if(Re(e))throw Error(`A Token Vocabulary cannot be empty. + Note that the first argument for the parser constructor + is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 + For Further details.`)}if(se(e))this.tokensMap=kt(e,(i,o)=>(i[o.name]=o,i),{});else if(K(e,"modes")&&Yt(Ht(Ke(e.modes)),y_)){const i=Ht(Ke(e.modes)),o=By(i);this.tokensMap=kt(o,(u,l)=>(u[l.name]=l,u),{})}else if(zt(e))this.tokensMap=it(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Jr;const n=K(e,"modes")?Ht(Ke(e.modes)):Ke(e),a=Yt(n,i=>Re(i.categoryMatches));this.tokenMatcher=a?_u:ul,cl(Ke(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' +Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const a=K(n,"resyncEnabled")?n.resyncEnabled:$f.resyncEnabled,i=K(n,"recoveryValueFunc")?n.recoveryValueFunc:$f.recoveryValueFunc,o=this.ruleShortNameIdx<o.call(this)&&u.call(this),"lookAheadFunc")}}else i=e;if(a.call(this)===!0)return i.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(Lm,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let a=this.getLaFuncFromCache(n),i;if(typeof r!="function"){i=r.DEF;const o=r.GATE;if(o!==void 0){const u=a;a=s(()=>o.call(this)&&u.call(this),"lookAheadFunc")}}else i=r;if(a.call(this)===!0){let o=this.doSingleRepetition(i);for(;a.call(this)===!0&&o===!0;)o=this.doSingleRepetition(i)}else throw this.raiseEarlyExitException(e,Pe.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],a,Lm,e,w1)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Lc,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const a=r.DEF,i=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){a.call(this);const u=s(()=>this.tokenMatcher(this.LA(1),i),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),a.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,u,a,Jv],u,Lc,e,Jv)}else throw this.raiseEarlyExitException(e,Pe.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(Om,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let a=this.getLaFuncFromCache(n),i;if(typeof r!="function"){i=r.DEF;const u=r.GATE;if(u!==void 0){const l=a;a=s(()=>u.call(this)&&l.call(this),"lookaheadFunction")}}else i=r;let o=!0;for(;a.call(this)===!0&&o===!0;)o=this.doSingleRepetition(i);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],a,Om,e,S1,o)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Dm,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const a=r.DEF,i=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){a.call(this);const u=s(()=>this.tokenMatcher(this.LA(1),i),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),a.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,u,a,Xv],u,Dm,e,Xv)}}repetitionSepSecondInternal(e,r,n,a,i){for(;n();)this.CONSUME(r),a.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,a,i],n,Lc,e,i)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(X_,r),a=se(e)?e:e.DEF,o=this.getLaFuncFromCache(n).call(this,a);if(o!==void 0)return a[o].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new O1(r,e))}}subruleInternal(e,r,n){let a;try{const i=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,a=e.apply(this,i),this.cstPostNonTerminal(a,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),a}catch(i){throw this.subruleInternalError(i,n,e.ruleName)}}subruleInternalError(e,r,n){throw Su(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let a;try{const i=this.LA(1);this.tokenMatcher(i,e)===!0?(this.consumeToken(),a=i):this.consumeInternalError(e,i,n)}catch(i){a=this.consumeInternalRecovery(e,r,i)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,a),a}consumeInternalError(e,r,n){let a;const i=this.LA(0);throw n!==void 0&&n.ERR_MSG?a=n.ERR_MSG:a=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new q_(a,r,i))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const a=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,a)}catch(i){throw i.name===H_?n:i}}else throw n}saveRecogState(){const e=this.errors,r=it(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Jr)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},s(qi,"RecognizerEngine"),qi),Hi,W1=(Hi=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=K(e,"errorMessageProvider")?e.errorMessageProvider:Lr.errorMessageProvider}SAVE_ERROR(e){if(Su(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:it(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return it(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const a=this.getCurrRuleFullName(),i=this.getGAstProductions()[a],u=ec(e,i,r,this.maxLookahead)[0],l=[];for(let f=1;f<=this.maxLookahead;f++)l.push(this.LA(f));const c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:u,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:a});throw this.SAVE_ERROR(new L1(c,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),a=this.getGAstProductions()[n],i=Qu(e,a,this.maxLookahead),o=[];for(let c=1;c<=this.maxLookahead;c++)o.push(this.LA(c));const u=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:i,actual:o,previous:u,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new k1(l,this.LA(1),u))}},s(Hi,"ErrorHandler"),Hi),Yi,V1=(Yi=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(kr(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Qy([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Jt(e.ruleStack),a=this.getGAstProductions()[r];return new _1(a,e).startWalking()}},s(Yi,"ContentAssist"),Yi),yd={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(yd);var Zv=!0,Qv=Math.pow(2,nn)-1,sS=Xa({name:"RECORDING_PHASE_TOKEN",pattern:pt.NA});cl([sS]);var oS=Zu(sS,`This IToken indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(oS);var q1={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Xi,H1=(Xi=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,a){return this.consumeInternalRecord(n,e,a)},this[`SUBRULE${r}`]=function(n,a){return this.subruleInternalRecord(n,e,a)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return Tf}topLevelRuleRecord(e,r){try{const n=new sl({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` + This error was thrown during the "grammar recording phase" For more info see: + https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Na.call(this,at,e,r)}atLeastOneInternalRecord(e,r){Na.call(this,Ot,r,e)}atLeastOneSepFirstInternalRecord(e,r){Na.call(this,Lt,r,e,Zv)}manyInternalRecord(e,r){Na.call(this,xe,r,e)}manySepFirstInternalRecord(e,r){Na.call(this,_t,r,e,Zv)}orInternalRecord(e,r){return lS.call(this,e,r)}subruleInternalRecord(e,r,n){if(wu(r),!e||K(e,"ruleName")===!1){const u=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw u.KNOWN_RECORDER_ERROR=!0,u}const a=Bn(this.recordingProdStack),i=e.ruleName,o=new ht({idx:r,nonTerminalName:i,label:n?.LABEL,referencedRule:void 0});return a.definition.push(o),this.outputCst?q1:yd}consumeInternalRecord(e,r,n){if(wu(r),!Xy(e)){const o=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const a=Bn(this.recordingProdStack),i=new Se({idx:r,terminalType:e,label:n?.LABEL});return a.definition.push(i),oS}},s(Xi,"GastRecorder"),Xi);function Na(t,e,r,n=!1){wu(r);const a=Bn(this.recordingProdStack),i=Gr(e)?e:e.DEF,o=new t({definition:[],idx:r});return n&&(o.separator=e.SEP),K(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),i.call(this),a.definition.push(o),this.recordingProdStack.pop(),yd}s(Na,"recordProd");function lS(t,e){wu(e);const r=Bn(this.recordingProdStack),n=se(t)===!1,a=n===!1?t:t.DEF,i=new St({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});K(t,"MAX_LOOKAHEAD")&&(i.maxLookahead=t.MAX_LOOKAHEAD);const o=EC(a,u=>Gr(u.GATE));return i.hasPredicates=o,r.definition.push(i),V(a,u=>{const l=new Ct({definition:[]});i.definition.push(l),K(u,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=u.IGNORE_AMBIGUITIES:K(u,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),u.ALT.call(this),this.recordingProdStack.pop()}),yd}s(lS,"recordOrProd");function Fm(t){return t===0?"":`${t}`}s(Fm,"getIdxSuffix");function wu(t){if(t<0||t>Qv){const e=new Error(`Invalid DSL Method idx value: <${t}> + Idx value must be a none negative value smaller than ${Qv+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}s(wu,"assertMethodIdxIsValid");var Ji,Y1=(Ji=class{initPerformanceTracer(e){if(K(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=Lr.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:a,value:i}=Ky(r),o=a>10?console.warn:console.log;return this.traceInitIndent time: ${a}ms`),this.traceInitIndent--,i}else return r()}},s(Ji,"PerformanceTracer"),Ji);function uS(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(a=>{if(a==="constructor")return;const i=Object.getOwnPropertyDescriptor(n,a);i&&(i.get||i.set)?Object.defineProperty(t.prototype,a,i):t.prototype[a]=r.prototype[a]})})}s(uS,"applyMixins");var Tf=Zu(Jr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Tf);var Lr=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:qa,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),$f=Object.freeze({recoveryValueFunc:s(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),yt;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(yt||(yt={}));function zm(t=void 0){return function(){return t}}s(zm,"EMPTY_ALT");var Fn,og=(Fn=class{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{Wy(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),V(this.definedRulesNames,a=>{const o=this[a].originalGrammarAction;let u;this.TRACE_INIT(`${a} Rule`,()=>{u=this.topLevelRuleRecord(a,o)}),this.gastProductionsCache[a]=u})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=z_({rules:Ke(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Re(n)&&this.skipValidations===!1){const a=j_({rules:Ke(this.gastProductionsCache),tokenTypes:Ke(this.tokensMap),errMsgProvider:Ln,grammarName:r}),i=S_({lookaheadStrategy:this.lookaheadStrategy,rules:Ke(this.gastProductionsCache),tokenTypes:Ke(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(a,i)}}),Re(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const a=DC(Ke(this.gastProductionsCache));this.resyncFollows=a}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var a,i;(i=(a=this.lookaheadStrategy).initialize)===null||i===void 0||i.call(a,{rules:Ke(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Ke(this.gastProductionsCache))})),!Fn.DEFER_DEFINITION_ERRORS_HANDLING&&!Re(this.definitionErrors))throw e=j(this.definitionErrors,a=>a.message),new Error(`Parser Definition Errors detected: + ${e.join(` +------------------------------- +`)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),K(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. + Please use the flag on the relevant DSL method instead. + See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES + For further details.`);this.skipValidations=K(r,"skipValidations")?r.skipValidations:Lr.skipValidations}},s(Fn,"Parser"),Fn);og.DEFER_DEFINITION_ERRORS_HANDLING=!1;uS(og,[x1,G1,j1,B1,K1,U1,W1,V1,H1,Y1]);var Zi,X1=(Zi=class extends og{constructor(e,r=Lr){const n=it(r);n.outputCst=!1,super(e,n)}},s(Zi,"EmbeddedActionsParser"),Zi);function cS(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r-1}s(vS,"listCacheHas");var rG=vS;function TS(t,e){var r=this.__data__,n=gd(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}s(TS,"listCacheSet");var nG=TS;function ia(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eu))return!1;var c=i.get(t),f=i.get(e);if(c&&f)return c==e&&f==t;var d=-1,p=!0,y=r&uF?new ZS:void 0;for(i.set(t,e),i.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=KF}s(Rw,"isLength");var cg=Rw,WF="[object Arguments]",VF="[object Array]",qF="[object Boolean]",HF="[object Date]",YF="[object Error]",XF="[object Function]",JF="[object Map]",ZF="[object Number]",QF="[object Object]",ez="[object RegExp]",tz="[object Set]",rz="[object String]",nz="[object WeakMap]",az="[object ArrayBuffer]",iz="[object DataView]",sz="[object Float32Array]",oz="[object Float64Array]",lz="[object Int8Array]",uz="[object Int16Array]",cz="[object Int32Array]",fz="[object Uint8Array]",dz="[object Uint8ClampedArray]",pz="[object Uint16Array]",mz="[object Uint32Array]",_e={};_e[sz]=_e[oz]=_e[lz]=_e[uz]=_e[cz]=_e[fz]=_e[dz]=_e[pz]=_e[mz]=!0;_e[WF]=_e[VF]=_e[az]=_e[qF]=_e[iz]=_e[HF]=_e[YF]=_e[XF]=_e[JF]=_e[ZF]=_e[QF]=_e[ez]=_e[tz]=_e[rz]=_e[nz]=!1;function Aw(t){return tl(t)&&cg(t.length)&&!!_e[fl(t)]}s(Aw,"baseIsTypedArray");var hz=Aw;function Ew(t){return function(e){return t(e)}}s(Ew,"baseUnary");var yz=Ew,bw=typeof exports=="object"&&exports&&!exports.nodeType&&exports,hu=bw&&typeof module=="object"&&module&&!module.nodeType&&module,gz=hu&&hu.exports===bw,Yd=gz&&bS.process,vz=(function(){try{var t=hu&&hu.require&&hu.require("util").types;return t||Yd&&Yd.binding&&Yd.binding("util")}catch{}})(),uT=vz,cT=uT&&uT.isTypedArray,Tz=cT?yz(cT):hz,fg=Tz,$z=Object.prototype,Rz=$z.hasOwnProperty;function Cw(t,e){var r=gt(t),n=!r&&Rd(t),a=!r&&!n&&Rf(t),i=!r&&!n&&!a&&fg(t),o=r||n||a||i,u=o?OF(t.length,String):[],l=u.length;for(var c in t)(e||Rz.call(t,c))&&!(o&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||$w(c,l)))&&u.push(c);return u}s(Cw,"arrayLikeKeys");var Az=Cw,Ez=Object.prototype;function _w(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ez;return t===r}s(_w,"isPrototype");var Sw=_w;function ww(t,e){return function(r){return t(e(r))}}s(ww,"overArg");var bz=ww,Cz=bz(Object.keys,Object),_z=Cz,Sz=Object.prototype,wz=Sz.hasOwnProperty;function Iw(t){if(!Sw(t))return _z(t);var e=[];for(var r in Object(t))wz.call(t,r)&&r!="constructor"&&e.push(r);return e}s(Iw,"baseKeys");var Nw=Iw;function Pw(t){return t!=null&&cg(t.length)&&!PS(t)}s(Pw,"isArrayLike");var Ad=Pw;function kw(t){return Ad(t)?Az(t):Nw(t)}s(kw,"keys");var dg=kw;function Ow(t){return SF(t,dg,kF)}s(Ow,"getAllKeys");var fT=Ow,Iz=1,Nz=Object.prototype,Pz=Nz.hasOwnProperty;function Lw(t,e,r,n,a,i){var o=r&Iz,u=fT(t),l=u.length,c=fT(e),f=c.length;if(l!=f&&!o)return!1;for(var d=l;d--;){var p=u[d];if(!(o?p in e:Pz.call(e,p)))return!1}var y=i.get(t),h=i.get(e);if(y&&h)return y==e&&h==t;var T=!0;i.set(t,e),i.set(e,t);for(var b=o;++d$g(t,e,o));return ca(t,e,n,r,...a)}s(_I,"alternation");function SI(t,e,r){const n=We(t,e,r,{type:Zr});zr(t,n);const a=ca(t,e,n,r,an(t,e,r));return wI(t,e,r,a)}s(SI,"option");function an(t,e,r){const n=wj(_r(r.definition,a=>$g(t,e,a)),a=>a!==void 0);return n.length===1?n[0]:n.length===0?void 0:NI(t,n)}s(an,"block");function Rg(t,e,r,n,a){const i=n.left,o=n.right,u=We(t,e,r,{type:Oj});zr(t,u);const l=We(t,e,r,{type:vI});return i.loopback=u,l.loopback=u,t.decisionMap[Kn(e,a?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=u,Fe(o,u),a===void 0?(Fe(u,i),Fe(u,l)):(Fe(u,l),Fe(u,a.left),Fe(a.right,i)),{left:i,right:l}}s(Rg,"plus");function Ag(t,e,r,n,a){const i=n.left,o=n.right,u=We(t,e,r,{type:kj});zr(t,u);const l=We(t,e,r,{type:vI}),c=We(t,e,r,{type:Pj});return u.loopback=c,l.loopback=c,Fe(u,i),Fe(u,l),Fe(o,c),a!==void 0?(Fe(c,l),Fe(c,a.left),Fe(a.right,i)):Fe(c,u),t.decisionMap[Kn(e,a?"RepetitionWithSeparator":"Repetition",r.idx)]=u,{left:u,right:l}}s(Ag,"star");function wI(t,e,r,n){const a=n.left,i=n.right;return Fe(a,i),t.decisionMap[Kn(e,"Option",r.idx)]=a,n}s(wI,"optional");function zr(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}s(zr,"defineDecisionState");function ca(t,e,r,n,...a){const i=We(t,e,n,{type:Nj,start:r});r.end=i;for(const u of a)u!==void 0?(Fe(r,u.left),Fe(u.right,i)):Fe(r,i);const o={left:r,right:i};return t.decisionMap[Kn(e,II(n),n.idx)]=r,o}s(ca,"makeAlts");function II(t){if(t instanceof St)return"Alternation";if(t instanceof at)return"Option";if(t instanceof xe)return"Repetition";if(t instanceof _t)return"RepetitionWithSeparator";if(t instanceof Ot)return"RepetitionMandatory";if(t instanceof Lt)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}s(II,"getProdType");function NI(t,e){const r=e.length;for(let i=0;ie.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},s(ns,"ATNConfigSet"),ns);function Eg(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}s(Eg,"getATNConfigKey");function LI(t,e,r){for(var n=-1,a=t.length;++n0&&r(u)?e>1?bg(u,e-1,r,n,a):lw(a,u):n||(a[a.length]=u)}return a}s(bg,"baseFlatten");var GI=bg;function FI(t,e){return GI(_r(t,e),1)}s(FI,"flatMap");var Gj=FI;function zI(t,e,r,n){for(var a=t.length,i=r+(n?1:-1);n?i--:++i-1}s(KI,"arrayIncludes");var Uj=KI;function WI(t,e,r){for(var n=-1,a=t==null?0:t.length;++n=Yj){var c=e?null:Hj(t);if(c)return ug(c);o=!1,a=tw,l=new ZS}else l=e?[]:u;e:for(;++n{const a=n.toString();let i=r[a];return i!==void 0||(i={atnStartState:t,decision:e,states:{}},r[a]=i),i}}s(nN,"createDFACache");var as,aN=(as=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;nconsole.log(n))}initialize(e){this.atn=$I(e.rules),this.dfas=iN(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:a,dynamicTokensEnabled:i}=e,o=this.dfas,u=this.logging,l=Kn(n,"Alternation",r),f=this.atn.decisionMap[l].decision,d=_r(Pm({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),p=>_r(p,y=>y[0]));if(Vm(d,!1)&&!i){const p=ET(d,(y,h,T)=>(Xd(h,b=>{b&&(y[b.tokenTypeIdx]=T,Xd(b.categoryMatches,v=>{y[v]=T}))}),y),{});return a?function(y){var h;const T=this.LA(1),b=p[T.tokenTypeIdx];if(y!==void 0&&b!==void 0){const v=(h=y[b])===null||h===void 0?void 0:h.GATE;if(v!==void 0&&v.call(this)===!1)return}return b}:function(){const y=this.LA(1);return p[y.tokenTypeIdx]}}else return a?function(p){const y=new aN,h=p===void 0?0:p.length;for(let b=0;b_r(p,y=>y[0]));if(Vm(d)&&d[0][0]&&!i){const p=d[0],y=Zj(p);if(y.length===1&&iB(y[0].categoryMatches)){const T=y[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===T}}else{const h=ET(y,(T,b)=>(b!==void 0&&(T[b.tokenTypeIdx]=!0,Xd(b.categoryMatches,v=>{T[v]=!0})),T),{});return function(){const T=this.LA(1);return h[T.tokenTypeIdx]===!0}}}return function(){const p=Mc.call(this,o,f,bT,u);return typeof p=="object"?!1:p===0}}},s(is,"LLStarLookaheadStrategy"),is);function Vm(t,e=!0){const r=new Set;for(const n of t){const a=new Set;for(const i of n){if(i===void 0){if(e)break;return!1}const o=[i.tokenTypeIdx].concat(i.categoryMatches);for(const u of o)if(r.has(u)){if(!a.has(u))return!1}else r.add(u),a.add(u)}}return!0}s(Vm,"isLL1Sequence");function iN(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nMn(a)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${cN(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, +<${e}> may appears as a prefix path in all these alternatives. +`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`,n}s(uN,"buildAmbiguityError");function cN(t){if(t instanceof ht)return"SUBRULE";if(t instanceof at)return"OPTION";if(t instanceof St)return"OR";if(t instanceof Ot)return"AT_LEAST_ONE";if(t instanceof Lt)return"AT_LEAST_ONE_SEP";if(t instanceof _t)return"MANY_SEP";if(t instanceof xe)return"MANY";if(t instanceof Se)return"CONSUME";throw Error("non exhaustive match")}s(cN,"getProductionDslName");function fN(t,e,r){const n=Gj(e.configs.elements,i=>i.state.transitions),a=Jj(n.filter(i=>i instanceof vg).map(i=>i.tokenType),i=>i.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:a,tokenPath:t}}s(fN,"buildAdaptivePredictError");function dN(t,e){return t.edges[e.tokenTypeIdx]}s(dN,"getExistingTargetState");function pN(t,e,r){const n=new Wm,a=[];for(const o of t.elements){if(r.is(o.alt)===!1)continue;if(o.state.type===tc){a.push(o);continue}const u=o.state.transitions.length;for(let l=0;l0&&!vN(i))for(const o of a)i.add(o);return i}s(pN,"computeReachSet");function mN(t,e){if(t instanceof vg&&Zy(e,t.tokenType))return t.target}s(mN,"getReachableTarget");function hN(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}s(hN,"getUniqueAlt");function Cg(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}s(Cg,"newDFAState");function qm(t,e,r,n){return n=_g(t,n),e.edges[r.tokenTypeIdx]=n,n}s(qm,"addDFAEdge");function _g(t,e){if(e===Af)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}s(_g,"addDFAState");function yN(t){const e=new Wm,r=t.transitions.length;for(let n=0;n0){const a=[...t.stack],o={state:a.pop(),alt:t.alt,stack:a};ku(o,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let a=0;a1)return!0;return!1}s(AN,"hasConflictingAltSet");function EN(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}s(EN,"hasStateAssociatedWithOneAlt");Du();var ss,bN=(ss=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new wg(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new Nd;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Ef(e.startOffset,e.image.length,Tu(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const i of e){const o=new Ef(i.startOffset,i.image.length,Tu(i),i.tokenType,!0);o.root=this.rootNode,r.push(o)}let n=this.current,a=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const i=n.container.content.indexOf(n);if(i>0){n.container.content.splice(i,0,...r),a=!0;break}n=n.container}a||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infix&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}},s(ss,"CstNodeBuilder"),ss),os,Sg=(os=class{get hidden(){return!1}get astNode(){const e=typeof this._astNode?.$type=="string"?this._astNode:this.container?.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},s(os,"AbstractCstNode"),os),ls,Ef=(ls=class extends Sg{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,a,i=!1){super(),this._hidden=i,this._offset=e,this._tokenType=a,this._length=r,this._range=n}},s(ls,"LeafCstNodeImpl"),ls),us,Nd=(us=class extends Sg{constructor(){super(...arguments),this.content=new uB(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:a}=r;this._rangeCache={start:n.start,end:a.end.line=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},s(us,"CompositeCstNodeImpl"),us),zn,uB=(zn=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,zn.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}},s(zn,"CstNodeContainer"),zn),cs,wg=(cs=class extends Nd{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},s(cs,"RootCstNodeImpl"),cs),bf=Symbol("Datatype");function Gc(t){return t.$type===bf}s(Gc,"isDataTypeNode");var CT="​",CN=s(t=>t.endsWith(CT)?t:t+CT,"withRuleSuffix"),fs,Ig=(fs=class{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";e.shared.profilers.LangiumProfiler?.isActive("parsing")?this.wrapper=new fB(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new IN(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},s(fs,"AbstractLangiumParser"),fs),ds,_N=(ds=class extends Ig{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new bN,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e);let a;Xo(e)&&(a=e.name,this.registerPrecedenceMap(e));const i=this.wrapper.DEFINE_RULE(CN(e.name),this.startImplementation(n,a,r).bind(this));return this.allRules.set(e.name,i),mt(e)&&e.entry&&(this.mainRule=i),i}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let a=0;a0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return a=>{const i=!this.isRecording()&&e!==void 0;if(i){const o={$type:e};this.stack.push(o),e===bf?o.value="":r!==void 0&&(o.$infixName=r)}return n(a),i?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let a=0;an)return r.splice(0,a);return r.splice(0,r.length)}consume(e,r,n){const a=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(a)){const i=this.extractHiddenTokens(a);this.nodeBuilder.addHiddenNodes(i);const o=this.nodeBuilder.buildLeafNode(a,n),{assignment:u,crossRef:l}=this.getAssignment(n),c=this.current;if(u){const f=Ir(n)?a.image:this.converter.convert(a.image,o);this.assign(u.operator,u.feature,f,o,l)}else if(Gc(c)){let f=a.image;Ir(n)||(f=this.converter.convert(f,o).toString()),c.value+=f}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,a,i){let o;!this.isRecording()&&!n&&(o=this.nodeBuilder.buildCompositeNode(a));let u;try{u=this.wrapper.wrapSubrule(e,r,i)}finally{this.isRecording()||(u===void 0&&!n&&(u=this.construct()),u!==void 0&&o&&o.length>0&&this.performSubruleAssignment(u,a,o))}}performSubruleAssignment(e,r,n){const{assignment:a,crossRef:i}=this.getAssignment(r);if(a)this.assign(a.operator,a.feature,e,n,i);else if(!a){const o=this.current;if(Gc(o))o.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,o);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const i={$type:e};this.stack.push(i),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):Gc(e)?this.converter.convert(e.value,e.$cstNode):(Sh(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const a=e.operators;if(!Array.isArray(a)||n.length<2)return n[0];let i=0,o=-1;for(let T=0;To?(o=v.precedence,i=T):v.precedence===o&&(v.rightAssoc||(i=T))}const u=a.slice(0,i),l=a.slice(i+1),c=n.slice(0,i+1),f=n.slice(i+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:c,operators:u},p={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:f,operators:l},y=this.constructInfix(d,r),h=this.constructInfix(p,r);return{$type:e.$type,$cstNode:e.$cstNode,left:y,operator:a[i],right:h}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=qn(e,wr);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Yn(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,a,i){const o=this.current;let u;switch(i==="single"&&typeof n=="string"?u=this.linker.buildReference(o,r,a,n):i==="multi"&&typeof n=="string"?u=this.linker.buildMultiReference(o,r,a,n):u=n,e){case"=":{o[r]=u;break}case"?=":{o[r]=!0;break}case"+=":Array.isArray(o[r])||(o[r]=[]),o[r].push(u)}}assignWithoutOverride(e,r){for(const[a,i]of Object.entries(r)){const o=e[a];o===void 0?e[a]=i:Array.isArray(o)&&Array.isArray(i)&&(i.push(...o),e[a]=i)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},s(ds,"LangiumParser"),ds),ps,SN=(ps=class{buildMismatchTokenMessage(e){return qa.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return qa.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return qa.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return qa.buildEarlyExitMessage(e)}},s(ps,"AbstractParserErrorMessageProvider"),ps),ms,Ng=(ms=class extends SN{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},s(ms,"LangiumParserErrorMessageProvider"),ms),hs,wN=(hs=class extends Ig{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(CN(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,a,i){this.before(a),this.wrapper.wrapSubrule(e,r,i),this.after(a)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},s(hs,"LangiumCompletionParser"),hs),cB={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Ng},ys,IN=(ys=class extends X1{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...cB,lookaheadStrategy:n?new ig({maxLookahead:r.maxLookahead}):new lB({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},s(ys,"ChevrotainWrapper"),ys),gs,fB=(gs=class extends IN{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}},s(gs,"ProfilerWrapper"),gs);function Pd(t,e,r){return NN({parser:e,tokens:r,ruleNames:new Map},t),e}s(Pd,"createParser");function NN(t,e){const r=Vf(e,!1),n=de(e.rules).filter(mt).filter(i=>r.has(i));for(const i of n){const o={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(i,Qr(o,i.definition))}const a=de(e.rules).filter(Xo).filter(i=>r.has(i));for(const i of a)t.parser.rule(i,PN(t,i))}s(NN,"buildRules");function PN(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(jt(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(y=>y.operators),a={$type:"Group",elements:[]},i={$container:a,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},o={$container:a,$type:"Group",elements:[],cardinality:"*"};a.elements.push(i,o);const l={$container:o,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},c={...i,$container:o};o.elements.push(l,c);const d=n.map(y=>t.tokens[y.value]).map((y,h)=>({ALT:s(()=>t.parser.consume(h,y,l),"ALT")}));let p;return y=>{p??(p=kd(t,r)),t.parser.subrule(0,p,!1,i,y),t.parser.many(0,{DEF:s(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,p,!1,c,y)},"DEF")})}}s(PN,"buildInfixRule");function Qr(t,e,r=!1){let n;if(Ir(e))n=GN(t,e);else if(Yr(e))n=kN(t,e);else if(wr(e))n=Qr(t,e.terminal);else if(Yn(e))n=Pg(t,e);else if(Nr(e))n=ON(t,e);else if(Mf(e))n=DN(t,e);else if(jf(e))n=xN(t,e);else if(Xn(e))n=MN(t,e);else if(Lh(e)){const a=t.consume++;n=s(()=>t.parser.consume(a,Jr,e),"method")}else throw new Uf(e.$cstNode,`Unexpected element type: ${e.$type}`);return kg(t,r?void 0:Ou(e),n,e.cardinality)}s(Qr,"buildElement");function kN(t,e){const r=jn(e);return()=>t.parser.action(r,e)}s(kN,"buildAction");function ON(t,e){const r=e.rule.ref;if(Hn(r)){const n=t.subrule++,a=mt(r)&&r.fragment,i=e.arguments.length>0?LN(r,e.arguments):()=>({});let o;return u=>{o??(o=kd(t,r)),t.parser.subrule(n,o,a,e,i(u))}}else if(jt(r)){const n=t.consume++,a=Cf(t,r.name);return()=>t.parser.consume(n,a,e)}else if(r)tn();else throw new Uf(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}s(ON,"buildRuleCall");function LN(t,e){if(e.some(n=>n.calledByName)){const n=e.map(a=>({parameterName:a.parameter?.ref?.name,predicate:Wt(a.value)}));return a=>{const i={};for(const{parameterName:o,predicate:u}of n)o&&(i[o]=u(a));return i}}else{const n=e.map(a=>Wt(a.value));return a=>{const i={};for(let o=0;oe(n)||r(n)}else if(kh(t)){const e=Wt(t.left),r=Wt(t.right);return n=>e(n)&&r(n)}else if(Mh(t)){const e=Wt(t.value);return r=>!e(r)}else if(Gh(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Nh(t)){const e=!!t.true;return()=>e}tn()}s(Wt,"buildPredicate");function DN(t,e){if(e.elements.length===1)return Qr(t,e.elements[0]);{const r=[];for(const a of e.elements){const i={ALT:Qr(t,a,!0)},o=Ou(a);o&&(i.GATE=Wt(o)),r.push(i)}const n=t.or++;return a=>t.parser.alternatives(n,r.map(i=>{const o={ALT:s(()=>i.ALT(a),"ALT")},u=i.GATE;return u&&(o.GATE=()=>u(a)),o}))}}s(DN,"buildAlternatives");function xN(t,e){if(e.elements.length===1)return Qr(t,e.elements[0]);const r=[];for(const u of e.elements){const l={ALT:Qr(t,u,!0)},c=Ou(u);c&&(l.GATE=Wt(c)),r.push(l)}const n=t.or++,a=s((u,l)=>{const c=l.getRuleStack().join("-");return`uGroup_${u}_${c}`},"idFunc"),i=s(u=>t.parser.alternatives(n,r.map((l,c)=>{const f={ALT:s(()=>!0,"ALT")},d=t.parser;f.ALT=()=>{if(l.ALT(u),!d.isRecording()){const y=a(n,d);d.unorderedGroups.get(y)||d.unorderedGroups.set(y,[]);const h=d.unorderedGroups.get(y);typeof h?.[c]>"u"&&(h[c]=!0)}};const p=l.GATE;return p?f.GATE=()=>p(u):f.GATE=()=>!d.unorderedGroups.get(a(n,d))?.[c],f})),"alternatives"),o=kg(t,Ou(e),i,"*");return u=>{o(u),t.parser.isRecording()||t.parser.unorderedGroups.delete(a(n,t.parser))}}s(xN,"buildUnorderedGroup");function MN(t,e){const r=e.elements.map(n=>Qr(t,n));return n=>r.forEach(a=>a(n))}s(MN,"buildGroup");function Ou(t){if(Xn(t))return t.guardCondition}s(Ou,"getGuardCondition");function Pg(t,e,r=e.terminal){if(r)if(Nr(r)&&mt(r.rule.ref)){const n=r.rule.ref,a=t.subrule++;let i;return o=>{i??(i=kd(t,n)),t.parser.subrule(a,i,!1,e,o)}}else if(Nr(r)&&jt(r.rule.ref)){const n=t.consume++,a=Cf(t,r.rule.ref.name);return()=>t.parser.consume(n,a,e)}else if(Ir(r)){const n=t.consume++,a=Cf(t,r.value);return()=>t.parser.consume(n,a,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const a=Xf(e.type.ref)?.terminal;if(!a)throw new Error("Could not find name assignment for type: "+jn(e.type.ref));return Pg(t,e,a)}}s(Pg,"buildCrossReference");function GN(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}s(GN,"buildKeyword");function kg(t,e,r,n){const a=e&&Wt(e);if(!n)if(a){const i=t.or++;return o=>t.parser.alternatives(i,[{ALT:s(()=>r(o),"ALT"),GATE:s(()=>a(o),"GATE")},{ALT:zm(),GATE:s(()=>!a(o),"GATE")}])}else return r;if(n==="*"){const i=t.many++;return o=>t.parser.many(i,{DEF:s(()=>r(o),"DEF"),GATE:a?()=>a(o):void 0})}else if(n==="+"){const i=t.many++;if(a){const o=t.or++;return u=>t.parser.alternatives(o,[{ALT:s(()=>t.parser.atLeastOne(i,{DEF:s(()=>r(u),"DEF")}),"ALT"),GATE:s(()=>a(u),"GATE")},{ALT:zm(),GATE:s(()=>!a(u),"GATE")}])}else return o=>t.parser.atLeastOne(i,{DEF:s(()=>r(o),"DEF")})}else if(n==="?"){const i=t.optional++;return o=>t.parser.optional(i,{DEF:s(()=>r(o),"DEF"),GATE:a?()=>a(o):void 0})}else tn()}s(kg,"wrap");function kd(t,e){const r=FN(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}s(kd,"getRule");function FN(t,e){if(Hn(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,a=e.$type;for(;!mt(n);)(Xn(n)||Mf(n)||jf(n))&&(a=n.elements.indexOf(r).toString()+":"+a),r=n,n=n.$container;return a=n.name+":"+a,t.ruleNames.set(e,a),a}}s(FN,"getRuleName");function Cf(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}s(Cf,"getToken");function Og(t){const e=t.Grammar,r=t.parser.Lexer,n=new wN(t);return Pd(e,n,r.definition),n.finalize(),n}s(Og,"createCompletionParser");function Lg(t){const e=Dg(t);return e.finalize(),e}s(Lg,"createLangiumParser");function Dg(t){const e=t.Grammar,r=t.parser.Lexer,n=new _N(t);return Pd(e,n,r.definition)}s(Dg,"prepareLangiumParser");var vs,Od=(vs=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=de(Vf(e,!1)),a=this.buildTerminalTokens(n),i=this.buildKeywordTokens(n,a,r);return i.push(...a),i}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(jt).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=ju(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,a={name:e.name,PATTERN:n};return typeof n=="function"&&(a.LINE_BREAKS=!0),e.hidden&&(a.GROUP=Wf(r)?pt.SKIPPED:"hidden"),a}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,a)=>(r.lastIndex=a,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Hn).flatMap(a=>Mr(a).filter(Ir)).distinct(a=>a.value).toArray().sort((a,i)=>i.value.length-a.value.length).map(a=>this.buildKeywordToken(a,r,!!n?.caseInsensitive))}buildKeywordToken(e,r,n){const a=this.buildKeywordPattern(e,n),i={name:e.value,PATTERN:a,LONGER_ALT:this.findLongerAlt(e,r)};return typeof a=="function"&&(i.LINE_BREAKS=!0),i}buildKeywordPattern(e,r){return r?new RegExp(il(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,a)=>{const i=a?.PATTERN;return i?.source&&sy("^"+i.source+"$",e.value)&&n.push(a),n},[])}},s(vs,"DefaultTokenBuilder"),vs),Ts,xg=(Ts=class{convert(e,r){let n=r.grammarSource;if(Yn(n)&&(n=fy(n)),Nr(n)){const a=n.rule.ref;if(!a)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(a,e,r)}return e}runConverter(e,r,n){switch(e.name.toUpperCase()){case"INT":return or.convertInt(r);case"STRING":return or.convertString(r);case"ID":return or.convertID(r)}switch($y(e)?.toLowerCase()){case"number":return or.convertNumber(r);case"boolean":return or.convertBoolean(r);case"bigint":return or.convertBigint(r);case"date":return or.convertDate(r);default:return r}}},s(Ts,"DefaultValueConverter"),Ts),or;(function(t){function e(c){let f="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}s(Ld,"delayNextTick");var Fc=0,zN=10;function Dd(){return Fc=performance.now(),new $e.CancellationTokenSource}s(Dd,"startCancelableOperation");function Mg(t){zN=t}s(Mg,"setInterruptionPeriod");var cr=Symbol("OperationCancelled");function fa(t){return t===cr}s(fa,"isOperationCancelled");async function Ye(t){if(t===$e.CancellationToken.None)return;const e=performance.now();if(e-Fc>=zN&&(Fc=e,await Ld(),Fc=performance.now()),t.isCancellationRequested)throw cr}s(Ye,"interruptAndCheck");var $s,Dr=($s=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},s($s,"Deferred"),$s),Hr,_T=(Hr=class{constructor(e,r,n,a){this._uri=e,this._languageId=r,this._version=n,this._content=a,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Hr.isIncremental(n)){const a=Fg(n.range),i=this.offsetAt(a.start),o=this.offsetAt(a.end);this._content=this._content.substring(0,i)+n.text+this._content.substring(o,this._content.length);const u=Math.max(a.start.line,0),l=Math.max(a.end.line,0);let c=this._lineOffsets;const f=Hm(n.text,!1,i);if(l-u===f.length)for(let p=0,y=f.length;pe?a=o:n=o+1}const i=n-1;return e=this.ensureBeforeEOL(e,r[i]),{line:i,character:e-r[i]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const a=e.line+1r&&Gg(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},s(Hr,"FullTextDocument"),Hr),_f;(function(t){function e(a,i,o,u){return new _T(a,i,o,u)}s(e,"create"),t.create=e;function r(a,i,o){if(a instanceof _T)return a.update(i,o),a;throw new Error("TextDocument.update: document must be created by TextDocument.create")}s(r,"update"),t.update=r;function n(a,i){const o=a.getText(),u=Sf(i.map(jN),(f,d)=>{const p=f.range.start.line-d.range.start.line;return p===0?f.range.start.character-d.range.start.character:p});let l=0;const c=[];for(const f of u){const d=a.offsetAt(f.range.start);if(dl&&c.push(o.substring(l,d)),f.newText.length&&c.push(f.newText),l=a.offsetAt(f.range.end)}return c.push(o.substr(l)),c.join("")}s(n,"applyEdits"),t.applyEdits=n})(_f||(_f={}));function Sf(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),a=t.slice(r);Sf(n,e),Sf(a,e);let i=0,o=0,u=0;for(;ir.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}s(Fg,"getWellformedRange");function jN(t){const e=Fg(t.range);return e!==t.range?{newText:t.newText,range:e}:t}s(jN,"getWellformedEdit");var BN;(()=>{var t={975:k=>{function _(R){if(typeof R!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(R))}s(_,"e");function $(R,A){for(var S,L="",x=0,O=-1,z=0,M=0;M<=R.length;++M){if(M2){var Y=L.lastIndexOf("/");if(Y!==L.length-1){Y===-1?(L="",x=0):x=(L=L.slice(0,Y)).length-1-L.lastIndexOf("/"),O=M,z=0;continue}}else if(L.length===2||L.length===1){L="",x=0,O=M,z=0;continue}}A&&(L.length>0?L+="/..":L="..",x=2)}else L.length>0?L+="/"+R.slice(O+1,M):L=R.slice(O+1,M),x=M-O-1;O=M,z=0}else S===46&&z!==-1?++z:z=-1}return L}s($,"r");var I={resolve:s(function(){for(var R,A="",S=!1,L=arguments.length-1;L>=-1&&!S;L--){var x;L>=0?x=arguments[L]:(R===void 0&&(R=process.cwd()),x=R),_(x),x.length!==0&&(A=x+"/"+A,S=x.charCodeAt(0)===47)}return A=$(A,!S),S?A.length>0?"/"+A:"/":A.length>0?A:"."},"resolve"),normalize:s(function(R){if(_(R),R.length===0)return".";var A=R.charCodeAt(0)===47,S=R.charCodeAt(R.length-1)===47;return(R=$(R,!A)).length!==0||A||(R="."),R.length>0&&S&&(R+="/"),A?"/"+R:R},"normalize"),isAbsolute:s(function(R){return _(R),R.length>0&&R.charCodeAt(0)===47},"isAbsolute"),join:s(function(){if(arguments.length===0)return".";for(var R,A=0;A0&&(R===void 0?R=S:R+="/"+S)}return R===void 0?".":I.normalize(R)},"join"),relative:s(function(R,A){if(_(R),_(A),R===A||(R=I.resolve(R))===(A=I.resolve(A)))return"";for(var S=1;SM){if(A.charCodeAt(O+q)===47)return A.slice(O+q+1);if(q===0)return A.slice(O+q)}else x>M&&(R.charCodeAt(S+q)===47?Y=q:q===0&&(Y=0));break}var Z=R.charCodeAt(S+q);if(Z!==A.charCodeAt(O+q))break;Z===47&&(Y=q)}var ae="";for(q=S+Y+1;q<=L;++q)q!==L&&R.charCodeAt(q)!==47||(ae.length===0?ae+="..":ae+="/..");return ae.length>0?ae+A.slice(O+Y):(O+=Y,A.charCodeAt(O)===47&&++O,A.slice(O))},"relative"),_makeLong:s(function(R){return R},"_makeLong"),dirname:s(function(R){if(_(R),R.length===0)return".";for(var A=R.charCodeAt(0),S=A===47,L=-1,x=!0,O=R.length-1;O>=1;--O)if((A=R.charCodeAt(O))===47){if(!x){L=O;break}}else x=!1;return L===-1?S?"/":".":S&&L===1?"//":R.slice(0,L)},"dirname"),basename:s(function(R,A){if(A!==void 0&&typeof A!="string")throw new TypeError('"ext" argument must be a string');_(R);var S,L=0,x=-1,O=!0;if(A!==void 0&&A.length>0&&A.length<=R.length){if(A.length===R.length&&A===R)return"";var z=A.length-1,M=-1;for(S=R.length-1;S>=0;--S){var Y=R.charCodeAt(S);if(Y===47){if(!O){L=S+1;break}}else M===-1&&(O=!1,M=S+1),z>=0&&(Y===A.charCodeAt(z)?--z==-1&&(x=S):(z=-1,x=M))}return L===x?x=M:x===-1&&(x=R.length),R.slice(L,x)}for(S=R.length-1;S>=0;--S)if(R.charCodeAt(S)===47){if(!O){L=S+1;break}}else x===-1&&(O=!1,x=S+1);return x===-1?"":R.slice(L,x)},"basename"),extname:s(function(R){_(R);for(var A=-1,S=0,L=-1,x=!0,O=0,z=R.length-1;z>=0;--z){var M=R.charCodeAt(z);if(M!==47)L===-1&&(x=!1,L=z+1),M===46?A===-1?A=z:O!==1&&(O=1):A!==-1&&(O=-1);else if(!x){S=z+1;break}}return A===-1||L===-1||O===0||O===1&&A===L-1&&A===S+1?"":R.slice(A,L)},"extname"),format:s(function(R){if(R===null||typeof R!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof R);return(function(A,S){var L=S.dir||S.root,x=S.base||(S.name||"")+(S.ext||"");return L?L===S.root?L+x:L+"/"+x:x})(0,R)},"format"),parse:s(function(R){_(R);var A={root:"",dir:"",base:"",ext:"",name:""};if(R.length===0)return A;var S,L=R.charCodeAt(0),x=L===47;x?(A.root="/",S=1):S=0;for(var O=-1,z=0,M=-1,Y=!0,q=R.length-1,Z=0;q>=S;--q)if((L=R.charCodeAt(q))!==47)M===-1&&(Y=!1,M=q+1),L===46?O===-1?O=q:Z!==1&&(Z=1):O!==-1&&(Z=-1);else if(!Y){z=q+1;break}return O===-1||M===-1||Z===0||Z===1&&O===M-1&&O===z+1?M!==-1&&(A.base=A.name=z===0&&x?R.slice(1,M):R.slice(z,M)):(z===0&&x?(A.name=R.slice(1,O),A.base=R.slice(1,M)):(A.name=R.slice(z,O),A.base=R.slice(z,M)),A.ext=R.slice(O,M)),z>0?A.dir=R.slice(0,z-1):x&&(A.dir="/"),A},"parse"),sep:"/",delimiter:":",win32:null,posix:null};I.posix=I,k.exports=I}},e={};function r(k){var _=e[k];if(_!==void 0)return _.exports;var $=e[k]={exports:{}};return t[k]($,$.exports,r),$.exports}s(r,"r"),r.d=(k,_)=>{for(var $ in _)r.o(_,$)&&!r.o(k,$)&&Object.defineProperty(k,$,{enumerable:!0,get:_[$]})},r.o=(k,_)=>Object.prototype.hasOwnProperty.call(k,_),r.r=k=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})};var n={};let a;r.r(n),r.d(n,{URI:s(()=>p,"URI"),Utils:s(()=>ye,"Utils")}),typeof process=="object"?a=process.platform==="win32":typeof navigator=="object"&&(a=navigator.userAgent.indexOf("Windows")>=0);const i=/^\w[\w\d+.-]*$/,o=/^\//,u=/^\/\//;function l(k,_){if(!k.scheme&&_)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${k.authority}", path: "${k.path}", query: "${k.query}", fragment: "${k.fragment}"}`);if(k.scheme&&!i.test(k.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(k.path){if(k.authority){if(!o.test(k.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(u.test(k.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}s(l,"a");const c="",f="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,ue=class ue{static isUri(_){return _ instanceof ue||!!_&&typeof _.authority=="string"&&typeof _.fragment=="string"&&typeof _.path=="string"&&typeof _.query=="string"&&typeof _.scheme=="string"&&typeof _.fsPath=="string"&&typeof _.with=="function"&&typeof _.toString=="function"}scheme;authority;path;query;fragment;constructor(_,$,I,R,A,S=!1){typeof _=="object"?(this.scheme=_.scheme||c,this.authority=_.authority||c,this.path=_.path||c,this.query=_.query||c,this.fragment=_.fragment||c):(this.scheme=(function(L,x){return L||x?L:"file"})(_,S),this.authority=$||c,this.path=(function(L,x){switch(L){case"https":case"http":case"file":x?x[0]!==f&&(x=f+x):x=f}return x})(this.scheme,I||c),this.query=R||c,this.fragment=A||c,l(this,S))}get fsPath(){return w(this,!1)}with(_){if(!_)return this;let{scheme:$,authority:I,path:R,query:A,fragment:S}=_;return $===void 0?$=this.scheme:$===null&&($=c),I===void 0?I=this.authority:I===null&&(I=c),R===void 0?R=this.path:R===null&&(R=c),A===void 0?A=this.query:A===null&&(A=c),S===void 0?S=this.fragment:S===null&&(S=c),$===this.scheme&&I===this.authority&&R===this.path&&A===this.query&&S===this.fragment?this:new h($,I,R,A,S)}static parse(_,$=!1){const I=d.exec(_);return I?new h(I[2]||c,ne(I[4]||c),ne(I[5]||c),ne(I[7]||c),ne(I[9]||c),$):new h(c,c,c,c,c)}static file(_){let $=c;if(a&&(_=_.replace(/\\/g,f)),_[0]===f&&_[1]===f){const I=_.indexOf(f,2);I===-1?($=_.substring(2),_=f):($=_.substring(2,I),_=_.substring(I)||f)}return new h("file",$,_,c,c)}static from(_){const $=new h(_.scheme,_.authority,_.path,_.query,_.fragment);return l($,!0),$}toString(_=!1){return C(this,_)}toJSON(){return this}static revive(_){if(_){if(_ instanceof ue)return _;{const $=new h(_);return $._formatted=_.external,$._fsPath=_._sep===y?_.fsPath:null,$}}return _}};s(ue,"l");let p=ue;const y=a?1:void 0,ot=class ot extends p{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=w(this,!1)),this._fsPath}toString(_=!1){return _?C(this,!0):(this._formatted||(this._formatted=C(this,!1)),this._formatted)}toJSON(){const _={$mid:1};return this._fsPath&&(_.fsPath=this._fsPath,_._sep=y),this._formatted&&(_.external=this._formatted),this.path&&(_.path=this.path),this.scheme&&(_.scheme=this.scheme),this.authority&&(_.authority=this.authority),this.query&&(_.query=this.query),this.fragment&&(_.fragment=this.fragment),_}};s(ot,"d");let h=ot;const T={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function b(k,_,$){let I,R=-1;for(let A=0;A=97&&S<=122||S>=65&&S<=90||S>=48&&S<=57||S===45||S===46||S===95||S===126||_&&S===47||$&&S===91||$&&S===93||$&&S===58)R!==-1&&(I+=encodeURIComponent(k.substring(R,A)),R=-1),I!==void 0&&(I+=k.charAt(A));else{I===void 0&&(I=k.substr(0,A));const L=T[S];L!==void 0?(R!==-1&&(I+=encodeURIComponent(k.substring(R,A)),R=-1),I+=L):R===-1&&(R=A)}}return R!==-1&&(I+=encodeURIComponent(k.substring(R))),I!==void 0?I:k}s(b,"m");function v(k){let _;for(let $=0;$1&&k.scheme==="file"?`//${k.authority}${k.path}`:k.path.charCodeAt(0)===47&&(k.path.charCodeAt(1)>=65&&k.path.charCodeAt(1)<=90||k.path.charCodeAt(1)>=97&&k.path.charCodeAt(1)<=122)&&k.path.charCodeAt(2)===58?_?k.path.substr(1):k.path[1].toLowerCase()+k.path.substr(2):k.path,a&&($=$.replace(/\//g,"\\")),$}s(w,"v");function C(k,_){const $=_?v:b;let I="",{scheme:R,authority:A,path:S,query:L,fragment:x}=k;if(R&&(I+=R,I+=":"),(A||R==="file")&&(I+=f,I+=f),A){let O=A.indexOf("@");if(O!==-1){const z=A.substr(0,O);A=A.substr(O+1),O=z.lastIndexOf(":"),O===-1?I+=$(z,!1,!1):(I+=$(z.substr(0,O),!1,!1),I+=":",I+=$(z.substr(O+1),!1,!0)),I+="@"}A=A.toLowerCase(),O=A.lastIndexOf(":"),O===-1?I+=$(A,!1,!0):(I+=$(A.substr(0,O),!1,!0),I+=A.substr(O))}if(S){if(S.length>=3&&S.charCodeAt(0)===47&&S.charCodeAt(2)===58){const O=S.charCodeAt(1);O>=65&&O<=90&&(S=`/${String.fromCharCode(O+32)}:${S.substr(3)}`)}else if(S.length>=2&&S.charCodeAt(1)===58){const O=S.charCodeAt(0);O>=65&&O<=90&&(S=`${String.fromCharCode(O+32)}:${S.substr(2)}`)}I+=$(S,!0,!1)}return L&&(I+="?",I+=$(L,!1,!1)),x&&(I+="#",I+=_?x:b(x,!1,!1)),I}s(C,"b");function N(k){try{return decodeURIComponent(k)}catch{return k.length>3?k.substr(0,3)+N(k.substr(3)):k}}s(N,"C");const B=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ne(k){return k.match(B)?k.replace(B,(_=>N(_))):k}s(ne,"w");var J=r(975);const he=J.posix||J,Ae="/";var ye;(function(k){k.joinPath=function(_,...$){return _.with({path:he.join(_.path,...$)})},k.resolvePath=function(_,...$){let I=_.path,R=!1;I[0]!==Ae&&(I=Ae+I,R=!0);let A=he.resolve(I,...$);return R&&A[0]===Ae&&!_.authority&&(A=A.substring(1)),_.with({path:A})},k.dirname=function(_){if(_.path.length===0||_.path===Ae)return _;let $=he.dirname(_.path);return $.length===1&&$.charCodeAt(0)===46&&($=""),_.with({path:$})},k.basename=function(_){return he.basename(_.path)},k.extname=function(_){return he.extname(_.path)}})(ye||(ye={})),BN=n})();var{URI:It,Utils:Ll}=BN,dt;(function(t){t.basename=Ll.basename,t.dirname=Ll.dirname,t.extname=Ll.extname,t.joinPath=Ll.joinPath,t.resolvePath=Ll.resolvePath;const e=typeof process=="object"&&process?.platform==="win32";function r(o,u){return o?.toString()===u?.toString()}s(r,"equals"),t.equals=r;function n(o,u){const l=typeof o=="string"?It.parse(o).path:o.path,c=typeof u=="string"?It.parse(u).path:u.path,f=l.split("/").filter(T=>T.length>0),d=c.split("/").filter(T=>T.length>0);if(e){const T=/^[A-Z]:$/;if(f[0]&&T.test(f[0])&&(f[0]=f[0].toLowerCase()),d[0]&&T.test(d[0])&&(d[0]=d[0].toLowerCase()),f[0]!==d[0])return c.substring(1)}let p=0;for(;p({name:a.name,uri:dt.joinPath(It.parse(r),a.name).toString(),element:a.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(dt.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let a=this.root;for(const i of n){let o=a.children.get(i);if(!o)if(r)o={name:i,children:new Map,parent:a},a.children.set(i,o);else return;a=o}return a}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}},s(Rs,"UriTrie"),Rs),Q;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(Q||(Q={}));var As,UN=(As=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=$e.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??It.parse(e.uri),$e.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return $e.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const a=this.parse(e,r,n);return this.createLangiumDocument(a,e,void 0,r)}else if("$model"in r){const a={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(a,e)}else{const a=this.parse(e,r.getText(),n);return this.createLangiumDocument(a,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const a=await this.parseAsync(e,r,n);return this.createLangiumDocument(a,e,void 0,r)}else{const a=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(a,e,r)}}createLangiumDocument(e,r,n,a){let i;if(n)i={parseResult:e,uri:r,state:Q.Parsed,references:[],textDocument:n};else{const o=this.createTextDocumentGetter(r,a);i={parseResult:e,uri:r,state:Q.Parsed,references:[],get textDocument(){return o()}}}return e.value.$document=i,i}async update(e,r){const n=e.parseResult.value.$cstNode?.root.fullText,a=this.textDocuments?.get(e.uri.toString()),i=a?a.getText():await this.fileSystemProvider.readFile(e.uri);if(a)Object.defineProperty(e,"textDocument",{value:a});else{const o=this.createTextDocumentGetter(e.uri,i);Object.defineProperty(e,"textDocument",{get:o})}return n!==i&&(e.parseResult=await this.parseAsync(e.uri,i,r),e.parseResult.value.$document=e),e.state=Q.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let a;return()=>a??(a=_f.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},s(As,"DefaultLangiumDocumentFactory"),As),Es,KN=(Es=class{constructor(e){this.documentTrie=new zg,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return de(this.documentTrie.all())}addDocument(e){const r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(a=>(this.addDocument(a),a));{const a=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(a),a}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,Q.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=Q.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const a of n)a.state=Q.Changed;return this.documentTrie.delete(r),n}},s(Es,"DefaultLangiumDocuments"),Es),gn=Symbol("RefResolving"),bs,WN=(bs=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=$e.CancellationToken.None){if(this.profiler?.isActive("linking")){const n=this.profiler.createTask("linking",this.languageId);n.start();try{for(const a of qt(e.parseResult.value))await Ye(r),Yo(a).forEach(i=>{const o=`${a.$type}:${i.property}`;n.startSubTask(o);try{this.doLink(i,e)}finally{n.stopSubTask(o)}})}finally{n.stop()}}else for(const n of qt(e.parseResult.value))await Ye(r),Yo(n).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=gn;try{const a=this.getCandidate(e);if(Rn(a))n._ref=a;else{n._nodeDescription=a;const i=this.loadAstNode(a);n._ref=i??this.createLinkingError(e,a)}}catch(a){console.error(`An error occurred while resolving reference to '${n.$refText}':`,a);const i=a.message??String(a);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=gn;try{const a=this.getCandidates(e),i=[];if(Rn(a))n._linkingError=a;else for(const o of a){const u=this.loadAstNode(o);u&&i.push({ref:u,$nodeDescription:o})}n._items=i}catch(a){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`},n._items=[]}r.references.push(n)}}unlink(e){for(const r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(a=>`${a.documentUri}#${a.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,a){const i=this,o={$refNode:n,$refText:a,_ref:void 0,get ref(){if(Be(this._ref))return this._ref;if(bh(this._nodeDescription)){const u=i.loadAstNode(this._nodeDescription);this._ref=u??i.createLinkingError({reference:o,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=gn;const u=Ha(e).$document,l=i.getLinkedNode({reference:o,container:e,property:r});if(l.error&&u&&u.state0))return this._linkingError=i.createLinkingError({reference:o,container:e,property:r})}};return o}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if(Rn(r))return{error:r};const n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=Ha(e.container).$document;n&&n.stateYn(r)&&r.isMulti)}findDeclarations(e){if(e){const r=hy(e),n=e.astNode;if(r&&n){const a=n[r.feature];if(ft(a)||fr(a))return Kc(a);if(Array.isArray(a)){for(const i of a)if((ft(i)||fr(i))&&i.$refNode&&i.$refNode.offset<=e.offset&&i.$refNode.end>=e.end)return Kc(i)}}if(n){const a=this.nameProvider.getNameNode(n);if(a&&(a===e||Hh(e,a)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const a of Yo(n))if(fr(a.reference)&&a.reference.items.some(i=>i.ref===e))return a.reference.items.map(i=>i.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const a of r){const i=this.nameProvider.getNameNode(a)??a.$cstNode;i&&n.push(i)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let a=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(a=a.filter(i=>dt.equals(i.sourceUri,r.documentUri))),n.push(...a),de(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const a of r){const i=this.nameProvider.getNameNode(a);if(i){const o=Vt(a),u=this.nodeLocator.getAstNodePath(a);n.push({sourceUri:o.uri,sourcePath:u,targetUri:o.uri,targetPath:u,segment:Zo(i),local:!0})}}return n}},s(_s,"DefaultReferences"),_s),Ss,xr=(Ss=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return vu.sum(de(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const a=n.indexOf(r);if(a>=0)return n.length===1?this.map.delete(e):n.splice(a,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const r=this.map.get(e);return r?de(r):Vo}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(a=>e(a,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return de(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return de(this.map.keys())}values(){return de(this.map.values()).flat()}entriesGroupedByKey(){return de(this.map.entries())}},s(Ss,"MultiMap"),Ss),ws,wf=(ws=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}},s(ws,"BiMap"),ws),Is,HN=(Is=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=$e.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=Mu,a=$e.CancellationToken.None){const i=[];this.addExportedSymbol(e,i,r);for(const o of n(e))await Ye(a),this.addExportedSymbol(o,i,r);return i}addExportedSymbol(e,r,n){const a=this.nameProvider.getName(e);a&&r.push(this.descriptions.createDescription(e,a,n))}async collectLocalSymbols(e,r=$e.CancellationToken.None){const n=e.parseResult.value,a=new xr;for(const i of Mr(n))await Ye(r),this.addLocalSymbol(i,e,a);return a}addLocalSymbol(e,r,n){const a=e.$container;if(a){const i=this.nameProvider.getName(e);i&&n.add(a,this.descriptions.createDescription(e,i,r))}}},s(Is,"DefaultScopeComputation"),Is),Ns,Ym=(Ns=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(a=>a.name.toLowerCase()===r):this.elements.find(a=>a.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(a=>a.name.toLowerCase()===r):this.elements.filter(a=>a.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},s(Ns,"StreamScope"),Ns),Ps,dB=(Ps=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(const a of e){const i=this.caseInsensitive?a.name.toLowerCase():a.name;this.elements.set(i,a)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),a=n?[n]:[];return(this.concatOuterScope||a.length>0)&&this.outerScope?de(a).concat(this.outerScope.getElements(e)):de(a)}getAllElements(){let e=de(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},s(Ps,"MapScope"),Ps),ks,YN=(ks=class{constructor(e,r,n){this.elements=new xr,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(const a of e){const i=this.caseInsensitive?a.name.toLowerCase():a.name;this.elements.add(i,a)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?de(n).concat(this.outerScope.getElements(e)):de(n)}getAllElements(){let e=de(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},s(ks,"MultiMapScope"),ks),pB={getElement(){},getElements(){return Vo},getAllElements(){return Vo}},Os,xd=(Os=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},s(Os,"DisposableCache"),Os),Ls,Bg=(Ls=class extends xd{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},s(Ls,"SimpleCache"),Ls),Ds,Md=(Ds=class extends xd{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const a=this.cacheForContext(e);if(a.has(r))return a.get(r);if(n){const i=n();return a.set(r,i),i}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},s(Ds,"ContextCache"),Ds),xs,XN=(xs=class extends Md{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,a)=>{for(const i of a)this.clear(i)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,a)=>{const i=n.concat(a);for(const o of i)this.clear(o)}))}},s(xs,"DocumentCache"),xs),Ms,Ug=(Ms=class extends Bg{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,a)=>{a.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},s(Ms,"WorkspaceCache"),Ms),Gs,JN=(Gs=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Ug(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),a=Vt(e.container).localSymbols;if(a){let o=e.container;do a.has(o)&&r.push(a.getStream(o).filter(u=>this.reflection.isSubtype(u.type,n))),o=o.$container;while(o)}let i=this.getGlobalScope(n,e);for(let o=r.length-1;o>=0;o--)i=this.createScope(r[o],i);return i}createScope(e,r,n){return new Ym(de(e),r,n)}createScopeForNodes(e,r,n){const a=de(e).map(i=>{const o=this.nameProvider.getName(i);if(o)return this.descriptions.createDescription(i,o)}).nonNullable();return new Ym(a,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new YN(this.indexManager.allElements(e)))}},s(Gs,"DefaultScopeProvider"),Gs);function Kg(t){return typeof t.$comment=="string"}s(Kg,"isAstNodeWithComment");function Xm(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}s(Xm,"isIntermediateReference");var Fs,ZN=(Fs=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},a=r?.replacer,i=s((u,l)=>this.replacer(u,l,n),"defaultReplacer"),o=a?(u,l)=>a(u,l,i):i;try{return this.currentDocument=Vt(e),JSON.stringify(e,o,r?.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},a=JSON.parse(e);return this.linkNode(a,a,n),a}replacer(e,r,{refText:n,sourceText:a,textRegions:i,comments:o,uriConverter:u}){if(!this.ignoreProperties.has(e))if(ft(r)){const l=r.ref,c=n?r.$refText:void 0;if(l){const f=Vt(l);let d="";this.currentDocument&&this.currentDocument!==f&&(u?d=u(f.uri,l):d=f.uri.toString());const p=this.astNodeLocator.getAstNodePath(l);return{$ref:`${d}#${p}`,$refText:c}}else return{$error:r.error?.message??"Could not resolve reference",$refText:c}}else if(fr(r)){const l=n?r.$refText:void 0,c=[];for(const f of r.items){const d=f.ref,p=Vt(f.ref);let y="";this.currentDocument&&this.currentDocument!==p&&(u?y=u(p.uri,d):y=p.uri.toString());const h=this.astNodeLocator.getAstNodePath(d);c.push(`${y}#${h}`)}return{$refs:c,$refText:l}}else if(Be(r)){let l;if(i&&(l=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&l?.$textRegion&&(l.$textRegion.documentURI=this.currentDocument?.uri.toString())),a&&!e&&(l??(l={...r}),l.$sourceText=r.$cstNode?.text),o){l??(l={...r});const c=this.commentProvider.getComment(r);c&&(l.$comment=c.replace(/\r/g,""))}return l??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=s(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),a=n.assignments={};return Object.keys(e).filter(i=>!i.startsWith("$")).forEach(i=>{const o=py(e.$cstNode,i).map(r);o.length!==0&&(a[i]=o)}),e}}linkNode(e,r,n,a,i,o){for(const[l,c]of Object.entries(e))if(Array.isArray(c))for(let f=0;f{await this.handleException(()=>e.call(r,n,a,i),"An error occurred during validation",a,n)}}async handleException(e,r,n,a){try{await e()}catch(i){if(fa(i))throw i;console.error(`${r}:`,i),i instanceof Error&&i.stack&&console.error(i.stack);const o=i instanceof Error?i.message:String(i);n("error",`${r}: ${o}`,{node:a})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=de(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(a=>r.includes(a.category))),n.map(a=>a.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(a,i,o,u)=>{await this.handleException(()=>e.call(n,a,i,o,u),r,i,a)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},s(js,"ValidationRegistry"),js),tP=Object.freeze({validateNode:!0,validateChildren:!0}),Bs,rP=(Bs=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=$e.CancellationToken.None){const a=e.parseResult,i=[];if(await Ye(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(a,i,r),r.stopAfterLexingErrors&&i.some(o=>o.data?.code===Mt.LexingError)||(this.processParsingErrors(a,i,r),r.stopAfterParsingErrors&&i.some(o=>o.data?.code===Mt.ParsingError))||(this.processLinkingErrors(e,i,r),r.stopAfterLinkingErrors&&i.some(o=>o.data?.code===Mt.LinkingError))))return i;try{i.push(...await this.validateAst(a.value,r,n))}catch(o){if(fa(o))throw o;console.error("An error occurred during validation:",o)}return await Ye(n),i}processLexingErrors(e,r,n){const a=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(const i of a){const o=i.severity??"error",u={severity:yu(o),range:{start:{line:i.line-1,character:i.column-1},end:{line:i.line-1,character:i.column+i.length-1}},message:i.message,data:Vg(o),source:this.getSource()};r.push(u)}}processParsingErrors(e,r,n){for(const a of e.parserErrors){let i;if(isNaN(a.token.startOffset)){if("previousToken"in a){const o=a.previousToken;if(isNaN(o.startOffset)){const u={line:0,character:0};i={start:u,end:u}}else{const u={line:o.endLine-1,character:o.endColumn};i={start:u,end:u}}}}else i=Tu(a.token);if(i){const o={severity:yu("error"),range:i,message:a.message,data:Dn(Mt.ParsingError),source:this.getSource()};r.push(o)}}}processLinkingErrors(e,r,n){for(const a of e.references){const i=a.error;if(i){const o={node:i.info.container,range:a.$refNode?.range,property:i.info.property,index:i.info.index,data:{code:Mt.LinkingError,containerType:i.info.container.$type,property:i.info.property,refText:i.info.reference.$refText}};r.push(this.toDiagnostic("error",i.message,o))}}}async validateAst(e,r,n=$e.CancellationToken.None){const a=[],i=s((o,u,l)=>{a.push(this.toDiagnostic(o,u,l))},"acceptor");return await this.validateAstBefore(e,r,i,n),await this.validateAstNodes(e,r,i,n),await this.validateAstAfter(e,r,i,n),a}async validateAstBefore(e,r,n,a=$e.CancellationToken.None){const i=this.validationRegistry.checksBefore;for(const o of i)await Ye(a),await o(e,n,r.categories??[],a)}async validateAstNodes(e,r,n,a=$e.CancellationToken.None){if(this.profiler?.isActive("validating")){const i=this.profiler.createTask("validating",this.languageId);i.start();try{const o=qt(e).iterator();for(const u of o){i.startSubTask(u.$type);const l=this.validateSingleNodeOptions(u,r);if(l.validateNode)try{const c=this.validationRegistry.getChecks(u.$type,r.categories);for(const f of c)await f(u,n,a)}finally{i.stopSubTask(u.$type)}l.validateChildren||o.prune()}}finally{i.stop()}}else{const i=qt(e).iterator();for(const o of i){await Ye(a);const u=this.validateSingleNodeOptions(o,r);if(u.validateNode){const l=this.validationRegistry.getChecks(o.$type,r.categories);for(const c of l)await c(o,n,a)}u.validateChildren||i.prune()}}}validateSingleNodeOptions(e,r){return tP}async validateAstAfter(e,r,n,a=$e.CancellationToken.None){const i=this.validationRegistry.checksAfter;for(const o of i)await Ye(a),await o(e,n,r.categories??[],a)}toDiagnostic(e,r,n){return{message:r,range:Wg(n),severity:yu(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},s(Bs,"DefaultDocumentValidator"),Bs);function Wg(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=qf(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=my(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}s(Wg,"getDiagnosticRange");function yu(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}s(yu,"toDiagnosticSeverity");function Vg(t){switch(t){case"error":return Dn(Mt.LexingError);case"warning":return Dn(Mt.LexingWarning);case"info":return Dn(Mt.LexingInfo);case"hint":return Dn(Mt.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}s(Vg,"toDiagnosticData");var Mt;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(Mt||(Mt={}));var Us,nP=(Us=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const a=n??Vt(e);r??(r=this.nameProvider.getName(e));const i=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${i} has no name.`);let o;const u=s(()=>o??(o=Zo(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return u()},selectionSegment:Zo(e.$cstNode),type:e.$type,documentUri:a.uri,path:i}}},s(Us,"DefaultAstNodeDescriptionProvider"),Us),Ks,aP=(Ks=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=$e.CancellationToken.None){const n=[],a=e.parseResult.value;for(const i of qt(a))await Ye(r),Yo(i).forEach(o=>{o.reference.error||n.push(...this.createInfoDescriptions(o))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];ft(r)&&r.$nodeDescription?n=[r.$nodeDescription]:fr(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const a=Vt(e.container).uri,i=this.nodeLocator.getAstNodePath(e.container),o=[],u=Zo(r.$refNode);for(const l of n)o.push({sourceUri:a,sourcePath:i,targetUri:l.documentUri,targetPath:l.path,segment:u,local:dt.equals(l.documentUri,a)});return o}},s(Ks,"DefaultReferenceDescriptionProvider"),Ks),Ws,iP=(Ws=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((a,i)=>{if(!a||i.length===0)return a;const o=i.indexOf(this.indexSeparator);if(o>0){const u=i.substring(0,o),l=parseInt(i.substring(o+1));return a[u]?.[l]}return a[i]},e)}},s(Ws,"DefaultAstNodeLocator"),Ws),Gd={};kf(Gd,$h(nl()));var Vs,sP=(Vs=class{constructor(e){this._ready=new Dr,this.onConfigurationSectionUpdateEmitter=new Gd.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){this.workspaceConfig=e.capabilities.workspace?.configuration??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(a=>({section:this.toSectionName(a.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((a,i)=>{this.updateSectionConfiguration(a.section,n[i])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},s(Vs,"DefaultConfigurationProvider"),Vs),lc=$h(qk()),Gn;(function(t){function e(r){return{dispose:s(async()=>await r(),"dispose")}}s(e,"create"),t.create=e})(Gn||(Gn={}));var qs,oP=(qs=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new xr,this.documentPhaseListeners=new xr,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Q.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=$e.CancellationToken.None){for(const a of e){const i=a.uri.toString();if(a.state===Q.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,Q.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(i,{completed:!1,options:{validation:{categories:o}},result:this.buildState.get(i)?.result}),a.state=Q.IndexedReferences)}}else this.buildState.delete(i)}this.currentState=Q.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=$e.CancellationToken.None){this.currentState=Q.Changed;const a=[];for(const l of r){const c=this.langiumDocuments.deleteDocuments(l);for(const f of c)a.push(f.uri),this.cleanUpDeleted(f)}const i=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of i){let c=this.langiumDocuments.getDocument(l);c===void 0&&(c=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),c.state=Q.Changed,this.langiumDocuments.addDocument(c)),this.resetToState(c,Q.Changed)}const o=de(i).concat(a).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!o.has(l.uri.toString())&&this.shouldRelink(l,o)).forEach(l=>this.resetToState(l,Q.ComputedScopes)),await this.emitUpdate(i,a),await Ye(n);const u=this.sortDocuments(this.langiumDocuments.all.filter(l=>l.state=1}findMissingValidationCategories(e,r){const n=this.buildState.get(e.uri.toString()),a=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),i=n?.result?.validationChecks?new Set(n?.result?.validationChecks):n?.completed?a:new Set,o=r===void 0||r.validation===!0?a:typeof r.validation=="object"?r.validation.categories??a:[];return de(o).filter(u=>!i.has(u)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{const n=await this.fileSystemProvider.stat(e);if(n.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(n))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r=0&&!this.hasTextDocument(e[n]);)n--;rn.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),Gn.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case Q.Changed:case Q.Parsed:this.indexManager.removeContent(e.uri);case Q.IndexedContent:e.localSymbols=void 0;case Q.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Q.Linked:this.indexManager.removeReferences(e.uri);case Q.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Q.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Q.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,Q.Parsed,n,o=>this.langiumDocumentFactory.update(o,n)),await this.runCancelable(e,Q.IndexedContent,n,o=>this.indexManager.updateContent(o,n)),await this.runCancelable(e,Q.ComputedScopes,n,async o=>{const u=this.serviceRegistry.getServices(o.uri).references.ScopeComputation;o.localSymbols=await u.collectLocalSymbols(o,n)});const a=e.filter(o=>this.shouldLink(o));await this.runCancelable(a,Q.Linked,n,o=>this.serviceRegistry.getServices(o.uri).references.Linker.link(o,n)),await this.runCancelable(a,Q.IndexedReferences,n,o=>this.indexManager.updateReferences(o,n));const i=e.filter(o=>this.shouldValidate(o)?!0:(this.markAsCompleted(o),!1));await this.runCancelable(i,Q.Validated,n,async o=>{await this.validate(o,n),this.markAsCompleted(o)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const a=n.uri.toString(),i=this.buildState.get(a);(!i||i.completed)&&this.buildState.set(a,{completed:!1,options:r,result:i?.result})}}async runCancelable(e,r,n,a){for(const o of e)o.stateo.state===r);await this.notifyBuildPhase(i,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),Gn.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),Gn.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let a;return r&&"path"in r?a=r:n=r,n??(n=$e.CancellationToken.None),a?this.awaitDocumentState(e,a,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const a=this.langiumDocuments.getDocument(r);if(a){if(a.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(cr);if(this.currentState>=e&&e>a.state)return Promise.reject(new lc.ResponseError(lc.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${Q[a.state]}, requiring ${Q[e]}, but workspace state is already ${Q[this.currentState]}. Returning undefined.`))}else return Promise.reject(new lc.ResponseError(lc.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((i,o)=>{const u=this.onDocumentPhase(e,c=>{dt.equals(c.uri,r)&&(u.dispose(),l.dispose(),i(c.uri))}),l=n.onCancellationRequested(()=>{u.dispose(),l.dispose(),o(cr)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(cr):new Promise((n,a)=>{const i=this.onBuildPhase(e,()=>{i.dispose(),o.dispose(),n()}),o=r.onCancellationRequested(()=>{i.dispose(),o.dispose(),a(cr)})})}async notifyDocumentPhase(e,r,n){const i=this.documentPhaseListeners.get(r).slice();for(const o of i)try{await Ye(n),await o(e,n)}catch(u){if(!fa(u))throw u}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const i=this.buildPhaseListeners.get(r).slice();for(const o of i)await Ye(n),await o(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,a=this.getBuildOptions(e),i=typeof a.validation=="object"?{...a.validation}:{};i.categories=this.findMissingValidationCategories(e,a);const o=await n.validateDocument(e,i,r);e.diagnostics?e.diagnostics.push(...o):e.diagnostics=o;const u=this.buildState.get(e.uri.toString());u&&(u.result??(u.result={}),u.result.validationChecks?u.result.validationChecks=de(u.result.validationChecks).concat(i.categories).distinct().toArray():u.result.validationChecks=[...i.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}},s(qs,"DefaultDocumentBuilder"),qs),Hs,lP=(Hs=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Md,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Vt(e).uri,a=[];return this.referenceIndex.forEach(i=>{i.forEach(o=>{dt.equals(o.targetUri,n)&&o.targetPath===r&&a.push(o)})}),de(a)}allElements(e,r){let n=de(this.symbolIndex.keys());return r&&(n=n.filter(a=>!r||r.has(a))),n.map(a=>this.getFileDescriptions(a,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(i=>this.astReflection.isSubtype(i.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=$e.CancellationToken.None){const a=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),i=e.uri.toString();this.symbolIndex.set(i,a),this.symbolByTypeIndex.clear(i)}async updateReferences(e,r=$e.CancellationToken.None){const a=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),a)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(a=>!a.local&&r.has(a.targetUri.toString())):!1}},s(Hs,"DefaultIndexManager"),Hs),Ys,uP=(Ys=class{constructor(e){this.initialBuildOptions={},this._ready=new Dr,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=$e.CancellationToken.None){const n=await this.performStartup(e);await Ye(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=s(o=>{r.push(o),this.langiumDocuments.hasDocument(o.uri)||this.langiumDocuments.addDocument(o)},"collector");await this.loadAdditionalDocuments(e,n);const a=[];await Promise.all(e.map(o=>this.getRootFolder(o)).map(async o=>this.traverseFolder(o,a)));const i=de(a).distinct(o=>o.toString()).filter(o=>!this.langiumDocuments.hasDocument(o));return await this.loadWorkspaceDocuments(i,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const a=await this.langiumDocuments.getOrCreateDocument(n);r(a)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return It.parse(e.uri)}async traverseFolder(e,r){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async a=>{this.shouldIncludeEntry(a)&&(a.isDirectory?await this.traverseFolder(a.uri,r):a.isFile&&r.push(a.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=dt.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},s(Ys,"DefaultWorkspaceManager"),Ys),Xs,cP=(Xs=class{buildUnexpectedCharactersMessage(e,r,n,a,i){return Nm.buildUnexpectedCharactersMessage(e,r,n,a,i)}buildUnableToPopLexerModeMessage(e){return Nm.buildUnableToPopLexerModeMessage(e)}},s(Xs,"DefaultLexerErrorMessageProvider"),Xs),qg={mode:"full"},Js,Hg=(Js=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=Nf(r)?Object.values(r):r,a=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new pt(n,{positionTracking:"full",skipValidations:a,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=qg){const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if(Nf(e))return e;const r=zd(e)?Object.values(e.modes).flat():e,n={};return r.forEach(a=>n[a.name]=a),n}},s(Js,"DefaultLexer"),Js);function Fd(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}s(Fd,"isTokenTypeArray");function zd(t){return t&&"modes"in t&&"defaultMode"in t}s(zd,"isIMultiModeLexerDefinition");function Nf(t){return!Fd(t)&&!zd(t)}s(Nf,"isTokenTypeDictionary");Du();function Yg(t,e,r){let n,a;typeof t=="string"?(a=e,n=r):(a=t.range.start,n=e),a||(a=oe.create(0,0));const i=Jg(t),o=jd(n),u=fP({lines:i,position:a,options:o});return mP({index:0,tokens:u,position:a})}s(Yg,"parseJSDoc");function Xg(t,e){const r=jd(e),n=Jg(t);if(n.length===0)return!1;const a=n[0],i=n[n.length-1],o=r.start,u=r.end;return!!o?.exec(a)&&!!u?.exec(i)}s(Xg,"isJSDoc");function Jg(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(hR)}s(Jg,"getLines");var ST=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,mB=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function fP(t){const e=[];let r=t.position.line,n=t.position.character;for(let a=0;a=u.length){if(e.length>0){const f=oe.create(r,n);e.push({type:"break",content:"",range:te.create(f,f)})}}else{ST.lastIndex=l;const f=ST.exec(u);if(f){const d=f[0],p=f[1],y=oe.create(r,n+l),h=oe.create(r,n+l+d.length);e.push({type:"tag",content:p,range:te.create(y,h)}),l+=d.length,l=Pf(u,l)}if(l0&&e[e.length-1].type==="break"?e.slice(0,-1):e}s(fP,"tokenize");function dP(t,e,r,n){const a=[];if(t.length===0){const i=oe.create(r,n),o=oe.create(r,n+e.length);a.push({type:"text",content:e,range:te.create(i,o)})}else{let i=0;for(const u of t){const l=u.index,c=e.substring(i,l);c.length>0&&a.push({type:"text",content:e.substring(i,l),range:te.create(oe.create(r,i+n),oe.create(r,l+n))});let f=c.length+1;const d=u[1];if(a.push({type:"inline-tag",content:d,range:te.create(oe.create(r,i+f+n),oe.create(r,i+f+d.length+n))}),f+=d.length,u.length===4){f+=u[2].length;const p=u[3];a.push({type:"text",content:p,range:te.create(oe.create(r,i+f+n),oe.create(r,i+f+p.length+n))})}else a.push({type:"text",content:"",range:te.create(oe.create(r,i+f+n),oe.create(r,i+f+n))});i=l+u[0].length}const o=e.substring(i);o.length>0&&a.push({type:"text",content:o,range:te.create(oe.create(r,i+n),oe.create(r,i+n+o.length))})}return a}s(dP,"buildInlineTokens");var hB=/\S/,yB=/\s*$/;function Pf(t,e){const r=t.substring(e).match(hB);return r?e+r.index:t.length}s(Pf,"skipWhitespace");function pP(t){const e=t.match(yB);if(e&&typeof e.index=="number")return e.index}s(pP,"lastCharacter");function mP(t){const e=oe.create(t.position.line,t.position.character);if(t.tokens.length===0)return new wT([],te.create(e,e));const r=[];for(;t.indexr.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=Zm(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const a=n.toMarkdown(e);r+=Zm(r)+a}return r.trim()}},s(Zs,"JSDocCommentImpl"),Zs),Qs,Jd=(Qs=class{constructor(e,r,n,a){this.name=e,this.content=r,this.inline=n,this.range=a}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} +${r}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const i=vP(this.name,r,e??{});if(typeof i=="string")return i}let n="";e?.tag==="italic"||e?.tag===void 0?n="*":e?.tag==="bold"?n="**":e?.tag==="bold-italic"&&(n="***");let a=`${n}@${this.name}${n}`;return this.content.inlines.length===1?a=`${a} — ${r}`:this.content.inlines.length>1&&(a=`${a} +${r}`),this.inline?`{${a}}`:a}},s(Qs,"JSDocTagImpl"),Qs);function vP(t,e,r){if(t==="linkplain"||t==="linkcode"||t==="link"){const n=e.indexOf(" ");let a=e;if(n>0){const o=Pf(e,n);a=e.substring(o),e=e.substring(0,n)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),r.renderLink?.(e,a)??TP(e,a)}}s(vP,"renderInlineTag");function TP(t,e){try{return It.parse(t,!0),`[${e}](${t})`}catch{return t}}s(TP,"renderLinkDefault");var eo,Jm=(eo=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` +`)}return e}toMarkdown(e){let r="";for(let n=0;na.range.start.line&&(r+=` +`)}return r}},s(eo,"JSDocTextImpl"),eo),to,$P=(to=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},s(to,"JSDocLineImpl"),to);function Zm(t){return t.endsWith(` +`)?` +`:` + +`}s(Zm,"fillNewlines");var ro,RP=(ro=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&Xg(r))return Yg(r).toMarkdown({renderLink:s((a,i)=>this.documentationLinkRenderer(e,a,i),"renderLink"),renderTag:s(a=>this.documentationTagRenderer(e,a),"renderTag")})}documentationLinkRenderer(e,r,n){const a=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(a&&a.nameSegment){const i=a.nameSegment.range.start.line+1,o=a.nameSegment.range.start.character+1,u=a.documentUri.with({fragment:`L${i},${o}`});return`[${n}](${u.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const a=Vt(e).localSymbols;if(!a)return;let i=e;do{const u=a.getStream(i).find(l=>l.name===r);if(u)return u;i=i.$container}while(i)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(a=>a.name===r)}},s(ro,"JSDocDocumentationProvider"),ro),no,AP=(no=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return Kg(e)?e.$comment:Zh(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}},s(no,"DefaultCommentProvider"),no),ao,EP=(ao=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},s(ao,"DefaultAsyncParser"),ao),io,gB=(io=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),a=new Dr;let i;const o=r.onCancellationRequested(()=>{i=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(u=>{const l=this.hydrator.hydrate(u);a.resolve(l)}).catch(u=>{a.reject(u)}).finally(()=>{o.dispose(),clearTimeout(i)}),a.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new Dr;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(cr)}),this.queue.push(r),r.promise}},s(io,"AbstractThreadedAsyncParser"),io),so,vB=(so=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,a){this.onReadyEmitter=new Gd.Emitter,this.deferred=new Dr,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=a,r(i=>{const o=i;this.deferred.resolve(o),this.unlock()}),n(i=>{this.deferred.reject(i),this.unlock()})}terminate(){this.deferred.reject(cr),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new Dr,this.sendMessage(e),this.deferred.promise}},s(so,"ParserWorker"),so),oo,bP=(oo=class{constructor(){this.previousTokenSource=new $e.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=Dd();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=$e.CancellationToken.None){const a=new Dr,i={action:r,deferred:a,cancellationToken:n};return e.push(i),this.performNextOperation(),a.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:a})=>{try{const i=await Promise.resolve().then(()=>r(a));n.resolve(i)}catch(i){fa(i)?n.resolve(void 0):n.reject(i)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},s(oo,"DefaultWorkspaceLock"),oo),lo,CP=(lo=class{constructor(e){this.grammarElementIdMap=new wf,this.tokenTypeIdMap=new wf,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const a of qt(e))r.set(a,{});if(e.$cstNode)for(const a of Jo(e.$cstNode))n.set(a,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[a,i]of Object.entries(e))if(!a.startsWith("$"))if(Array.isArray(i)){const o=[];n[a]=o;for(const u of i)Be(u)?o.push(this.dehydrateAstNode(u,r)):ft(u)?o.push(this.dehydrateReference(u,r)):o.push(u)}else Be(i)?n[a]=this.dehydrateAstNode(i,r):ft(i)?n[a]=this.dehydrateReference(i,r):i!==void 0&&(n[a]=i);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return Df(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Sr(e)?n.content=e.content.map(a=>this.dehydrateCstNode(a,r)):Vn(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const i of qt(e))r.set(i,{});let a;if(e.$cstNode)for(const i of Jo(e.$cstNode)){let o;"fullText"in i?(o=new wg(i.fullText),a=o):"content"in i?o=new Nd:"tokenType"in i&&(o=this.hydrateCstLeafNode(i)),o&&(n.set(i,o),o.root=a)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[a,i]of Object.entries(e))if(!a.startsWith("$"))if(Array.isArray(i)){const o=[];n[a]=o;for(const u of i)Be(u)?o.push(this.setParent(this.hydrateAstNode(u,r),n)):ft(u)?o.push(this.hydrateReference(u,n,a,r)):o.push(u)}else Be(i)?n[a]=this.setParent(this.hydrateAstNode(i,r),n):ft(i)?n[a]=this.hydrateReference(i,n,a,r):i!==void 0&&(n[a]=i);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,a){return this.linker.buildReference(r,n,a.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const a=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(a.grammarSource=this.getGrammarElement(e.grammarSource)),a.astNode=r.astNodes.get(e.astNode),Sr(a))for(const i of e.content){const o=this.hydrateCstNode(i,r,n++);a.content.push(o)}return a}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,a=e.length,i=e.startLine,o=e.startColumn,u=e.endLine,l=e.endColumn,c=e.hidden;return new Ef(n,a,{start:{line:i,character:o},end:{line:u,character:l}},r,c)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of qt(this.grammar))xf(r)&&this.grammarElementIdMap.set(r,e++)}},s(lo,"DefaultHydrator"),lo);function Xe(t){return{documentation:{CommentProvider:s(e=>new AP(e),"CommentProvider"),DocumentationProvider:s(e=>new RP(e),"DocumentationProvider")},parser:{AsyncParser:s(e=>new EP(e),"AsyncParser"),GrammarConfig:s(e=>Ay(e),"GrammarConfig"),LangiumParser:s(e=>Lg(e),"LangiumParser"),CompletionParser:s(e=>Og(e),"CompletionParser"),ValueConverter:s(()=>new xg,"ValueConverter"),TokenBuilder:s(()=>new Od,"TokenBuilder"),Lexer:s(e=>new Hg(e),"Lexer"),ParserErrorMessageProvider:s(()=>new Ng,"ParserErrorMessageProvider"),LexerErrorMessageProvider:s(()=>new cP,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:s(()=>new iP,"AstNodeLocator"),AstNodeDescriptionProvider:s(e=>new nP(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:s(e=>new aP(e),"ReferenceDescriptionProvider")},references:{Linker:s(e=>new WN(e),"Linker"),NameProvider:s(()=>new VN,"NameProvider"),ScopeProvider:s(e=>new JN(e),"ScopeProvider"),ScopeComputation:s(e=>new HN(e),"ScopeComputation"),References:s(e=>new qN(e),"References")},serializer:{Hydrator:s(e=>new CP(e),"Hydrator"),JsonSerializer:s(e=>new ZN(e),"JsonSerializer")},validation:{DocumentValidator:s(e=>new rP(e),"DocumentValidator"),ValidationRegistry:s(e=>new eP(e),"ValidationRegistry")},shared:s(()=>t.shared,"shared")}}s(Xe,"createDefaultCoreModule");function Je(t){return{ServiceRegistry:s(e=>new QN(e),"ServiceRegistry"),workspace:{LangiumDocuments:s(e=>new KN(e),"LangiumDocuments"),LangiumDocumentFactory:s(e=>new UN(e),"LangiumDocumentFactory"),DocumentBuilder:s(e=>new oP(e),"DocumentBuilder"),IndexManager:s(e=>new lP(e),"IndexManager"),WorkspaceManager:s(e=>new uP(e),"WorkspaceManager"),FileSystemProvider:s(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:s(()=>new bP,"WorkspaceLock"),ConfigurationProvider:s(e=>new sP(e),"ConfigurationProvider")},profilers:{}}}s(Je,"createDefaultSharedCoreModule");var Qm;(function(t){t.merge=(e,r)=>rl(rl({},e),r)})(Qm||(Qm={}));function re(t,e,r,n,a,i,o,u,l){const c=[t,e,r,n,a,i,o,u,l].reduce(rl,{});return rv(c)}s(re,"inject");var _P=Symbol("isProxy");function tv(t){if(t&&t[_P])for(const e of Object.values(t))tv(e);return t}s(tv,"eagerLoad");function rv(t,e){const r=new Proxy({},{deleteProperty:s(()=>!1,"deleteProperty"),set:s(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:s((n,a)=>a===_P?!0:eh(n,a,t,e||r),"get"),getOwnPropertyDescriptor:s((n,a)=>(eh(n,a,t,e||r),Object.getOwnPropertyDescriptor(n,a)),"getOwnPropertyDescriptor"),has:s((n,a)=>a in t,"has"),ownKeys:s(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}s(rv,"_inject");var IT=Symbol();function eh(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===IT)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const a=r[e];t[e]=IT;try{t[e]=typeof a=="function"?a(n):rv(a,n)}catch(i){throw t[e]=i instanceof Error?i:void 0,i}return t[e]}else return}s(eh,"_resolve");function rl(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const a=t[r];typeof a=="object"&&a!==null?t[r]=rl(a,n):t[r]=rl({},n)}else t[r]=n}return t}s(rl,"_merge");var th={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},xn;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(xn||(xn={}));var uo,SP=(uo=class extends Od{constructor(e=th){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...th,...e},this.indentTokenType=Xa({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=Xa({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!Fd(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:a,dedentTokenName:i,whitespaceTokenName:o,ignoreIndentationDelimiters:u}=this.options;let l,c,f;const d=[];for(const p of n){for(const[y,h]of u)p.name===y?p.PUSH_MODE=xn.IGNORE_INDENTATION:p.name===h&&(p.POP_MODE=!0);p.name===i?l=p:p.name===a?c=p:p.name===o?f=p:d.push(p)}if(!l||!c||!f)throw new Error("Some indentation/whitespace tokens not found!");return u.length>0?{modes:{[xn.REGULAR]:[l,c,...d,f],[xn.IGNORE_INDENTATION]:[...d,f]},defaultMode:xn.REGULAR}:[l,c,f,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r +`.includes(e[r-1])}matchWhitespace(e,r,n,a){this.whitespaceRegExp.lastIndex=r;const i=this.whitespaceRegExp.exec(e);return{currIndentLevel:i?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:i}}createIndentationTokenInstance(e,r,n,a){const i=this.getLineNumber(r,a);return Zu(e,n,a,a+n.length,i,i,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,a){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:i,prevIndentLevel:o,match:u}=this.matchWhitespace(e,r,n,a);return i<=o?null:(this.indentationStack.push(i),u)}dedentMatcher(e,r,n,a){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:i,prevIndentLevel:o,match:u}=this.matchWhitespace(e,r,n,a);if(i>=o)return null;const l=this.indentationStack.lastIndexOf(i);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${i} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:u?.[0]?.length??0,line:this.getLineNumber(e,r),column:1}),null;const c=this.indentationStack.length-l-1,f=e.substring(0,r).match(/[\r\n]+$/)?.[0].length??1;for(let d=0;d1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},s(uo,"IndentationAwareTokenBuilder"),uo),co,TB=(co=class extends Hg{constructor(e){if(super(e),e.parser.TokenBuilder instanceof SP)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=qg){const n=super.tokenize(e),a=n.report;r?.mode==="full"&&n.tokens.push(...a.remainingDedents),a.remainingDedents=[];const{indentTokenType:i,dedentTokenType:o}=this.indentationTokenBuilder,u=i.tokenTypeIdx,l=o.tokenTypeIdx,c=[],f=n.tokens.length-1;for(let d=0;d=0&&c.push(n.tokens[f]),n.tokens=c,n}},s(co,"IndentationAwareLexer"),co),nv={};en(nv,{AstUtils:()=>_h,BiMap:()=>wf,Cancellation:()=>$e,ContextCache:()=>Md,CstUtils:()=>Eh,DONE_RESULT:()=>ct,Deferred:()=>Dr,Disposable:()=>Gn,DisposableCache:()=>xd,DocumentCache:()=>XN,EMPTY_STREAM:()=>Vo,ErrorWithLocation:()=>Uf,GrammarUtils:()=>ry,MultiMap:()=>xr,OperationCancelled:()=>cr,Reduction:()=>vu,RegExpUtils:()=>ay,SimpleCache:()=>Bg,StreamImpl:()=>ur,TreeStreamImpl:()=>qo,URI:()=>It,UriTrie:()=>zg,UriUtils:()=>dt,WorkspaceCache:()=>Ug,assertCondition:()=>ny,assertUnreachable:()=>tn,delayNextTick:()=>Ld,interruptAndCheck:()=>Ye,isOperationCancelled:()=>fa,loadGrammarFromJson:()=>Ze,setInterruptionPeriod:()=>Mg,startCancelableOperation:()=>Dd,stream:()=>de});kf(nv,Gd);var fo,wP=(fo=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},s(fo,"EmptyFileSystemProvider"),fo),st={fileSystemProvider:s(()=>new wP,"fileSystemProvider")},$B={Grammar:s(()=>{},"Grammar"),LanguageMetaData:s(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},RB={AstReflection:s(()=>new qh,"AstReflection")};function IP(){const t=re(Je(st),RB),e=re(Xe({shared:t}),$B);return t.ServiceRegistry.register(e),e}s(IP,"createMinimalGrammarServices");function Ze(t){const e=IP(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,It.parse(`memory:/${r.name??"grammar"}.langium`)),r}s(Ze,"loadGrammarFromJson");kf(z$,nv);var po,AB=(po=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new xr}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new NP(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);const n=[];for(const o of r.entries.keys()){const u=r.entries.get(o),l=u.reduce((c,f)=>c+f);n.push({name:`${r.identifier}.${o}`,count:u.length,duration:l})}const a=r.duration-n.map(o=>o.duration).reduce((o,u)=>o+u,0);n.push({name:r.identifier,count:1,duration:a}),n.sort((o,u)=>u.duration-o.duration);function i(o){return Math.round(100*o)/100}return s(i,"Round"),console.table(n.map(o=>({Element:o.name,Count:o.count,"Self %":i(100*o.duration/r.duration),"Time (ms)":i(o.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},s(po,"DefaultLangiumProfiler"),po),mo,NP=(mo=class{constructor(e,r){this.stack=[],this.entries=new xr,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);const n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);const a=n-r.content;this.entries.add(e,a)}},s(mo,"ProfilingTask"),mo),rh;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(rh||(rh={}));var nh;(t=>{t.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(nh||(nh={}));var ah;(t=>{t.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(ah||(ah={}));var ih;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(ih||(ih={}));var sh;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(sh||(sh={}));var oh;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(oh||(oh={}));var lh;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(lh||(lh={}));var uh;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(uh||(uh={}));var ch;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(ch||(ch={}));var fh;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(fh||(fh={}));var dh;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(dh||(dh={}));var ph;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(ph||(ph={}));var mh;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(mh||(mh={}));var hh;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(hh||(hh={}));var yh;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(yh||(yh={}));({...rh.Terminals,...nh.Terminals,...ah.Terminals,...ih.Terminals,...sh.Terminals,...oh.Terminals,...lh.Terminals,...uh.Terminals,...ch.Terminals,...fh.Terminals,...dh.Terminals,...ph.Terminals,...hh.Terminals,...mh.Terminals,...yh.Terminals});var NT={$type:"AbnfAlternation",alternatives:"alternatives"},PT={$type:"AbnfConcatenation",elements:"elements"},Zd={$type:"AbnfElement",primary:"primary",repeat:"repeat"},kT={$type:"AbnfGroup",element:"element"},OT={$type:"AbnfNumVal",value:"value"},LT={$type:"AbnfOptionalGroup",element:"element"},Ta={$type:"AbnfPrimary"},Qd={$type:"AbnfRule",definition:"definition",name:"name"},DT={$type:"AbnfRuleName",name:"name"},xT={$type:"AbnfStringLiteral",value:"value"},uc={$type:"Accelerator",name:"name",x:"x",y:"y"},ep={$type:"Alignment",direction:"direction",members:"members"},cc={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},Dl={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},tp={$type:"Annotations",x:"x",y:"y"},ir={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function EB(t){return ze.isInstance(t,ir.$type)}s(EB,"isArchitecture");var fc={$type:"Axis",label:"label",name:"name"},jc={$type:"Branch",name:"name",order:"order"};function bB(t){return ze.isInstance(t,jc.$type)}s(bB,"isBranch");var MT={$type:"Checkout",branch:"branch"},dc={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},rp={$type:"ClassDefStatement",className:"className",styleText:"styleText"},Pa={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function CB(t){return ze.isInstance(t,Pa.$type)}s(CB,"isCommit");var pc={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},on={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},mc={$type:"Curve",entries:"entries",label:"label",name:"name"},vn={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function _B(t){return ze.isInstance(t,vn.$type)}s(_B,"isCynefin");var hc={$type:"Deaccelerator",name:"name",x:"x",y:"y"},GT={$type:"Decorator",strategy:"strategy"},$a={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},Bc={$type:"DomainBlock",domain:"domain",items:"items"};function SB(t){return ze.isInstance(t,Bc.$type)}s(SB,"isDomainBlock");var gh={$type:"DomainItem",label:"label"};function wB(t){return ze.isInstance(t,gh.$type)}s(wB,"isDomainItem");var FT={$type:"EbnfChoice",alternatives:"alternatives"},zT={$type:"EbnfExceptionPostfix",except:"except"},jT={$type:"EbnfGroup",element:"element"},BT={$type:"EbnfNonTerminal",name:"name"},UT={$type:"EbnfOneOrMorePostfix",operator:"operator"},KT={$type:"EbnfOptional",element:"element"},WT={$type:"EbnfOptionalPostfix",operator:"operator"},xl={$type:"EbnfPostfix"},ln={$type:"EbnfPrimary"},VT={$type:"EbnfRepetition",element:"element"},np={$type:"EbnfRule",definition:"definition",name:"name"},qT={$type:"EbnfSequence",elements:"elements"},HT={$type:"EbnfSpecial",text:"text"},ap={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},YT={$type:"EbnfTerminal",value:"value"},XT={$type:"EbnfZeroOrMorePostfix",operator:"operator"},nr={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},Ra={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},un={$type:"EmFrame"},Ml={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},JT={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},ip={$type:"EmModelEntity",name:"name"};function IB(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}s(IB,"isEmModelEntityType");var yc={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},Er={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function NB(t){return ze.isInstance(t,Er.$type)}s(NB,"isEmResetFrame");var Br={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},sp={$type:"Entry",axis:"axis",value:"value"},$r={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},ZT={$type:"Evolution",stages:"stages"},gc={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},op={$type:"Evolve",component:"component",target:"target"},Tn={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function PB(t){return ze.isInstance(t,Tn.$type)}s(PB,"isGitGraph");var Gl={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},eu={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function kB(t){return ze.isInstance(t,eu.$type)}s(kB,"isInfo");var Fl={$type:"Item",classSelector:"classSelector",name:"name"},lp={$type:"Junction",id:"id",in:"in"},zl={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},vc={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},cn={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},ka={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function OB(t){return ze.isInstance(t,ka.$type)}s(OB,"isMerge");var Tc={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},up={$type:"Option",name:"name",value:"value"},Oa={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function LB(t){return ze.isInstance(t,Oa.$type)}s(LB,"isPacket");var La={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function DB(t){return ze.isInstance(t,La.$type)}s(DB,"isPacketBlock");var QT={$type:"PegAny",dot:"dot"},e$={$type:"PegGroup",element:"element"},t$={$type:"PegIdentifier",name:"name"},r$={$type:"PegLiteral",value:"value"},n$={$type:"PegOrderedChoice",alternatives:"alternatives"},cp={$type:"PegPrefix",operator:"operator",suffix:"suffix"},jl={$type:"PegPrimary"},fp={$type:"PegRule",definition:"definition",name:"name"},a$={$type:"PegSequence",elements:"elements"},dp={$type:"PegSuffix",operator:"operator",primary:"primary"},$n={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function xB(t){return ze.isInstance(t,$n.$type)}s(xB,"isPie");var Uc={$type:"PieSection",label:"label",value:"value"};function MB(t){return ze.isInstance(t,Uc.$type)}s(MB,"isPieSection");var pp={$type:"Pipeline",components:"components",parent:"parent"},$c={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},fn={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},Da={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function GB(t){return ze.isInstance(t,Da.$type)}s(GB,"isRailroad");var xa={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function FB(t){return ze.isInstance(t,xa.$type)}s(FB,"isRailroadAbnf");var i$={$type:"RailroadChoiceExpr",alternatives:"alternatives"},Ma={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function zB(t){return ze.isInstance(t,Ma.$type)}s(zB,"isRailroadEbnf");var Rr={$type:"RailroadExpression"},s$={$type:"RailroadNonTerminalExpr",name:"name"},o$={$type:"RailroadOneOrMoreExpr",element:"element"},l$={$type:"RailroadOptionalExpr",element:"element"},Ga={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function jB(t){return ze.isInstance(t,Ga.$type)}s(jB,"isRailroadPeg");var mp={$type:"RailroadRule",definition:"definition",name:"name"},u$={$type:"RailroadSequenceExpr",elements:"elements"},c$={$type:"RailroadSpecialExpr",text:"text"},f$={$type:"RailroadTerminalExpr",value:"value"},d$={$type:"RailroadZeroOrMoreExpr",element:"element"},hp={$type:"Section",classSelector:"classSelector",name:"name"},Aa={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},yp={$type:"Size",height:"height",width:"width"},Ea={$type:"Statement"},tu={$type:"Transition",from:"from",label:"label",to:"to"};function BB(t){return ze.isInstance(t,tu.$type)}s(BB,"isTransition");var Fa={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function UB(t){return ze.isInstance(t,Fa.$type)}s(UB,"isTreemap");var gp={$type:"TreemapRow",indent:"indent",item:"item"},ba={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},Bl={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},tt={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function KB(t){return ze.isInstance(t,tt.$type)}s(KB,"isWardley");var ho,PP=(ho=class extends Ch{constructor(){super(...arguments),this.types={AbnfAlternation:{name:NT.$type,properties:{alternatives:{name:NT.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:PT.$type,properties:{elements:{name:PT.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:Zd.$type,properties:{primary:{name:Zd.primary},repeat:{name:Zd.repeat}},superTypes:[]},AbnfGroup:{name:kT.$type,properties:{element:{name:kT.element}},superTypes:[Ta.$type]},AbnfNumVal:{name:OT.$type,properties:{value:{name:OT.value}},superTypes:[Ta.$type]},AbnfOptionalGroup:{name:LT.$type,properties:{element:{name:LT.element}},superTypes:[Ta.$type]},AbnfPrimary:{name:Ta.$type,properties:{},superTypes:[]},AbnfRule:{name:Qd.$type,properties:{definition:{name:Qd.definition},name:{name:Qd.name}},superTypes:[]},AbnfRuleName:{name:DT.$type,properties:{name:{name:DT.name}},superTypes:[Ta.$type]},AbnfStringLiteral:{name:xT.$type,properties:{value:{name:xT.value}},superTypes:[Ta.$type]},Accelerator:{name:uc.$type,properties:{name:{name:uc.name},x:{name:uc.x},y:{name:uc.y}},superTypes:[]},Alignment:{name:ep.$type,properties:{direction:{name:ep.direction},members:{name:ep.members,defaultValue:[]}},superTypes:[]},Anchor:{name:cc.$type,properties:{evolution:{name:cc.evolution},name:{name:cc.name},visibility:{name:cc.visibility}},superTypes:[]},Annotation:{name:Dl.$type,properties:{number:{name:Dl.number},text:{name:Dl.text},x:{name:Dl.x},y:{name:Dl.y}},superTypes:[]},Annotations:{name:tp.$type,properties:{x:{name:tp.x},y:{name:tp.y}},superTypes:[]},Architecture:{name:ir.$type,properties:{accDescr:{name:ir.accDescr},accTitle:{name:ir.accTitle},alignments:{name:ir.alignments,defaultValue:[]},edges:{name:ir.edges,defaultValue:[]},groups:{name:ir.groups,defaultValue:[]},junctions:{name:ir.junctions,defaultValue:[]},services:{name:ir.services,defaultValue:[]},title:{name:ir.title}},superTypes:[]},Axis:{name:fc.$type,properties:{label:{name:fc.label},name:{name:fc.name}},superTypes:[]},Branch:{name:jc.$type,properties:{name:{name:jc.name},order:{name:jc.order}},superTypes:[Ea.$type]},Checkout:{name:MT.$type,properties:{branch:{name:MT.branch}},superTypes:[Ea.$type]},CherryPicking:{name:dc.$type,properties:{id:{name:dc.id},parent:{name:dc.parent},tags:{name:dc.tags,defaultValue:[]}},superTypes:[Ea.$type]},ClassDefStatement:{name:rp.$type,properties:{className:{name:rp.className},styleText:{name:rp.styleText}},superTypes:[]},Commit:{name:Pa.$type,properties:{id:{name:Pa.id},message:{name:Pa.message},tags:{name:Pa.tags,defaultValue:[]},type:{name:Pa.type}},superTypes:[Ea.$type]},Common:{name:pc.$type,properties:{accDescr:{name:pc.accDescr},accTitle:{name:pc.accTitle},title:{name:pc.title}},superTypes:[]},Component:{name:on.$type,properties:{decorator:{name:on.decorator},evolution:{name:on.evolution},inertia:{name:on.inertia,defaultValue:!1},label:{name:on.label},name:{name:on.name},visibility:{name:on.visibility}},superTypes:[]},Curve:{name:mc.$type,properties:{entries:{name:mc.entries,defaultValue:[]},label:{name:mc.label},name:{name:mc.name}},superTypes:[]},Cynefin:{name:vn.$type,properties:{accDescr:{name:vn.accDescr},accTitle:{name:vn.accTitle},domains:{name:vn.domains,defaultValue:[]},title:{name:vn.title},transitions:{name:vn.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:hc.$type,properties:{name:{name:hc.name},x:{name:hc.x},y:{name:hc.y}},superTypes:[]},Decorator:{name:GT.$type,properties:{strategy:{name:GT.strategy}},superTypes:[]},Direction:{name:$a.$type,properties:{accDescr:{name:$a.accDescr},accTitle:{name:$a.accTitle},dir:{name:$a.dir},statements:{name:$a.statements,defaultValue:[]},title:{name:$a.title}},superTypes:[Tn.$type]},DomainBlock:{name:Bc.$type,properties:{domain:{name:Bc.domain},items:{name:Bc.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:gh.$type,properties:{label:{name:gh.label}},superTypes:[]},EbnfChoice:{name:FT.$type,properties:{alternatives:{name:FT.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:zT.$type,properties:{except:{name:zT.except}},superTypes:[xl.$type]},EbnfGroup:{name:jT.$type,properties:{element:{name:jT.element}},superTypes:[ln.$type]},EbnfNonTerminal:{name:BT.$type,properties:{name:{name:BT.name}},superTypes:[ln.$type]},EbnfOneOrMorePostfix:{name:UT.$type,properties:{operator:{name:UT.operator}},superTypes:[xl.$type]},EbnfOptional:{name:KT.$type,properties:{element:{name:KT.element}},superTypes:[ln.$type]},EbnfOptionalPostfix:{name:WT.$type,properties:{operator:{name:WT.operator}},superTypes:[xl.$type]},EbnfPostfix:{name:xl.$type,properties:{},superTypes:[]},EbnfPrimary:{name:ln.$type,properties:{},superTypes:[]},EbnfRepetition:{name:VT.$type,properties:{element:{name:VT.element}},superTypes:[ln.$type]},EbnfRule:{name:np.$type,properties:{definition:{name:np.definition},name:{name:np.name}},superTypes:[]},EbnfSequence:{name:qT.$type,properties:{elements:{name:qT.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:HT.$type,properties:{text:{name:HT.text}},superTypes:[ln.$type]},EbnfTerm:{name:ap.$type,properties:{base:{name:ap.base},postfixes:{name:ap.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:YT.$type,properties:{value:{name:YT.value}},superTypes:[ln.$type]},EbnfZeroOrMorePostfix:{name:XT.$type,properties:{operator:{name:XT.operator}},superTypes:[xl.$type]},Edge:{name:nr.$type,properties:{lhsDir:{name:nr.lhsDir},lhsGroup:{name:nr.lhsGroup,defaultValue:!1},lhsId:{name:nr.lhsId},lhsInto:{name:nr.lhsInto,defaultValue:!1},rhsDir:{name:nr.rhsDir},rhsGroup:{name:nr.rhsGroup,defaultValue:!1},rhsId:{name:nr.rhsId},rhsInto:{name:nr.rhsInto,defaultValue:!1},title:{name:nr.title}},superTypes:[]},EmDataEntity:{name:Ra.$type,properties:{dataBlockValue:{name:Ra.dataBlockValue},dataType:{name:Ra.dataType},name:{name:Ra.name}},superTypes:[]},EmFrame:{name:un.$type,properties:{},superTypes:[]},EmGwt:{name:Ml.$type,properties:{givenStatements:{name:Ml.givenStatements,defaultValue:[]},sourceFrame:{name:Ml.sourceFrame,referenceType:un.$type},thenStatements:{name:Ml.thenStatements,defaultValue:[]},whenStatements:{name:Ml.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:JT.$type,properties:{entityIdentifier:{name:JT.entityIdentifier,referenceType:ip.$type}},superTypes:[]},EmModelEntity:{name:ip.$type,properties:{name:{name:ip.name}},superTypes:[]},EmNoteEntity:{name:yc.$type,properties:{dataBlockValue:{name:yc.dataBlockValue},dataType:{name:yc.dataType},sourceFrame:{name:yc.sourceFrame,referenceType:un.$type}},superTypes:[]},EmResetFrame:{name:Er.$type,properties:{dataInlineValue:{name:Er.dataInlineValue},dataReference:{name:Er.dataReference,referenceType:Ra.$type},dataType:{name:Er.dataType},entityIdentifier:{name:Er.entityIdentifier},modelEntityType:{name:Er.modelEntityType},name:{name:Er.name},sourceFrames:{name:Er.sourceFrames,defaultValue:[],referenceType:un.$type}},superTypes:[un.$type]},EmTimeFrame:{name:Br.$type,properties:{dataInlineValue:{name:Br.dataInlineValue},dataReference:{name:Br.dataReference,referenceType:Ra.$type},dataType:{name:Br.dataType},entityIdentifier:{name:Br.entityIdentifier},modelEntityType:{name:Br.modelEntityType},name:{name:Br.name},sourceFrames:{name:Br.sourceFrames,defaultValue:[],referenceType:un.$type}},superTypes:[un.$type]},Entry:{name:sp.$type,properties:{axis:{name:sp.axis,referenceType:fc.$type},value:{name:sp.value}},superTypes:[]},EventModel:{name:$r.$type,properties:{accDescr:{name:$r.accDescr},accTitle:{name:$r.accTitle},dataEntities:{name:$r.dataEntities,defaultValue:[]},frames:{name:$r.frames,defaultValue:[]},gwtEntities:{name:$r.gwtEntities,defaultValue:[]},modelEntities:{name:$r.modelEntities,defaultValue:[]},noteEntities:{name:$r.noteEntities,defaultValue:[]},title:{name:$r.title}},superTypes:[]},Evolution:{name:ZT.$type,properties:{stages:{name:ZT.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:gc.$type,properties:{boundary:{name:gc.boundary},name:{name:gc.name},secondName:{name:gc.secondName}},superTypes:[]},Evolve:{name:op.$type,properties:{component:{name:op.component},target:{name:op.target}},superTypes:[]},GitGraph:{name:Tn.$type,properties:{accDescr:{name:Tn.accDescr},accTitle:{name:Tn.accTitle},statements:{name:Tn.statements,defaultValue:[]},title:{name:Tn.title}},superTypes:[]},Group:{name:Gl.$type,properties:{icon:{name:Gl.icon},id:{name:Gl.id},in:{name:Gl.in},title:{name:Gl.title}},superTypes:[]},Info:{name:eu.$type,properties:{accDescr:{name:eu.accDescr},accTitle:{name:eu.accTitle},title:{name:eu.title}},superTypes:[]},Item:{name:Fl.$type,properties:{classSelector:{name:Fl.classSelector},name:{name:Fl.name}},superTypes:[]},Junction:{name:lp.$type,properties:{id:{name:lp.id},in:{name:lp.in}},superTypes:[]},Label:{name:zl.$type,properties:{negX:{name:zl.negX,defaultValue:!1},negY:{name:zl.negY,defaultValue:!1},offsetX:{name:zl.offsetX},offsetY:{name:zl.offsetY}},superTypes:[]},Leaf:{name:vc.$type,properties:{classSelector:{name:vc.classSelector},name:{name:vc.name},value:{name:vc.value}},superTypes:[Fl.$type]},Link:{name:cn.$type,properties:{arrow:{name:cn.arrow},from:{name:cn.from},fromPort:{name:cn.fromPort},linkLabel:{name:cn.linkLabel},to:{name:cn.to},toPort:{name:cn.toPort}},superTypes:[]},Merge:{name:ka.$type,properties:{branch:{name:ka.branch},id:{name:ka.id},tags:{name:ka.tags,defaultValue:[]},type:{name:ka.type}},superTypes:[Ea.$type]},Note:{name:Tc.$type,properties:{evolution:{name:Tc.evolution},text:{name:Tc.text},visibility:{name:Tc.visibility}},superTypes:[]},Option:{name:up.$type,properties:{name:{name:up.name},value:{name:up.value,defaultValue:!1}},superTypes:[]},Packet:{name:Oa.$type,properties:{accDescr:{name:Oa.accDescr},accTitle:{name:Oa.accTitle},blocks:{name:Oa.blocks,defaultValue:[]},title:{name:Oa.title}},superTypes:[]},PacketBlock:{name:La.$type,properties:{bits:{name:La.bits},end:{name:La.end},label:{name:La.label},start:{name:La.start}},superTypes:[]},PegAny:{name:QT.$type,properties:{dot:{name:QT.dot}},superTypes:[jl.$type]},PegGroup:{name:e$.$type,properties:{element:{name:e$.element}},superTypes:[jl.$type]},PegIdentifier:{name:t$.$type,properties:{name:{name:t$.name}},superTypes:[jl.$type]},PegLiteral:{name:r$.$type,properties:{value:{name:r$.value}},superTypes:[jl.$type]},PegOrderedChoice:{name:n$.$type,properties:{alternatives:{name:n$.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:cp.$type,properties:{operator:{name:cp.operator},suffix:{name:cp.suffix}},superTypes:[]},PegPrimary:{name:jl.$type,properties:{},superTypes:[]},PegRule:{name:fp.$type,properties:{definition:{name:fp.definition},name:{name:fp.name}},superTypes:[]},PegSequence:{name:a$.$type,properties:{elements:{name:a$.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:dp.$type,properties:{operator:{name:dp.operator},primary:{name:dp.primary}},superTypes:[]},Pie:{name:$n.$type,properties:{accDescr:{name:$n.accDescr},accTitle:{name:$n.accTitle},sections:{name:$n.sections,defaultValue:[]},showData:{name:$n.showData,defaultValue:!1},title:{name:$n.title}},superTypes:[]},PieSection:{name:Uc.$type,properties:{label:{name:Uc.label},value:{name:Uc.value}},superTypes:[]},Pipeline:{name:pp.$type,properties:{components:{name:pp.components,defaultValue:[]},parent:{name:pp.parent}},superTypes:[]},PipelineComponent:{name:$c.$type,properties:{evolution:{name:$c.evolution},label:{name:$c.label},name:{name:$c.name}},superTypes:[]},Radar:{name:fn.$type,properties:{accDescr:{name:fn.accDescr},accTitle:{name:fn.accTitle},axes:{name:fn.axes,defaultValue:[]},curves:{name:fn.curves,defaultValue:[]},options:{name:fn.options,defaultValue:[]},title:{name:fn.title}},superTypes:[]},Railroad:{name:Da.$type,properties:{accDescr:{name:Da.accDescr},accTitle:{name:Da.accTitle},rules:{name:Da.rules,defaultValue:[]},title:{name:Da.title}},superTypes:[]},RailroadAbnf:{name:xa.$type,properties:{accDescr:{name:xa.accDescr},accTitle:{name:xa.accTitle},rules:{name:xa.rules,defaultValue:[]},title:{name:xa.title}},superTypes:[]},RailroadChoiceExpr:{name:i$.$type,properties:{alternatives:{name:i$.alternatives,defaultValue:[]}},superTypes:[Rr.$type]},RailroadEbnf:{name:Ma.$type,properties:{accDescr:{name:Ma.accDescr},accTitle:{name:Ma.accTitle},rules:{name:Ma.rules,defaultValue:[]},title:{name:Ma.title}},superTypes:[]},RailroadExpression:{name:Rr.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:s$.$type,properties:{name:{name:s$.name}},superTypes:[Rr.$type]},RailroadOneOrMoreExpr:{name:o$.$type,properties:{element:{name:o$.element}},superTypes:[Rr.$type]},RailroadOptionalExpr:{name:l$.$type,properties:{element:{name:l$.element}},superTypes:[Rr.$type]},RailroadPeg:{name:Ga.$type,properties:{accDescr:{name:Ga.accDescr},accTitle:{name:Ga.accTitle},rules:{name:Ga.rules,defaultValue:[]},title:{name:Ga.title}},superTypes:[]},RailroadRule:{name:mp.$type,properties:{definition:{name:mp.definition},name:{name:mp.name}},superTypes:[]},RailroadSequenceExpr:{name:u$.$type,properties:{elements:{name:u$.elements,defaultValue:[]}},superTypes:[Rr.$type]},RailroadSpecialExpr:{name:c$.$type,properties:{text:{name:c$.text}},superTypes:[Rr.$type]},RailroadTerminalExpr:{name:f$.$type,properties:{value:{name:f$.value}},superTypes:[Rr.$type]},RailroadZeroOrMoreExpr:{name:d$.$type,properties:{element:{name:d$.element}},superTypes:[Rr.$type]},Section:{name:hp.$type,properties:{classSelector:{name:hp.classSelector},name:{name:hp.name}},superTypes:[Fl.$type]},Service:{name:Aa.$type,properties:{icon:{name:Aa.icon},iconText:{name:Aa.iconText},id:{name:Aa.id},in:{name:Aa.in},title:{name:Aa.title}},superTypes:[]},Size:{name:yp.$type,properties:{height:{name:yp.height},width:{name:yp.width}},superTypes:[]},Statement:{name:Ea.$type,properties:{},superTypes:[]},Transition:{name:tu.$type,properties:{from:{name:tu.from},label:{name:tu.label},to:{name:tu.to}},superTypes:[]},TreeNode:{name:ba.$type,properties:{classAnnotation:{name:ba.classAnnotation},descAnnotation:{name:ba.descAnnotation},iconAnnotation:{name:ba.iconAnnotation},indent:{name:ba.indent},name:{name:ba.name}},superTypes:[]},TreeView:{name:Bl.$type,properties:{accDescr:{name:Bl.accDescr},accTitle:{name:Bl.accTitle},nodes:{name:Bl.nodes,defaultValue:[]},title:{name:Bl.title}},superTypes:[]},Treemap:{name:Fa.$type,properties:{accDescr:{name:Fa.accDescr},accTitle:{name:Fa.accTitle},title:{name:Fa.title},TreemapRows:{name:Fa.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:gp.$type,properties:{indent:{name:gp.indent},item:{name:gp.item}},superTypes:[]},Wardley:{name:tt.$type,properties:{accDescr:{name:tt.accDescr},accelerators:{name:tt.accelerators,defaultValue:[]},accTitle:{name:tt.accTitle},anchors:{name:tt.anchors,defaultValue:[]},annotation:{name:tt.annotation,defaultValue:[]},annotations:{name:tt.annotations,defaultValue:[]},components:{name:tt.components,defaultValue:[]},deaccelerators:{name:tt.deaccelerators,defaultValue:[]},evolution:{name:tt.evolution},evolves:{name:tt.evolves,defaultValue:[]},links:{name:tt.links,defaultValue:[]},notes:{name:tt.notes,defaultValue:[]},pipelines:{name:tt.pipelines,defaultValue:[]},size:{name:tt.size},title:{name:tt.title}},superTypes:[]}}}},s(ho,"MermaidAstReflection"),ho),ze=new PP,p$,WB=s(()=>p$??(p$=Ze(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),m$,VB=s(()=>m$??(m$=Ze(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),h$,qB=s(()=>h$??(h$=Ze('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),y$,HB=s(()=>y$??(y$=Ze(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),g$,YB=s(()=>g$??(g$=Ze(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),v$,XB=s(()=>v$??(v$=Ze(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),T$,JB=s(()=>T$??(T$=Ze(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),$$,ZB=s(()=>$$??($$=Ze(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),R$,QB=s(()=>R$??(R$=Ze('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),A$,eU=s(()=>A$??(A$=Ze(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),E$,tU=s(()=>E$??(E$=Ze(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),b$,rU=s(()=>b$??(b$=Ze(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),C$,nU=s(()=>C$??(C$=Ze(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),_$,aU=s(()=>_$??(_$=Ze(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),S$,iU=s(()=>S$??(S$=Ze(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),sU={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},oU={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},lU={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},uU={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},cU={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},fU={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},dU={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},pU={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},mU={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},hU={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},yU={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},gU={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},vU={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},TU={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},$U={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Tt={AstReflection:s(()=>new PP,"AstReflection")},RU={Grammar:s(()=>WB(),"Grammar"),LanguageMetaData:s(()=>sU,"LanguageMetaData"),parser:{}},AU={Grammar:s(()=>VB(),"Grammar"),LanguageMetaData:s(()=>oU,"LanguageMetaData"),parser:{}},EU={Grammar:s(()=>qB(),"Grammar"),LanguageMetaData:s(()=>lU,"LanguageMetaData"),parser:{}},bU={Grammar:s(()=>HB(),"Grammar"),LanguageMetaData:s(()=>uU,"LanguageMetaData"),parser:{}},CU={Grammar:s(()=>YB(),"Grammar"),LanguageMetaData:s(()=>cU,"LanguageMetaData"),parser:{}},_U={Grammar:s(()=>XB(),"Grammar"),LanguageMetaData:s(()=>fU,"LanguageMetaData"),parser:{}},SU={Grammar:s(()=>JB(),"Grammar"),LanguageMetaData:s(()=>dU,"LanguageMetaData"),parser:{}},wU={Grammar:s(()=>ZB(),"Grammar"),LanguageMetaData:s(()=>pU,"LanguageMetaData"),parser:{}},IU={Grammar:s(()=>QB(),"Grammar"),LanguageMetaData:s(()=>mU,"LanguageMetaData"),parser:{}},NU={Grammar:s(()=>eU(),"Grammar"),LanguageMetaData:s(()=>hU,"LanguageMetaData"),parser:{}},PU={Grammar:s(()=>tU(),"Grammar"),LanguageMetaData:s(()=>yU,"LanguageMetaData"),parser:{}},kU={Grammar:s(()=>rU(),"Grammar"),LanguageMetaData:s(()=>gU,"LanguageMetaData"),parser:{}},OU={Grammar:s(()=>nU(),"Grammar"),LanguageMetaData:s(()=>vU,"LanguageMetaData"),parser:{}},LU={Grammar:s(()=>aU(),"Grammar"),LanguageMetaData:s(()=>TU,"LanguageMetaData"),parser:{}},DU={Grammar:s(()=>iU(),"Grammar"),LanguageMetaData:s(()=>$U,"LanguageMetaData"),parser:{}},xU=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,MU=/accTitle[\t ]*:([^\n\r]*)/,GU=/title([\t ][^\n\r]*|)/,FU={ACC_DESCR:xU,ACC_TITLE:MU,TITLE:GU},yo,vr=(yo=class extends xg{runConverter(e,r,n){let a=this.runCommonConverter(e,r,n);return a===void 0&&(a=this.runCustomConverter(e,r,n)),a===void 0?super.runConverter(e,r,n):a}runCommonConverter(e,r,n){const a=FU[e.name];if(a===void 0)return;const i=a.exec(r);if(i!==null){if(i[1]!==void 0)return i[1].trim().replace(/[\t ]{2,}/gm," ");if(i[2]!==void 0)return i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` +`)}}},s(yo,"AbstractMermaidValueConverter"),yo),go,pl=(go=class extends vr{runCustomConverter(e,r,n){}},s(go,"CommonValueConverter"),go),vo,$t=(vo=class extends Od{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const a=super.buildKeywordTokens(e,r,n);return a.forEach(i=>{this.keywords.has(i.name)&&i.PATTERN!==void 0&&(i.PATTERN=new RegExp(i.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),a}},s(vo,"AbstractMermaidTokenBuilder"),vo),To;To=class extends $t{},s(To,"CommonTokenBuilder");var $o,zU=($o=class extends $t{constructor(){super(["radar-beta"])}},s($o,"RadarTokenBuilder"),$o),kP={parser:{TokenBuilder:s(()=>new zU,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")}};function OP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),wU,kP);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}s(OP,"createRadarServices");var Ro,jU=(Ro=class extends $t{constructor(){super(["railroad-beta"])}},s(Ro,"RailroadTokenBuilder"),Ro),w$=s(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew jU,"TokenBuilder"),ValueConverter:s(()=>new BU,"ValueConverter")}};function DP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),PU,LP);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}s(DP,"createRailroadServices");var Eo,UU=(Eo=class extends $t{constructor(){super(["railroad-ebnf-beta"])}},s(Eo,"RailroadEbnfTokenBuilder"),Eo),I$=s(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew UU,"TokenBuilder"),ValueConverter:s(()=>new KU,"ValueConverter")}};function MP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),NU,xP);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}s(MP,"createRailroadEbnfServices");var Co,WU=(Co=class extends $t{constructor(){super(["railroad-abnf-beta"])}},s(Co,"RailroadAbnfTokenBuilder"),Co),_o,VU=(_o=class extends vr{runConverter(e,r,n){const a=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof a=="string"){const i=a.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1)}return a}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},s(_o,"RailroadAbnfValueConverter"),_o),GP={parser:{TokenBuilder:s(()=>new WU,"TokenBuilder"),ValueConverter:s(()=>new VU,"ValueConverter")}};function FP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),IU,GP);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}s(FP,"createRailroadAbnfServices");var So,qU=(So=class extends $t{constructor(){super(["railroad-peg-beta"])}},s(So,"RailroadPegTokenBuilder"),So),N$=s(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew qU,"TokenBuilder"),ValueConverter:s(()=>new HU,"ValueConverter")}};function jP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),kU,zP);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}s(jP,"createRailroadPegServices");var Io,YU=(Io=class extends $t{constructor(){super(["treemap"])}},s(Io,"TreemapTokenBuilder"),Io),XU=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,No,JU=(No=class extends vr{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const a=XU.exec(r);if(a)return{$type:"ClassDefStatement",className:a[1],styleText:a[2]||void 0}}}},s(No,"TreemapValueConverter"),No);function BP(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}s(BP,"registerValidationChecks");var Po,ZU=(Po=class{checkSingleRoot(e,r){let n;for(const a of e.TreemapRows)a.item&&(n===void 0&&a.indent===void 0?n=0:a.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:a,property:"item"}):n!==void 0&&n>=parseInt(a.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:a,property:"item"}))}},s(Po,"TreemapValidator"),Po),UP={parser:{TokenBuilder:s(()=>new YU,"TokenBuilder"),ValueConverter:s(()=>new JU,"ValueConverter")},validation:{TreemapValidator:s(()=>new ZU,"TreemapValidator")}};function KP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),OU,UP);return e.ServiceRegistry.register(r),BP(r),{shared:e,Treemap:r}}s(KP,"createTreemapServices");var ko,QU=(ko=class extends vr{runCustomConverter(e,r,n){if(e.name.toUpperCase()==="LINK_LABEL")return r.substring(1).trim()}},s(ko,"WardleyValueConverter"),ko),WP={parser:{ValueConverter:s(()=>new QU,"ValueConverter")}};function VP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),DU,WP);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}s(VP,"createWardleyServices");var Oo,eK=(Oo=class extends $t{constructor(){super(["cynefin-beta"])}},s(Oo,"CynefinTokenBuilder"),Oo),qP={parser:{TokenBuilder:s(()=>new eK,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")}};function HP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),AU,qP);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}s(HP,"createCynefinServices");var Lo,tK=(Lo=class extends $t{constructor(){super(["gitGraph"])}},s(Lo,"GitGraphTokenBuilder"),Lo),YP={parser:{TokenBuilder:s(()=>new tK,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")}};function XP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),bU,YP);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}s(XP,"createGitGraphServices");var Do,rK=(Do=class extends $t{constructor(){super(["info","showInfo"])}},s(Do,"InfoTokenBuilder"),Do),JP={parser:{TokenBuilder:s(()=>new rK,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")}};function ZP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),CU,JP);return e.ServiceRegistry.register(r),{shared:e,Info:r}}s(ZP,"createInfoServices");var xo,nK=(xo=class extends $t{constructor(){super(["packet"])}},s(xo,"PacketTokenBuilder"),xo),QP={parser:{TokenBuilder:s(()=>new nK,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")}};function ek(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),_U,QP);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}s(ek,"createPacketServices");var Mo,aK=(Mo=class extends $t{constructor(){super(["pie","showData"])}},s(Mo,"PieTokenBuilder"),Mo),Go,iK=(Go=class extends vr{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},s(Go,"PieValueConverter"),Go),tk={parser:{TokenBuilder:s(()=>new aK,"TokenBuilder"),ValueConverter:s(()=>new iK,"ValueConverter")}};function rk(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),SU,tk);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}s(rk,"createPieServices");var Fo,sK=(Fo=class extends vr{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return r?.length||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const a=r.trim();return a.substring(5,a.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},s(Fo,"TreeViewValueConverter"),Fo),zo,oK=(zo=class extends $t{constructor(){super(["treeView-beta"])}},s(zo,"TreeViewTokenBuilder"),zo),nk={parser:{TokenBuilder:s(()=>new oK,"TokenBuilder"),ValueConverter:s(()=>new sK,"ValueConverter")}};function ak(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),LU,nk);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}s(ak,"createTreeViewServices");var jo,lK=(jo=class extends $t{constructor(){super(["architecture"])}},s(jo,"ArchitectureTokenBuilder"),jo),Bo,uK=(Bo=class extends vr{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let a=r.replace(/^\[|]$/g,"").trim();return(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=a.slice(1,-1),a=a.replace(/\\"/g,'"').replace(/\\'/g,"'")),a.trim()}}},s(Bo,"ArchitectureValueConverter"),Bo),ik={parser:{TokenBuilder:s(()=>new lK,"TokenBuilder"),ValueConverter:s(()=>new uK,"ValueConverter")}};function sk(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),RU,ik);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}s(sk,"createArchitectureServices");var Uo,cK=(Uo=class extends $t{constructor(){super(["eventmodeling"])}},s(Uo,"EventModelingTokenBuilder"),Uo),P$=new Set(["cmd","command"]),k$=new Set(["evt","event"]),vp=new Set(["rmo","readmodel"]),O$=new Set(["pcr","processor"]),L$=new Set(["ui"]);function ok(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}s(ok,"registerValidationChecks");var Ko,fK=(Ko=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(P$.has(e.modelEntityType)?this.validateSources(e,new Set([...L$,...O$]),"command","ui or processor",r):k$.has(e.modelEntityType)?this.validateSources(e,P$,"event","command",r):vp.has(e.modelEntityType)?this.validateSources(e,k$,"read model","event",r):O$.has(e.modelEntityType)?this.validateSources(e,vp,"processor","read model",r):L$.has(e.modelEntityType)&&this.validateSources(e,vp,"ui","read model",r))}validateSources(e,r,n,a,i){for(const o of e.sourceFrames){const u=o.ref;u!==void 0&&!r.has(u.modelEntityType)&&i("error",`A ${n} can only receive input from a ${a}, not from '${u.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},s(Ko,"EventModelingValidator"),Ko),lk={parser:{TokenBuilder:s(()=>new cK,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")},validation:{EventModelingValidator:s(()=>new fK,"EventModelingValidator")}};function uk(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),EU,lk);return e.ServiceRegistry.register(r),ok(r),{shared:e,EventModel:r}}s(uk,"createEventModelingServices");var rt={},dK={info:s(async()=>{const{createInfoServices:t}=await ut(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>hK);return{createInfoServices:r}},void 0),e=t().Info.parser.LangiumParser;rt.info=e},"info"),packet:s(async()=>{const{createPacketServices:t}=await ut(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>yK);return{createPacketServices:r}},void 0),e=t().Packet.parser.LangiumParser;rt.packet=e},"packet"),pie:s(async()=>{const{createPieServices:t}=await ut(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>gK);return{createPieServices:r}},void 0),e=t().Pie.parser.LangiumParser;rt.pie=e},"pie"),treeView:s(async()=>{const{createTreeViewServices:t}=await ut(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>vK);return{createTreeViewServices:r}},void 0),e=t().TreeView.parser.LangiumParser;rt.treeView=e},"treeView"),architecture:s(async()=>{const{createArchitectureServices:t}=await ut(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>TK);return{createArchitectureServices:r}},void 0),e=t().Architecture.parser.LangiumParser;rt.architecture=e},"architecture"),gitGraph:s(async()=>{const{createGitGraphServices:t}=await ut(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>$K);return{createGitGraphServices:r}},void 0),e=t().GitGraph.parser.LangiumParser;rt.gitGraph=e},"gitGraph"),eventmodeling:s(async()=>{const{createEventModelingServices:t}=await ut(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>RK);return{createEventModelingServices:r}},void 0),e=t().EventModel.parser.LangiumParser;rt.eventmodeling=e},"eventmodeling"),radar:s(async()=>{const{createRadarServices:t}=await ut(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>AK);return{createRadarServices:r}},void 0),e=t().Radar.parser.LangiumParser;rt.radar=e},"radar"),railroad:s(async()=>{const{createRailroadServices:t}=await ut(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>EK);return{createRailroadServices:r}},void 0),e=t().Railroad.parser.LangiumParser;rt.railroad=e},"railroad"),railroadEbnf:s(async()=>{const{createRailroadEbnfServices:t}=await ut(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>bK);return{createRailroadEbnfServices:r}},void 0),e=t().RailroadEbnf.parser.LangiumParser;rt.railroadEbnf=e},"railroadEbnf"),railroadAbnf:s(async()=>{const{createRailroadAbnfServices:t}=await ut(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>CK);return{createRailroadAbnfServices:r}},void 0),e=t().RailroadAbnf.parser.LangiumParser;rt.railroadAbnf=e},"railroadAbnf"),railroadPeg:s(async()=>{const{createRailroadPegServices:t}=await ut(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>_K);return{createRailroadPegServices:r}},void 0),e=t().RailroadPeg.parser.LangiumParser;rt.railroadPeg=e},"railroadPeg"),treemap:s(async()=>{const{createTreemapServices:t}=await ut(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>SK);return{createTreemapServices:r}},void 0),e=t().Treemap.parser.LangiumParser;rt.treemap=e},"treemap"),wardley:s(async()=>{const{createWardleyServices:t}=await ut(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>wK);return{createWardleyServices:r}},void 0),e=t().Wardley.parser.LangiumParser;rt.wardley=e},"wardley"),cynefin:s(async()=>{const{createCynefinServices:t}=await ut(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>IK);return{createCynefinServices:r}},void 0),e=t().Cynefin.parser.LangiumParser;rt.cynefin=e},"cynefin")};async function pK(t,e){const r=dK[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);rt[t]||await r();const a=rt[t].parse(e);if(a.lexerErrors.length>0||a.parserErrors.length>0)throw new mK(a);return a.value}s(pK,"parse");var Wo,mK=(Wo=class extends Error{constructor(e){const r=e.lexerErrors.map(a=>{const i=a.line!==void 0&&!isNaN(a.line)?a.line:"?",o=a.column!==void 0&&!isNaN(a.column)?a.column:"?";return`Lexer error on line ${i}, column ${o}: ${a.message}`}).join(` +`),n=e.parserErrors.map(a=>{const i=a.token.startLine!==void 0&&!isNaN(a.token.startLine)?a.token.startLine:"?",o=a.token.startColumn!==void 0&&!isNaN(a.token.startColumn)?a.token.startColumn:"?";return`Parse error on line ${i}, column ${o}: ${a.message}`}).join(` +`);super(`Parsing failed: ${r} ${n}`),this.result=e}},s(Wo,"MermaidParseError"),Wo);const hK=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:JP,createInfoServices:ZP},Symbol.toStringTag,{value:"Module"})),yK=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:QP,createPacketServices:ek},Symbol.toStringTag,{value:"Module"})),gK=Object.freeze(Object.defineProperty({__proto__:null,PieModule:tk,createPieServices:rk},Symbol.toStringTag,{value:"Module"})),vK=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:nk,createTreeViewServices:ak},Symbol.toStringTag,{value:"Module"})),TK=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:ik,createArchitectureServices:sk},Symbol.toStringTag,{value:"Module"})),$K=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:YP,createGitGraphServices:XP},Symbol.toStringTag,{value:"Module"})),RK=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:lk,createEventModelingServices:uk},Symbol.toStringTag,{value:"Module"})),AK=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:kP,createRadarServices:OP},Symbol.toStringTag,{value:"Module"})),EK=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:LP,createRailroadServices:DP},Symbol.toStringTag,{value:"Module"})),bK=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:xP,createRailroadEbnfServices:MP},Symbol.toStringTag,{value:"Module"})),CK=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:GP,createRailroadAbnfServices:FP},Symbol.toStringTag,{value:"Module"})),_K=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:zP,createRailroadPegServices:jP},Symbol.toStringTag,{value:"Module"})),SK=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:UP,createTreemapServices:KP},Symbol.toStringTag,{value:"Module"})),wK=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:WP,createWardleyServices:VP},Symbol.toStringTag,{value:"Module"})),IK=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:qP,createCynefinServices:HP},Symbol.toStringTag,{value:"Module"}));export{mK as M,MP as a,FP as b,DP as c,jP as d,NB as i,pK as p}; diff --git a/internal/webapp/static/assets/cynefinDiagram-MW4NZA55-DzpNWex9.js b/internal/webapp/static/assets/cynefinDiagram-MW4NZA55-DzpNWex9.js new file mode 100644 index 0000000..2fef2a3 --- /dev/null +++ b/internal/webapp/static/assets/cynefinDiagram-MW4NZA55-DzpNWex9.js @@ -0,0 +1,62 @@ +import{p as xt}from"./chunk-JWPE2WC7-Czg53Rx5.js";import{s as gt,g as $t,o as bt,n as wt,a as Ct,b as vt,_ as s,l as O,D as Dt,e as kt,p as At,A as U,y as Q,B as Tt,E as ot}from"./mermaid.core-B7WVQkyL.js";import{p as Bt}from"./cynefin-VYW2F7L2-CdOzebfq.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Vt();return` + .cynefinDomain { + stroke: none; + } + .cynefinDomainLabel { + font-size: ${t.domainFontSize}px; + font-weight: bold; + fill: ${t.labelColor}; + } + .cynefinSubtitle { + font-size: ${t.itemFontSize-1}px; + fill: ${t.textColor}; + font-style: italic; + } + .cynefinItem { + fill-opacity: 0.95; + stroke: ${t.boundaryColor}; + stroke-width: 1; + } + .cynefinItemText { + font-size: ${t.itemFontSize}px; + fill: ${t.textColor}; + } + .cynefinItemOverflow { + fill-opacity: 0.6; + stroke: ${t.boundaryColor}; + stroke-width: 1; + stroke-dasharray: 3 2; + } + .cynefinBoundary { + stroke: ${t.boundaryColor}; + stroke-width: ${t.boundaryWidth}; + stroke-dasharray: 6 3; + } + .cynefinCliff { + stroke: ${t.cliffColor}; + stroke-width: ${t.cliffWidth}; + } + .cynefinConfusion { + stroke: ${t.boundaryColor}; + stroke-width: 1.5; + stroke-dasharray: 4 2; + } + .cynefinArrowLine { + stroke: ${t.arrowColor}; + stroke-width: ${t.arrowWidth}; + fill: none; + } + .cynefinArrowHead { + fill: ${t.arrowColor}; + stroke: none; + } + .cynefinArrowLabel { + font-size: ${t.itemFontSize-1}px; + fill: ${t.textColor}; + } + .cynefinTitle { + font-size: ${t.domainFontSize+2}px; + font-weight: bold; + fill: ${t.labelColor}; + } + `},"styles"),Gt=Ht,Ut={parser:Wt,db:Y,renderer:Ft,styles:Gt};export{Ut as diagram}; diff --git a/internal/webapp/static/assets/cytoscape.esm-D3_iZ_3b.js b/internal/webapp/static/assets/cytoscape.esm-D3_iZ_3b.js new file mode 100644 index 0000000..cd8f6fd --- /dev/null +++ b/internal/webapp/static/assets/cytoscape.esm-D3_iZ_3b.js @@ -0,0 +1,321 @@ +function Bs(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,a=Array(e);t=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return s=u.done,u},e:function(u){o=!0,i=u},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw i}}}}function Jl(r,e,t){return(e=jl(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function nc(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function ic(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var a,n,i,s,o=[],u=!0,l=!1;try{if(i=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;u=!1}else for(;!(u=(a=i.call(t)).done)&&(o.push(a.value),o.length!==e);u=!0);}catch(v){l=!0,n=v}finally{try{if(!u&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(l)throw n}}return o}}function sc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oc(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qe(r,e){return rc(r)||ic(r,e)||Xs(r,e)||sc()}function mn(r){return tc(r)||nc(r)||Xs(r)||oc()}function uc(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function jl(r){var e=uc(r,"string");return typeof e=="symbol"?e:e+""}function rr(r){"@babel/helpers - typeof";return rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rr(r)}function Xs(r,e){if(r){if(typeof r=="string")return Bs(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Bs(r,e):void 0}}var je=typeof window>"u"?null:window,To=je?je.navigator:null;je&&je.document;var lc=rr(""),ev=rr({}),vc=rr(function(){}),fc=typeof HTMLElement>"u"?"undefined":rr(HTMLElement),La=function(e){return e&&e.instanceString&&$e(e.instanceString)?e.instanceString():null},he=function(e){return e!=null&&rr(e)==lc},$e=function(e){return e!=null&&rr(e)===vc},Ve=function(e){return!Tr(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Me=function(e){return e!=null&&rr(e)===ev&&!Ve(e)&&e.constructor===Object},cc=function(e){return e!=null&&rr(e)===ev},ae=function(e){return e!=null&&rr(e)===rr(1)&&!isNaN(e)},dc=function(e){return ae(e)&&Math.floor(e)===e},bn=function(e){if(fc!=="undefined")return e!=null&&e instanceof HTMLElement},Tr=function(e){return Ia(e)||rv(e)},Ia=function(e){return La(e)==="collection"&&e._private.single},rv=function(e){return La(e)==="collection"&&!e._private.single},Ys=function(e){return La(e)==="core"},tv=function(e){return La(e)==="stylesheet"},hc=function(e){return La(e)==="event"},ot=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},gc=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},pc=function(e){return Me(e)&&ae(e.x1)&&ae(e.x2)&&ae(e.y1)&&ae(e.y2)},yc=function(e){return cc(e)&&$e(e.then)},mc=function(){return To&&To.userAgent.match(/msie|trident|edge/i)},Yt=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;st?1:0},Sc=function(e,t){return-1*nv(e,t)},ye=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t1&&(g-=1),g<1/6?d+(y-d)*6*g:g<1/2?y:g<2/3?d+(y-d)*(2/3-g)*6:d}var f=new RegExp("^"+xc+"$").exec(e);if(f){if(a=parseInt(f[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(f[2]),n<0||n>100||(n=n/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,s=f[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)o=u=l=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,h=2*i-c;o=Math.round(255*v(h,c,a+1/3)),u=Math.round(255*v(h,c,a)),l=Math.round(255*v(h,c,a-1/3))}t=[o,u,l,s]}return t},Bc=function(e){var t,a=new RegExp("^"+bc+"$").exec(e);if(a){t=[];for(var n=[],i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%"&&(n[i]=!0),s=parseFloat(s),n[i]&&(s=s/100*255),s<0||s>255)return;t.push(Math.floor(s))}var o=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(o&&!u)return;var l=a[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;t.push(l)}}return t},Pc=function(e){return Ac[e.toLowerCase()]},iv=function(e){return(Ve(e)?e:null)||Pc(e)||kc(e)||Bc(e)||Dc(e)},Ac={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},sv=function(e){for(var t=e.map,a=e.keys,n=a.length,i=0;i=u||R<0||m&&L>=c}function S(){var A=e();if(x(A))return k(A);d=setTimeout(S,C(A))}function k(A){return d=void 0,b&&v?w(A):(v=f=void 0,h)}function B(){d!==void 0&&clearTimeout(d),g=0,v=y=f=d=void 0}function D(){return d===void 0?h:k(e())}function P(){var A=e(),R=x(A);if(v=arguments,f=this,y=A,R){if(d===void 0)return E(y);if(m)return clearTimeout(d),d=setTimeout(S,u),w(y)}return d===void 0&&(d=setTimeout(S,u)),h}return P.cancel=B,P.flush=D,P}return fi=s,fi}var qc=Vc(),Fa=Oa(qc),ci=je?je.performance:null,lv=ci&&ci.now?function(){return ci.now()}:function(){return Date.now()},_c=(function(){if(je){if(je.requestAnimationFrame)return function(r){je.requestAnimationFrame(r)};if(je.mozRequestAnimationFrame)return function(r){je.mozRequestAnimationFrame(r)};if(je.webkitRequestAnimationFrame)return function(r){je.webkitRequestAnimationFrame(r)};if(je.msRequestAnimationFrame)return function(r){je.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(lv())},1e3/60)}})(),wn=function(e){return _c(e)},Xr=lv,Ct=9261,vv=65599,_t=5381,fv=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ct,a=t,n;n=e.next(),!n.done;)a=a*vv+n.value|0;return a},Ca=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ct;return t*vv+e|0},Ta=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_t;return(t<<5)+t+e|0},Gc=function(e,t){return e*2097152+t},jr=function(e){return e[0]*2097152+e[1]},Xa=function(e,t){return[Ca(e[0],t[0]),Ta(e[1],t[1])]},qo=function(e,t){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){return n=0;n--)e[n]===t&&e.splice(n,1)},eo=function(e){e.splice(0,e.length)},Jc=function(e,t){for(var a=0;a"u"?"undefined":rr(Set))!==ed?Set:rd,In=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!Ys(e)){He("An element must have a core reference and parameters set");return}var n=t.group;if(n==null&&(t.data&&t.data.source!=null&&t.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){He("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?n==="edges":!!t.pannable,active:!1,classes:new ra,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),t.renderedPosition){var s=t.renderedPosition,o=e.pan(),u=e.zoom();i.position={x:(s.x-o.x)/u,y:(s.y-o.y)/u}}var l=[];Ve(t.classes)?l=t.classes:he(t.classes)&&(l=t.classes.split(/\s+/));for(var v=0,f=l.length;vm?1:0},v=function(p,m,b,w,E){var C;if(b==null&&(b=0),E==null&&(E=a),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=p.length);bB;0<=B?k++:k--)S.push(k);return S}).apply(this).reverse(),x=[],w=0,E=C.length;wD;0<=D?++S:--S)P.push(s(p,b));return P},y=function(p,m,b,w){var E,C,x;for(w==null&&(w=a),E=p[b];b>m;){if(x=b-1>>1,C=p[x],w(E,C)<0){p[b]=C,b=x;continue}break}return p[b]=E},g=function(p,m,b){var w,E,C,x,S;for(b==null&&(b=a),E=p.length,S=m,C=p[m],w=2*m+1;w0;){var C=m.pop(),x=g(C),S=C.id();if(c[S]=x,x!==1/0)for(var k=C.neighborhood().intersect(d),B=0;B0)for(O.unshift(M);f[_];){var N=f[_];O.unshift(N.edge),O.unshift(N.node),q=N.node,_=q.id()}return o.spawn(O)}}}},ud={kruskal:function(e){e=e||function(b){return 1};for(var t=this.byGroup(),a=t.nodes,n=t.edges,i=a.length,s=new Array(i),o=a,u=function(w){for(var E=0;E0;){if(E(),x++,w===v){for(var S=[],k=i,B=v,D=p[B];S.unshift(k),D!=null&&S.unshift(D),k=g[B],k!=null;)B=k.id(),D=p[B];return{found:!0,distance:f[w],path:this.spawn(S),steps:x}}h[w]=!0;for(var P=b._private.edges,A=0;AD&&(d[B]=D,m[B]=k,b[B]=E),!i){var P=k*v+S;!i&&d[P]>D&&(d[P]=D,m[P]=S,b[P]=E)}}}for(var A=0;A1&&arguments[1]!==void 0?arguments[1]:s,se=b(me),de=[],ce=se;;){if(ce==null)return t.spawn();var xe=m(ce),be=xe.edge,Se=xe.pred;if(de.unshift(ce[0]),ce.same(ge)&&de.length>0)break;be!=null&&de.unshift(be),ce=Se}return u.spawn(de)},C=0;C=0;v--){var f=l[v],c=f[1],h=f[2];(t[c]===o&&t[h]===u||t[c]===u&&t[h]===o)&&l.splice(v,1)}for(var d=0;dn;){var i=Math.floor(Math.random()*t.length);t=pd(i,e,t),a--}return t},yd={kargerStein:function(){var e=this,t=this.byGroup(),a=t.nodes,n=t.edges;n.unmergeBy(function(O){return O.isLoop()});var i=a.length,s=n.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/gd);if(i<2){He("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],v=0;v1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=t;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=t;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,s=t;s1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(t,a):(a0&&e.splice(0,t));for(var o=0,u=e.length-1;u>=0;u--){var l=e[u];s?isFinite(l)||(e[u]=-1/0,o++):e.splice(u,1)}i&&e.sort(function(c,h){return c-h});var v=e.length,f=Math.floor(v/2);return v%2!==0?e[f+1+o]:(e[f-1+o]+e[f+o])/2},Cd=function(e){return Math.PI*e/180},Ya=function(e,t){return Math.atan2(t,e)-Math.PI/2},ro=Math.log2||function(r){return Math.log(r)/Math.log(2)},to=function(e){return e>0?1:e<0?-1:0},Dt=function(e,t){return Math.sqrt(xt(e,t))},xt=function(e,t){var a=t.x-e.x,n=t.y-e.y;return a*a+n*n},Td=function(e){for(var t=e.length,a=0,n=0;n=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},kd=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},Dd=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Bd=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},mv=function(e,t,a){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},un=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ln=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,s;if(t.length===1)a=n=i=s=t[0];else if(t.length===2)a=i=t[0],s=n=t[1];else if(t.length===4){var o=Qe(t,4);a=o[0],n=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Uo=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},ao=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2t.y2||t.y1>e.y2)},at=function(e,t,a){return e.x1<=t&&t<=e.x2&&e.y1<=a&&a<=e.y2},Ko=function(e,t){return at(e,t.x,t.y)},bv=function(e,t){return at(e,t.x1,t.y1)&&at(e,t.x2,t.y2)},Pd=(gi=Math.hypot)!==null&&gi!==void 0?gi:function(r,e){return Math.sqrt(r*r+e*e)};function Ad(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(S,k){return{x:S.x+k.x,y:S.y+k.y}},a=function(S,k){return{x:S.x-k.x,y:S.y-k.y}},n=function(S,k){return{x:S.x*k,y:S.y*k}},i=function(S,k){return S.x*k.y-S.y*k.x},s=function(S){var k=Pd(S.x,S.y);return k===0?{x:0,y:0}:{x:S.x/k,y:S.y/k}},o=function(S){for(var k=0,B=0;B7&&arguments[7]!==void 0?arguments[7]:"auto",l=u==="auto"?lt(i,s):u,v=i/2,f=s/2;l=Math.min(l,v,f);var c=l!==v,h=l!==f,d;if(c){var y=a-v+l-o,g=n-f-o,p=a+v-l+o,m=g;if(d=nt(e,t,a,n,y,g,p,m,!1),d.length>0)return d}if(h){var b=a+v+o,w=n-f+l-o,E=b,C=n+f-l+o;if(d=nt(e,t,a,n,b,w,E,C,!1),d.length>0)return d}if(c){var x=a-v+l-o,S=n+f+o,k=a+v-l+o,B=S;if(d=nt(e,t,a,n,x,S,k,B,!1),d.length>0)return d}if(h){var D=a-v-o,P=n-f+l-o,A=D,R=n+f-l+o;if(d=nt(e,t,a,n,D,P,A,R,!1),d.length>0)return d}var L;{var I=a-v+l,M=n-f+l;if(L=ya(e,t,a,n,I,M,l+o),L.length>0&&L[0]<=I&&L[1]<=M)return[L[0],L[1]]}{var O=a+v-l,q=n-f+l;if(L=ya(e,t,a,n,O,q,l+o),L.length>0&&L[0]>=O&&L[1]<=q)return[L[0],L[1]]}{var _=a+v-l,N=n+f-l;if(L=ya(e,t,a,n,_,N,l+o),L.length>0&&L[0]>=_&&L[1]>=N)return[L[0],L[1]]}{var V=a-v+l,Y=n+f-l;if(L=ya(e,t,a,n,V,Y,l+o),L.length>0&&L[0]<=V&&L[1]>=Y)return[L[0],L[1]]}return[]},Md=function(e,t,a,n,i,s,o){var u=o,l=Math.min(a,i),v=Math.max(a,i),f=Math.min(n,s),c=Math.max(n,s);return l-u<=e&&e<=v+u&&f-u<=t&&t<=c+u},Ld=function(e,t,a,n,i,s,o,u,l){var v={x1:Math.min(a,o,i)-l,x2:Math.max(a,o,i)+l,y1:Math.min(n,u,s)-l,y2:Math.max(n,u,s)+l};return!(ev.x2||tv.y2)},Id=function(e,t,a,n){a-=n;var i=t*t-4*e*a;if(i<0)return[];var s=Math.sqrt(i),o=2*e,u=(-t+s)/o,l=(-t-s)/o;return[u,l]},Od=function(e,t,a,n,i){var s=1e-5;e===0&&(e=s),t/=e,a/=e,n/=e;var o,u,l,v,f,c,h,d;if(u=(3*a-t*t)/9,l=-(27*n)+t*(9*a-2*(t*t)),l/=54,o=u*u*u+l*l,i[1]=0,h=t/3,o>0){f=l+Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),c=l-Math.sqrt(o),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-h+f+c,h+=(f+c)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-c+f)/2,i[3]=h,i[5]=-h;return}if(i[5]=i[3]=0,o===0){d=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-h+2*d,i[4]=i[2]=-(d+h);return}u=-u,v=u*u*u,v=Math.acos(l/Math.sqrt(v)),d=2*Math.sqrt(u),i[0]=-h+d*Math.cos(v/3),i[2]=-h+d*Math.cos((v+2*Math.PI)/3),i[4]=-h+d*Math.cos((v+4*Math.PI)/3)},Nd=function(e,t,a,n,i,s,o,u){var l=1*a*a-4*a*i+2*a*o+4*i*i-4*i*o+o*o+n*n-4*n*s+2*n*u+4*s*s-4*s*u+u*u,v=9*a*i-3*a*a-3*a*o-6*i*i+3*i*o+9*n*s-3*n*n-3*n*u-6*s*s+3*s*u,f=3*a*a-6*a*i+a*o-a*e+2*i*i+2*i*e-o*e+3*n*n-6*n*s+n*u-n*t+2*s*s+2*s*t-u*t,c=1*a*i-a*a+a*e-i*e+n*s-n*n+n*t-s*t,h=[];Od(l,v,f,c,h);for(var d=1e-7,y=[],g=0;g<6;g+=2)Math.abs(h[g+1])=0&&h[g]<=1&&y.push(h[g]);y.push(1),y.push(0);for(var p=-1,m,b,w,E=0;E=0?wl?(e-i)*(e-i)+(t-s)*(t-s):v-c},Er=function(e,t,a){for(var n,i,s,o,u,l=0,v=0;v=e&&e>=s||n<=e&&e<=s)u=(e-n)/(s-n)*(o-i)+i,u>t&&l++;else continue;return l%2!==0},Yr=function(e,t,a,n,i,s,o,u,l){var v=new Array(a.length),f;u[0]!=null?(f=Math.atan(u[1]/u[0]),u[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=u;for(var c=Math.cos(-f),h=Math.sin(-f),d=0;d0){var g=Cn(v,-l);y=En(g)}else y=v;return Er(e,t,y)},Fd=function(e,t,a,n,i,s,o,u){for(var l=new Array(a.length*2),v=0;v=0&&g<=1&&m.push(g),p>=0&&p<=1&&m.push(p),m.length===0)return[];var b=m[0]*u[0]+e,w=m[0]*u[1]+t;if(m.length>1){if(m[0]==m[1])return[b,w];var E=m[1]*u[0]+e,C=m[1]*u[1]+t;return[b,w,E,C]}else return[b,w]},pi=function(e,t,a){return t<=e&&e<=a||a<=e&&e<=t?e:e<=t&&t<=a||a<=t&&t<=e?t:a},nt=function(e,t,a,n,i,s,o,u,l){var v=e-i,f=a-e,c=o-i,h=t-s,d=n-t,y=u-s,g=c*h-y*v,p=f*h-d*v,m=y*f-c*d;if(m!==0){var b=g/m,w=p/m,E=.001,C=0-E,x=1+E;return C<=b&&b<=x&&C<=w&&w<=x?[e+b*f,t+b*d]:l?[e+b*f,t+b*d]:[]}else return g===0||p===0?pi(e,a,o)===o?[o,u]:pi(e,a,i)===i?[i,s]:pi(i,o,a)===a?[a,n]:[]:[]},qd=function(e,t,a,n,i){var s=[],o=n/2,u=i/2,l=t,v=a;s.push({x:l+o*e[0],y:v+u*e[1]});for(var f=1;f0){var y=Cn(f,-u);h=En(y)}else h=f}else h=a;for(var g,p,m,b,w=0;w2){for(var d=[v[0],v[1]],y=Math.pow(d[0]-e,2)+Math.pow(d[1]-t,2),g=1;gv&&(v=w)},get:function(b){return l[b]}},c=0;c0?L=R.edgesTo(A)[0]:L=A.edgesTo(R)[0];var I=n(L);A=A.id(),x[A]>x[D]+I&&(x[A]=x[D]+I,S.nodes.indexOf(A)<0?S.push(A):S.updateItem(A),C[A]=0,E[A]=[]),x[A]==x[D]+I&&(C[A]=C[A]+C[D],E[A].push(D))}else for(var M=0;M0;){for(var N=w.pop(),V=0;V0&&o.push(a[u]);o.length!==0&&i.push(n.collection(o))}return i},rh=function(e,t){for(var a=0;a5&&arguments[5]!==void 0?arguments[5]:nh,o=n,u,l,v=0;v=2?va(e,t,a,0,Jo,ih):va(e,t,a,0,Qo)},squaredEuclidean:function(e,t,a){return va(e,t,a,0,Jo)},manhattan:function(e,t,a){return va(e,t,a,0,Qo)},max:function(e,t,a){return va(e,t,a,-1/0,sh)}};Zt["squared-euclidean"]=Zt.squaredEuclidean;Zt.squaredeuclidean=Zt.squaredEuclidean;function Nn(r,e,t,a,n,i){var s;return $e(r)?s=r:s=Zt[r]||Zt.euclidean,e===0&&$e(r)?s(n,i):s(e,t,a,n,i)}var oh=vr({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),io=function(e){return oh(e)},Tn=function(e,t,a,n,i){var s=i!=="kMedoids",o=s?function(f){return a[f]}:function(f){return n[f](a)},u=function(c){return n[c](t)},l=a,v=t;return Nn(e,n.length,o,u,l,v)},mi=function(e,t,a){for(var n=a.length,i=new Array(n),s=new Array(n),o=new Array(t),u=null,l=0;la)return!1}return!0},vh=function(e,t,a){for(var n=0;no&&(o=t[l][v],u=v);i[u].push(e[l])}for(var f=0;f=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=t[s],y=t[n[s]],g;i.mode==="dendrogram"?g={left:d,right:y,key:d.key}:g={value:d.value.concat(y.value),key:d.key},e[d.index]=g,e.splice(y.index,1),t[d.key]=g;for(var p=0;pa[y.key][m.key]&&(u=a[y.key][m.key])):i.linkage==="max"?(u=a[d.key][m.key],a[d.key][m.key]0&&n.push(i);return n},nu=function(e,t,a){for(var n=[],i=0;io&&(s=l,o=t[i*e+l])}s>0&&n.push(s)}for(var v=0;vl&&(u=v,l=f)}a[i]=s[u]}return n=nu(e,t,a),n},iu=function(e){for(var t=this.cy(),a=this.nodes(),n=Eh(e),i={},s=0;s=D?(P=D,D=R,A=L):R>P&&(P=R);for(var I=0;I0?1:0;x[k%n.minIterations*o+V]=Y,N+=Y}if(N>0&&(k>=n.minIterations-1||k==n.maxIterations-1)){for(var J=0,Z=0;Z1||C>1)&&(o=!0),f[b]=[],m.outgoers().forEach(function(S){S.isEdge()&&f[b].push(S.id())})}else c[b]=[void 0,m.target().id()]}):s.forEach(function(m){var b=m.id();if(m.isNode()){var w=m.degree(!0);w%2&&(u?l?o=!0:l=b:u=b),f[b]=[],m.connectedEdges().forEach(function(E){return f[b].push(E.id())})}else c[b]=[m.source().id(),m.target().id()]});var h={found:!1,trail:void 0};if(o)return h;if(l&&u)if(i){if(v&&l!=v)return h;v=l}else{if(v&&l!=v&&u!=v)return h;v||(v=l)}else v||(v=s[0].id());var d=function(b){for(var w=b,E=[b],C,x,S;f[w].length;)C=f[w].shift(),x=c[C][0],S=c[C][1],w!=S?(f[S]=f[S].filter(function(k){return k!=C}),w=S):!i&&w!=x&&(f[x]=f[x].filter(function(k){return k!=C}),w=x),E.unshift(C),E.unshift(w);return E},y=[],g=[];for(g=d(v);g.length!=1;)f[g[0]].length==0?(y.unshift(s.getElementById(g.shift())),y.unshift(s.getElementById(g.shift()))):g=d(g.shift()).concat(g);y.unshift(s.getElementById(g.shift()));for(var p in f)if(f[p].length)return h;return h.found=!0,h.trail=this.spawn(y,!0),h}},Qa=function(){var e=this,t={},a=0,n=0,i=[],s=[],o={},u=function(c,h){for(var d=s.length-1,y=[],g=e.spawn();s[d].x!=c||s[d].y!=h;)y.push(s.pop().edge),d--;y.push(s.pop().edge),y.forEach(function(p){var m=p.connectedNodes().intersection(e);g.merge(p),m.forEach(function(b){var w=b.id(),E=b.connectedEdges().intersection(e);g.merge(b),t[w].cutVertex?g.merge(E.filter(function(C){return C.isLoop()})):g.merge(E)})}),i.push(g)},l=function(c,h,d){c===d&&(n+=1),t[h]={id:a,low:a++,cutVertex:!1};var y=e.getElementById(h).connectedEdges().intersection(e);if(y.size()===0)i.push(e.spawn(e.getElementById(h)));else{var g,p,m,b;y.forEach(function(w){g=w.source().id(),p=w.target().id(),m=g===h?p:g,m!==d&&(b=w.id(),o[b]||(o[b]=!0,s.push({x:h,y:m,edge:w})),m in t?t[h].low=Math.min(t[h].low,t[m].id):(l(c,m,h),t[h].low=Math.min(t[h].low,t[m].low),t[h].id<=t[m].low&&(t[h].cutVertex=!0,u(h,m))))})}};e.forEach(function(f){if(f.isNode()){var c=f.id();c in t||(n=0,l(c,c),t[c].cutVertex=n>1)}});var v=Object.keys(t).filter(function(f){return t[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(v),components:i}},Ah={hopcroftTarjanBiconnected:Qa,htbc:Qa,htb:Qa,hopcroftTarjanBiconnectedComponents:Qa},Ja=function(){var e=this,t={},a=0,n=[],i=[],s=e.spawn(e),o=function(l){i.push(l),t[l]={index:a,low:a++,explored:!1};var v=e.getElementById(l).connectedEdges().intersection(e);if(v.forEach(function(y){var g=y.target().id();g!==l&&(g in t||o(g),t[g].explored||(t[l].low=Math.min(t[l].low,t[g].low)))}),t[l].index===t[l].low){for(var f=e.spawn();;){var c=i.pop();if(f.merge(e.getElementById(c)),t[c].low=t[l].index,t[c].explored=!0,c===l)break}var h=f.edgesWith(f),d=f.merge(h);n.push(d),s=s.difference(d)}};return e.forEach(function(u){if(u.isNode()){var l=u.id();l in t||o(l)}}),{cut:s,components:n}},Rh={tarjanStronglyConnected:Ja,tsc:Ja,tscc:Ja,tarjanStronglyConnectedComponents:Ja},Dv={};[Sa,od,ud,vd,cd,hd,yd,Wd,Ut,Kt,Rs,ah,ph,wh,Dh,Ph,Ah,Rh].forEach(function(r){ye(Dv,r)});var Bv=0,Pv=1,Av=2,Or=function(e){if(!(this instanceof Or))return new Or(e);this.id="Thenable/1.0.7",this.state=Bv,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Or.prototype={fulfill:function(e){return su(this,Pv,"fulfillValue",e)},reject:function(e){return su(this,Av,"rejectReason",e)},then:function(e,t){var a=this,n=new Or;return a.onFulfilled.push(uu(e,n,"fulfill")),a.onRejected.push(uu(t,n,"reject")),Rv(a),n.proxy}};var su=function(e,t,a,n){return e.state===Bv&&(e.state=t,e[a]=n,Rv(e)),e},Rv=function(e){e.state===Pv?ou(e,"onFulfilled",e.fulfillValue):e.state===Av&&ou(e,"onRejected",e.rejectReason)},ou=function(e,t,a){if(e[t].length!==0){var n=e[t];e[t]=[];var i=function(){for(var o=0;o0}},clearQueue:function(){return function(){var t=this,a=t.length!==void 0,n=a?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s-1}return qi=e,qi}var _i,Ru;function Zh(){if(Ru)return _i;Ru=1;var r=Vn();function e(t,a){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,a])):n[i][1]=a,this}return _i=e,_i}var Gi,Mu;function Qh(){if(Mu)return Gi;Mu=1;var r=Uh(),e=Kh(),t=Xh(),a=Yh(),n=Zh();function i(s){var o=-1,u=s==null?0:s.length;for(this.clear();++o-1&&a%1==0&&a0&&this.spawn(n).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){Ve(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=t===void 0,i=[],s=0,o=a.length;s0&&this.spawn(i).updateStyle().emit("class"),a},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var a=this;if(t==null)t=250;else if(t===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},t),a}};vn.className=vn.classNames=vn.classes;var Re={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:er,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Re.variable="(?:[\\w-.]|(?:\\\\"+Re.metaChar+"))+";Re.className="(?:[\\w-]|(?:\\\\"+Re.metaChar+"))+";Re.value=Re.string+"|"+Re.number;Re.id=Re.variable;(function(){var r,e,t;for(r=Re.comparatorOp.split("|"),t=0;t=0)&&e!=="="&&(Re.comparatorOp+="|\\!"+e)})();var Fe=function(){return{checks:[]}},ue={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Os=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(r,e){return Sc(r.selector,e.selector)}),Bg=(function(){for(var r={},e,t=0;t0&&v.edgeCount>0)return ze("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(v.edgeCount>1)return ze("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;v.edgeCount===1&&ze("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},Ig=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(v){return v??""},t=function(v){return he(v)?'"'+v+'"':e(v)},a=function(v){return" "+v+" "},n=function(v,f){var c=v.type,h=v.value;switch(c){case ue.GROUP:{var d=e(h);return d.substring(0,d.length-1)}case ue.DATA_COMPARE:{var y=v.field,g=v.operator;return"["+y+a(e(g))+t(h)+"]"}case ue.DATA_BOOL:{var p=v.operator,m=v.field;return"["+e(p)+m+"]"}case ue.DATA_EXIST:{var b=v.field;return"["+b+"]"}case ue.META_COMPARE:{var w=v.operator,E=v.field;return"[["+E+a(e(w))+t(h)+"]]"}case ue.STATE:return h;case ue.ID:return"#"+h;case ue.CLASS:return"."+h;case ue.PARENT:case ue.CHILD:return i(v.parent,f)+a(">")+i(v.child,f);case ue.ANCESTOR:case ue.DESCENDANT:return i(v.ancestor,f)+" "+i(v.descendant,f);case ue.COMPOUND_SPLIT:{var C=i(v.left,f),x=i(v.subject,f),S=i(v.right,f);return C+(C.length>0?" ":"")+x+S}case ue.TRUE:return""}},i=function(v,f){return v.checks.reduce(function(c,h,d){return c+(f===v&&d===0?"$":"")+n(h,f)},"")},s="",o=0;o1&&o=0&&(t=t.replace("!",""),f=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),v=!0),(i||o||v)&&(u=!i&&!s?"":""+e,l=""+a),v&&(e=u=u.toLowerCase(),a=l=l.toLowerCase()),t){case"*=":n=u.indexOf(l)>=0;break;case"$=":n=u.indexOf(l,u.length-l.length)>=0;break;case"^=":n=u.indexOf(l)===0;break;case"=":n=e===a;break;case">":c=!0,n=e>a;break;case">=":c=!0,n=e>=a;break;case"<":c=!0,n=e0;){var v=n.shift();e(v),i.add(v.id()),o&&a(n,i,v)}return r}function Vv(r,e,t){if(t.isParent())for(var a=t._private.children,n=0;n1&&arguments[1]!==void 0?arguments[1]:!0;return lo(this,r,e,Vv)};function qv(r,e,t){if(t.isChild()){var a=t._private.parent;e.has(a.id())||r.push(a)}}Qt.forEachUp=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return lo(this,r,e,qv)};function Gg(r,e,t){qv(r,e,t),Vv(r,e,t)}Qt.forEachUpAndDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return lo(this,r,e,Gg)};Qt.ancestors=Qt.parents;var Ba,_v;Ba=_v={data:Ne.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Ne.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ne.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ne.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ne.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ne.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};Ba.attr=Ba.data;Ba.removeAttr=Ba.removeData;var Hg=_v,_n={};function ps(r){return function(e){var t=this;if(e===void 0&&(e=!0),t.length!==0)if(t.isNode()&&!t.removed()){for(var a=0,n=t[0],i=n._private.edges,s=0;se}),minIndegree:It("indegree",function(r,e){return re}),minOutdegree:It("outdegree",function(r,e){return re})});ye(_n,{totalDegree:function(e){for(var t=0,a=this.nodes(),n=0;n0,c=f;f&&(v=v[0]);var h=c?v.position():{x:0,y:0};t!==void 0?l.position(e,t+h[e]):i!==void 0&&l.position({x:i.x+h.x,y:i.y+h.y})}else{var d=a.position(),y=o?a.parent():null,g=y&&y.length>0,p=g;g&&(y=y[0]);var m=p?y.position():{x:0,y:0};return i={x:d.x-m.x,y:d.y-m.y},e===void 0?i:i[e]}else if(!s)return;return this}};Ir.modelPosition=Ir.point=Ir.position;Ir.modelPositions=Ir.points=Ir.positions;Ir.renderedPoint=Ir.renderedPosition;Ir.relativePoint=Ir.relativePosition;var Wg=Gv,Jt=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},jt=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},$g=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},Xt,gt;Xt=gt={};gt.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),a=t.zoom(),n=t.pan(),i=e.x1*a+n.x,s=e.x2*a+n.x,o=e.y1*a+n.y,u=e.y2*a+n.y;return{x1:i,x2:s,y1:o,y2:u,w:s-i,h:u-o}};gt.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(t){if(t.isParent()){var a=t._private;a.compoundBoundsClean=!1,a.bbCache=null,r||t.emitAndNotify("bounds")}}),this)};gt.updateCompoundBounds=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(s){if(!s.isParent())return;var o=s._private,u=s.children(),l=s.pstyle("compound-sizing-wrt-labels").value==="include",v={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},f=u.boundingBox({includeLabels:l,includeOverlays:!1,useCache:!1}),c=o.position;(f.w===0||f.h===0)&&(f={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},f.x1=c.x-f.w/2,f.x2=c.x+f.w/2,f.y1=c.y-f.h/2,f.y2=c.y+f.h/2);function h(k,B,D){var P=0,A=0,R=B+D;return k>0&&R>0&&(P=B/R*k,A=D/R*k),{biasDiff:P,biasComplementDiff:A}}function d(k,B,D,P){if(D.units==="%")switch(P){case"width":return k>0?D.pfValue*k:0;case"height":return B>0?D.pfValue*B:0;case"average":return k>0&&B>0?D.pfValue*(k+B)/2:0;case"min":return k>0&&B>0?k>B?D.pfValue*B:D.pfValue*k:0;case"max":return k>0&&B>0?k>B?D.pfValue*k:D.pfValue*B:0;default:return 0}else return D.units==="px"?D.pfValue:0}var y=v.width.left.value;v.width.left.units==="px"&&v.width.val>0&&(y=y*100/v.width.val);var g=v.width.right.value;v.width.right.units==="px"&&v.width.val>0&&(g=g*100/v.width.val);var p=v.height.top.value;v.height.top.units==="px"&&v.height.val>0&&(p=p*100/v.height.val);var m=v.height.bottom.value;v.height.bottom.units==="px"&&v.height.val>0&&(m=m*100/v.height.val);var b=h(v.width.val-f.w,y,g),w=b.biasDiff,E=b.biasComplementDiff,C=h(v.height.val-f.h,p,m),x=C.biasDiff,S=C.biasComplementDiff;o.autoPadding=d(f.w,f.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(f.w,v.width.val),c.x=(-w+f.x1+f.x2+E)/2,o.autoHeight=Math.max(f.h,v.height.val),c.y=(-x+f.y1+f.y2+S)/2}for(var a=0;ae.x2?n:e.x2,e.y1=ae.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},rt=function(e,t){return t==null?e:Lr(e,t.x1,t.y1,t.x2,t.y2)},fa=function(e,t,a){return yr(e,t,a)},ja=function(e,t,a){if(!t.cy().headless()){var n=t._private,i=n.rstyle,s=i.arrowWidth/2,o=t.pstyle(a+"-arrow-shape").value,u,l;if(o!=="none"){a==="source"?(u=i.srcX,l=i.srcY):a==="target"?(u=i.tgtX,l=i.tgtY):(u=i.midX,l=i.midY);var v=n.arrowBounds=n.arrowBounds||{},f=v[a]=v[a]||{};f.x1=u-s,f.y1=l-s,f.x2=u+s,f.y2=l+s,f.w=f.x2-f.x1,f.h=f.y2-f.y1,un(f,1),Lr(e,f.x1,f.y1,f.x2,f.y2)}}},ys=function(e,t,a){if(!t.cy().headless()){var n;a?n=a+"-":n="";var i=t._private,s=i.rstyle,o=t.pstyle(n+"label").strValue;if(o){var u=t.pstyle("text-halign"),l=t.pstyle("text-valign"),v=fa(s,"labelWidth",a),f=fa(s,"labelHeight",a),c=fa(s,"labelX",a),h=fa(s,"labelY",a),d=t.pstyle(n+"text-margin-x").pfValue,y=t.pstyle(n+"text-margin-y").pfValue,g=t.isEdge(),p=t.pstyle(n+"text-rotation"),m=t.pstyle("text-outline-width").pfValue,b=t.pstyle("text-border-width").pfValue,w=b/2,E=t.pstyle("text-background-padding").pfValue,C=2,x=f,S=v,k=S/2,B=x/2,D,P,A,R;if(g)D=c-k,P=c+k,A=h-B,R=h+B;else{switch(Jt(u.value)){case"left":D=c-S,P=c;break;case"center":D=c-k,P=c+k;break;case"right":D=c,P=c+S;break}switch(jt(l.value)){case"top":A=h-x,R=h;break;case"center":A=h-B,R=h+B;break;case"bottom":A=h,R=h+x;break}}var L=d-Math.max(m,w)-E-C,I=d+Math.max(m,w)+E+C,M=y-Math.max(m,w)-E-C,O=y+Math.max(m,w)+E+C;D+=L,P+=I,A+=M,R+=O;var q=a||"main",_=i.labelBounds,N=_[q]=_[q]||{};N.x1=D,N.y1=A,N.x2=P,N.y2=R,N.w=P-D,N.h=R-A,N.leftPad=L,N.rightPad=I,N.topPad=M,N.botPad=O;var V=g&&p.strValue==="autorotate",Y=p.pfValue!=null&&p.pfValue!==0;if(V||Y){var J=V?fa(i.rstyle,"labelAngle",a):p.pfValue,Z=Math.cos(J),ee=Math.sin(J),re=(D+P)/2,ne=(A+R)/2;if(!g){switch(Jt(u.value)){case"left":re=P;break;case"right":re=D;break}switch(jt(l.value)){case"top":ne=R;break;case"bottom":ne=A;break}}var X=function(we,me){return we=we-re,me=me-ne,{x:we*Z-me*ee+re,y:we*ee+me*Z+ne}},F=X(D,A),H=X(D,R),W=X(P,A),U=X(P,R);D=Math.min(F.x,H.x,W.x,U.x),P=Math.max(F.x,H.x,W.x,U.x),A=Math.min(F.y,H.y,W.y,U.y),R=Math.max(F.y,H.y,W.y,U.y)}var te=q+"Rot",le=_[te]=_[te]||{};le.x1=D,le.y1=A,le.x2=P,le.y2=R,le.w=P-D,le.h=R-A,Lr(e,D,A,P,R),Lr(i.labelBounds.all,D,A,P,R)}return e}},ol=function(e,t){if(!t.cy().headless()){var a=t.pstyle("outline-opacity").value,n=t.pstyle("outline-width").value,i=t.pstyle("outline-offset").value,s=n+i;Wv(e,t,a,s,"outside",s/2)}},Wv=function(e,t,a,n,i,s){if(!(a===0||n<=0||i==="inside")){var o=t.cy(),u=o.renderer(),l=u.nodeShapes[u.getNodeShape(t)];if(l){var v=t.position(),f=v.x,c=v.y,h=t.width(),d=t.height();if(l.hasMiterBounds){i==="center"&&(n/=2);var y=l.miterBounds(f,c,h,d,n);rt(e,y)}else s!=null&&s>0&&ln(e,[s,s,s,s])}}},Ug=function(e,t){if(!t.cy().headless()){var a=t.pstyle("border-opacity").value,n=t.pstyle("border-width").pfValue,i=t.pstyle("border-position").value;Wv(e,t,a,n,i)}},Kg=function(e,t){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),s=mr(),o=e._private,u=e.isNode(),l=e.isEdge(),v,f,c,h,d,y,g=o.rstyle,p=u&&n?e.pstyle("bounds-expansion").pfValue:[0],m=function(De){return De.pstyle("display").value!=="none"},b=!n||m(e)&&(!l||m(e.source())&&m(e.target()));if(b){var w=0,E=0;n&&t.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(E=e.pstyle("overlay-padding").value));var C=0,x=0;n&&t.includeUnderlays&&(C=e.pstyle("underlay-opacity").value,C!==0&&(x=e.pstyle("underlay-padding").value));var S=Math.max(E,x),k=0,B=0;if(n&&(k=e.pstyle("width").pfValue,B=k/2),u&&t.includeNodes){var D=e.position();d=D.x,y=D.y;var P=e.outerWidth(),A=P/2,R=e.outerHeight(),L=R/2;v=d-A,f=d+A,c=y-L,h=y+L,Lr(s,v,c,f,h),n&&ol(s,e),n&&t.includeOutlines&&!i&&ol(s,e),n&&Ug(s,e)}else if(l&&t.includeEdges)if(n&&!i){var I=e.pstyle("curve-style").strValue;if(v=Math.min(g.srcX,g.midX,g.tgtX),f=Math.max(g.srcX,g.midX,g.tgtX),c=Math.min(g.srcY,g.midY,g.tgtY),h=Math.max(g.srcY,g.midY,g.tgtY),v-=B,f+=B,c-=B,h+=B,Lr(s,v,c,f,h),I==="haystack"){var M=g.haystackPts;if(M&&M.length===2){if(v=M[0].x,c=M[0].y,f=M[1].x,h=M[1].y,v>f){var O=v;v=f,f=O}if(c>h){var q=c;c=h,h=q}Lr(s,v-B,c-B,f+B,h+B)}}else if(I==="bezier"||I==="unbundled-bezier"||tt(I,"segments")||tt(I,"taxi")){var _;switch(I){case"bezier":case"unbundled-bezier":_=g.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":_=g.linePts;break}if(_!=null)for(var N=0;N<_.length;N++){var V=_[N];v=V.x-B,f=V.x+B,c=V.y-B,h=V.y+B,Lr(s,v,c,f,h)}}}else{var Y=e.source(),J=Y.position(),Z=e.target(),ee=Z.position();if(v=J.x,f=ee.x,c=J.y,h=ee.y,v>f){var re=v;v=f,f=re}if(c>h){var ne=c;c=h,h=ne}v-=B,f+=B,c-=B,h+=B,Lr(s,v,c,f,h)}if(n&&t.includeEdges&&l&&(ja(s,e,"mid-source"),ja(s,e,"mid-target"),ja(s,e,"source"),ja(s,e,"target")),n){var X=e.pstyle("ghost").value==="yes";if(X){var F=e.pstyle("ghost-offset-x").pfValue,H=e.pstyle("ghost-offset-y").pfValue;Lr(s,s.x1+F,s.y1+H,s.x2+F,s.y2+H)}}var W=o.bodyBounds=o.bodyBounds||{};Uo(W,s),ln(W,p),un(W,1),n&&(v=s.x1,f=s.x2,c=s.y1,h=s.y2,Lr(s,v-S,c-S,f+S,h+S));var U=o.overlayBounds=o.overlayBounds||{};Uo(U,s),ln(U,p),un(U,1);var te=o.labelBounds=o.labelBounds||{};te.all!=null?Dd(te.all):te.all=mr(),n&&t.includeLabels&&(t.includeMainLabels&&ys(s,e,null),l&&(t.includeSourceLabels&&ys(s,e,"source"),t.includeTargetLabels&&ys(s,e,"target")))}return s.x1=Dr(s.x1),s.y1=Dr(s.y1),s.x2=Dr(s.x2),s.y2=Dr(s.y2),s.w=Dr(s.x2-s.x1),s.h=Dr(s.y2-s.y1),s.w>0&&s.h>0&&b&&(ln(s,p),un(s,1)),s},$v=function(e){var t=0,a=function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:up,e=arguments.length>1?arguments[1]:void 0,t=0;t=0;o--)s(o);return this};ct.removeAllListeners=function(){return this.removeListener("*")};ct.emit=ct.trigger=function(r,e,t){var a=this.listeners,n=a.length;return this.emitting++,Ve(e)||(e=[e]),lp(this,function(i,s){t!=null&&(a=[{event:s.event,type:s.type,namespace:s.namespace,callback:t}],n=a.length);for(var o=function(){var v=a[u];if(v.type===s.type&&(!v.namespace||v.namespace===s.namespace||v.namespace===op)&&i.eventMatches(i.context,v,s)){var f=[s];e!=null&&Jc(f,e),i.beforeEmit(i.context,v,s),v.conf&&v.conf.one&&(i.listeners=i.listeners.filter(function(d){return d!==v}));var c=i.callbackContext(i.context,v,s),h=v.callback.apply(c,f);i.afterEmit(i.context,v,s),h===!1&&(s.stopPropagation(),s.preventDefault())}},u=0;u1&&!s){var o=this.length-1,u=this[o],l=u._private.data.id;this[o]=void 0,this[e]=u,i.set(l,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,a=e._private.data.id,n=t.map,i=n.get(a);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&he(e)){var a=e;e=t.mutableElements().filter(a)}for(var n=0;n=0;t--){var a=this[t];e(a)&&this.unmergeAt(t)}return this},map:function(e,t){for(var a=[],n=this,i=0;ia&&(a=u,n=o)}return{value:a,ele:n}},min:function(e,t){for(var a=1/0,n,i=this,s=0;s=0&&i"u"?"undefined":rr(Symbol))!=e&&rr(Symbol.iterator)!=e;t&&(Sn[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,s=this.length;return Jl({next:function(){return i1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(n.styleEnabled()&&a){a._private.styleDirty&&(a._private.styleDirty=!1,n.style().apply(a));var i=a._private.style[e];return i??(t?n.style().getDefaultProperty(e):null)}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var a=t.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var a=this[0];if(a)return t.style().getRenderedStyle(a,e)},style:function(e,t){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(Me(e)){var s=e;i.applyBypass(this,s,n),this.emitAndNotify("style")}else if(he(e))if(t===void 0){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}else i.applyBypass(this,e,t,n),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var a=!1,n=t.style(),i=this;if(e===void 0)for(var s=0;s0&&e.push(v[0]),e.push(o[0])}return this.spawn(e,!0).filter(r)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});dr.neighbourhood=dr.neighborhood;dr.closedNeighbourhood=dr.closedNeighborhood;dr.openNeighbourhood=dr.openNeighborhood;ye(dr,{source:Br(function(e){var t=this[0],a;return t&&(a=t._private.source||t.cy().collection()),a&&e?a.filter(e):a},"source"),target:Br(function(e){var t=this[0],a;return t&&(a=t._private.target||t.cy().collection()),a&&e?a.filter(e):a},"target"),sources:ml({attr:"source"}),targets:ml({attr:"target"})});function ml(r){return function(t){for(var a=[],n=0;n0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});dr.componentsOf=dr.components;var lr=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){He("A collection must have a reference to the core");return}var i=new Kr,s=!1;if(!t)t=[];else if(t.length>0&&Me(t[0])&&!Ia(t[0])){s=!0;for(var o=[],u=new ra,l=0,v=t.length;l0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=t.cy(),n=a._private,i=[],s=[],o,u=0,l=t.length;u0){for(var q=o.length===t.length?t:new lr(a,o),_=0;_0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=[],n={},i=t._private.cy;function s(R){for(var L=R._private.edges,I=0;I0&&(r?D.emitAndNotify("remove"):e&&D.emit("remove"));for(var P=0;P0?P=R:D=R;while(Math.abs(A)>s&&++L=i?m(B,L):I===0?L:w(B,D,D+l)}var C=!1;function x(){C=!0,(r!==e||t!==a)&&b()}var S=function(D){return C||x(),r===e&&t===a?D:D===0?0:D===1?1:g(E(D),e,a)};S.getControlPoints=function(){return[{x:r,y:e},{x:t,y:a}]};var k="generateBezier("+[r,e,t,a]+")";return S.toString=function(){return k},S}var wp=(function(){function r(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var s={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:s.v,dv:r(s)}}function t(a,n){var i={dx:a.v,dv:r(a)},s=e(a,n*.5,i),o=e(a,n*.5,s),u=e(a,n,o),l=1/6*(i.dx+2*(s.dx+o.dx)+u.dx),v=1/6*(i.dv+2*(s.dv+o.dv)+u.dv);return a.x=a.x+l*n,a.v=a.v+v*n,a}return function a(n,i,s){var o={x:-1,v:0,tension:null,friction:null},u=[0],l=0,v=1/1e4,f=16/1e3,c,h,d;for(n=parseFloat(n)||500,i=parseFloat(i)||20,s=s||null,o.tension=n,o.friction=i,c=s!==null,c?(l=a(n,i),h=l/s*f):h=f;d=t(d||o,h),u.push(1+d.x),l+=16,Math.abs(d.x)>v&&Math.abs(d.v)>v;);return c?function(y){return u[y*(u.length-1)|0]}:l}})(),qe=function(e,t,a,n){var i=bp(e,t,a,n);return function(s,o,u){return s+(o-s)*i(u)}},cn={linear:function(e,t,a){return e+(t-e)*a},ease:qe(.25,.1,.25,1),"ease-in":qe(.42,0,1,1),"ease-out":qe(0,0,.58,1),"ease-in-out":qe(.42,0,.58,1),"ease-in-sine":qe(.47,0,.745,.715),"ease-out-sine":qe(.39,.575,.565,1),"ease-in-out-sine":qe(.445,.05,.55,.95),"ease-in-quad":qe(.55,.085,.68,.53),"ease-out-quad":qe(.25,.46,.45,.94),"ease-in-out-quad":qe(.455,.03,.515,.955),"ease-in-cubic":qe(.55,.055,.675,.19),"ease-out-cubic":qe(.215,.61,.355,1),"ease-in-out-cubic":qe(.645,.045,.355,1),"ease-in-quart":qe(.895,.03,.685,.22),"ease-out-quart":qe(.165,.84,.44,1),"ease-in-out-quart":qe(.77,0,.175,1),"ease-in-quint":qe(.755,.05,.855,.06),"ease-out-quint":qe(.23,1,.32,1),"ease-in-out-quint":qe(.86,0,.07,1),"ease-in-expo":qe(.95,.05,.795,.035),"ease-out-expo":qe(.19,1,.22,1),"ease-in-out-expo":qe(1,0,0,1),"ease-in-circ":qe(.6,.04,.98,.335),"ease-out-circ":qe(.075,.82,.165,1),"ease-in-out-circ":qe(.785,.135,.15,.86),spring:function(e,t,a){if(a===0)return cn.linear;var n=wp(e,t,a);return function(i,s,o){return i+(s-i)*n(o)}},"cubic-bezier":qe};function xl(r,e,t,a,n){if(a===1||e===t)return t;var i=n(e,t,a);return r==null||((r.roundValue||r.color)&&(i=Math.round(i)),r.min!==void 0&&(i=Math.max(i,r.min)),r.max!==void 0&&(i=Math.min(i,r.max))),i}function El(r,e){return r.pfValue!=null||r.value!=null?r.pfValue!=null&&(e==null||e.type.units!=="%")?r.pfValue:r.value:r}function Ot(r,e,t,a,n){var i=n!=null?n.type:null;t<0?t=0:t>1&&(t=1);var s=El(r,n),o=El(e,n);if(ae(s)&&ae(o))return xl(i,s,o,t,a);if(Ve(s)&&Ve(o)){for(var u=[],l=0;l0?(h==="spring"&&d.push(s.duration),s.easingImpl=cn[h].apply(null,d)):s.easingImpl=cn[h]}var y=s.easingImpl,g;if(s.duration===0?g=1:g=(t-u)/s.duration,s.applying&&(g=s.progress),g<0?g=0:g>1&&(g=1),s.delay==null){var p=s.startPosition,m=s.position;if(m&&n&&!r.locked()){var b={};da(p.x,m.x)&&(b.x=Ot(p.x,m.x,g,y)),da(p.y,m.y)&&(b.y=Ot(p.y,m.y,g,y)),r.position(b)}var w=s.startPan,E=s.pan,C=i.pan,x=E!=null&&a;x&&(da(w.x,E.x)&&(C.x=Ot(w.x,E.x,g,y)),da(w.y,E.y)&&(C.y=Ot(w.y,E.y,g,y)),r.emit("pan"));var S=s.startZoom,k=s.zoom,B=k!=null&&a;B&&(da(S,k)&&(i.zoom=ka(i.minZoom,Ot(S,k,g,y),i.maxZoom)),r.emit("zoom")),(x||B)&&r.emit("viewport");var D=s.style;if(D&&D.length>0&&n){for(var P=0;P=0;x--){var S=C[x];S()}C.splice(0,C.length)},m=h.length-1;m>=0;m--){var b=h[m],w=b._private;if(w.stopped){h.splice(m,1),w.hooked=!1,w.playing=!1,w.started=!1,p(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||Ep(v,b,r),xp(v,b,r,f),w.applying&&(w.applying=!1),p(w.frames),w.step!=null&&w.step(r),b.completed()&&(h.splice(m,1),w.hooked=!1,w.playing=!1,w.started=!1,p(w.completes)),y=!0)}return!f&&h.length===0&&d.length===0&&a.push(v),y}for(var i=!1,s=0;s0?e.notify("draw",t):e.notify("draw")),t.unmerge(a),e.emit("step")}var Cp={animate:Ne.animate(),animation:Ne.animation(),animated:Ne.animated(),clearQueue:Ne.clearQueue(),delay:Ne.delay(),delayAnimation:Ne.delayAnimation(),stop:Ne.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&wn(function(i){Cl(i,e),t()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(i,s){Cl(s,e)},a.beforeRenderPriorities.animations):t()}},Tp={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,a){var n=t.qualifier;return n!=null?e!==a.target&&Ia(a.target)&&n.matches(a.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,a){return t.qualifier!=null?a.target:e}},tn=function(e){return he(e)?new vt(e):e},tf={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Gn(Tp,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,a){return this.emitter().on(e,tn(t),a),this},removeListener:function(e,t,a){return this.emitter().removeListener(e,tn(t),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,a){return this.emitter().one(e,tn(t),a),this},once:function(e,t,a){return this.emitter().one(e,tn(t),a),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};Ne.eventAliasesOn(tf);var zs={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};zs.jpeg=zs.jpg;var dn={layout:function(e){var t=this;if(e==null){He("Layout options must be specified to make a layout");return}if(e.name==null){He("A `name` must be specified to make a layout");return}var a=e.name,n=t.extension("layout",a);if(n==null){He("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;he(e.eles)?i=t.$(e.eles):i=e.eles!=null?e.eles:t.$();var s=new n(ye({},e,{cy:t,eles:i}));return s}};dn.createLayout=dn.makeLayout=dn.layout;var Sp={notify:function(e,t){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();t!=null&&n.merge(t);return}if(a.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];n.empty()?t.notify(a):t.notify(a,n)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var a=Object.keys(e),n=0;n0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(a){var n=a._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Fs.invalidateDimensions=Fs.resize;var hn={collection:function(e,t){return he(e)?this.$(e):Tr(e)?e.collection():Ve(e)?(t||(t={}),new lr(this,e,t.unique,t.removed)):new lr(this)},nodes:function(e){var t=this.$(function(a){return a.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(a){return a.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};hn.elements=hn.filter=hn.$;var sr={},wa="t",Dp="f";sr.apply=function(r){for(var e=this,t=e._private,a=t.cy,n=a.collection(),i=0;i0;if(c||f&&h){var d=void 0;c&&h||c?d=l.properties:h&&(d=l.mappedProperties);for(var y=0;y1&&(w=1),o.color){var C=a.valueMin[0],x=a.valueMax[0],S=a.valueMin[1],k=a.valueMax[1],B=a.valueMin[2],D=a.valueMax[2],P=a.valueMin[3]==null?1:a.valueMin[3],A=a.valueMax[3]==null?1:a.valueMax[3],R=[Math.round(C+(x-C)*w),Math.round(S+(k-S)*w),Math.round(B+(D-B)*w),Math.round(P+(A-P)*w)];i={bypass:a.bypass,name:a.name,value:R,strValue:"rgb("+R[0]+", "+R[1]+", "+R[2]+")"}}else if(o.number){var L=a.valueMin+(a.valueMax-a.valueMin)*w;i=this.parse(a.name,L,a.bypass,c)}else return!1;if(!i)return y(),!1;i.mapping=a,a=i;break}case s.data:{for(var I=a.field.split("."),M=f.data,O=0;O0&&i>0){for(var o={},u=!1,l=0;l0?r.delayAnimation(s).play().promise().then(b):b()}).then(function(){return r.animation({style:o,duration:i,easing:r.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){t.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1})}else a.transitioning&&(this.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1)};sr.checkTrigger=function(r,e,t,a,n,i){var s=this.properties[e],o=n(s);r.removed()||o!=null&&o(t,a,r)&&i(s)};sr.checkZOrderTrigger=function(r,e,t,a){var n=this;this.checkTrigger(r,e,t,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",r)})};sr.checkBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBounds},function(n){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache()})};sr.checkConnectedEdgesBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBoundsOfConnectedEdges},function(n){r.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};sr.checkParallelEdgesBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBoundsOfParallelEdges},function(n){r.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};sr.checkTriggers=function(r,e,t,a){r.dirtyStyleCache(),this.checkZOrderTrigger(r,e,t,a),this.checkBoundsTrigger(r,e,t,a),this.checkConnectedEdgesBoundsTrigger(r,e,t,a),this.checkParallelEdgesBoundsTrigger(r,e,t,a)};var _a={};_a.applyBypass=function(r,e,t,a){var n=this,i=[],s=!0;if(e==="*"||e==="**"){if(t!==void 0)for(var o=0;on.length?a=a.substr(n.length):a=""}function u(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var l=a.match(/^\s*$/);if(l)break;var v=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!v){ze("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=v[0];var f=v[1];if(f!=="core"){var c=new vt(f);if(c.invalid){ze("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),o();continue}}var h=v[2],d=!1;i=h;for(var y=[];;){var g=i.match(/^\s*$/);if(g)break;var p=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){ze("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+h),d=!0;break}s=p[0];var m=p[1],b=p[2],w=e.properties[m];if(!w){ze("Skipping property: Invalid property name in: "+s),u();continue}var E=t.parse(m,b);if(!E){ze("Skipping property: Invalid property definition in: "+s),u();continue}y.push({name:m,val:b}),u()}if(d){o();break}t.selector(f);for(var C=0;C=7&&e[0]==="d"&&(v=new RegExp(o.data.regex).exec(e))){if(t)return!1;var c=o.data;return{name:r,value:v,strValue:""+e,mapped:c,field:v[1],bypass:t}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(o.mapData.regex).exec(e))){if(t||l.multiple)return!1;var h=o.mapData;if(!(l.color||l.number))return!1;var d=this.parse(r,f[4]);if(!d||d.mapped)return!1;var y=this.parse(r,f[5]);if(!y||y.mapped)return!1;if(d.pfValue===y.pfValue||d.strValue===y.strValue)return ze("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+d.strValue+"`"),this.parse(r,d.strValue);if(l.color){var g=d.value,p=y.value,m=g[0]===p[0]&&g[1]===p[1]&&g[2]===p[2]&&(g[3]===p[3]||(g[3]==null||g[3]===1)&&(p[3]==null||p[3]===1));if(m)return!1}return{name:r,value:f,strValue:""+e,mapped:h,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:d.value,valueMax:y.value,bypass:t}}}if(l.multiple&&a!=="multiple"){var b;if(u?b=e.split(/\s+/):Ve(e)?b=e:b=[e],l.evenMultiple&&b.length%2!==0)return null;for(var w=[],E=[],C=[],x="",S=!1,k=0;k0?" ":"")+B.strValue}return l.validate&&!l.validate(w,E)?null:l.singleEnum&&S?w.length===1&&he(w[0])?{name:r,value:w[0],strValue:w[0],bypass:t}:null:{name:r,value:w,pfValue:C,strValue:x,bypass:t,units:E}}var D=function(){for(var X=0;Xl.max||l.strictMax&&e===l.max))return null;var I={name:r,value:e,strValue:""+e+(P||""),units:P,bypass:t};return l.unitless||P!=="px"&&P!=="em"?I.pfValue=e:I.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(I.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(I.pfValue=P==="rad"?e:Cd(e)),P==="%"&&(I.pfValue=e/100),I}else if(l.propList){var M=[],O=""+e;if(O!=="none"){for(var q=O.split(/\s*,\s*|\s+/),_=0;_0&&o>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){u=Math.min((s-2*t)/a.w,(o-2*t)/a.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u=a.minZoom&&(a.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,a=t.pan,n=t.zoom,i,s,o=!1;if(t.zoomingEnabled||(o=!0),ae(e)?s=e:Me(e)&&(s=e.level,e.position!=null?i=On(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!t.panningEnabled&&(o=!0)),s=s>t.maxZoom?t.maxZoom:s,s=st.maxZoom||!t.zoomingEnabled?s=!0:(t.zoom=u,i.push("zoom"))}if(n&&(!s||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;ae(l.x)&&(t.pan.x=l.x,o=!1),ae(l.y)&&(t.pan.y=l.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(he(e)){var a=e;e=this.mutableElements().filter(a)}else Tr(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),s=this.height();t=t===void 0?this._private.zoom:t;var o={x:(i-t*(n.x1+n.x2))/2,y:(s-t*(n.y1+n.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,a=this;return e.sizeCache=e.sizeCache||(t?(function(){var n=a.window().getComputedStyle(t),i=function(o){return parseFloat(n.getPropertyValue(o))};return{width:t.clientWidth-i("padding-left")-i("padding-right"),height:t.clientHeight-i("padding-top")-i("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/t,x2:(a.x2-e.x)/t,y1:(a.y1-e.y)/t,y2:(a.y2-e.y)/t};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Pt.centre=Pt.center;Pt.autolockNodes=Pt.autolock;Pt.autoungrabifyNodes=Pt.autoungrabify;var Aa={data:Ne.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ne.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ne.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ne.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Aa.attr=Aa.data;Aa.removeAttr=Aa.removeData;var Ra=function(e){var t=this;e=ye({},e);var a=e.container;a&&!bn(a)&&bn(a[0])&&(a=a[0]);var n=a?a._cyreg:null;n=n||{},n&&n.cy&&(n.cy.destroy(),n={});var i=n.readies=n.readies||[];a&&(a._cyreg=n),n.cy=t;var s=je!==void 0&&a!==void 0&&!e.headless,o=e;o.layout=ye({name:s?"grid":"null"},o.layout),o.renderer=ye({name:s?"canvas":"null"},o.renderer);var u=function(d,y,g){return y!==void 0?y:g!==void 0?g:d},l=this._private={container:a,ready:!1,options:o,elements:new lr(this),listeners:[],aniEles:new lr(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,o.zoomingEnabled),userZoomingEnabled:u(!0,o.userZoomingEnabled),panningEnabled:u(!0,o.panningEnabled),userPanningEnabled:u(!0,o.userPanningEnabled),boxSelectionEnabled:u(!0,o.boxSelectionEnabled),autolock:u(!1,o.autolock,o.autolockNodes),autoungrabify:u(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:u(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:ae(o.zoom)?o.zoom:1,pan:{x:Me(o.pan)&&ae(o.pan.x)?o.pan.x:0,y:Me(o.pan)&&ae(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var v=function(d,y){var g=d.some(yc);if(g)return ta.all(d).then(y);y(d)};l.styleEnabled&&t.setStyle([]);var f=ye({},o,o.renderer);t.initRenderer(f);var c=function(d,y,g){t.notifications(!1);var p=t.mutableElements();p.length>0&&p.remove(),d!=null&&(Me(d)||Ve(d))&&t.add(d),t.one("layoutready",function(b){t.notifications(!0),t.emit(b),t.one("load",y),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",g),t.emit("done")});var m=ye({},t._private.options.layout);m.eles=t.elements(),t.layout(m).run()};v([o.style,o.elements],function(h){var d=h[0],y=h[1];l.styleEnabled&&t.style().append(d),c(y,function(){t.startAnimationLoop(),l.ready=!0,$e(o.ready)&&t.on("ready",o.ready);for(var g=0;g0,o=!!r.boundingBox,u=mr(o?r.boundingBox:structuredClone(e.extent())),l;if(Tr(r.roots))l=r.roots;else if(Ve(r.roots)){for(var v=[],f=0;f0;){var R=A(),L=k(R,D);if(L)R.outgoers().filter(function(ge){return ge.isNode()&&t.has(ge)}).forEach(P);else if(L===null){ze("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var I=0;if(r.avoidOverlap)for(var M=0;M0&&p[0].length<=3?be/2:0),Be=2*Math.PI/p[ce].length*xe;return ce===0&&p[0].length===1&&(Se=1),{x:W.x+Se*Math.cos(Be),y:W.y+Se*Math.sin(Be)}}else{var Oe=p[ce].length,Le=Math.max(Oe===1?0:o?(u.w-r.padding*2-U.w)/((r.grid?le:Oe)-1):(u.w-r.padding*2-U.w)/((r.grid?le:Oe)+1),I),Ae={x:W.x+(xe+1-(Oe+1)/2)*Le,y:W.y+(ce+1-(Z+1)/2)*te};return Ae}},we={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(we).indexOf(r.direction)===-1&&He("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(we).join(", ")));var me=function(se){return Uc(De(se),u,we[r.direction])};return t.nodes().layoutPositions(this,r,me),this};var Mp={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function nf(r){this.options=ye({},Mp,r)}nf.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=a.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var s=mr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,l=u/Math.max(1,i.length-1),v,f=0,c=0;c1&&e.avoidOverlap){f*=1.75;var p=Math.cos(l)-Math.cos(0),m=Math.sin(l)-Math.sin(0),b=Math.sqrt(f*f/(p*p+m*m));v=Math.max(b,v)}var w=function(C,x){var S=e.startAngle+x*l*(n?1:-1),k=v*Math.cos(S),B=v*Math.sin(S),D={x:o.x+k,y:o.y+B};return D};return a.nodes().layoutPositions(this,e,w),this};var Lp={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function sf(r){this.options=ye({},Lp,r)}sf.prototype.run=function(){for(var r=this.options,e=r,t=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=r.cy,n=e.eles,i=n.nodes().not(":parent"),s=mr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},u=[],l=0,v=0;v0){var E=Math.abs(m[0].value-w.value);E>=g&&(m=[],p.push(m))}m.push(w)}var C=l+e.minNodeSpacing;if(!e.avoidOverlap){var x=p.length>0&&p[0].length>1,S=Math.min(s.w,s.h)/2-C,k=S/(p.length+x?1:0);C=Math.min(C,k)}for(var B=0,D=0;D1&&e.avoidOverlap){var L=Math.cos(R)-Math.cos(0),I=Math.sin(R)-Math.sin(0),M=Math.sqrt(C*C/(L*L+I*I));B=Math.max(M,B)}P.r=B,B+=C}if(e.equidistant){for(var O=0,q=0,_=0;_=r.numIter||(qp(a,r),a.temperature=a.temperature*r.coolingFactor,a.temperature=r.animationThreshold&&i(),wn(v)}};v()}else{for(;l;)l=s(u),u++;kl(a,r),o()}return this};Kn.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};Kn.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Op=function(e,t,a){for(var n=a.eles.edges(),i=a.eles.nodes(),s=mr(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},u=a.eles.components(),l={},v=0;v0){o.graphSet.push(S);for(var v=0;vn.count?0:n.graph},of=function(e,t,a,n){var i=n.graphSet[a];if(-10)var f=n.nodeOverlap*v,c=Math.sqrt(o*o+u*u),h=f*o/c,d=f*u/c;else var y=Dn(e,o,u),g=Dn(t,-1*o,-1*u),p=g.x-y.x,m=g.y-y.y,b=p*p+m*m,c=Math.sqrt(b),f=(e.nodeRepulsion+t.nodeRepulsion)/b,h=f*p/c,d=f*m/c;e.isLocked||(e.offsetX-=h,e.offsetY-=d),t.isLocked||(t.offsetX+=h,t.offsetY+=d)}},Hp=function(e,t,a,n){if(a>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(n>0)var s=e.maxY-t.minY;else var s=t.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},Dn=function(e,t,a){var n=e.positionX,i=e.positionY,s=e.height||1,o=e.width||1,u=a/t,l=s/o,v={};return t===0&&0a?(v.x=n,v.y=i+s/2,v):0t&&-1*l<=u&&u<=l?(v.x=n-o/2,v.y=i-o*a/2/t,v):0=l)?(v.x=n+s*t/2/a,v.y=i+s/2,v):(0>a&&(u<=-1*l||u>=l)&&(v.x=n-s*t/2/a,v.y=i-s/2),v)},Wp=function(e,t){for(var a=0;aa){var g=t.gravity*h/y,p=t.gravity*d/y;c.offsetX+=g,c.offsetY+=p}}}}},Up=function(e,t){var a=[],n=0,i=-1;for(a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;n<=i;){var s=a[n++],o=e.idToIndex[s],u=e.layoutNodes[o],l=u.children;if(0a)var i={x:a*e/n,y:a*t/n};else var i={x:e,y:t};return i},lf=function(e,t){var a=e.parentId;if(a!=null){var n=t.layoutNodes[t.idToIndex[a]],i=!1;if((n.maxX==null||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,i=!0),(n.minX==null||e.minX-n.padLeftn.maxY)&&(n.maxY=e.maxY+n.padBottom,i=!0),(n.minY==null||e.minY-n.padTopp&&(d+=g+t.componentSpacing,h=0,y=0,g=0)}}},Yp={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function vf(r){this.options=ye({},Yp,r)}vf.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=a.nodes().not(":parent");e.sort&&(n=n.sort(e.sort));var i=mr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function(Y){return{x:i.x1,y:i.y1}});else{var s=n.size(),o=Math.sqrt(s*i.h/i.w),u=Math.round(o),l=Math.round(i.w/i.h*o),v=function(J){if(J==null)return Math.min(u,l);var Z=Math.min(u,l);Z==u?u=J:l=J},f=function(J){if(J==null)return Math.max(u,l);var Z=Math.max(u,l);Z==u?u=J:l=J},c=e.rows,h=e.cols!=null?e.cols:e.columns;if(c!=null&&h!=null)u=c,l=h;else if(c!=null&&h==null)u=c,l=Math.ceil(s/u);else if(c==null&&h!=null)l=h,u=Math.ceil(s/l);else if(l*u>s){var d=v(),y=f();(d-1)*y>=s?v(d-1):(y-1)*d>=s&&f(y-1)}else for(;l*u=s?f(p+1):v(g+1)}var m=i.w/l,b=i.h/u;if(e.condense&&(m=0,b=0),e.avoidOverlap)for(var w=0;w=l&&(L=0,R++)},M={},O=0;O(L=zd(r,e,I[M],I[M+1],I[M+2],I[M+3])))return g(x,L),!0}else if(k.edgeType==="bezier"||k.edgeType==="multibezier"||k.edgeType==="self"||k.edgeType==="compound"){for(var I=k.allpts,M=0;M+5(L=Nd(r,e,I[M],I[M+1],I[M+2],I[M+3],I[M+4],I[M+5])))return g(x,L),!0}for(var O=O||S.source,q=q||S.target,_=n.getArrowWidth(B,D),N=[{name:"source",x:k.arrowStartX,y:k.arrowStartY,angle:k.srcArrowAngle},{name:"target",x:k.arrowEndX,y:k.arrowEndY,angle:k.tgtArrowAngle},{name:"mid-source",x:k.midX,y:k.midY,angle:k.midsrcArrowAngle},{name:"mid-target",x:k.midX,y:k.midY,angle:k.midtgtArrowAngle}],M=0;M0&&(p(O),p(q))}function b(x,S,k){return yr(x,S,k)}function w(x,S){var k=x._private,B=c,D;S?D=S+"-":D="",x.boundingBox();var P=k.labelBounds[S||"main"],A=x.pstyle(D+"label").value,R=x.pstyle("text-events").strValue==="yes";if(!(!R||!A)){var L=b(k.rscratch,"labelX",S),I=b(k.rscratch,"labelY",S),M=b(k.rscratch,"labelAngle",S),O=x.pstyle(D+"text-margin-x").pfValue,q=x.pstyle(D+"text-margin-y").pfValue,_=P.x1-B-O,N=P.x2+B-O,V=P.y1-B-q,Y=P.y2+B-q;if(M){var J=Math.cos(M),Z=Math.sin(M),ee=function(U,te){return U=U-L,te=te-I,{x:U*J-te*Z+L,y:U*Z+te*J+I}},re=ee(_,V),ne=ee(_,Y),X=ee(N,V),F=ee(N,Y),H=[re.x+O,re.y+q,X.x+O,X.y+q,F.x+O,F.y+q,ne.x+O,ne.y+q];if(Er(r,e,H))return g(x),!0}else if(at(P,r,e))return g(x),!0}}for(var E=s.length-1;E>=0;E--){var C=s[E];C.isNode()?p(C)||w(C):m(C)||w(C)||w(C,"source")||w(C,"target")}return o};Rt.getAllInBox=function(r,e,t,a){var n=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),s=2/i,o=[],u=Math.min(r,t),l=Math.max(r,t),v=Math.min(e,a),f=Math.max(e,a);r=u,t=l,e=v,a=f;var c=mr({x1:r,y1:e,x2:t,y2:a}),h=[{x:c.x1,y:c.y1},{x:c.x2,y:c.y1},{x:c.x2,y:c.y2},{x:c.x1,y:c.y2}],d=[[h[0],h[1]],[h[1],h[2]],[h[2],h[3]],[h[3],h[0]]];function y(U,te,le){return yr(U,te,le)}function g(U,te){var le=U._private,De=s,we="";U.boundingBox();var me=le.labelBounds.main;if(!me)return null;var ge=y(le.rscratch,"labelX",te),se=y(le.rscratch,"labelY",te),de=y(le.rscratch,"labelAngle",te),ce=U.pstyle(we+"text-margin-x").pfValue,xe=U.pstyle(we+"text-margin-y").pfValue,be=me.x1-De-ce,Se=me.x2+De-ce,Be=me.y1-De-xe,Oe=me.y2+De-xe;if(de){var Le=Math.cos(de),Ae=Math.sin(de),Q=function(z,G){return z=z-ge,G=G-se,{x:z*Le-G*Ae+ge,y:z*Ae+G*Le+se}};return[Q(be,Be),Q(Se,Be),Q(Se,Oe),Q(be,Oe)]}else return[{x:be,y:Be},{x:Se,y:Be},{x:Se,y:Oe},{x:be,y:Oe}]}function p(U,te,le,De){function we(me,ge,se){return(se.y-me.y)*(ge.x-me.x)>(ge.y-me.y)*(se.x-me.x)}return we(U,le,De)!==we(te,le,De)&&we(U,te,le)!==we(U,te,De)}for(var m=0;m0?-(Math.PI-e.ang):Math.PI+e.ang},ry=function(e,t,a,n,i){if(e!==Rl?Ml(t,e,Vr):ey(kr,Vr),Ml(t,a,kr),Pl=Vr.nx*kr.ny-Vr.ny*kr.nx,Al=Vr.nx*kr.nx-Vr.ny*-kr.ny,Ur=Math.asin(Math.max(-1,Math.min(1,Pl))),Math.abs(Ur)<1e-6){Vs=t.x,qs=t.y,Et=zt=0;return}Tt=1,gn=!1,Al<0?Ur<0?Ur=Math.PI+Ur:(Ur=Math.PI-Ur,Tt=-1,gn=!0):Ur>0&&(Tt=-1,gn=!0),t.radius!==void 0?zt=t.radius:zt=n,bt=Ur/2,an=Math.min(Vr.len/2,kr.len/2),i?(zr=Math.abs(Math.cos(bt)*zt/Math.sin(bt)),zr>an?(zr=an,Et=Math.abs(zr*Math.sin(bt)/Math.cos(bt))):Et=zt):(zr=Math.min(an,zt),Et=Math.abs(zr*Math.sin(bt)/Math.cos(bt))),_s=t.x+kr.nx*zr,Gs=t.y+kr.ny*zr,Vs=_s-kr.ny*Et*Tt,qs=Gs+kr.nx*Et*Tt,hf=t.x+Vr.nx*zr,gf=t.y+Vr.ny*zr,Rl=t};function pf(r,e){e.radius===0?r.lineTo(e.cx,e.cy):r.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function po(r,e,t,a){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return a===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(ry(r,e,t,a,n),{cx:Vs,cy:qs,radius:Et,startX:hf,startY:gf,stopX:_s,stopY:Gs,startAngle:Vr.ang+Math.PI/2*Tt,endAngle:kr.ang-Math.PI/2*Tt,counterClockwise:gn})}var Ma=.01,ty=Math.sqrt(2*Ma),gr={};gr.findMidptPtsEtc=function(r,e){var t=e.posPts,a=e.intersectionPts,n=e.vectorNormInverse,i,s=r.pstyle("source-endpoint"),o=r.pstyle("target-endpoint"),u=s.units!=null&&o.units!=null,l=function(E,C,x,S){var k=S-C,B=x-E,D=Math.sqrt(B*B+k*k);return{x:-k/D,y:B/D}},v=r.pstyle("edge-distances").value;switch(v){case"node-position":i=t;break;case"intersection":i=a;break;case"endpoints":{if(u){var f=this.manualEndptToPx(r.source()[0],s),c=Qe(f,2),h=c[0],d=c[1],y=this.manualEndptToPx(r.target()[0],o),g=Qe(y,2),p=g[0],m=g[1],b={x1:h,y1:d,x2:p,y2:m};n=l(h,d,p,m),i=b}else ze("Edge ".concat(r.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=a;break}}return{midptPts:i,vectorNormInverse:n}};gr.findHaystackPoints=function(r){for(var e=0;e0?Math.max(G-$,0):Math.min(G+$,0)},A=P(B,S),R=P(D,k),L=!1;m===l?p=Math.abs(A)>Math.abs(R)?n:a:m===u||m===o?(p=a,L=!0):(m===i||m===s)&&(p=n,L=!0);var I=p===a,M=I?R:A,O=I?D:B,q=to(O),_=!1;!(L&&(w||C))&&(m===o&&O<0||m===u&&O>0||m===i&&O>0||m===s&&O<0)&&(q*=-1,M=q*Math.abs(M),_=!0);var N;if(w){var V=E<0?1+E:E;N=V*M}else{var Y=E<0?M:0;N=Y+E*q}var J=function(G){return Math.abs(G)=Math.abs(M)},Z=J(N),ee=J(Math.abs(M)-Math.abs(N)),re=Z||ee;if(re&&!_)if(I){var ne=Math.abs(O)<=c/2,X=Math.abs(B)<=h/2;if(ne){var F=(v.x1+v.x2)/2,H=v.y1,W=v.y2;t.segpts=[F,H,F,W]}else if(X){var U=(v.y1+v.y2)/2,te=v.x1,le=v.x2;t.segpts=[te,U,le,U]}else t.segpts=[v.x1,v.y2]}else{var De=Math.abs(O)<=f/2,we=Math.abs(D)<=d/2;if(De){var me=(v.y1+v.y2)/2,ge=v.x1,se=v.x2;t.segpts=[ge,me,se,me]}else if(we){var de=(v.x1+v.x2)/2,ce=v.y1,xe=v.y2;t.segpts=[de,ce,de,xe]}else t.segpts=[v.x2,v.y1]}else if(I){var be=v.y1+N+(g?c/2*q:0),Se=v.x1,Be=v.x2;t.segpts=[Se,be,Be,be]}else{var Oe=v.x1+N+(g?f/2*q:0),Le=v.y1,Ae=v.y2;t.segpts=[Oe,Le,Oe,Ae]}if(t.isRound){var Q=r.pstyle("taxi-radius").value,T=r.pstyle("radius-type").value[0]==="arc-radius";t.radii=new Array(t.segpts.length/2).fill(Q),t.isArcRadius=new Array(t.segpts.length/2).fill(T)}};gr.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if(t.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,s=e.srcH,o=e.tgtW,u=e.tgtH,l=e.srcShape,v=e.tgtShape,f=e.srcCornerRadius,c=e.tgtCornerRadius,h=e.srcRs,d=e.tgtRs,y=!ae(t.startX)||!ae(t.startY),g=!ae(t.arrowStartX)||!ae(t.arrowStartY),p=!ae(t.endX)||!ae(t.endY),m=!ae(t.arrowEndX)||!ae(t.arrowEndY),b=3,w=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth,E=b*w,C=Dt({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),x=CO.poolIndex()){var q=M;M=O,O=q}var _=A.srcPos=M.position(),N=A.tgtPos=O.position(),V=A.srcW=M.outerWidth(),Y=A.srcH=M.outerHeight(),J=A.tgtW=O.outerWidth(),Z=A.tgtH=O.outerHeight(),ee=A.srcShape=t.nodeShapes[e.getNodeShape(M)],re=A.tgtShape=t.nodeShapes[e.getNodeShape(O)],ne=A.srcCornerRadius=M.pstyle("corner-radius").value==="auto"?"auto":M.pstyle("corner-radius").pfValue,X=A.tgtCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,F=A.tgtRs=O._private.rscratch,H=A.srcRs=M._private.rscratch;A.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var W=0;W=ty||(Be=Math.sqrt(Math.max(Se*Se,Ma)+Math.max(be*be,Ma)));var Oe=A.vector={x:Se,y:be},Le=A.vectorNorm={x:Oe.x/Be,y:Oe.y/Be},Ae={x:-Le.y,y:Le.x};A.nodesOverlap=!ae(Be)||re.checkPoint(me[0],me[1],0,J,Z,N.x,N.y,X,F)||ee.checkPoint(se[0],se[1],0,V,Y,_.x,_.y,ne,H),A.vectorNormInverse=Ae,R={nodesOverlap:A.nodesOverlap,dirCounts:A.dirCounts,calculatedIntersection:!0,hasBezier:A.hasBezier,hasUnbundled:A.hasUnbundled,eles:A.eles,srcPos:N,srcRs:F,tgtPos:_,tgtRs:H,srcW:J,srcH:Z,tgtW:V,tgtH:Y,srcIntn:de,tgtIntn:ge,srcShape:re,tgtShape:ee,posPts:{x1:xe.x2,y1:xe.y2,x2:xe.x1,y2:xe.y1},intersectionPts:{x1:ce.x2,y1:ce.y2,x2:ce.x1,y2:ce.y1},vector:{x:-Oe.x,y:-Oe.y},vectorNorm:{x:-Le.x,y:-Le.y},vectorNormInverse:{x:-Ae.x,y:-Ae.y}}}var Q=we?R:A;te.nodesOverlap=Q.nodesOverlap,te.srcIntn=Q.srcIntn,te.tgtIntn=Q.tgtIntn,te.isRound=le.startsWith("round"),n&&(M.isParent()||M.isChild()||O.isParent()||O.isChild())&&(M.parents().anySame(O)||O.parents().anySame(M)||M.same(O)&&M.isParent())?e.findCompoundLoopPoints(U,Q,W,De):M===O?e.findLoopPoints(U,Q,W,De):le.endsWith("segments")?e.findSegmentsPoints(U,Q):le.endsWith("taxi")?e.findTaxiPoints(U,Q):le==="straight"||!De&&A.eles.length%2===1&&W===Math.floor(A.eles.length/2)?e.findStraightEdgePoints(U):e.findBezierPoints(U,Q,W,De,we),e.findEndpoints(U),e.tryToCorrectInvalidPoints(U,Q),e.checkForInvalidEdgeWarning(U),e.storeAllpts(U),e.storeEdgeProjections(U),e.calculateArrowAngles(U),e.recalculateEdgeLabelProjections(U),e.calculateLabelAngles(U)}},x=0;x0){var me=l,ge=xt(me,Gt(s)),se=xt(me,Gt(we)),de=ge;if(se2){var ce=xt(me,{x:we[2],y:we[3]});ce0){var K=v,ve=xt(K,Gt(s)),j=xt(K,Gt($)),ie=ve;if(j2){var oe=xt(K,{x:$[2],y:$[3]});oe=d||x){g={cp:w,segment:C};break}}if(g)break}var S=g.cp,k=g.segment,B=(d-p)/k.length,D=k.t1-k.t0,P=h?k.t0+D*B:k.t1-D*B;P=ka(0,P,1),e=$t(S.p0,S.p1,S.p2,P),c=ny(S.p0,S.p1,S.p2,P);break}case"straight":case"segments":case"haystack":{for(var A=0,R,L,I,M,O=a.allpts.length,q=0;q+3=d));q+=2);var _=d-L,N=_/R;N=ka(0,N,1),e=Sd(I,M,N),c=bf(I,M);break}}s("labelX",f,e.x),s("labelY",f,e.y),s("labelAutoAngle",f,c)}};l("source"),l("target"),this.applyLabelDimensions(r)}};Hr.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))};Hr.applyPrefixedLabelDimensions=function(r,e){var t=r._private,a=this.getLabelText(r,e),n=kt(a,r._private.labelDimsKey);if(yr(t.rscratch,"prefixedLabelDimsKey",e)!==n){qr(t.rscratch,"prefixedLabelDimsKey",e,n);var i=this.calculateLabelDimensions(r,a),s=r.pstyle("line-height").pfValue,o=r.pstyle("font-size").pfValue,u=r.pstyle("text-wrap").strValue,l=yr(t.rscratch,"labelWrapCachedLines",e)||[],v=u!=="wrap"?1:Math.max(l.length,1),f=o*s,c=i.width,h=i.height+(v-1)*(s-1)*o;qr(t.rstyle,"labelWidth",e,c),qr(t.rscratch,"labelWidth",e,c),qr(t.rstyle,"labelHeight",e,h),qr(t.rscratch,"labelHeight",e,h),qr(t.rscratch,"labelLineHeight",e,f),qr(t.rscratch,"labelActualDescent",e,i.labelActualDescent)}};Hr.getLabelText=function(r,e){var t=r._private,a=e?e+"-":"",n=r.pstyle(a+"label").strValue,i=r.pstyle("text-transform").value,s=function(Y,J){return J?(qr(t.rscratch,Y,e,J),J):yr(t.rscratch,Y,e)};if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var o=r.pstyle("text-wrap").value;if(o==="wrap"){var u=s("labelKey");if(u!=null&&s("labelWrapKey")===u)return s("labelWrapCachedText");for(var l="​",v=n.split(` +`),f=r.pstyle("text-max-width").pfValue,c=r.pstyle("text-overflow-wrap").value,h=c==="anywhere",d=[],y=/[\s\u200b]+|$/g,g=0;gf){var E=p.matchAll(y),C="",x=0,S=Cr(E),k;try{for(S.s();!(k=S.n()).done;){var B=k.value,D=B[0],P=p.substring(x,B.index);x=B.index+D.length;var A=C.length===0?P:C+P+D,R=this.calculateLabelDimensions(r,A),L=R.width;L<=f?C+=P+D:(C&&d.push(C),C=P+D)}}catch(V){S.e(V)}finally{S.f()}C.match(/^[\s\u200b]+$/)||d.push(C)}else d.push(p)}s("labelWrapCachedLines",d),n=s("labelWrapCachedText",d.join(` +`)),s("labelWrapKey",u)}else if(o==="ellipsis"){var I=r.pstyle("text-max-width").pfValue,M="",O="…",q=!1;if(this.calculateLabelDimensions(r,n).widthI)break;M+=n[_],_===n.length-1&&(q=!0)}return q||(M+=O),M}return n};Hr.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;return e==="auto"?r.isNode()?$g(t):"center":e};Hr.calculateLabelDimensions=function(r,e){var t=this,a=t.cy.window(),n=a.document,i=0,s=r.pstyle("font-style").strValue,o=r.pstyle("font-size").pfValue,u=r.pstyle("font-family").strValue,l=r.pstyle("font-weight").strValue,v=r.pstyle("text-metrics").strValue||"font",f=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!f){f=this.labelCalcCanvas=n.createElement("canvas"),c=this.labelCalcCanvasContext=f.getContext("2d");var h=f.style;h.position="absolute",h.left="-9999px",h.top="-9999px",h.zIndex="-1",h.visibility="hidden",h.pointerEvents="none"}c.font="".concat(s," ").concat(l," ").concat(o,"px ").concat(u);for(var d=0,y=0,g=e.split(` +`),p=g.length,m=0,b=0,w=0;w1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var u=0;u=r.desktopTapThreshold2}var or=i(T);ar&&(r.hoverData.tapholdCancelled=!0);var Nr=function(){var Sr=r.hoverData.dragDelta=r.hoverData.dragDelta||[];Sr.length===0?(Sr.push(ke[0]),Sr.push(ke[1])):(Sr[0]+=ke[0],Sr[1]+=ke[1])};G=!0,n(Ee,["mousemove","vmousemove","tapdrag"],T,{x:j[0],y:j[1]});var We=function(Sr){return{originalEvent:T,type:Sr,position:{x:j[0],y:j[1]}}},$r=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||$.emit(We("boxstart")),pe[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(r.hoverData.which===3){if(ar){var Ar=We("cxtdrag");fe?fe.emit(Ar):$.emit(Ar),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||Ee!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit(We("cxtdragout")),r.hoverData.cxtOver=Ee,Ee&&Ee.emit(We("cxtdragover")))}}else if(r.hoverData.dragging){if(G=!0,$.panningEnabled()&&$.userPanningEnabled()){var Jr;if(r.hoverData.justStartedPan){var $a=r.hoverData.mdownPos;Jr={x:(j[0]-$a[0])*K,y:(j[1]-$a[1])*K},r.hoverData.justStartedPan=!1}else Jr={x:ke[0]*K,y:ke[1]*K};$.panBy(Jr),$.emit(We("dragpan")),r.hoverData.dragged=!0}j=r.projectIntoViewport(T.clientX,T.clientY)}else if(pe[4]==1&&(fe==null||fe.pannable())){if(ar){if(!r.hoverData.dragging&&$.boxSelectionEnabled()&&(or||!$.panningEnabled()||!$.userPanningEnabled()))$r();else if(!r.hoverData.selecting&&$.panningEnabled()&&$.userPanningEnabled()){var mt=s(fe,r.hoverData.downs);mt&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,pe[4]=0,r.data.bgActivePosistion=Gt(ie),r.redrawHint("select",!0),r.redraw())}fe&&fe.pannable()&&fe.active()&&fe.unactivate()}}else{if(fe&&fe.pannable()&&fe.active()&&fe.unactivate(),(!fe||!fe.grabbed())&&Ee!=Ce&&(Ce&&n(Ce,["mouseout","tapdragout"],T,{x:j[0],y:j[1]}),Ee&&n(Ee,["mouseover","tapdragover"],T,{x:j[0],y:j[1]}),r.hoverData.last=Ee),fe)if(ar){if($.boxSelectionEnabled()&&or)fe&&fe.grabbed()&&(y(Pe),fe.emit(We("freeon")),Pe.emit(We("free")),r.dragData.didDrag&&(fe.emit(We("dragfreeon")),Pe.emit(We("dragfree")))),$r();else if(fe&&fe.grabbed()&&r.nodeIsDraggable(fe)){var wr=!r.dragData.didDrag;wr&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||h(Pe,{inDragLayer:!0});var cr={x:0,y:0};if(ae(ke[0])&&ae(ke[1])&&(cr.x+=ke[0],cr.y+=ke[1],wr)){var xr=r.hoverData.dragDelta;xr&&ae(xr[0])&&ae(xr[1])&&(cr.x+=xr[0],cr.y+=xr[1])}r.hoverData.draggingEles=!0,Pe.silentShift(cr).emit(We("position")).emit(We("drag")),r.redrawHint("drag",!0),r.redraw()}}else Nr();G=!0}if(pe[2]=j[0],pe[3]=j[1],G)return T.stopPropagation&&T.stopPropagation(),T.preventDefault&&T.preventDefault(),!1}},!1);var B,D,P;r.registerBinding(e,"mouseup",function(T){if(!(r.hoverData.which===1&&T.which!==1&&r.hoverData.capture)){var z=r.hoverData.capture;if(z){r.hoverData.capture=!1;var G=r.cy,$=r.projectIntoViewport(T.clientX,T.clientY),K=r.selection,ve=r.findNearestElement($[0],$[1],!0,!1),j=r.dragData.possibleDragElements,ie=r.hoverData.down,oe=i(T);r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,ie&&ie.unactivate();var pe=function(Ue){return{originalEvent:T,type:Ue,position:{x:$[0],y:$[1]}}};if(r.hoverData.which===3){var Ee=pe("cxttapend");if(ie?ie.emit(Ee):G.emit(Ee),!r.hoverData.cxtDragged){var Ce=pe("cxttap");ie?ie.emit(Ce):G.emit(Ce)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(r.hoverData.which===1){if(n(ve,["mouseup","tapend","vmouseup"],T,{x:$[0],y:$[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(n(ie,["click","tap","vclick"],T,{x:$[0],y:$[1]}),D=!1,T.timeStamp-P<=G.multiClickDebounceTime()?(B&&clearTimeout(B),D=!0,P=null,n(ie,["dblclick","dbltap","vdblclick"],T,{x:$[0],y:$[1]})):(B=setTimeout(function(){D||n(ie,["oneclick","onetap","voneclick"],T,{x:$[0],y:$[1]})},G.multiClickDebounceTime()),P=T.timeStamp)),ie==null&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!i(T)&&(G.$(t).unselect(["tapunselect"]),j.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=j=G.collection()),ve==ie&&!r.dragData.didDrag&&!r.hoverData.selecting&&ve!=null&&ve._private.selectable&&(r.hoverData.dragging||(G.selectionType()==="additive"||oe?ve.selected()?ve.unselect(["tapunselect"]):ve.select(["tapselect"]):oe||(G.$(t).unmerge(ve).unselect(["tapunselect"]),ve.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var fe=G.collection(r.getAllInBox(K[0],K[1],K[2],K[3]));r.redrawHint("select",!0),fe.length>0&&r.redrawHint("eles",!0),G.emit(pe("boxend"));var ke=function(Ue){return Ue.selectable()&&!Ue.selected()};G.selectionType()==="additive"||oe||G.$(t).unmerge(fe).unselect(),fe.emit(pe("box")).stdFilter(ke).select().emit(pe("boxselect")),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!K[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var Pe=ie&&ie.grabbed();y(j),Pe&&(ie.emit(pe("freeon")),j.emit(pe("free")),r.dragData.didDrag&&(ie.emit(pe("dragfreeon")),j.emit(pe("dragfree"))))}}K[4]=0,r.hoverData.down=null,r.hoverData.cxtStarted=!1,r.hoverData.draggingEles=!1,r.hoverData.selecting=!1,r.hoverData.isOverThresholdDrag=!1,r.dragData.didDrag=!1,r.hoverData.dragged=!1,r.hoverData.dragDelta=[],r.hoverData.mdownPos=null,r.hoverData.mdownGPos=null,r.hoverData.which=null}}},!1);var A=[],R=4,L,I=1e5,M=function(T,z){for(var G=0;G=R){var $=A;if(L=M($,5),!L){var K=Math.abs($[0]);L=O($)&&K>5}if(L)for(var ve=0;ve<$.length;ve++)I=Math.min(Math.abs($[ve]),I)}else A.push(G),z=!0;else L&&(I=Math.min(Math.abs(G),I));if(!r.scrollingPage){var j=r.cy,ie=j.zoom(),oe=j.pan(),pe=r.projectIntoViewport(T.clientX,T.clientY),Ee=[pe[0]*ie+oe.x,pe[1]*ie+oe.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||x()){T.preventDefault();return}if(j.panningEnabled()&&j.userPanningEnabled()&&j.zoomingEnabled()&&j.userZoomingEnabled()){T.preventDefault(),r.data.wheelZooming=!0,clearTimeout(r.data.wheelTimeout),r.data.wheelTimeout=setTimeout(function(){r.data.wheelZooming=!1,r.redrawHint("eles",!0),r.redraw()},150);var Ce;z&&Math.abs(G)>5&&(G=to(G)*5),Ce=G/-250,L&&(Ce/=I,Ce*=3),Ce=Ce*r.wheelSensitivity;var fe=T.deltaMode===1;fe&&(Ce*=33);var ke=j.zoom()*Math.pow(10,Ce);T.type==="gesturechange"&&(ke=r.gestureStartZoom*T.scale),j.zoom({level:ke,renderedPosition:{x:Ee[0],y:Ee[1]}}),j.emit({type:T.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:T,position:{x:pe[0],y:pe[1]}})}}}};r.registerBinding(r.container,"wheel",q,!0),r.registerBinding(e,"scroll",function(T){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(T){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||T.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(Q){r.hasTouchStarted||q(Q)},!0),r.registerBinding(r.container,"mouseout",function(T){var z=r.projectIntoViewport(T.clientX,T.clientY);r.cy.emit({originalEvent:T,type:"mouseout",position:{x:z[0],y:z[1]}})},!1),r.registerBinding(r.container,"mouseover",function(T){var z=r.projectIntoViewport(T.clientX,T.clientY);r.cy.emit({originalEvent:T,type:"mouseover",position:{x:z[0],y:z[1]}})},!1);var _,N,V,Y,J,Z,ee,re,ne,X,F,H,W,U=function(T,z,G,$){return Math.sqrt((G-T)*(G-T)+($-z)*($-z))},te=function(T,z,G,$){return(G-T)*(G-T)+($-z)*($-z)},le;r.registerBinding(r.container,"touchstart",le=function(T){if(r.hasTouchStarted=!0,!!S(T)){p(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var z=r.cy,G=r.touchData.now,$=r.touchData.earlier;if(T.touches[0]){var K=r.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);G[0]=K[0],G[1]=K[1]}if(T.touches[1]){var K=r.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);G[2]=K[0],G[3]=K[1]}if(T.touches[2]){var K=r.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);G[4]=K[0],G[5]=K[1]}var ve=function(or){return{originalEvent:T,type:or,position:{x:G[0],y:G[1]}}};if(T.touches[1]){r.touchData.singleTouchMoved=!0,y(r.dragData.touchDragEles);var j=r.findContainerClientCoords();ne=j[0],X=j[1],F=j[2],H=j[3],_=T.touches[0].clientX-ne,N=T.touches[0].clientY-X,V=T.touches[1].clientX-ne,Y=T.touches[1].clientY-X,W=0<=_&&_<=F&&0<=V&&V<=F&&0<=N&&N<=H&&0<=Y&&Y<=H;var ie=z.pan(),oe=z.zoom();J=U(_,N,V,Y),Z=te(_,N,V,Y),ee=[(_+V)/2,(N+Y)/2],re=[(ee[0]-ie.x)/oe,(ee[1]-ie.y)/oe];var pe=200,Ee=pe*pe;if(Z=1){for(var Pr=r.touchData.startPosition=[null,null,null,null,null,null],Ke=0;Ke=r.touchTapThreshold2}if(z&&r.touchData.cxt){T.preventDefault();var Ke=T.touches[0].clientX-ne,Ye=T.touches[0].clientY-X,Je=T.touches[1].clientX-ne,or=T.touches[1].clientY-X,Nr=te(Ke,Ye,Je,or),We=Nr/Z,$r=150,Ar=$r*$r,Jr=1.5,$a=Jr*Jr;if(We>=$a||Nr>=Ar){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var mt=oe("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(mt),r.touchData.start=null):$.emit(mt)}}if(z&&r.touchData.cxt){var mt=oe("cxtdrag");r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(mt):$.emit(mt),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var wr=r.findNearestElement(K[0],K[1],!0,!0);(!r.touchData.cxtOver||wr!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit(oe("cxtdragout")),r.touchData.cxtOver=wr,wr&&wr.emit(oe("cxtdragover")))}else if(z&&T.touches[2]&&$.boxSelectionEnabled())T.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||$.emit(oe("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,G[4]=1,!G||G.length===0||G[0]===void 0?(G[0]=(K[0]+K[2]+K[4])/3,G[1]=(K[1]+K[3]+K[5])/3,G[2]=(K[0]+K[2]+K[4])/3+1,G[3]=(K[1]+K[3]+K[5])/3+1):(G[2]=(K[0]+K[2]+K[4])/3,G[3]=(K[1]+K[3]+K[5])/3),r.redrawHint("select",!0),r.redraw();else if(z&&T.touches[1]&&!r.touchData.didSelect&&$.zoomingEnabled()&&$.panningEnabled()&&$.userZoomingEnabled()&&$.userPanningEnabled()){T.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var cr=r.dragData.touchDragEles;if(cr){r.redrawHint("drag",!0);for(var xr=0;xr0&&!r.hoverData.draggingEles&&!r.swipePanning&&r.data.bgActivePosistion!=null&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1);var we;r.registerBinding(e,"touchcancel",we=function(T){var z=r.touchData.start;r.touchData.capture=!1,z&&z.unactivate()});var me,ge,se,de;if(r.registerBinding(e,"touchend",me=function(T){var z=r.touchData.start,G=r.touchData.capture;if(G)T.touches.length===0&&(r.touchData.capture=!1),T.preventDefault();else return;var $=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var K=r.cy,ve=K.zoom(),j=r.touchData.now,ie=r.touchData.earlier;if(T.touches[0]){var oe=r.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);j[0]=oe[0],j[1]=oe[1]}if(T.touches[1]){var oe=r.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);j[2]=oe[0],j[3]=oe[1]}if(T.touches[2]){var oe=r.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);j[4]=oe[0],j[5]=oe[1]}var pe=function(Ar){return{originalEvent:T,type:Ar,position:{x:j[0],y:j[1]}}};z&&z.unactivate();var Ee;if(r.touchData.cxt){if(Ee=pe("cxttapend"),z?z.emit(Ee):K.emit(Ee),!r.touchData.cxtDragged){var Ce=pe("cxttap");z?z.emit(Ce):K.emit(Ce)}r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,r.redraw();return}if(!T.touches[2]&&K.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var fe=K.collection(r.getAllInBox($[0],$[1],$[2],$[3]));$[0]=void 0,$[1]=void 0,$[2]=void 0,$[3]=void 0,$[4]=0,r.redrawHint("select",!0),K.emit(pe("boxend"));var ke=function(Ar){return Ar.selectable()&&!Ar.selected()};fe.emit(pe("box")).stdFilter(ke).select().emit(pe("boxselect")),fe.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(z?.unactivate(),T.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!T.touches[1]){if(!T.touches[0]){if(!T.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Pe=r.dragData.touchDragEles;if(z!=null){var ar=z._private.grabbed;y(Pe),r.redrawHint("drag",!0),r.redrawHint("eles",!0),ar&&(z.emit(pe("freeon")),Pe.emit(pe("free")),r.dragData.didDrag&&(z.emit(pe("dragfreeon")),Pe.emit(pe("dragfree")))),n(z,["touchend","tapend","vmouseup","tapdragout"],T,{x:j[0],y:j[1]}),z.unactivate(),r.touchData.start=null}else{var Ue=r.findNearestElement(j[0],j[1],!0,!0);n(Ue,["touchend","tapend","vmouseup","tapdragout"],T,{x:j[0],y:j[1]})}var Pr=r.touchData.startPosition[0]-j[0],Ke=Pr*Pr,Ye=r.touchData.startPosition[1]-j[1],Je=Ye*Ye,or=Ke+Je,Nr=or*ve*ve;r.touchData.singleTouchMoved||(z||K.$(":selected").unselect(["tapunselect"]),n(z,["tap","vclick"],T,{x:j[0],y:j[1]}),ge=!1,T.timeStamp-de<=K.multiClickDebounceTime()?(se&&clearTimeout(se),ge=!0,de=null,n(z,["dbltap","vdblclick"],T,{x:j[0],y:j[1]})):(se=setTimeout(function(){ge||n(z,["onetap","voneclick"],T,{x:j[0],y:j[1]})},K.multiClickDebounceTime()),de=T.timeStamp)),z!=null&&!r.dragData.didDrag&&z._private.selectable&&Nr"u"){var ce=[],xe=function(T){return{clientX:T.clientX,clientY:T.clientY,force:1,identifier:T.pointerId,pageX:T.pageX,pageY:T.pageY,radiusX:T.width/2,radiusY:T.height/2,screenX:T.screenX,screenY:T.screenY,target:T.target}},be=function(T){return{event:T,touch:xe(T)}},Se=function(T){ce.push(be(T))},Be=function(T){for(var z=0;z0)return V[0]}return null},d=Object.keys(c),y=0;y0?h:wv(i,s,e,t,a,n,o,u)},checkPoint:function(e,t,a,n,i,s,o,u){u=u==="auto"?lt(n,i):u;var l=2*u;if(Yr(e,t,this.points,s,o,n,i-l,[0,-1],a)||Yr(e,t,this.points,s,o,n-l,i,[0,-1],a))return!0;var v=n/2+2*a,f=i/2+2*a,c=[s-v,o-f,s-v,o,s+v,o,s+v,o-f];return!!(Er(e,t,c)||St(e,t,l,l,s+n/2-u,o+i/2-u,a)||St(e,t,l,l,s-n/2+u,o+i/2-u,a))}}};Zr.registerNodeShapes=function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",pr(3,0)),this.generateRoundPolygon("round-triangle",pr(3,0)),this.generatePolygon("rectangle",pr(4,0)),r.square=r.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var t=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",t),this.generateRoundPolygon("round-diamond",t)}this.generatePolygon("pentagon",pr(5,0)),this.generateRoundPolygon("round-pentagon",pr(5,0)),this.generatePolygon("hexagon",pr(6,0)),this.generateRoundPolygon("round-hexagon",pr(6,0)),this.generatePolygon("heptagon",pr(7,0)),this.generateRoundPolygon("round-heptagon",pr(7,0)),this.generatePolygon("octagon",pr(8,0)),this.generateRoundPolygon("round-octagon",pr(8,0));var a=new Array(20);{var n=Ps(5,0),i=Ps(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(l){if(m>=e.deqCost*h||m>=e.deqAvgCost*c)break}else if(b>=e.deqNoDrawCost*ws)break;var E=e.deq(a,g,y);if(E.length>0)for(var C=0;C0&&(e.onDeqd(a,d),!l&&e.shouldRedraw(a,d,g,y)&&i())},o=e.priority||js;n.beforeRender(s,o(a))}}}},uy=(function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xn;dt(this,r),this.idsByKey=new Kr,this.keyForId=new Kr,this.cachesByLvl=new Kr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t}return ht(r,[{key:"getIdsFor",value:function(t){t==null&&He("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(t);return n||(n=new ra,a.set(t,n)),n}},{key:"addIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).add(a)}},{key:"deleteIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).delete(a)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)}},{key:"deleteKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)}},{key:"keyHasChangedFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);return n!==i}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var a=this.cachesByLvl,n=this.lvls,i=a.get(t);return i||(i=new Kr,a.set(t,i),n.push(t)),i}},{key:"getCache",value:function(t,a){return this.getCachesAt(a).get(t)}},{key:"get",value:function(t,a){var n=this.getKey(t),i=this.getCache(n,a);return i!=null&&this.updateKeyMappingFor(t),i}},{key:"getForCachedKey",value:function(t,a){var n=this.keyForId.get(t.id()),i=this.getCache(n,a);return i}},{key:"hasCache",value:function(t,a){return this.getCachesAt(a).has(t)}},{key:"has",value:function(t,a){var n=this.getKey(t);return this.hasCache(n,a)}},{key:"setCache",value:function(t,a,n){n.key=t,this.getCachesAt(a).set(t,n)}},{key:"set",value:function(t,a,n){var i=this.getKey(t);this.setCache(i,a,n),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,a){this.getCachesAt(a).delete(t)}},{key:"delete",value:function(t,a){var n=this.getKey(t);this.deleteCache(n,a)}},{key:"invalidateKey",value:function(t){var a=this;this.lvls.forEach(function(n){return a.deleteCache(t,n)})}},{key:"invalidate",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(t);var i=this.doesEleInvalidateKey(t);return i&&this.invalidateKey(n),i||this.getNumberOfIdsForKey(n)===0}}])})(),Nl=25,nn=50,pn=-4,Hs=3,kf=7.99,ly=8,vy=1024,fy=1024,cy=1024,dy=.2,hy=.8,gy=10,py=.15,yy=.1,my=.9,by=.9,wy=100,xy=1,Wt={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Ey=vr({getKey:null,doesEleInvalidateKey:xn,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:dv,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ba=function(e,t){var a=this;a.renderer=e,a.onDequeues=[];var n=Ey(t);ye(a,n),a.lookup=new uy(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},tr=ba.prototype;tr.reasons=Wt;tr.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]};tr.getRetiredTextureQueue=function(r){var e=this,t=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=t[r]=t[r]||[];return a};tr.getElementQueue=function(){var r=this,e=r.eleCacheQueue=r.eleCacheQueue||new Va(function(t,a){return a.reqs-t.reqs});return e};tr.getElementKeyToQueue=function(){var r=this,e=r.eleKeyToCacheQueue=r.eleKeyToCacheQueue||{};return e};tr.getElement=function(r,e,t,a,n){var i=this,s=this.renderer,o=s.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!i.allowEdgeTxrCaching&&r.isEdge()||!i.allowParentTxrCaching&&r.isParent())return null;if(a==null&&(a=Math.ceil(ro(o*t))),a=kf||a>Hs)return null;var l=Math.pow(2,a),v=e.h*l,f=e.w*l,c=s.eleTextBiggerThanMin(r,l);if(!this.isVisible(r,c))return null;var h=u.get(r,a);if(h&&h.invalidated&&(h.invalidated=!1,h.texture.invalidatedWidth-=h.width),h)return h;var d;if(v<=Nl?d=Nl:v<=nn?d=nn:d=Math.ceil(v/nn)*nn,v>cy||f>fy)return null;var y=i.getTextureQueue(d),g=y[y.length-2],p=function(){return i.recycleTexture(d,f)||i.addTexture(d,f)};g||(g=y[y.length-1]),g||(g=p()),g.width-g.usedWidtha;D--)k=i.getElement(r,e,t,D,Wt.downscale);B()}else return i.queueElement(r,C.level-1),C;else{var P;if(!b&&!w&&!E)for(var A=a-1;A>=pn;A--){var R=u.get(r,A);if(R){P=R;break}}if(m(P))return i.queueElement(r,a),P;g.context.translate(g.usedWidth,0),g.context.scale(l,l),this.drawElement(g.context,r,e,c,!1),g.context.scale(1/l,1/l),g.context.translate(-g.usedWidth,0)}return h={x:g.usedWidth,texture:g,level:a,scale:l,width:f,height:v,scaledLabelShown:c},g.usedWidth+=Math.ceil(f+ly),g.eleCaches.push(h),u.set(r,a,h),i.checkTextureFullness(g),h};tr.invalidateElements=function(r){for(var e=0;e=dy*r.width&&this.retireTexture(r)};tr.checkTextureFullness=function(r){var e=this,t=e.getTextureQueue(r.height);r.usedWidth/r.width>hy&&r.fullnessChecks>=gy?ut(t,r):r.fullnessChecks++};tr.retireTexture=function(r){var e=this,t=r.height,a=e.getTextureQueue(t),n=this.lookup;ut(a,r),r.retired=!0;for(var i=r.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,eo(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),ut(n,s),a.push(s),s}};tr.queueElement=function(r,e){var t=this,a=t.getElementQueue(),n=t.getElementKeyToQueue(),i=this.getKey(r),s=n[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(r),s.reqs++,a.updateItem(s);else{var o={eles:r.spawn().merge(r),level:e,reqs:1,key:i};a.push(o),n[i]=o}};tr.dequeue=function(r){for(var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,s=0;s0;s++){var o=t.pop(),u=o.key,l=o.eles[0],v=i.hasCache(l,o.level);if(a[u]=null,v)continue;n.push(o);var f=e.getBoundingBox(l);e.getElement(l,f,r,o.level,Wt.dequeue)}return n};tr.removeFromQueue=function(r){var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(r),i=a[n];i!=null&&(i.eles.length===1?(i.reqs=Js,t.updateItem(i),t.pop(),a[n]=null):i.eles.unmerge(r))};tr.onDequeue=function(r){this.onDequeues.push(r)};tr.offDequeue=function(r){ut(this.onDequeues,r)};tr.setupDequeueing=Sf.setupDequeueing({deqRedrawThreshold:wy,deqCost:py,deqAvgCost:yy,deqNoDrawCost:my,deqFastCost:by,deq:function(e,t,a){return e.dequeue(t,a)},onDeqd:function(e,t){for(var a=0;a=Ty||t>Pn)return null}a.validateLayersElesOrdering(t,r);var u=a.layersByLevel,l=Math.pow(2,t),v=u[t]=u[t]||[],f,c=a.levelIsComplete(t,r),h,d=function(){var B=function(L){if(a.validateLayersElesOrdering(L,r),a.levelIsComplete(L,r))return h=u[L],!0},D=function(L){if(!h)for(var I=t+L;xa<=I&&I<=Pn&&!B(I);I+=L);};D(1),D(-1);for(var P=v.length-1;P>=0;P--){var A=v[P];A.invalid&&ut(v,A)}};if(!c)d();else return v;var y=function(){if(!f){f=mr();for(var B=0;BFl||A>Fl)return null;var R=P*A;if(R>My)return null;var L=a.makeLayer(f,t);if(D!=null){var I=v.indexOf(D)+1;v.splice(I,0,L)}else(B.insert===void 0||B.insert)&&v.unshift(L);return L};if(a.skipping&&!o)return null;for(var p=null,m=r.length/Cy,b=!o,w=0;w=m||!bv(p.bb,E.boundingBox()))&&(p=g({insert:!0,after:p}),!p))return null;h||b?a.queueLayer(p,E):a.drawEleInLayer(p,E,t,e),p.eles.push(E),x[t]=p}return h||(b?null:v)};fr.getEleLevelForLayerLevel=function(r,e){return r};fr.drawEleInLayer=function(r,e,t,a){var n=this,i=this.renderer,s=r.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(t=n.getEleLevelForLayerLevel(t,a),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,t,Ly),i.setImgSmoothing(s,!0))};fr.levelIsComplete=function(r,e){var t=this,a=t.layersByLevel[r];if(!a||a.length===0)return!1;for(var n=0,i=0;i0||s.invalid)return!1;n+=s.eles.length}return n===e.length};fr.validateLayersElesOrdering=function(r,e){var t=this.layersByLevel[r];if(t)for(var a=0;a0){e=!0;break}}return e};fr.invalidateElements=function(r){var e=this;r.length!==0&&(e.lastInvalidationTime=Xr(),!(r.length===0||!e.haveLayers())&&e.updateElementsInLayers(r,function(a,n,i){e.invalidateLayer(a)}))};fr.invalidateLayer=function(r){if(this.lastInvalidationTime=Xr(),!r.invalid){var e=r.level,t=r.eles,a=this.layersByLevel[e];ut(a,r),r.elesQueue=[],r.invalid=!0,r.replacement&&(r.replacement.invalid=!0);for(var n=0;n3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(i&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var u;t&&(u=t,r.translate(-u.x1,-u.y1));var l=i?e.pstyle("opacity").value:1,v=i?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,c=e.pstyle("line-style").value,h=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,y=e.pstyle("line-outline-width").value,g=e.pstyle("line-outline-color").value,p=l*v,m=l*v,b=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;f==="straight-triangle"?(s.eleStrokeStyle(r,e,L),s.drawEdgeTrianglePath(e,r,o.allpts)):(r.lineWidth=h,r.lineCap=d,s.eleStrokeStyle(r,e,L),s.drawEdgePath(e,r,o.allpts,c),r.lineCap="butt")},w=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;if(r.lineWidth=h+y,r.lineCap=d,y>0)s.colorStrokeStyle(r,g[0],g[1],g[2],L);else{r.lineCap="butt";return}f==="straight-triangle"?s.drawEdgeTrianglePath(e,r,o.allpts):(s.drawEdgePath(e,r,o.allpts,c),r.lineCap="butt")},E=function(){n&&s.drawEdgeOverlay(r,e)},C=function(){n&&s.drawEdgeUnderlay(r,e)},x=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;s.drawArrowheads(r,e,L)},S=function(){s.drawElementText(r,e,null,a)};r.lineJoin="round";var k=e.pstyle("ghost").value==="yes";if(k){var B=e.pstyle("ghost-offset-x").pfValue,D=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,A=p*P;r.translate(B,D),b(A),x(A),r.translate(-B,-D)}else w();C(),b(),x(),E(),S(),t&&r.translate(u.x1,u.y1)}};var Pf=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,a){if(a.visible()){var n=a.pstyle("".concat(e,"-opacity")).value;if(n!==0){var i=this,s=i.usePaths(),o=a._private.rscratch,u=a.pstyle("".concat(e,"-padding")).pfValue,l=2*u,v=a.pstyle("".concat(e,"-color")).value;t.lineWidth=l,o.edgeType==="self"&&!s?t.lineCap="butt":t.lineCap="round",i.colorStrokeStyle(t,v[0],v[1],v[2],n),i.drawEdgePath(a,t,o.allpts,"solid")}}}};Qr.drawEdgeOverlay=Pf("overlay");Qr.drawEdgeUnderlay=Pf("underlay");Qr.drawEdgePath=function(r,e,t,a){var n=r._private.rscratch,i=e,s,o=!1,u=this.usePaths(),l=r.pstyle("line-dash-pattern").pfValue,v=r.pstyle("line-dash-offset").pfValue;if(u){var f=t.join("$"),c=n.pathCacheKey&&n.pathCacheKey===f;c?(s=e=n.pathCache,o=!0):(s=e=new Path2D,n.pathCacheKey=f,n.pathCache=s)}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(l),i.lineDashOffset=v;break;case"solid":i.setLineDash([]);break}if(!o&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(t[0],t[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(a==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var u=s.getLabelJustification(e),l=e.pstyle("text-metrics").strValue==="glyph";r.textAlign=u,r.textBaseline=l?"alphabetic":"bottom"}else{var v=e.element()._private.rscratch.badLine,f=e.pstyle("label"),c=e.pstyle("source-label"),h=e.pstyle("target-label");if(v||(!f||!f.value)&&(!c||!c.value)&&(!h||!h.value))return;r.textAlign="center",r.textBaseline="bottom"}var d=!t,y;t&&(y=t,r.translate(-y.x1,-y.y1)),n==null?(s.drawText(r,e,null,d,i),e.isEdge()&&(s.drawText(r,e,"source",d,i),s.drawText(r,e,"target",d,i))):s.drawText(r,e,n,d,i),t&&r.translate(y.x1,y.y1)};Mt.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*o,l=e.pstyle("color").value,v=e.pstyle("text-outline-color").value;r.font=a+" "+s+" "+n+" "+i,r.lineJoin="round",this.colorFillStyle(r,l[0],l[1],l[2],o),this.colorStrokeStyle(r,v[0],v[1],v[2],u)};function Wy(r,e,t,a,n){var i=Math.min(a,n),s=i/2,o=e+a/2,u=t+n/2;r.beginPath(),r.arc(o,u,s,0,Math.PI*2),r.closePath()}function Gl(r,e,t,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(i,a/2,n/2);r.beginPath(),r.moveTo(e+s,t),r.lineTo(e+a-s,t),r.quadraticCurveTo(e+a,t,e+a,t+s),r.lineTo(e+a,t+n-s),r.quadraticCurveTo(e+a,t+n,e+a-s,t+n),r.lineTo(e+s,t+n),r.quadraticCurveTo(e,t+n,e,t+n-s),r.lineTo(e,t+s),r.quadraticCurveTo(e,t,e+s,t),r.closePath()}Mt.getTextAngle=function(r,e){var t,a=r._private,n=a.rscratch,i=e?e+"-":"",s=r.pstyle(i+"text-rotation");if(s.strValue==="autorotate"){var o=yr(n,"labelAngle",e);t=r.isEdge()?o:0}else s.strValue==="none"?t=0:t=s.pfValue;return t};Mt.drawText=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,o=n?e.effectiveOpacity():1;if(!(n&&(o===0||e.pstyle("text-opacity").value===0))){t==="main"&&(t=null);var u=yr(s,"labelX",t),l=yr(s,"labelY",t),v,f,c=this.getLabelText(e,t);if(c!=null&&c!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(r,e,n);var h=t?t+"-":"",d=yr(s,"labelWidth",t),y=yr(s,"labelHeight",t),g=yr(s,"labelActualDescent",t),p=e.pstyle(h+"text-margin-x").pfValue,m=e.pstyle(h+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,E=e.pstyle("text-valign").value;b&&(w="center",E="center"),u+=p,l+=m;var C;a?C=this.getTextAngle(e,t):C=0,C!==0&&(v=u,f=l,r.translate(v,f),r.rotate(C),u=0,l=0);var x=Jt(w),S=jt(E);switch(S){case"top":break;case"center":l+=y/2;break;case"bottom":l+=y;break}var k=e.pstyle("text-background-opacity").value,B=e.pstyle("text-border-opacity").value,D=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,A=e.pstyle("text-background-shape").strValue,R=A==="round-rectangle"||A==="roundrectangle",L=A==="circle",I=2;if(k>0||D>0&&B>0){var M=r.fillStyle,O=r.strokeStyle,q=r.lineWidth,_=e.pstyle("text-background-color").value,N=e.pstyle("text-border-color").value,V=e.pstyle("text-border-style").value,Y=k>0,J=D>0&&B>0,Z=u-P;switch(x){case"left":Z-=d;break;case"center":Z-=d/2;break}var ee=l-y-P,re=d+2*P,ne=y+2*P;if(Y&&(r.fillStyle="rgba(".concat(_[0],",").concat(_[1],",").concat(_[2],",").concat(k*o,")")),J&&(r.strokeStyle="rgba(".concat(N[0],",").concat(N[1],",").concat(N[2],",").concat(B*o,")"),r.lineWidth=D,r.setLineDash))switch(V){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=D/4,r.setLineDash([]);break;default:r.setLineDash([]);break}if(R?(r.beginPath(),Gl(r,Z,ee,re,ne,I)):L?(r.beginPath(),Wy(r,Z,ee,re,ne)):(r.beginPath(),r.rect(Z,ee,re,ne)),Y&&r.fill(),J&&r.stroke(),J&&V==="double"){var X=D/2;r.beginPath(),R?Gl(r,Z+X,ee+X,re-2*X,ne-2*X,I):r.rect(Z+X,ee+X,re-2*X,ne-2*X),r.stroke()}r.fillStyle=M,r.strokeStyle=O,r.lineWidth=q,r.setLineDash&&r.setLineDash([])}var F=2*e.pstyle("text-outline-width").pfValue;if(F>0&&(r.lineWidth=F),l-=g,e.pstyle("text-wrap").value==="wrap"){var H=yr(s,"labelWrapCachedLines",t),W=yr(s,"labelLineHeight",t),U=d/2,te=this.getLabelJustification(e);switch(te==="auto"||(x==="left"?te==="left"?u+=-d:te==="center"&&(u+=-U):x==="center"?te==="left"?u+=-U:te==="right"&&(u+=U):x==="right"&&(te==="center"?u+=U:te==="right"&&(u+=d))),S){case"top":l-=(H.length-1)*W;break;case"center":case"bottom":l-=(H.length-1)*W;break}for(var le=0;le0&&r.strokeText(H[le],u,l),r.fillText(H[le],u,l),l+=W}else F>0&&r.strokeText(c,u,l),r.fillText(c,u,l);C!==0&&(r.rotate(-C),r.translate(-v,-f))}}};var pt={};pt.drawNode=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,u,l=e._private,v=l.rscratch,f=e.position();if(!(!ae(f.x)||!ae(f.y))&&!(i&&!e.visible())){var c=i?e.effectiveOpacity():1,h=s.usePaths(),d,y=!1,g=e.padding();o=e.width()+2*g,u=e.height()+2*g;var p;t&&(p=t,r.translate(-p.x1,-p.y1));for(var m=e.pstyle("background-image"),b=m.value,w=new Array(b.length),E=new Array(b.length),C=0,x=0;x0&&arguments[0]!==void 0?arguments[0]:A;s.eleFillStyle(r,e,T)},X=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N;s.colorStrokeStyle(r,R[0],R[1],R[2],T)},F=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Z;s.colorStrokeStyle(r,Y[0],Y[1],Y[2],T)},H=function(T,z,G,$){var K=s.nodePathCache=s.nodePathCache||[],ve=cv(G==="polygon"?G+","+$.join(","):G,""+z,""+T,""+re),j=K[ve],ie,oe=!1;return j!=null?(ie=j,oe=!0,v.pathCache=ie):(ie=new Path2D,K[ve]=v.pathCache=ie),{path:ie,cacheHit:oe}},W=e.pstyle("shape").strValue,U=e.pstyle("shape-polygon-points").pfValue;if(h){r.translate(f.x,f.y);var te=H(o,u,W,U);d=te.path,y=te.cacheHit}var le=function(){if(!y){var T=f;h&&(T={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(d||r,T.x,T.y,o,u,re,v)}h?r.fill(d):r.fill()},De=function(){for(var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,G=l.backgrounding,$=0,K=0;K0&&arguments[0]!==void 0?arguments[0]:!1,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;s.hasPie(e)&&(s.drawPie(r,e,z),T&&(h||s.nodeShapes[s.getNodeShape(e)].draw(r,f.x,f.y,o,u,re,v)))},me=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;s.hasStripe(e)&&(r.save(),h?r.clip(v.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(r,f.x,f.y,o,u,re,v),r.clip()),s.drawStripe(r,e,z),r.restore(),T&&(h||s.nodeShapes[s.getNodeShape(e)].draw(r,f.x,f.y,o,u,re,v)))},ge=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,z=(D>0?D:-D)*T,G=D>0?0:255;D!==0&&(s.colorFillStyle(r,G,G,G,z),h?r.fill(d):r.fill())},se=function(){if(P>0){if(r.lineWidth=P,r.lineCap=M,r.lineJoin=I,r.setLineDash)switch(L){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash(q),r.lineDashOffset=_;break;case"solid":case"double":r.setLineDash([]);break}if(O!=="center"){if(r.save(),r.lineWidth*=2,O==="inside")h?r.clip(d):r.clip();else{var T=new Path2D;T.rect(-o/2-P,-u/2-P,o+2*P,u+2*P),T.addPath(d),r.clip(T,"evenodd")}h?r.stroke(d):r.stroke(),r.restore()}else h?r.stroke(d):r.stroke();if(L==="double"){r.lineWidth=P/3;var z=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",h?r.stroke(d):r.stroke(),r.globalCompositeOperation=z}r.setLineDash&&r.setLineDash([])}},de=function(){if(V>0){if(r.lineWidth=V,r.lineCap="butt",r.setLineDash)switch(J){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([]);break}var T=f;h&&(T={x:0,y:0});var z=s.getNodeShape(e),G=P;O==="inside"&&(G=0),O==="outside"&&(G*=2);var $=(o+G+(V+ee))/o,K=(u+G+(V+ee))/u,ve=o*$,j=u*K,ie=s.nodeShapes[z].points,oe;if(h){var pe=H(ve,j,z,ie);oe=pe.path}if(z==="ellipse")s.drawEllipsePath(oe||r,T.x,T.y,ve,j);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(z)){var Ee=0,Ce=0,fe=0;z==="round-diamond"?Ee=(G+ee+V)*1.4:z==="round-heptagon"?(Ee=(G+ee+V)*1.075,fe=-(G/2+ee+V)/35):z==="round-hexagon"?Ee=(G+ee+V)*1.12:z==="round-pentagon"?(Ee=(G+ee+V)*1.13,fe=-(G/2+ee+V)/15):z==="round-tag"?(Ee=(G+ee+V)*1.12,Ce=(G/2+V+ee)*.07):z==="round-triangle"&&(Ee=(G+ee+V)*(Math.PI/2),fe=-(G+ee/2+V)/Math.PI),Ee!==0&&($=(o+Ee)/o,ve=o*$,["round-hexagon","round-tag"].includes(z)||(K=(u+Ee)/u,j=u*K)),re=re==="auto"?Ev(ve,j):re;for(var ke=ve/2,Pe=j/2,ar=re+(G+V+ee)/2,Ue=new Array(ie.length/2),Pr=new Array(ie.length/2),Ke=0;Ke0){if(n=n||a.position(),i==null||s==null){var h=a.padding();i=a.width()+2*h,s=a.height()+2*h}o.colorFillStyle(t,v[0],v[1],v[2],l),o.nodeShapes[f].draw(t,n.x,n.y,i+u*2,s+u*2,c),t.fill()}}}};pt.drawNodeOverlay=Af("overlay");pt.drawNodeUnderlay=Af("underlay");pt.hasPie=function(r){return r=r[0],r._private.hasPie};pt.hasStripe=function(r){return r=r[0],r._private.hasStripe};pt.drawPie=function(r,e,t,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,u=a.x,l=a.y,v=e.width(),f=e.height(),c=Math.min(v,f)/2,h,d=0,y=this.usePaths();if(y&&(u=0,l=0),i.units==="%"?c=c*i.pfValue:i.pfValue!==void 0&&(c=i.pfValue/2),s.units==="%"?h=c*s.pfValue:s.pfValue!==void 0&&(h=s.pfValue/2),!(h>=c))for(var g=1;g<=n.pieBackgroundN;g++){var p=e.pstyle("pie-"+g+"-background-size").value,m=e.pstyle("pie-"+g+"-background-color").value,b=e.pstyle("pie-"+g+"-background-opacity").value*t,w=p/100;w+d>1&&(w=1-d);var E=1.5*Math.PI+2*Math.PI*d;E+=o;var C=2*Math.PI*w,x=E+C;p===0||d>=1||d+w>1||(h===0?(r.beginPath(),r.moveTo(u,l),r.arc(u,l,c,E,x),r.closePath()):(r.beginPath(),r.arc(u,l,c,E,x),r.arc(u,l,h,x,E,!0),r.closePath()),this.colorFillStyle(r,m[0],m[1],m[2],b),r.fill(),d+=w)}};pt.drawStripe=function(r,e,t,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=a.x,s=a.y,o=e.width(),u=e.height(),l=0,v=this.usePaths();r.save();var f=e.pstyle("stripe-direction").value,c=e.pstyle("stripe-size");switch(f){case"vertical":break;case"righward":r.rotate(-Math.PI/2);break}var h=o,d=u;c.units==="%"?(h=h*c.pfValue,d=d*c.pfValue):c.pfValue!==void 0&&(h=c.pfValue,d=c.pfValue),v&&(i=0,s=0),s-=h/2,i-=d/2;for(var y=1;y<=n.stripeBackgroundN;y++){var g=e.pstyle("stripe-"+y+"-background-size").value,p=e.pstyle("stripe-"+y+"-background-color").value,m=e.pstyle("stripe-"+y+"-background-opacity").value*t,b=g/100;b+l>1&&(b=1-l),!(g===0||l>=1||l+b>1)&&(r.beginPath(),r.rect(i,s+d*l,h,d*b),r.closePath(),this.colorFillStyle(r,p[0],p[1],p[2],m),r.fill(),l+=b)}r.restore()};var br={},$y=100;br.getPixelRatio=function(){var r=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),t=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/t};br.paintCache=function(r){for(var e=this.paintCaches=this.paintCaches||[],t=!0,a,n=0;ne.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!f&&(v[e.NODE]=!0,v[e.SELECT_BOX]=!0);var m=t.style(),b=t.zoom(),w=s!==void 0?s:b,E=t.pan(),C={x:E.x,y:E.y},x={zoom:b,pan:{x:E.x,y:E.y}},S=e.prevViewport,k=S===void 0||x.zoom!==S.zoom||x.pan.x!==S.pan.x||x.pan.y!==S.pan.y;!k&&!(y&&!d)&&(e.motionBlurPxRatio=1),o&&(C=o),w*=u,C.x*=u,C.y*=u;var B=e.getCachedZSortedEles();function D(X,F,H,W,U){var te=X.globalCompositeOperation;X.globalCompositeOperation="destination-out",e.colorFillStyle(X,255,255,255,e.motionBlurTransparency),X.fillRect(F,H,W,U),X.globalCompositeOperation=te}function P(X,F){var H,W,U,te;!e.clearingMotionBlur&&(X===l.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||X===l.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(H={x:E.x*h,y:E.y*h},W=b*h,U=e.canvasWidth*h,te=e.canvasHeight*h):(H=C,W=w,U=e.canvasWidth,te=e.canvasHeight),X.setTransform(1,0,0,1,0,0),F==="motionBlur"?D(X,0,0,U,te):!a&&(F===void 0||F)&&X.clearRect(0,0,U,te),n||(X.translate(H.x,H.y),X.scale(W,W)),o&&X.translate(o.x,o.y),s&&X.scale(s,s)}if(f||(e.textureDrawLastFrame=!1),f){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=t.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var A=e.data.bufferContexts[e.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:u*e.textureMult});var x=e.textureCache.viewport={zoom:t.zoom(),pan:t.pan(),width:e.canvasWidth,height:e.canvasHeight};x.mpan={x:(0-x.pan.x)/x.zoom,y:(0-x.pan.y)/x.zoom}}v[e.DRAG]=!1,v[e.NODE]=!1;var R=l.contexts[e.NODE],L=e.textureCache.texture,x=e.textureCache.viewport;R.setTransform(1,0,0,1,0,0),c?D(R,0,0,x.width,x.height):R.clearRect(0,0,x.width,x.height);var I=m.core("outside-texture-bg-color").value,M=m.core("outside-texture-bg-opacity").value;e.colorFillStyle(R,I[0],I[1],I[2],M),R.fillRect(0,0,x.width,x.height);var b=t.zoom();P(R,!1),R.clearRect(x.mpan.x,x.mpan.y,x.width/x.zoom/u,x.height/x.zoom/u),R.drawImage(L,x.mpan.x,x.mpan.y,x.width/x.zoom/u,x.height/x.zoom/u)}else e.textureOnViewport&&!a&&(e.textureCache=null);var O=t.extent(),q=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),_=e.hideEdgesOnViewport&&q,N=[];if(N[e.NODE]=!v[e.NODE]&&c&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,N[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),N[e.DRAG]=!v[e.DRAG]&&c&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,N[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),v[e.NODE]||n||i||N[e.NODE]){var V=c&&!N[e.NODE]&&h!==1,R=a||(V?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:l.contexts[e.NODE]),Y=c&&!V?"motionBlur":void 0;P(R,Y),_?e.drawCachedNodes(R,B.nondrag,u,O):e.drawLayeredElements(R,B.nondrag,u,O),e.debug&&e.drawDebugPoints(R,B.nondrag),!n&&!c&&(v[e.NODE]=!1)}if(!i&&(v[e.DRAG]||n||N[e.DRAG])){var V=c&&!N[e.DRAG]&&h!==1,R=a||(V?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:l.contexts[e.DRAG]);P(R,c&&!V?"motionBlur":void 0),_?e.drawCachedNodes(R,B.drag,u,O):e.drawCachedElements(R,B.drag,u,O),e.debug&&e.drawDebugPoints(R,B.drag),!n&&!c&&(v[e.DRAG]=!1)}if(this.drawSelectionRectangle(r,P),c&&h!==1){var J=l.contexts[e.NODE],Z=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],ee=l.contexts[e.DRAG],re=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ne=function(F,H,W){F.setTransform(1,0,0,1,0,0),W||!p?F.clearRect(0,0,e.canvasWidth,e.canvasHeight):D(F,0,0,e.canvasWidth,e.canvasHeight);var U=h;F.drawImage(H,0,0,e.canvasWidth*U,e.canvasHeight*U,0,0,e.canvasWidth,e.canvasHeight)};(v[e.NODE]||N[e.NODE])&&(ne(J,Z,N[e.NODE]),v[e.NODE]=!1),(v[e.DRAG]||N[e.DRAG])&&(ne(ee,re,N[e.DRAG]),v[e.DRAG]=!1)}e.prevViewport=x,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),c&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!f,e.mbFrames=0,v[e.NODE]=!0,v[e.DRAG]=!0,e.redraw()},$y)),a||t.emit("render")};var ha;br.drawSelectionRectangle=function(r,e){var t=this,a=t.cy,n=t.data,i=a.style(),s=r.drawOnlyNodeLayer,o=r.drawAllLayers,u=n.canvasNeedsRedraw,l=r.forcedContext;if(t.showFps||!s&&u[t.SELECT_BOX]&&!o){var v=l||n.contexts[t.SELECT_BOX];if(e(v),t.selection[4]==1&&(t.hoverData.selecting||t.touchData.selecting)){var f=t.cy.zoom(),c=i.core("selection-box-border-width").value/f;v.lineWidth=c,v.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",v.fillRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]),c>0&&(v.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",v.strokeRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]))}if(n.bgActivePosistion&&!t.hoverData.selecting){var f=t.cy.zoom(),h=n.bgActivePosistion;v.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",v.beginPath(),v.arc(h.x,h.y,i.core("active-bg-size").pfValue/f,0,2*Math.PI),v.fill()}var d=t.lastRedrawTime;if(t.showFps&&d){d=Math.round(d);var y=Math.round(1e3/d),g="1 frame = "+d+" ms = "+y+" fps";if(v.setTransform(1,0,0,1,0,0),v.fillStyle="rgba(255, 0, 0, 0.75)",v.strokeStyle="rgba(255, 0, 0, 0.75)",v.font="30px Arial",!ha){var p=v.measureText(g);ha=p.actualBoundingBoxAscent}v.fillText(g,0,ha);var m=60;v.strokeRect(0,ha+10,250,20),v.fillRect(0,ha+10,250*Math.min(y/m,1),20)}o||(u[t.SELECT_BOX]=!1)}};function Hl(r,e,t){var a=r.createShader(e);if(r.shaderSource(a,t),r.compileShader(a),!r.getShaderParameter(a,r.COMPILE_STATUS))throw new Error(r.getShaderInfoLog(a));return a}function Uy(r,e,t){var a=Hl(r,r.VERTEX_SHADER,e),n=Hl(r,r.FRAGMENT_SHADER,t),i=r.createProgram();if(r.attachShader(i,a),r.attachShader(i,n),r.linkProgram(i),!r.getProgramParameter(i,r.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function Ky(r,e,t){t===void 0&&(t=e);var a=r.makeOffscreenCanvas(e,t),n=a.context=a.getContext("2d");return a.clear=function(){return n.clearRect(0,0,a.width,a.height)},a.clear(),a}function bo(r){var e=r.pixelRatio,t=r.cy.zoom(),a=r.cy.pan();return{zoom:t*e,pan:{x:a.x*e,y:a.y*e}}}function Xy(r){var e=r.pixelRatio,t=r.cy.zoom();return t*e}function Yy(r,e,t,a,n){var i=a*t+e.x,s=n*t+e.y;return s=Math.round(r.canvasHeight-s),[i,s]}function Zy(r,e){return e.picking?!0:r.pstyle("background-fill").value!=="solid"||r.pstyle("background-image").strValue!=="none"?!1:r.pstyle("border-width").value===0||r.pstyle("border-opacity").value===0?!0:r.pstyle("border-style").value==="solid"}function Qy(r,e){if(r.length!==e.length)return!1;for(var t=0;t>0&255)/255,t[1]=(r>>8&255)/255,t[2]=(r>>16&255)/255,t[3]=(r>>24&255)/255,t}function Jy(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function jy(r,e){var t=r.createTexture();return t.buffer=function(a){r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,a),r.generateMipmap(r.TEXTURE_2D),r.bindTexture(r.TEXTURE_2D,null)},t.deleteTexture=function(){r.deleteTexture(t)},t}function Rf(r,e){switch(e){case"float":return[1,r.FLOAT,4];case"vec2":return[2,r.FLOAT,4];case"vec3":return[3,r.FLOAT,4];case"vec4":return[4,r.FLOAT,4];case"int":return[1,r.INT,4];case"ivec2":return[2,r.INT,4]}}function Mf(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function em(r,e,t,a,n,i){switch(e){case r.FLOAT:return new Float32Array(t.buffer,i*a,n);case r.INT:return new Int32Array(t.buffer,i*a,n)}}function rm(r,e,t,a){var n=Rf(r,e),i=Qe(n,2),s=i[0],o=i[1],u=Mf(r,o,a),l=r.createBuffer();return r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferData(r.ARRAY_BUFFER,u,r.STATIC_DRAW),o===r.FLOAT?r.vertexAttribPointer(t,s,o,!1,0,0):o===r.INT&&r.vertexAttribIPointer(t,s,o,0,0),r.enableVertexAttribArray(t),r.bindBuffer(r.ARRAY_BUFFER,null),l}function Fr(r,e,t,a){var n=Rf(r,t),i=Qe(n,3),s=i[0],o=i[1],u=i[2],l=Mf(r,o,e*s),v=s*u,f=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,f),r.bufferData(r.ARRAY_BUFFER,e*v,r.DYNAMIC_DRAW),r.enableVertexAttribArray(a),o===r.FLOAT?r.vertexAttribPointer(a,s,o,!1,v,0):o===r.INT&&r.vertexAttribIPointer(a,s,o,v,0),r.vertexAttribDivisor(a,1),r.bindBuffer(r.ARRAY_BUFFER,null);for(var c=new Array(e),h=0;hs&&(o=s/a,u=a*o,l=n*o),{scale:o,texW:u,texH:l}}},{key:"draw",value:function(t,a,n){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,u=this.texHeight,l=this.getScale(a),v=l.scale,f=l.texW,c=l.texH,h=function(b,w){if(n&&w){var E=w.context,C=b.x,x=b.row,S=C,k=u*x;E.save(),E.translate(S,k),E.scale(v,v),n(E,a),E.restore()}},d=[null,null],y=function(){h(i.freePointer,i.canvas),d[0]={x:i.freePointer.x,y:i.freePointer.row*u,w:f,h:c},d[1]={x:i.freePointer.x+f,y:i.freePointer.row*u,w:0,h:c},i.freePointer.x+=f,i.freePointer.x==s&&(i.freePointer.x=0,i.freePointer.row++)},g=function(){var b=i.scratch,w=i.canvas;b.clear(),h({x:0,row:0},b);var E=s-i.freePointer.x,C=f-E,x=u;{var S=i.freePointer.x,k=i.freePointer.row*u,B=E;w.context.drawImage(b,0,0,B,x,S,k,B,x),d[0]={x:S,y:k,w:B,h:c}}{var D=E,P=(i.freePointer.row+1)*u,A=C;w&&w.context.drawImage(b,D,0,A,x,0,P,A,x),d[1]={x:0,y:P,w:A,h:c}}i.freePointer.x=C,i.freePointer.row++},p=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+f<=s)y();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(p(),y()):this.enableWrapping?g():(p(),y())}return this.keyToLocation.set(t,d),this.needsBuffer=!0,d}},{key:"getOffsets",value:function(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(t){if(this.locked)return!1;var a=this.texSize,n=this.texRows,i=this.getScale(t),s=i.texW;return this.freePointer.x+s>a?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},i=n.forceRedraw,s=i===void 0?!1:i,o=n.filterEle,u=o===void 0?function(){return!0}:o,l=n.filterType,v=l===void 0?function(){return!0}:l,f=!1,c=!1,h=Cr(t),d;try{for(h.s();!(d=h.n()).done;){var y=d.value;if(u(y)){var g=Cr(this.renderTypes.values()),p;try{var m=function(){var w=p.value,E=w.type;if(v(E)){var C=a.collections.get(w.collection),x=w.getKey(y),S=Array.isArray(x)?x:[x];if(s)S.forEach(function(P){return C.markKeyForGC(P)}),c=!0;else{var k=w.getID?w.getID(y):y.id(),B=a._key(E,k),D=a.typeAndIdToKey.get(B);D!==void 0&&!Qy(S,D)&&(f=!0,a.typeAndIdToKey.delete(B),D.forEach(function(P){return C.markKeyForGC(P)}))}}};for(g.s();!(p=g.n()).done;)m()}catch(b){g.e(b)}finally{g.f()}}}}catch(b){h.e(b)}finally{h.f()}return c&&(this.gc(),f=!1),f}},{key:"gc",value:function(){var t=Cr(this.collections.values()),a;try{for(t.s();!(a=t.n()).done;){var n=a.value;n.gc()}}catch(i){t.e(i)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(t,a,n,i){var s=this.renderTypes.get(a),o=this.collections.get(s.collection),u=!1,l=o.draw(i,n,function(c){s.drawClipped?(c.save(),c.beginPath(),c.rect(0,0,n.w,n.h),c.clip(),s.drawElement(c,t,n,!0,!0),c.restore()):s.drawElement(c,t,n,!0,!0),u=!0});if(u){var v=s.getID?s.getID(t):t.id(),f=this._key(a,v);this.typeAndIdToKey.has(f)?this.typeAndIdToKey.get(f).push(i):this.typeAndIdToKey.set(f,[i])}return l}},{key:"getAtlasInfo",value:function(t,a){var n=this,i=this.renderTypes.get(a),s=i.getKey(t),o=Array.isArray(s)?s:[s];return o.map(function(u){var l=i.getBoundingBox(t,u),v=n.getOrCreateAtlas(t,a,l,u),f=v.getOffsets(u),c=Qe(f,2),h=c[0],d=c[1];return{atlas:v,tex:h,tex1:h,tex2:d,bb:l}})}},{key:"getDebugInfo",value:function(){var t=[],a=Cr(this.collections),n;try{for(a.s();!(n=a.n()).done;){var i=Qe(n.value,2),s=i[0],o=i[1],u=o.getCounts(),l=u.keyCount,v=u.atlasCount;t.push({type:s,keyCount:l,atlasCount:v})}}catch(f){a.e(f)}finally{a.f()}return t}}])})(),vm=(function(){function r(e){dt(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return ht(r,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(t,a){return a})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(t){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(t):!0}},{key:"getAtlasIndexForBatch",value:function(t){var a=this.batchAtlases.indexOf(t);if(a<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(t),a=this.batchAtlases.length-1}return a}}])})(),fm=` + float circleSD(vec2 p, float r) { + return distance(vec2(0), p) - r; // signed distance + } +`,cm=` + float rectangleSD(vec2 p, vec2 b) { + vec2 d = abs(p)-b; + return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0); + } +`,dm=` + float roundRectangleSD(vec2 p, vec2 b, vec4 cr) { + cr.xy = (p.x > 0.0) ? cr.xy : cr.zw; + cr.x = (p.y > 0.0) ? cr.x : cr.y; + vec2 q = abs(p) - b + cr.x; + return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x; + } +`,hm=` + float ellipseSD(vec2 p, vec2 ab) { + p = abs( p ); // symmetry + + // find root with Newton solver + vec2 q = ab*(p-ab); + float w = (q.x1.0) ? d : -d; + } +`,Ea={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},An={IGNORE:1,USE_BB:2},Cs=0,Kl=1,Xl=2,Ts=3,Vt=4,sn=5,ga=6,pa=7,gm=(function(){function r(e,t,a){dt(this,r),this.r=e,this.gl=t,this.maxInstances=a.webglBatchSize,this.atlasSize=a.webglTexSize,this.bgColor=a.bgColor,this.debug=a.webglDebug,this.batchDebugInfo=[],a.enableWrapping=!0,a.createTextureCanvas=Ky,this.atlasManager=new lm(e,a),this.batchManager=new vm(a),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Ea.SCREEN),this.pickingProgram=this._createShaderProgram(Ea.PICKING),this.vao=this._createVAO()}return ht(r,[{key:"addAtlasCollection",value:function(t,a){this.atlasManager.addAtlasCollection(t,a)}},{key:"addTextureAtlasRenderType",value:function(t,a){this.atlasManager.addRenderType(t,a)}},{key:"addSimpleShapeRenderType",value:function(t,a){this.simpleShapeOptions.set(t,a)}},{key:"invalidate",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.type,i=this.atlasManager;return n?i.invalidate(t,{filterType:function(o){return o===n},forceRedraw:!0}):i.invalidate(t)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(t){var a=this.gl,n=`#version 300 es + precision highp float; + + uniform mat3 uPanZoomMatrix; + uniform int uAtlasSize; + + // instanced + in vec2 aPosition; // a vertex from the unit square + + in mat3 aTransform; // used to transform verticies, eg into a bounding box + in int aVertType; // the type of thing we are rendering + + // the z-index that is output when using picking mode + in vec4 aIndex; + + // For textures + in int aAtlasId; // which shader unit/atlas to use + in vec4 aTex; // x/y/w/h of texture in atlas + + // for edges + in vec4 aPointAPointB; + in vec4 aPointCPointD; + in vec2 aLineWidth; // also used for node border width + + // simple shapes + in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left] + in vec4 aColor; // also used for edges + in vec4 aBorderColor; // aLineWidth is used for border width + + // output values passed to the fragment shader + out vec2 vTexCoord; + out vec4 vColor; + out vec2 vPosition; + // flat values are not interpolated + flat out int vAtlasId; + flat out int vVertType; + flat out vec2 vTopRight; + flat out vec2 vBotLeft; + flat out vec4 vCornerRadius; + flat out vec4 vBorderColor; + flat out vec2 vBorderWidth; + flat out vec4 vIndex; + + void main(void) { + int vid = gl_VertexID; + vec2 position = aPosition; // TODO make this a vec3, simplifies some code below + + if(aVertType == `.concat(Cs,`) { + float texX = aTex.x; // texture coordinates + float texY = aTex.y; + float texW = aTex.z; + float texH = aTex.w; + + if(vid == 1 || vid == 2 || vid == 4) { + texX += texW; + } + if(vid == 2 || vid == 4 || vid == 5) { + texY += texH; + } + + float d = float(uAtlasSize); + vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1 + + gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); + } + else if(aVertType == `).concat(Vt," || aVertType == ").concat(pa,` + || aVertType == `).concat(sn," || aVertType == ").concat(ga,`) { // simple shapes + + // the bounding box is needed by the fragment shader + vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat + vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat + vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated + + // calculations are done in the fragment shader, just pass these along + vColor = aColor; + vCornerRadius = aCornerRadius; + vBorderColor = aBorderColor; + vBorderWidth = aLineWidth; + + gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); + } + else if(aVertType == `).concat(Kl,`) { + vec2 source = aPointAPointB.xy; + vec2 target = aPointAPointB.zw; + + // adjust the geometry so that the line is centered on the edge + position.y = position.y - 0.5; + + // stretch the unit square into a long skinny rectangle + vec2 xBasis = target - source; + vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x)); + vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y; + + gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); + vColor = aColor; + } + else if(aVertType == `).concat(Xl,`) { + vec2 pointA = aPointAPointB.xy; + vec2 pointB = aPointAPointB.zw; + vec2 pointC = aPointCPointD.xy; + vec2 pointD = aPointCPointD.zw; + + // adjust the geometry so that the line is centered on the edge + position.y = position.y - 0.5; + + vec2 p0, p1, p2, pos; + if(position.x == 0.0) { // The left side of the unit square + p0 = pointA; + p1 = pointB; + p2 = pointC; + pos = position; + } else { // The right side of the unit square, use same approach but flip the geometry upside down + p0 = pointD; + p1 = pointC; + p2 = pointB; + pos = vec2(0.0, -position.y); + } + + vec2 p01 = p1 - p0; + vec2 p12 = p2 - p1; + vec2 p21 = p1 - p2; + + // Find the normal vector. + vec2 tangent = normalize(normalize(p12) + normalize(p01)); + vec2 normal = vec2(-tangent.y, tangent.x); + + // Find the vector perpendicular to p0 -> p1. + vec2 p01Norm = normalize(vec2(-p01.y, p01.x)); + + // Determine the bend direction. + float sigma = sign(dot(p01 + p21, normal)); + float width = aLineWidth[0]; + + if(sign(pos.y) == -sigma) { + // This is an intersecting vertex. Adjust the position so that there's no overlap. + vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm); + gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); + } else { + // This is a non-intersecting vertex. Treat it like a mitre join. + vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm); + gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); + } + + vColor = aColor; + } + else if(aVertType == `).concat(Ts,` && vid < 3) { + // massage the first triangle into an edge arrow + if(vid == 0) + position = vec2(-0.15, -0.3); + if(vid == 1) + position = vec2( 0.0, 0.0); + if(vid == 2) + position = vec2( 0.15, -0.3); + + gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); + vColor = aColor; + } + else { + gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space + } + + vAtlasId = aAtlasId; + vVertType = aVertType; + vIndex = aIndex; + } + `),i=this.batchManager.getIndexArray(),s=`#version 300 es + precision highp float; + + // declare texture unit for each texture atlas in the batch + `.concat(i.map(function(l){return"uniform sampler2D uTexture".concat(l,";")}).join(` + `),` + + uniform vec4 uBGColor; + uniform float uZoom; + + in vec2 vTexCoord; + in vec4 vColor; + in vec2 vPosition; // model coordinates + + flat in int vAtlasId; + flat in vec4 vIndex; + flat in int vVertType; + flat in vec2 vTopRight; + flat in vec2 vBotLeft; + flat in vec4 vCornerRadius; + flat in vec4 vBorderColor; + flat in vec2 vBorderWidth; + + out vec4 outColor; + + `).concat(fm,` + `).concat(cm,` + `).concat(dm,` + `).concat(hm,` + + vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha + return vec4( + top.rgb + (bot.rgb * (1.0 - top.a)), + top.a + (bot.a * (1.0 - top.a)) + ); + } + + vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance + // scale to the zoom level so that borders don't look blurry when zoomed in + // note 1.5 is an aribitrary value chosen because it looks good + return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); + } + + void main(void) { + if(vVertType == `).concat(Cs,`) { + // look up the texel from the texture unit + `).concat(i.map(function(l){return"if(vAtlasId == ".concat(l,") outColor = texture(uTexture").concat(l,", vTexCoord);")}).join(` + else `),` + } + else if(vVertType == `).concat(Ts,`) { + // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out'; + outColor = blend(vColor, uBGColor); + outColor.a = 1.0; // make opaque, masks out line under arrow + } + else if(vVertType == `).concat(Vt,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border + outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done + } + else if(vVertType == `).concat(Vt," || vVertType == ").concat(pa,` + || vVertType == `).concat(sn," || vVertType == ").concat(ga,`) { // use SDF + + float outerBorder = vBorderWidth[0]; + float innerBorder = vBorderWidth[1]; + float borderPadding = outerBorder * 2.0; + float w = vTopRight.x - vBotLeft.x - borderPadding; + float h = vTopRight.y - vBotLeft.y - borderPadding; + vec2 b = vec2(w/2.0, h/2.0); // half width, half height + vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center + + float d; // signed distance + if(vVertType == `).concat(Vt,`) { + d = rectangleSD(p, b); + } else if(vVertType == `).concat(pa,` && w == h) { + d = circleSD(p, b.x); // faster than ellipse + } else if(vVertType == `).concat(pa,`) { + d = ellipseSD(p, b); + } else { + d = roundRectangleSD(p, b, vCornerRadius.wzyx); + } + + // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling + // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box + if(d > 0.0) { + if(d > outerBorder) { + discard; + } else { + outColor = distInterp(vBorderColor, vec4(0), d - outerBorder); + } + } else { + if(d > innerBorder) { + vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor; + vec4 innerBorderColor = blend(vBorderColor, vColor); + outColor = distInterp(innerBorderColor, outerColor, d); + } + else { + vec4 outerColor; + if(innerBorder == 0.0 && outerBorder == 0.0) { + outerColor = vec4(0); + } else if(innerBorder == 0.0) { + outerColor = vBorderColor; + } else { + outerColor = blend(vBorderColor, vColor); + } + outColor = distInterp(vColor, outerColor, d - innerBorder); + } + } + } + else { + outColor = vColor; + } + + `).concat(t.picking?`if(outColor.a == 0.0) discard; + else outColor = vIndex;`:"",` + } + `),o=Uy(a,n,s);o.aPosition=a.getAttribLocation(o,"aPosition"),o.aIndex=a.getAttribLocation(o,"aIndex"),o.aVertType=a.getAttribLocation(o,"aVertType"),o.aTransform=a.getAttribLocation(o,"aTransform"),o.aAtlasId=a.getAttribLocation(o,"aAtlasId"),o.aTex=a.getAttribLocation(o,"aTex"),o.aPointAPointB=a.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=a.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=a.getAttribLocation(o,"aLineWidth"),o.aColor=a.getAttribLocation(o,"aColor"),o.aCornerRadius=a.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=a.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=a.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=a.getUniformLocation(o,"uAtlasSize"),o.uBGColor=a.getUniformLocation(o,"uBGColor"),o.uZoom=a.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var u=0;u1&&arguments[1]!==void 0?arguments[1]:Ea.SCREEN;this.panZoomMatrix=t,this.renderTarget=a,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,a){return t.visible()?a&&a.isVisible?a.isVisible(t):!0:!1}},{key:"drawTexture",value:function(t,a,n){var i=this.atlasManager,s=this.batchManager,o=i.getRenderTypeOpts(n);if(this._isVisible(t,o)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&o.getTexPickingMode){var u=o.getTexPickingMode(t);if(u===An.IGNORE)return;if(u==An.USE_BB){this.drawPickingRectangle(t,a,n);return}}var l=i.getAtlasInfo(t,n),v=Cr(l),f;try{for(v.s();!(f=v.n()).done;){var c=f.value,h=c.atlas,d=c.tex1,y=c.tex2;s.canAddToCurrentBatch(h)||this.endBatch();for(var g=s.getAtlasIndexForBatch(h),p=0,m=[[d,!0],[y,!1]];p=this.maxInstances&&this.endBatch()}}}}catch(D){v.e(D)}finally{v.f()}}}},{key:"setTransformMatrix",value:function(t,a,n,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(n.shapeProps&&n.shapeProps.padding&&(o=t.pstyle(n.shapeProps.padding).pfValue),i){var u=i.bb,l=i.tex1,v=i.tex2,f=l.w/(l.w+v.w);s||(f=1-f);var c=this._getAdjustedBB(u,o,s,f);this._applyTransformMatrix(a,c,n,t)}else{var h=n.getBoundingBox(t),d=this._getAdjustedBB(h,o,!0,1);this._applyTransformMatrix(a,d,n,t)}}},{key:"_applyTransformMatrix",value:function(t,a,n,i){var s,o;$l(t);var u=n.getRotation?n.getRotation(i):0;if(u!==0){var l=n.getRotationPoint(i),v=l.x,f=l.y;yn(t,t,[v,f]),Ul(t,t,u);var c=n.getRotationOffset(i);s=c.x+(a.xOffset||0),o=c.y+(a.yOffset||0)}else s=a.x1,o=a.y1;yn(t,t,[s,o]),Ws(t,t,[a.w,a.h])}},{key:"_getAdjustedBB",value:function(t,a,n,i){var s=t.x1,o=t.y1,u=t.w,l=t.h,v=t.yOffset;a&&(s-=a,o-=a,u+=2*a,l+=2*a);var f=0,c=u*i;return n&&i<1?u=c:!n&&i<1&&(f=u-c,s+=f,u=c),{x1:s,y1:o,w:u,h:l,xOffset:f,yOffset:v}}},{key:"drawPickingRectangle",value:function(t,a,n){var i=this.atlasManager.getRenderTypeOpts(n),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=Vt;var o=this.indexBuffer.getView(s);Ft(a,o);var u=this.colorBuffer.getView(s);wt([0,0,0],1,u);var l=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(t,l,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,a,n){var i=this.simpleShapeOptions.get(n);if(this._isVisible(t,i)){var s=i.shapeProps,o=this._getVertTypeForShape(t,s.shape);if(o===void 0||i.isSimple&&!i.isSimple(t,this.renderTarget)){this.drawTexture(t,a,n);return}var u=this.instanceCount;if(this.vertTypeBuffer.getView(u)[0]=o,o===sn||o===ga){var l=i.getBoundingBox(t),v=this._getCornerRadius(t,s.radius,l),f=this.cornerRadiusBuffer.getView(u);f[0]=v,f[1]=v,f[2]=v,f[3]=v,o===ga&&(f[0]=0,f[2]=0)}var c=this.indexBuffer.getView(u);Ft(a,c);var h=this.renderTarget.picking?1:n==="node-body"?t.effectiveOpacity():1,d=this.renderTarget.picking?1:t.pstyle(s.opacity).value*h,y=t.pstyle(s.color).value,g=this.colorBuffer.getView(u);wt(y,d,g);var p=this.lineWidthBuffer.getView(u);if(p[0]=0,p[1]=0,s.border){var m=t.pstyle("border-width").value;if(m>0){var b=t.pstyle("border-color").value,w=h*t.pstyle("border-opacity").value,E=this.borderColorBuffer.getView(u);wt(b,w,E);var C=t.pstyle("border-position").value;if(C==="inside")p[0]=0,p[1]=-m;else if(C==="outside")p[0]=m,p[1]=0;else{var x=m/2;p[0]=x,p[1]=-x}}}var S=this.transformBuffer.getMatrixView(u);this.setTransformMatrix(t,S,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,a){var n=t.pstyle(a).value;switch(n){case"rectangle":return Vt;case"ellipse":return pa;case"roundrectangle":case"round-rectangle":return sn;case"bottom-round-rectangle":return ga;default:return}}},{key:"_getCornerRadius",value:function(t,a,n){var i=n.w,s=n.h;if(t.pstyle(a).value==="auto")return lt(i,s);var o=t.pstyle(a).pfValue,u=i/2,l=s/2;return Math.min(o,l,u)}},{key:"drawEdgeArrow",value:function(t,a,n){if(t.visible()){var i=t._private.rscratch,s,o,u;if(n==="source"?(s=i.arrowStartX,o=i.arrowStartY,u=i.srcArrowAngle):(s=i.arrowEndX,o=i.arrowEndY,u=i.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(u)||u==null)){var l=t.pstyle(n+"-arrow-shape").value;if(l!=="none"){var v=t.pstyle(n+"-arrow-color").value,f=t.pstyle("opacity").value,c=t.pstyle("line-opacity").value,h=f*c,d=t.pstyle("width").pfValue,y=t.pstyle("arrow-scale").value,g=this.r.getArrowWidth(d,y),p=this.instanceCount,m=this.transformBuffer.getMatrixView(p);$l(m),yn(m,m,[s,o]),Ws(m,m,[g,g]),Ul(m,m,u),this.vertTypeBuffer.getView(p)[0]=Ts;var b=this.indexBuffer.getView(p);Ft(a,b);var w=this.colorBuffer.getView(p);wt(v,h,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(t,a){if(t.visible()){var n=this._getEdgePoints(t);if(n){var i=t.pstyle("opacity").value,s=t.pstyle("line-opacity").value,o=t.pstyle("width").pfValue,u=t.pstyle("line-color").value,l=i*s;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),n.length==4){var v=this.instanceCount;this.vertTypeBuffer.getView(v)[0]=Kl;var f=this.indexBuffer.getView(v);Ft(a,f);var c=this.colorBuffer.getView(v);wt(u,l,c);var h=this.lineWidthBuffer.getView(v);h[0]=o;var d=this.pointAPointBBuffer.getView(v);d[0]=n[0],d[1]=n[1],d[2]=n[2],d[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var y=0;y=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var a=t._private.rscratch;return!(a.badLine||a.allpts==null||isNaN(a.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var a=t._private.rscratch;if(this._isValidEdge(t)){var n=a.allpts;if(n.length==4)return n;var i=this._getNumSegments(t);return this._getCurveSegmentPoints(n,i)}}},{key:"_getNumSegments",value:function(t){var a=15;return Math.min(Math.max(a,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,a){if(t.length==4)return t;for(var n=Array((a+1)*2),i=0;i<=a;i++)if(i==0)n[0]=t[0],n[1]=t[1];else if(i==a)n[i*2]=t[t.length-2],n[i*2+1]=t[t.length-1];else{var s=i/a;this._setCurvePoint(t,s,n,i*2)}return n}},{key:"_setCurvePoint",value:function(t,a,n,i){if(t.length<=2)n[i]=t[0],n[i+1]=t[1];else{for(var s=Array(t.length-2),o=0;o0}},o=function(f){var c=f.pstyle("text-events").strValue==="yes";return c?An.USE_BB:An.IGNORE},u=function(f){var c=f.position(),h=c.x,d=c.y,y=f.outerWidth(),g=f.outerHeight();return{w:y,h:g,x1:h-y/2,y1:d-g/2}};t.drawing.addAtlasCollection("node",{texRows:r.webglTexRowsNodes}),t.drawing.addAtlasCollection("label",{texRows:r.webglTexRows}),t.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),t.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:u,isSimple:Zy,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:u,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:u,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),t.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:Ss(e.getLabelKey,null),getBoundingBox:ks(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:n(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),t.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:Ss(e.getSourceLabelKey,"source"),getBoundingBox:ks(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:n("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),t.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:Ss(e.getTargetLabelKey,"target"),getBoundingBox:ks(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:n("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var l=Fa(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(v,f){var c=!1;f&&f.length>0&&(c|=t.drawing.invalidate(f)),c&&l()}),ym(t)};function pm(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return iv(t)}function If(r,e){var t=r._private.rscratch;return yr(t,"labelWrapCachedLines",e)||[]}var Ss=function(e,t){return function(a){var n=e(a),i=If(a,t);return i.length>1?i.map(function(s,o){return"".concat(n,"_").concat(o)}):n}},ks=function(e,t){return function(a,n){var i=e(a);if(typeof n=="string"){var s=n.indexOf("_");if(s>0){var o=Number(n.substring(s+1)),u=If(a,t),l=i.h/u.length,v=l*o,f=i.y1+v;return{x1:i.x1,w:i.w,y1:f,h:l,yOffset:v}}}return i}};function ym(r){{var e=r.render;r.render=function(i){i=i||{};var s=r.cy;r.webgl&&(s.zoom()>kf?(mm(r),e.call(r,i)):(bm(r),Nf(r,i,Ea.SCREEN)))}}{var t=r.matchCanvasSize;r.matchCanvasSize=function(i){t.call(r,i),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0}}r.findNearestElements=function(i,s,o,u){return Sm(r,i,s)};{var a=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){a.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var n=r.notify;r.notify=function(i,s){n.call(r,i,s),i==="viewport"||i==="bounds"?r.pickingFrameBuffer.needsDraw=!0:i==="background"&&r.drawing.invalidate(s,{type:"node-body"})}}}function mm(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function bm(r){var e=function(a){a.save(),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,r.canvasWidth,r.canvasHeight),a.restore()};e(r.data.contexts[r.NODE]),e(r.data.contexts[r.DRAG])}function wm(r){var e=r.canvasWidth,t=r.canvasHeight,a=bo(r),n=a.pan,i=a.zoom,s=Es();yn(s,s,[n.x,n.y]),Ws(s,s,[i,i]);var o=Es();im(o,e,t);var u=Es();return nm(u,o,s),u}function Of(r,e){var t=r.canvasWidth,a=r.canvasHeight,n=bo(r),i=n.pan,s=n.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,a),e.translate(i.x,i.y),e.scale(s,s)}function xm(r,e){r.drawSelectionRectangle(e,function(t){return Of(r,t)})}function Em(r){var e=r.data.contexts[r.NODE];e.save(),Of(r,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function Cm(r){var e=function(n,i,s){for(var o=n.atlasManager.getAtlasCollection(i),u=r.data.contexts[r.NODE],l=o.atlases,v=0;v=0&&w.add(x)}return w}function Sm(r,e,t){var a=Tm(r,e,t),n=r.getCachedZSortedEles(),i,s,o=Cr(a),u;try{for(o.s();!(u=o.n()).done;){var l=u.value,v=n[l];if(!i&&v.isNode()&&(i=v),!s&&v.isEdge()&&(s=v),i&&s)break}}catch(f){o.e(f)}finally{o.f()}return[i,s].filter(Boolean)}function Ds(r,e,t){var a=r.drawing;e+=1,t.isNode()?(a.drawNode(t,e,"node-underlay"),a.drawNode(t,e,"node-body"),a.drawTexture(t,e,"label"),a.drawNode(t,e,"node-overlay")):(a.drawEdgeLine(t,e),a.drawEdgeArrow(t,e,"source"),a.drawEdgeArrow(t,e,"target"),a.drawTexture(t,e,"label"),a.drawTexture(t,e,"edge-source-label"),a.drawTexture(t,e,"edge-target-label"))}function Nf(r,e,t){var a;r.webglDebug&&(a=performance.now());var n=r.drawing,i=0;if(t.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&xm(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var s=r.data.contexts[r.WEBGL];t.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=wm(r),u=r.getCachedZSortedEles();if(i=u.length,n.startFrame(o,t),t.screen){for(var l=0;l0&&s>0){h.clearRect(0,0,i,s),h.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(r.full)h.translate(-a.x1*l,-a.y1*l),h.scale(l,l),this.drawElements(h,d),h.scale(1/l,1/l),h.translate(a.x1*l,a.y1*l);else{var y=e.pan(),g={x:y.x*l,y:y.y*l};l*=e.zoom(),h.translate(g.x,g.y),h.scale(l,l),this.drawElements(h,d),h.scale(1/l,1/l),h.translate(-g.x,-g.y)}r.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=r.bg,h.rect(0,0,i,s),h.fill())}return c};function km(r,e){for(var t=atob(r),a=new ArrayBuffer(t.length),n=new Uint8Array(a),i=0;i"u"?"undefined":rr(OffscreenCanvas))!=="undefined")t=new OffscreenCanvas(r,e);else{var a=this.cy.window(),n=a.document;t=n.createElement("canvas"),t.width=r,t.height=e}return t};[Bf,Wr,Qr,mo,Mt,pt,br,Lf,yt,Wa,Vf].forEach(function(r){ye(Te,r)});var Pm=[{name:"null",impl:df},{name:"base",impl:Tf},{name:"canvas",impl:Dm}],Am=[{type:"layout",extensions:jp},{type:"renderer",extensions:Pm}],_f={},Gf={};function Hf(r,e,t){var a=t,n=function(S){ze("Can not register `"+e+"` for `"+r+"` since `"+S+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(Ra.prototype[e])return n(e);Ra.prototype[e]=t}else if(r==="collection"){if(lr.prototype[e])return n(e);lr.prototype[e]=t}else if(r==="layout"){for(var i=function(S){this.options=S,t.call(this,S),Me(this._private)||(this._private={}),this._private.cy=S.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(t.prototype),o=[],u=0;uMath.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,m,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==m&&r.add(i),n!==m&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,m=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(m,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",m=0,c={})=>{const r=s.x,f=s.y-m,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const m=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;m.has(h)||m.set(h,[]),m.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),m.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},y=Z(s,n,r,i.start,o),X=ee(n,y,t,p.width??0),S=te(n,X,y,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,m,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX + Node.id = `,d,` + data=`,u.height,` +Parent cluster`,c.height),t.setNode(c.id,u),t.parent(d)||(l.trace("Setting parent",d,c.id),t.setParent(d,c.id,u))}if(l.info("(Insert) Node XXX"+d+": "+JSON.stringify(t.node(d))),e?.clusterNode){l.info("Cluster identified XBX",d,e.width,t.node(d));const{ranksep:u,nodesep:x}=t.graph();e.graph.setGraph({...e.graph.graph(),ranksep:u+25,nodesep:x});const N=await T(n,e.graph,g,m,t.node(d),o),M=N.elem;W(e,M),e.diff=N.diff||0,l.info("New compound node after recursive render XAX",d,"width",e.width,"height",e.height),$(M,e)}else t.children(d).length>0?(l.trace("Cluster - the non recursive path XBX",d,e.id,e,e.width,"Graph:",t),l.trace(P(e.id,t)),E.set(e.id,{id:P(e.id,t),node:e})):(l.trace("Node - the non recursive path XAX",d,n,t.node(d),r),await j(n,t.node(d),{config:o,dir:r}))})),await w(async()=>{const d=t.edges().map(async function(e){const u=t.edge(e.v,e.w,e.name);if(l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),l.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),l.info("Fix",E,"ids:",e.v,e.w,"Translating: ",E.get(e.v),E.get(e.w)),p&&u.selfLoop){if(u.selfLoop.order!==1)return;const x=u.id;u.id=u.selfLoop.id,await G(i,u),u.id=x;return}await G(i,u)});await Promise.all(d)},"processEdges")(),l.info("Graph before layout:",JSON.stringify(I(t))),l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),U(t),l.info("Graph after layout:",JSON.stringify(I(t)));let X=0,{subGraphTitleTotalMargin:S}=q(o);await Promise.all(A(t).map(async function(d){const e=t.node(d);if(l.info("Position XBX => "+d+": ("+e.x,","+e.y,") width: ",e.width," height: ",e.height),e?.clusterNode)e.y+=S,l.info("A tainted cluster node XBX1",d,e.id,e.width,e.height,e.x,e.y,t.parent(d)),E.get(e.id).node=e,R(e);else if(t.children(d).length>0){l.info("A pure cluster node XBX1",d,e.id,e.x,e.y,e.width,e.height,t.parent(d)),e.height+=S,t.node(e.parentId);const u=e?.padding/2||0,x=e?.labelBBox?.height||0,N=x-u||0;l.debug("OffsetY",N,"labelHeight",x,"halfPadding",u),await F(h,e),E.get(e.id).node=e}else{const u=t.node(e.parentId);e.y+=S/2,l.info("A regular node XBX1 - using the padding",e.id,"parent",e.parentId,e.width,e.height,e.x,e.y,"offsetY",e.offsetY,"parent",u,u?.offsetY,e),R(e)}}));const b=S/2;return ne(t,b,{mergeSelfLoops:p}).forEach(function({edge:d,start:e,end:u}){l.info("Edge "+e+" -> "+u+": "+JSON.stringify(d),d),d.points.forEach(k=>k.y+=b);const x=t.node(e),N=t.node(u),M=z(a,d,E,g,x,N,m);K(d,M)}),t.nodes().forEach(function(d){const e=t.node(d);l.info(d,e.type,e.diff),e.isGroup&&(X=e.diff)}),l.warn("Returning from recursive render XAX",f,X),{elem:f,diff:X}},"recursiveRender"),le=w(async(s,t)=>{const g=new Q({multigraph:!0,compound:!0}).setGraph({rankdir:s.direction,nodesep:s.config?.nodeSpacing||s.config?.flowchart?.nodeSpacing||s.nodeSpacing,ranksep:s.config?.rankSpacing||s.config?.flowchart?.rankSpacing||s.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),m=t.select("g");v(m,s.markers,s.type,s.diagramId),D(),H(),Y(),O(),s.nodes.forEach(o=>{g.setNode(o.id,{...o}),o.parentId&&g.setParent(o.id,o.parentId)}),l.debug("Edges:",s.edges),s.edges.forEach(o=>{if(o.start===o.end){const r=o.start,f=r+"---"+r+"---1",h=r+"---"+r+"---2",a=g.node(r);g.setNode(f,{domId:f,id:f,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),g.setParent(f,a.parentId),g.setNode(h,{domId:h,id:h,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),g.setParent(h,a.parentId);const i=structuredClone(o),n=structuredClone(o),p=structuredClone(o),y=structuredClone(o);n.originalEdge=i,n.selfLoop={id:i.id,order:0},p.originalEdge=i,p.selfLoop={id:i.id,order:1},y.originalEdge=i,y.selfLoop={id:i.id,order:2},n.label="",n.arrowTypeEnd="none",n.endLabelLeft="",n.endLabelRight="",n.startLabelLeft="",n.id=r+"-cyclic-special-1",p.startLabelRight="",p.startLabelLeft="",p.endLabelLeft="",p.endLabelRight="",p.arrowTypeStart="none",p.arrowTypeEnd="none",p.id=r+"-cyclic-special-mid",y.label="",y.startLabelRight="",y.startLabelLeft="",y.arrowTypeStart="none",a.isGroup&&(n.fromCluster=r,y.toCluster=r),y.id=r+"-cyclic-special-2",y.arrowTypeStart="none",g.setEdge(r,f,n,r+"-cyclic-special-0"),g.setEdge(f,h,p,r+"-cyclic-special-1"),g.setEdge(h,r,y,r+"-cyclic-special-2")}else g.setEdge(o.start,o.end,{...o},o.id)}),l.warn("Graph at first:",JSON.stringify(I(g))),J(g),l.warn("Graph after XAX:",JSON.stringify(I(g)));const c=_();await T(m,g,s.type,s.diagramId,void 0,c)},"render");export{ne as getEdgesToRender,le as render}; diff --git a/internal/webapp/static/assets/defaultLocale-DX6XiGOO.js b/internal/webapp/static/assets/defaultLocale-DX6XiGOO.js new file mode 100644 index 0000000..f001d16 --- /dev/null +++ b/internal/webapp/static/assets/defaultLocale-DX6XiGOO.js @@ -0,0 +1 @@ +function J(n){return Math.abs(n=Math.round(n))>=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function j(n,t){if(!isFinite(n)||n===0)return null;var e=(n=t?n.toExponential(t-1):n.toExponential()).indexOf("e"),i=n.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+n.slice(e+1)]}function K(n){return n=j(Math.abs(n)),n?n[1]:NaN}function Q(n,t){return function(e,i){for(var o=e.length,a=[],c=0,h=n[0],M=0;o>0&&h>0&&(M+h+1>i&&(h=Math.max(1,i-M)),a.push(e.substring(o-=h,o+h)),!((M+=h+1)>i));)h=n[c=(c+1)%n.length];return a.reverse().join(t)}}function V(n){return function(t){return t.replace(/[0-9]/g,function(e){return n[+e]})}}var W=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $(n){if(!(t=W.exec(n)))throw new Error("invalid format: "+n);var t;return new L({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}$.prototype=L.prototype;function L(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}L.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function _(n){n:for(var t=n.length,e=1,i=-1,o;e0&&(i=0);break}return i>0?n.slice(0,i)+n.slice(o+1):n}var N;function v(n,t){var e=j(n,t);if(!e)return N=void 0,n.toPrecision(t);var i=e[0],o=e[1],a=o-(N=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,c=i.length;return a===c?i:a>c?i+new Array(a-c+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+j(n,Math.max(0,t+a-1))[0]}function X(n,t){var e=j(n,t);if(!e)return n+"";var i=e[0],o=e[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}const O={"%":(n,t)=>(n*100).toFixed(t),b:n=>Math.round(n).toString(2),c:n=>n+"",d:J,e:(n,t)=>n.toExponential(t),f:(n,t)=>n.toFixed(t),g:(n,t)=>n.toPrecision(t),o:n=>Math.round(n).toString(8),p:(n,t)=>X(n*100,t),r:X,s:v,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function R(n){return n}var U=Array.prototype.map,Y=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nn(n){var t=n.grouping===void 0||n.thousands===void 0?R:Q(U.call(n.grouping,Number),n.thousands+""),e=n.currency===void 0?"":n.currency[0]+"",i=n.currency===void 0?"":n.currency[1]+"",o=n.decimal===void 0?".":n.decimal+"",a=n.numerals===void 0?R:V(U.call(n.numerals,String)),c=n.percent===void 0?"%":n.percent+"",h=n.minus===void 0?"−":n.minus+"",M=n.nan===void 0?"NaN":n.nan+"";function T(f,g){f=$(f);var b=f.fill,p=f.align,m=f.sign,w=f.symbol,S=f.zero,E=f.width,F=f.comma,y=f.precision,C=f.trim,d=f.type;d==="n"?(F=!0,d="g"):O[d]||(y===void 0&&(y=12),C=!0,d="g"),(S||b==="0"&&p==="=")&&(S=!0,b="0",p="=");var q=(g&&g.prefix!==void 0?g.prefix:"")+(w==="$"?e:w==="#"&&/[boxX]/.test(d)?"0"+d.toLowerCase():""),B=(w==="$"?i:/[%p]/.test(d)?c:"")+(g&&g.suffix!==void 0?g.suffix:""),D=O[d],H=/[defgprs%]/.test(d);y=y===void 0?6:/[gprs]/.test(d)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function G(r){var l=q,u=B,x,I,k;if(d==="c")u=D(r)+u,r="";else{r=+r;var P=r<0||1/r<0;if(r=isNaN(r)?M:D(Math.abs(r),y),C&&(r=_(r)),P&&+r==0&&m!=="+"&&(P=!1),l=(P?m==="("?m:h:m==="-"||m==="("?"":m)+l,u=(d==="s"&&!isNaN(r)&&N!==void 0?Y[8+N/3]:"")+u+(P&&m==="("?")":""),H){for(x=-1,I=r.length;++xk||k>57){u=(k===46?o+r.slice(x+1):r.slice(x))+u,r=r.slice(0,x);break}}}F&&!S&&(r=t(r,1/0));var z=l.length+r.length+u.length,s=z>1)+l+r+u+s.slice(z);break;default:r=s+l+r+u;break}return a(r)}return G.toString=function(){return f+""},G}function Z(f,g){var b=Math.max(-8,Math.min(8,Math.floor(K(g)/3)))*3,p=Math.pow(10,-b),m=T((f=$(f),f.type="f",f),{suffix:Y[8+b/3]});return function(w){return m(p*w)}}return{format:T,formatPrefix:Z}}var A,tn,rn;en({thousands:",",grouping:[3],currency:["$",""]});function en(n){return A=nn(n),tn=A.format,rn=A.formatPrefix,A}export{rn as a,tn as b,K as e,$ as f}; diff --git a/internal/webapp/static/assets/diagram-7IWD3JNH-CsOlUumf.js b/internal/webapp/static/assets/diagram-7IWD3JNH-CsOlUumf.js new file mode 100644 index 0000000..0006321 --- /dev/null +++ b/internal/webapp/static/assets/diagram-7IWD3JNH-CsOlUumf.js @@ -0,0 +1,30 @@ +import{I as X}from"./chunk-2Q5K7J3B-Krb_H4ce.js";import{p as O}from"./chunk-JWPE2WC7-Czg53Rx5.js";import{n as G,b as Y,s as P,o as j,g as F,a as Z,_ as f,A,l as D,D as q,e as U,y as N,p as J,i as K,ai as Q,B as ee,aj as te}from"./mermaid.core-B7WVQkyL.js";import{p as ne}from"./cynefin-VYW2F7L2-CdOzebfq.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(` +`),t=new Map;let r=-1;for(const[s,o]of e.entries())if(o.trim()==="treeView-beta"){r=s;break}if(r===-1)return{text:n,lineMap:t};const i=[];for(let s=r+1;s({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=f(()=>{x.reset(),J()},"clear"),se=f(()=>x.records.stack[0],"getRoot"),ae=f(()=>x.records.cnt,"getCount"),ce=ee.treeView,le=f(()=>A(ce,N().treeView),"getConfig"),de=f((n,e,t,r,i,a)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const c={id:x.records.cnt++,level:n,name:e,nodeType:t,icon:i,cssClass:r,description:a,children:[]};x.records.stack[x.records.stack.length-1].children.push(c),x.records.stack.push(c)},"addNode"),he={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:Z,getAccDescription:F,getDiagramTitle:j,setAccDescription:P,setAccTitle:Y,setDiagramTitle:G},I=he,pe=f(n=>{O(n,I);for(const e of n.nodes){const t=typeof e.indent=="number"?e.indent:0;let r=e.name;const i=r.endsWith("/");i&&(r=r.slice(0,-1));const a=i?"directory":"file",c=e.classAnnotation||void 0,l=e.iconAnnotation,s=l!==void 0?l||"none":void 0,o=e.descAnnotation||void 0,h=o?K(o,N()):void 0;I.addNode(t,r,a,c,s,h)}},"populate"),fe={parse:f(async n=>{const{text:e,lineMap:t}=R(n);try{const r=await ne("treeView",e);D.debug(r),pe(r)}catch(r){throw t.size>0&&r instanceof Error&&(r.message=M(r.message,t)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function H(n,e){const t=e?.filenameIcons?.[n];if(t)return t;const r=n.lastIndexOf(".");if(r>0){const i=n.substring(r).toLowerCase(),a=e?.extensionIcons;return a?.[i]??a?.[i.slice(1)]}}f(H,"detectIcon");function C(n,e){return n.includes(":")?n:n in b.icons||!e?`${b.prefix}:${n}`:`${e}:${n}`}f(C,"qualifyIcon");function B(n,e){if(n.icon!=="none"){if(n.icon)return C(n.icon,e.defaultIconPack);if(e.showIcons){if(n.nodeType==="file"){const t=H(n.name,e);if(t==="none")return;if(t)return C(t,e.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}f(B,"getNodeIcon");te([{name:b.prefix,icons:b}]);var y=14,ge=4,ue=16,z=f((n,e)=>`tv-icon-${n}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),we=f(async(n,e,t,r)=>{const i=new Set,a=f(s=>{const o=B(s,t);o&&i.add(o),s.children.forEach(a)},"collect");if(a(e),i.size===0)return;const c=await Promise.all([...i].map(async s=>({icon:s,svg:await Q(s,{height:y,width:y})}))),l=n.append("defs");for(const{icon:s,svg:o}of c)l.append("g").attr("id",z(r,s)).html(o)},"injectIconDefs"),me=f((n,e,t,r,i,a)=>{const c=r.append("g");let l="treeView-node-label";t.nodeType==="directory"&&(l+=" treeView-node-dir"),t.cssClass&&(l+=` ${t.cssClass}`);const s=y+ge,o=B(t,i),h=o!==void 0;o&&c.append("use").attr("xlink:href",`#${z(a,o)}`).attr("x",n+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const p=c.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:d,width:w}=p.node().getBBox(),g=d+i.paddingY*2,m=n+i.paddingX+(h?s:0);p.attr("x",m),p.attr("y",e+g/2);const u=m+w,v=w+i.paddingX*2+(h?s:0);return t.BBox={x:n,y:e,width:v,height:g},t.cssClass?.split(/\s+/).includes("highlight")&&c.insert("rect",":first-child").attr("x",n).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:t,nodeGroup:c,labelRightEdge:u,centerY:e+g/2}},"positionLabel"),T=f((n,e,t,r,i,a)=>n.append("line").attr("x1",e).attr("y1",t).attr("x2",r).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),xe=f((n,e,t,r)=>{let i=0,a=0;const c=[],l=f((h,p,d,w)=>{const g=w*(d.rowIndent+d.paddingX),m=me(g,i,p,h,d,r);c.push(m);const{height:u,width:v}=p.BBox;T(h,g-d.rowIndent,i+u/2,g,i+u/2,d.lineThickness),a=Math.max(a,g+v),i+=u},"drawNode"),s=f((h,p=0)=>{l(n,h,t,p),h.children.forEach(m=>{s(m,p+1)});const{x:d,y:w,height:g}=h.BBox;if(h.children.length){const{y:m,height:u}=h.children[h.children.length-1].BBox;T(n,d+t.paddingX,w+g,d+t.paddingX,m+u/2+t.lineThickness/2,t.lineThickness)}},"processNode");s(e);const o=c.filter(h=>h.node.description);if(o.length>0){const p=Math.max(...c.map(d=>d.labelRightEdge))+ue;for(const d of o){const g=d.nodeGroup.append("text").text(d.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",p).attr("y",d.centerY).node().getBBox();a=Math.max(a,p+g.width+t.paddingX)}}for(const h of c)if(h.node.cssClass?.split(/\s+/).includes("highlight")){const p=h.nodeGroup.select(".treeView-highlight-bg");if(!p.empty()){const d=a-h.node.BBox.x+8;p.attr("width",d),a=Math.max(a,h.node.BBox.x+d+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),ve=f(async(n,e,t,r)=>{D.debug(`Rendering treeView diagram +`+n);const i=r.db,a=i.getRoot(),c=i.getConfig(),l=q(e);await we(l,a,c,e);const s=l.append("g");s.attr("class","tree-view");const{totalHeight:o,totalWidth:h}=xe(s,a,c,e);l.attr("viewBox",`-${c.lineThickness/2} 0 ${h} ${o}`),U(l,o,h,c.useMaxWidth)},"draw"),be={draw:ve},Ie=be,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},ye=f(({treeView:n})=>{const{labelFontSize:e,labelColor:t,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:c,highlightStroke:l}=A(Ce,n);return` + .treeView-node-label { + font-size: ${e}; + fill: ${t}; + white-space: pre; + } + .treeView-node-dir { + font-weight: bold; + } + .treeView-node-line { + stroke: ${r}; + } + .treeView-node-icon { + color: ${i}; + } + .treeView-node-description { + font-size: ${e}; + fill: ${a}; + font-style: italic; + white-space: pre; + } + .treeView-highlight-bg { + fill: ${c}; + stroke: ${l}; + stroke-width: 1; + } + `},"styles"),Be=ye,Ne={db:I,renderer:Ie,parser:fe,styles:Be};export{Ne as diagram}; diff --git a/internal/webapp/static/assets/diagram-B4RE2ZJO-D1KNNV8U.js b/internal/webapp/static/assets/diagram-B4RE2ZJO-D1KNNV8U.js new file mode 100644 index 0000000..211d041 --- /dev/null +++ b/internal/webapp/static/assets/diagram-B4RE2ZJO-D1KNNV8U.js @@ -0,0 +1,3 @@ +import{p as re}from"./chunk-JWPE2WC7-Czg53Rx5.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,d as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,ak as pe}from"./mermaid.core-B7WVQkyL.js";import{p as be,i as ve}from"./cynefin-VYW2F7L2-CdOzebfq.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ +`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[$]:V,[S]:J},Be={[D]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=T(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var Te=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+` +`,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),$e={draw:Te},De=o(e=>"","getStyles"),Ne=De,Ue={parser:Ee,db:F,renderer:$e,styles:Ne};export{Ue as diagram}; diff --git a/internal/webapp/static/assets/diagram-LBJQPF4R-Cj_6Wlkl.js b/internal/webapp/static/assets/diagram-LBJQPF4R-Cj_6Wlkl.js new file mode 100644 index 0000000..5ee4d73 --- /dev/null +++ b/internal/webapp/static/assets/diagram-LBJQPF4R-Cj_6Wlkl.js @@ -0,0 +1,24 @@ +import{p as $}from"./chunk-JWPE2WC7-Czg53Rx5.js";import{_ as b,A as m,D as C,e as S,l as w,b as D,a as T,n as P,o as z,g as A,s as E,y as F,B as W,p as _}from"./mermaid.core-B7WVQkyL.js";import{p as N}from"./cynefin-VYW2F7L2-CdOzebfq.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var L=W.packet,u,v=(u=class{constructor(){this.packet=[],this.setAccTitle=D,this.getAccTitle=T,this.setDiagramTitle=P,this.getDiagramTitle=z,this.getAccDescription=A,this.setAccDescription=E}getConfig(){const t=m({...L,...F().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){_(),this.packet=[]}},b(u,"PacketDB"),u),M=1e4,Y=b((e,t)=>{$(e,t);let r=-1,o=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];const o=t*r-1,n=t*r;return[{start:e.start,end:o,label:e.label,bits:o-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{const t=await N("packet",e),r=x.parser?.yy;if(!(r instanceof v))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");w.debug(t),Y(t,r)},"parse")},O=b((e,t,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=C(t);f.attr("viewBox",`0 0 ${k} ${g}`),S(f,g,k,l.useMaxWidth);for(const[y,B]of p.entries())j(f,B,y,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),j=b((e,t,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=r*(o+l)+l;for(const s of t){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),G={draw:O},H={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},K=b(({packet:e}={})=>{const t=m(H,e);return` + .packetByte { + font-size: ${t.byteFontSize}; + } + .packetByte.start { + fill: ${t.startByteColor}; + } + .packetByte.end { + fill: ${t.endByteColor}; + } + .packetLabel { + fill: ${t.labelColor}; + font-size: ${t.labelFontSize}; + } + .packetTitle { + fill: ${t.titleColor}; + font-size: ${t.titleFontSize}; + } + .packetBlock { + stroke: ${t.blockStrokeColor}; + stroke-width: ${t.blockStrokeWidth}; + fill: ${t.blockFillColor}; + } + `},"styles"),Q={parser:x,get db(){return new v},renderer:G,styles:K};export{Q as diagram}; diff --git a/internal/webapp/static/assets/diagram-Q27KOJAE-CveaUqzz.js b/internal/webapp/static/assets/diagram-Q27KOJAE-CveaUqzz.js new file mode 100644 index 0000000..c8c4014 --- /dev/null +++ b/internal/webapp/static/assets/diagram-Q27KOJAE-CveaUqzz.js @@ -0,0 +1,24 @@ +import{p as ge}from"./chunk-JWPE2WC7-Czg53Rx5.js";import{_ as w,E as ye,y as ae,A as ee,D as Se,e as ve,l as te,be as B,d as U,b as xe,a as be,n as we,o as Ce,g as Te,s as Le,B as $e,bf as Ae,p as Fe}from"./mermaid.core-B7WVQkyL.js";import{s as Ne}from"./chunk-KBJHAD2P-CHI3y1em.js";import{p as Me}from"./cynefin-VYW2F7L2-CdOzebfq.js";import{b as O}from"./defaultLocale-DX6XiGOO.js";import{o as Q}from"./ordinal-Cboi1Yqb.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function _e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ke(){return this.eachAfter(_e)}function ze(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function Ve(t,a){for(var l=this,n=[l],r,i,h=-1;l=n.pop();)if(t.call(a,l,++h,this),r=l.children)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}function De(t,a){for(var l=this,n=[l],r=[],i,h,d,g=-1;l=n.pop();)if(r.push(l),i=l.children)for(h=0,d=i.length;h=0;)l+=n[r].value;a.value=l})}function Ee(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Re(t){for(var a=this,l=We(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function We(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function He(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Ie(){return Array.from(this)}function Oe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ge(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*qe(){var t=this,a,l=[t],n,r,i;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,i=n.length;r=0;--d)r.push(i=h[d]=new Z(h[d])),i.parent=n,i.depth=n.depth+1;return l.eachBefore(Ze)}function Xe(){return ne(this).eachBefore(Ue)}function Ye(t){return t.children}function je(t){return Array.isArray(t)?t[1]:null}function Ue(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ze(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Z(t){this.data=t,this.depth=this.height=0,this.parent=null}Z.prototype=ne.prototype={constructor:Z,count:ke,each:ze,eachAfter:De,eachBefore:Ve,find:Pe,sum:Be,sort:Ee,path:Re,ancestors:He,descendants:Ie,leaves:Oe,links:Ge,copy:Xe,[Symbol.iterator]:qe};function Je(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function q(t){return function(){return t}}function Ke(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Qe(t,a,l,n,r){for(var i=t.children,h,d=-1,g=i.length,c=t.value&&(n-a)/t.value;++dN&&(N=c),M=u*u*W,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?n:1)},l})(tt);function lt(){var t=nt,a=!1,l=1,n=1,r=[0],i=G,h=G,d=G,g=G,c=G;function p(s){return s.x0=s.y0=0,s.x1=l,s.y1=n,s.eachBefore(b),r=[0],a&&s.eachBefore(Ke),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{Ae(i)&&(n?.textStyles?n.textStyles.push(i):n.textStyles=[i]),n?.styles?n.styles.push(i):n.styles=[i]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){return this.classes.get(a)?.styles??[]}clear(){Fe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(R,"TreeMapDB"),R);function ce(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n?.classSelector,n?.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const i=l[l.length-1].node;i.children?i.children.push(r):i.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}w(ce,"buildHierarchy");var rt=w((t,a)=>{ge(t,a);const l=[];for(const i of t.TreemapRows??[])i.$type==="ClassDefStatement"&&a.addClass(i.className??"",i.styleText??"");for(const i of t.TreemapRows??[]){const h=i.item;if(!h)continue;const d=i.indent?parseInt(i.indent):0,g=st(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};l.push(b)}const n=ce(l),r=w((i,h)=>{for(const d of i)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(n,0)},"populate"),st=w(t=>t.name?String(t.name):"","getItemName"),he={parser:{yy:void 0},parse:w(async t=>{try{const l=await Me("treemap",t);te.debug("Treemap AST:",l);const n=he.parser?.yy;if(!(n instanceof oe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");rt(l,n)}catch(a){throw te.error("Error parsing treemap:",a),a}},"parse")},it=10,E=10,X=25,ot=w((t,a,l,n)=>{const r=n.db,i=r.getConfig(),h=i.padding??it,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=ae();if(!g)return;const p=d?30:0,b=Se(a),s=i.nodeWidth?i.nodeWidth*E:960,x=i.nodeHeight?i.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),ve(b,v,S,i.useMaxWidth);let u;try{const e=i.valueFormat||",";if(e==="$0,0")u=w(o=>"$"+O(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),f=o?o[0]:"";u=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);u=w(f=>"$"+O(o||"")(f),"valueFormat")}else u=O(e)}catch(e){te.error("Error creating format function:",e),u=O(",")}const y=Q().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=Q().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=Q().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),W=ne(g).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),le=lt().size([s,x]).paddingTop(e=>e.children&&e.children.length>0?X+E:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?E:0).paddingRight(e=>e.children&&e.children.length>0?E:0).paddingBottom(e=>e.children&&e.children.length>0?E:0).round(!0)(W),de=le.descendants().filter(e=>e.children&&e.children.length>0),H=V.selectAll(".treemapSection").data(de).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=B({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=U(this),f=e.data.name;o.text(f);const C=e.x1-e.x0,L=6;let T;i.showValues!==!1&&e.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=o.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){o.text("..."),_.getComputedTextLength()>m&&o.text("");break}if(o.text(z+"..."),_.getComputedTextLength()<=m)break}}}),i.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?u(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")});const re=le.leaves(),A=re.length>20,pe=A?16:38,Y=A?14:28,D=A?4:8,I=A?4:6,J=A?2:4,se=A?8:10,K=A?1:2,j=V.selectAll(".treemapLeafGroup").data(re).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${pe}px;fill:`+$(e.data.name)+";",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=U(this),f=e.x1-e.x0,C=e.y1-e.y0,L=o.node(),T=f-2*J,P=C-2*J;if(TT&&m>D;)m--,o.style("font-size",`${m}px`);let F=Math.max(I,Math.min(Y,Math.round(m*_))),k=m+K+F;for(;k>P&&m>D&&(m--,F=Math.max(I,Math.min(Y,Math.round(m*_))),!(FT||m(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${Y}px;fill:`+$(o.data.name)+";",C=B({cssCompiledStyles:o.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,f)=>`url(#clip-${a}-${f})`).text(o=>o.value?u(o.value):"").each(function(o){const f=U(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=U(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(I,Math.min(Y,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(o.y1-o.y0)/2+T/2+K;f.attr("y",F);const k=o.x1-o.x0,ie=o.y1-o.y0-4,me=k-2*J;f.node().getComputedTextLength()>me||F+m>ie||m{const a=ye(),l=ae(),n=ee(a,l.themeVariables),r=ee(dt,t),i=r.titleColor??n.titleColor,h=r.labelColor??n.textColor,d=r.valueColor??n.textColor;return` + .treemapNode.section { + stroke: ${r.sectionStrokeColor}; + stroke-width: ${r.sectionStrokeWidth}; + fill: ${r.sectionFillColor}; + } + .treemapNode.leaf { + stroke: ${r.leafStrokeColor}; + stroke-width: ${r.leafStrokeWidth}; + fill: ${r.leafFillColor}; + } + .treemapLabel { + fill: ${h}; + font-size: ${r.labelFontSize}; + } + .treemapValue { + fill: ${d}; + font-size: ${r.valueFontSize}; + } + .treemapTitle { + fill: ${i}; + font-size: ${r.titleFontSize}; + } + `},"getStyles"),ut=pt,Tt={parser:he,get db(){return new oe},renderer:ht,styles:ut};export{Tt as diagram}; diff --git a/internal/webapp/static/assets/diagram-UB23O5K3-BjKBIl7q.js b/internal/webapp/static/assets/diagram-UB23O5K3-BjKBIl7q.js new file mode 100644 index 0000000..078f014 --- /dev/null +++ b/internal/webapp/static/assets/diagram-UB23O5K3-BjKBIl7q.js @@ -0,0 +1,41 @@ +import{p as I}from"./chunk-JWPE2WC7-Czg53Rx5.js";import{s as _,g as E,o as D,n as F,a as P,b as z,_ as c,D as G,p as B,A as w,y as C,B as W,l as b,E as V,e as H}from"./mermaid.core-B7WVQkyL.js";import{p as j}from"./cynefin-VYW2F7L2-CdOzebfq.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y=32,A={axes:[],curves:[],options:x},m=structuredClone(A),U=W.radar,X=c(()=>w({...U,...C().radar}),"getConfig"),M=c(()=>m.axes,"getAxes"),K=c(()=>m.curves,"getCurves"),N=c(()=>m.options,"getOptions"),Y=c(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});m.options={showLegend:t.showLegend?.value??x.showLegend,ticks:t.ticks?.value??x.ticks,max:t.max?.value??x.max,min:t.min?.value??x.min,graticule:t.graticule?.value??x.graticule},m.options.ticks>y&&(b.warn(`Radar diagram ticks (${m.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),m.options.ticks=y)},"setOptions"),Q=c(()=>{B(),m=structuredClone(A)},"clear"),$={getAxes:M,getCurves:K,getOptions:N,setAxes:Y,setCurves:Z,setOptions:J,getConfig:X,clear:Q,setAccTitle:z,getAccTitle:P,setDiagramTitle:F,getDiagramTitle:D,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await j("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=G(t),u=rt(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;st(u,i,v,n.ticks,n.graticule),nt(u,i,v,o),L(u,i,l,h,g,n.graticule,o),k(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=T(g,r,s,o),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});i==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;r{const t=V(),e=C(),r=w(t,e.themeVariables),s=w(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),ct=c(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=lt(a);return` + .radarTitle { + font-size: ${t.fontSize}; + color: ${t.titleColor}; + dominant-baseline: hanging; + text-anchor: middle; + } + .radarAxisLine { + stroke: ${e.axisColor}; + stroke-width: ${e.axisStrokeWidth}; + } + .radarAxisLabel { + font-size: ${e.axisLabelFontSize}px; + color: ${e.axisColor}; + } + .radarGraticule { + fill: ${e.graticuleColor}; + fill-opacity: ${e.graticuleOpacity}; + stroke: ${e.graticuleColor}; + stroke-width: ${e.graticuleStrokeWidth}; + } + .radarLegendText { + text-anchor: start; + font-size: ${e.legendFontSize}px; + dominant-baseline: hanging; + } + ${it(t,e)} + `},"styles"),xt={parser:et,db:$,renderer:ot,styles:ct};export{xt as diagram}; diff --git a/internal/webapp/static/assets/ebnfDiagram-BXEA7PRR-DV-beFnC.js b/internal/webapp/static/assets/ebnfDiagram-BXEA7PRR-DV-beFnC.js new file mode 100644 index 0000000..4ea8a23 --- /dev/null +++ b/internal/webapp/static/assets/ebnfDiagram-BXEA7PRR-DV-beFnC.js @@ -0,0 +1 @@ +import{g as l,r as m,d as n}from"./chunk-6Q2QTUOP-C7qNvbCj.js";import{p}from"./chunk-JWPE2WC7-Czg53Rx5.js";import{_ as t,l as o}from"./mermaid.core-B7WVQkyL.js";import{M as u,a as f}from"./cynefin-VYW2F7L2-CdOzebfq.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; diff --git a/internal/webapp/static/assets/erDiagram-JOGREHBK-BkNwaUcA.js b/internal/webapp/static/assets/erDiagram-JOGREHBK-BkNwaUcA.js new file mode 100644 index 0000000..65f71e4 --- /dev/null +++ b/internal/webapp/static/assets/erDiagram-JOGREHBK-BkNwaUcA.js @@ -0,0 +1,85 @@ +import{g as Bt}from"./chunk-XXDRQBXY-BXTWinaX.js";import{s as Ft}from"./chunk-KBJHAD2P-CHI3y1em.js";import{_ as d,b as Yt,a as Pt,s as zt,g as Gt,n as Kt,o as Ut,c as rt,l as V,p as Zt,q as jt,r as Wt,t as qt,u as Qt,v as Xt,d as Ht,x as Jt}from"./mermaid.core-B7WVQkyL.js";import{c as $t}from"./channel-BphRH4Sr.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var gt=(function(){var s=d(function(I,n,a,o){for(a=a||{},o=I.length;o--;a[I[o]]=n);return a},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],c=[1,10],h=[1,11],l=[1,12],p=[1,13],y=[1,23],u=[1,24],m=[1,25],W=[1,26],q=[1,27],S=[1,19],Q=[1,28],B=[1,29],D=[1,20],R=[1,18],T=[1,21],C=[1,22],at=[1,36],ct=[1,37],ot=[1,38],lt=[1,39],ht=[1,40],F=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],Y=[1,55],P=[40,48,50,51,52,71,72],z=[1,66],G=[1,64],A=[1,61],K=[1,65],U=[1,67],X=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],bt=[66,67,68,69,70],kt=[1,85],mt=[1,84],Et=[1,82],St=[1,83],Tt=[6,10,42,47],L=[6,10,13,41,42,47,48,49],H=[1,93],J=[1,92],$=[1,91],Z=[19,58],Ot=[1,102],Nt=[1,101],ut=[19,58,61,63],dt={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:d(function(n,a,o,r,f,t,j){var e=t.length-1;switch(f){case 1:break;case 2:this.$=[];break;case 3:t[e-1].push(t[e]),this.$=t[e-1];break;case 4:case 5:this.$=t[e];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[e-4]),r.addEntity(t[e-2]),r.addRelationship(t[e-4],t[e],t[e-2],t[e-3]);break;case 9:r.addEntity(t[e-8]),r.addEntity(t[e-4]),r.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),r.setClass([t[e-8]],t[e-6]),r.setClass([t[e-4]],t[e-2]);break;case 10:r.addEntity(t[e-6]),r.addEntity(t[e-2]),r.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),r.setClass([t[e-6]],t[e-4]);break;case 11:r.addEntity(t[e-6]),r.addEntity(t[e-4]),r.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),r.setClass([t[e-4]],t[e-2]);break;case 12:r.addEntity(t[e-3]),r.addAttributes(t[e-3],t[e-1]);break;case 13:r.addEntity(t[e-5]),r.addAttributes(t[e-5],t[e-1]),r.setClass([t[e-5]],t[e-3]);break;case 14:r.addEntity(t[e-2]);break;case 15:r.addEntity(t[e-4]),r.setClass([t[e-4]],t[e-2]);break;case 16:r.addEntity(t[e]);break;case 17:r.addEntity(t[e-2]),r.setClass([t[e-2]],t[e]);break;case 18:r.addEntity(t[e-6],t[e-4]),r.addAttributes(t[e-6],t[e-1]);break;case 19:r.addEntity(t[e-8],t[e-6]),r.addAttributes(t[e-8],t[e-1]),r.setClass([t[e-8]],t[e-3]);break;case 20:r.addEntity(t[e-5],t[e-3]);break;case 21:r.addEntity(t[e-7],t[e-5]),r.setClass([t[e-7]],t[e-2]);break;case 22:r.addEntity(t[e-3],t[e-1]);break;case 23:r.addEntity(t[e-5],t[e-3]),r.setClass([t[e-5]],t[e]);break;case 24:case 25:this.$=t[e].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[e].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[e-3],r.addClass(t[e-2],t[e-1]);break;case 37:case 38:case 59:case 68:this.$=[t[e]];break;case 39:case 40:this.$=t[e-2].concat([t[e]]);break;case 41:this.$=t[e-2],r.setClass(t[e-1],t[e]);break;case 42:this.$=t[e-3],r.addCssStyles(t[e-2],t[e-1]);break;case 43:this.$=[t[e]];break;case 44:t[e-2].push(t[e]),this.$=t[e-2];break;case 46:this.$=t[e-1]+t[e];break;case 54:case 80:case 81:this.$=t[e].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[e];break;case 60:t[e].push(t[e-1]),this.$=t[e];break;case 61:this.$={type:t[e-1],name:t[e]};break;case 62:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 63:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 64:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 65:case 67:case 70:this.$=t[e];break;case 66:this.$=t[e-1]+t[e];break;case 69:t[e-2].push(t[e]),this.$=t[e-2];break;case 71:this.$=t[e].replace(/"/g,"");break;case 72:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:c,24:h,26:l,28:p,29:14,30:15,31:16,32:17,33:y,34:u,35:m,36:W,37:q,40:S,43:Q,44:B,48:D,50:R,51:T,52:C},s(i,[2,7],{1:[2,1]}),s(i,[2,3]),{9:30,11:9,22:c,24:h,26:l,28:p,29:14,30:15,31:16,32:17,33:y,34:u,35:m,36:W,37:q,40:S,43:Q,44:B,48:D,50:R,51:T,52:C},s(i,[2,5]),s(i,[2,6]),s(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:at,67:ct,68:ot,69:lt,70:ht}),{23:[1,41]},{25:[1,42]},{27:[1,43]},s(i,[2,27]),s(i,[2,28]),s(i,[2,29]),s(i,[2,30]),s(i,[2,31]),s(F,[2,54]),s(F,[2,55]),s(F,[2,56]),s(F,[2,57]),s(F,[2,58]),s(i,[2,32]),s(i,[2,33]),s(i,[2,34]),s(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},s(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:Y},{11:56,40:S,48:D,50:R,51:T,52:C},{65:57,71:[1,58],72:[1,59]},s(P,[2,73]),s(P,[2,74]),s(P,[2,75]),s(P,[2,76]),s(P,[2,77]),s(i,[2,24]),s(i,[2,25]),s(i,[2,26]),{13:z,38:60,41:G,42:A,45:62,46:63,48:K,49:U},s(X,[2,37]),s(X,[2,38]),{16:68,40:O,41:N,42:A},{13:z,38:69,41:G,42:A,45:62,46:63,48:K,49:U},{13:[1,70],15:[1,71]},s(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:at,67:ct,68:ot,69:lt,70:ht}),{19:[1,74]},s(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:Y},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:at,67:ct,68:ot,69:lt,70:ht},s(bt,[2,78]),s(bt,[2,79]),{6:kt,10:mt,39:81,42:Et,47:St},{40:[1,86],41:[1,87]},s(Tt,[2,43],{46:88,13:z,41:G,48:K,49:U}),s(L,[2,45]),s(L,[2,50]),s(L,[2,51]),s(L,[2,52]),s(L,[2,53]),s(i,[2,41],{42:A}),{6:kt,10:mt,39:89,42:Et,47:St},{14:90,40:H,50:J,73:$},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:C},{18:96,19:[1,97],53:53,54:54,58:Y},s(i,[2,12]),{19:[2,60]},s(Z,[2,61],{56:98,57:99,60:100,62:Ot,63:Nt}),s([19,58,62,63],[2,67]),{58:[2,66]},s(i,[2,22],{15:[1,104],17:[1,103]}),s([40,48,50,51,52],[2,72]),s(i,[2,36]),{13:z,41:G,45:105,46:63,48:K,49:U},s(i,[2,47]),s(i,[2,48]),s(i,[2,49]),s(X,[2,39]),s(X,[2,40]),s(L,[2,46]),s(i,[2,42]),s(i,[2,8]),s(i,[2,80]),s(i,[2,81]),s(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},s(i,[2,15]),s(Z,[2,62],{57:110,61:[1,111],63:Nt}),s(Z,[2,63]),s(ut,[2,68]),s(Z,[2,71]),s(ut,[2,70]),{18:112,19:[1,113],53:53,54:54,58:Y},{16:114,40:O,41:N},s(Tt,[2,44],{46:88,13:z,41:G,48:K,49:U}),{14:115,40:H,50:J,73:$},{16:116,40:O,41:N},{14:117,40:H,50:J,73:$},s(i,[2,13]),s(Z,[2,64]),{60:118,62:Ot},{19:[1,119]},s(i,[2,20]),s(i,[2,23],{17:[1,120],42:A}),s(i,[2,11]),{13:[1,121],42:A},s(i,[2,10]),s(ut,[2,69]),s(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:Y},{14:124,40:H,50:J,73:$},{19:[1,125]},s(i,[2,21]),s(i,[2,9]),s(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:d(function(n,a){if(a.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=a,o}},"parseError"),parse:d(function(n){var a=this,o=[0],r=[],f=[null],t=[],j=this.table,e="",et=0,At=0,Lt=2,It=1,wt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var pt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,pt)&&(x.yy[pt]=this.yy[pt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var ft=_.yylloc;t.push(ft);var Vt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(b){o.length=o.length-2*b,f.length=f.length-b,t.length=t.length-b}d(Mt,"popStack");function Rt(){var b;return b=r.pop()||_.lex()||It,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=a.symbols_[b]||b),b}d(Rt,"lex");for(var g,v,k,yt,w={},st,E,Ct,it;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=Rt()),k=j[v]&&j[v][g]),typeof k>"u"||!k.length||!k[0]){var _t="";it=[];for(st in j[v])this.terminals_[st]&&st>Lt&&it.push("'"+this.terminals_[st]+"'");_.showPosition?_t="Parse error on line "+(et+1)+`: +`+_.showPosition()+` +Expecting `+it.join(", ")+", got '"+(this.terminals_[g]||g)+"'":_t="Parse error on line "+(et+1)+": Unexpected "+(g==It?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(_t,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:ft,expected:it})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:o.push(g),f.push(_.yytext),t.push(_.yylloc),o.push(k[1]),g=null,At=_.yyleng,e=_.yytext,et=_.yylineno,ft=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=f[f.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},Vt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),yt=this.performAction.apply(w,[e,At,et,x.yy,k[1],f,t].concat(wt)),typeof yt<"u")return yt;E&&(o=o.slice(0,-1*E*2),f=f.slice(0,-1*E),t=t.slice(0,-1*E)),o.push(this.productions_[k[1]][0]),f.push(w.$),t.push(w._$),Ct=j[o[o.length-2]][o[o.length-1]],o.push(Ct);break;case 3:return!0}}return!0},"parse")},Dt=(function(){var I={EOF:1,parseError:d(function(a,o){if(this.yy.parser)this.yy.parser.parseError(a,o);else throw new Error(a)},"parseError"),setInput:d(function(n,a){return this.yy=a||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var a=n.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:d(function(n){var a=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===r.length?this.yylloc.first_column:0)+r[r.length-o.length].length-o[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(n){this.unput(this.match.slice(n))},"less"),pastInput:d(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var n=this.pastInput(),a=new Array(n.length+1).join("-");return n+this.upcomingInput()+` +`+a+"^"},"showPosition"),test_match:d(function(n,a){var o,r,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),r=n[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],o=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var t in f)this[t]=f[t];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,a,o,r;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),t=0;ta[0].length)){if(a=o,r=t,this.options.backtrack_lexer){if(n=this.test_match(o,f[t]),n!==!1)return n;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(n=this.test_match(a,f[r]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var a=this.next();return a||this.lex()},"lex"),begin:d(function(a){this.conditionStack.push(a)},"begin"),popState:d(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:d(function(a){this.begin(a)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(a,o,r,f){switch(r){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin("block_bq");break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return o.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin("style"),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin("style"),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return o.yytext[0];case 81:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],inclusive:!0}}};return I})();dt.lexer=Dt;function tt(){this.yy={}}return d(tt,"Parser"),tt.prototype=dt,dt.Parser=tt,new tt})();gt.parser=gt;var te=gt,M,ee=(M=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Yt,this.getAccTitle=Pt,this.setAccDescription=zt,this.getAccDescription=Gt,this.setDiagramTitle=Kt,this.getDiagramTitle=Ut,this.getConfig=d(()=>rt().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(i,c=""){return this.entities.has(i)?!this.entities.get(i)?.alias&&c&&(this.entities.get(i).alias=c,V.info(`Add alias '${c}' to entity '${i}'`)):(this.entities.set(i,{id:`entity-${i}-${this.entities.size}`,label:i,attributes:[],alias:c,shape:"erBox",look:rt().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),V.info("Added new entity :",i)),this.entities.get(i)}getEntity(i){return this.entities.get(i)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(i,c){const h=this.addEntity(i);let l;for(l=c.length-1;l>=0;l--)c[l].keys||(c[l].keys=[]),c[l].comment||(c[l].comment=""),h.attributes.push(c[l]),V.debug("Added attribute ",c[l].name)}addRelationship(i,c,h,l){const p=this.entities.get(i),y=this.entities.get(h);if(!p||!y)return;const u={entityA:p.id,roleA:c,entityB:y.id,relSpec:l};this.relationships.push(u),V.debug("Added new relationship :",u)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(i){this.direction=i}getCompiledStyles(i){let c=[];for(const h of i){const l=this.classes.get(h);l?.styles&&(c=[...c,...l.styles??[]].map(p=>p.trim())),l?.textStyles&&(c=[...c,...l.textStyles??[]].map(p=>p.trim()))}return c}addCssStyles(i,c){for(const h of i){const l=this.entities.get(h);if(!c||!l)return;for(const p of c)l.cssStyles.push(p)}}addClass(i,c){i.forEach(h=>{let l=this.classes.get(h);l===void 0&&(l={id:h,styles:[],textStyles:[]},this.classes.set(h,l)),c&&c.forEach(function(p){if(/color/.exec(p)){const y=p.replace("fill","bgFill");l.textStyles.push(y)}l.styles.push(p)})})}setClass(i,c){for(const h of i){const l=this.entities.get(h);if(l)for(const p of c)l.cssClasses+=" "+p}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Zt()}getData(){const i=[],c=[],h=rt();let l=0;for(const y of this.entities.keys()){const u=this.entities.get(y);u&&(u.cssCompiledStyles=this.getCompiledStyles(u.cssClasses.split(" ")),u.colorIndex=l++,i.push(u))}let p=0;for(const y of this.relationships){const u={id:jt(y.entityA,y.entityB,{prefix:"id",counter:p++}),type:"normal",curve:"basis",start:y.entityA,end:y.entityB,label:y.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:y.relSpec.cardB.toLowerCase(),arrowTypeEnd:y.relSpec.cardA.toLowerCase(),pattern:y.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:h.look,labelType:"markdown"};c.push(u)}return{nodes:i,edges:c,other:{},config:h,direction:"TB"}}},d(M,"ErDB"),M),vt={};qt(vt,{draw:()=>se});var se=d(async function(s,i,c,h){V.info("REF0:"),V.info("Drawing er diagram (unified)",i);const{securityLevel:l,er:p,layout:y}=rt(),u=h.db.getData(),m=Bt(i,l);u.type=h.type,u.layoutAlgorithm=Qt(y),u.config.flowchart.nodeSpacing=p?.nodeSpacing||140,u.config.flowchart.rankSpacing=p?.rankSpacing||80,u.direction=h.db.getDirection();const{config:W}=u,{look:q}=W;q==="neo"?u.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:u.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],u.diagramId=i,await Xt(u,m),u.layoutAlgorithm==="elk"&&m.select(".edges").lower();const S=m.selectAll('[id*="-background"]');Array.from(S).length>0&&S.each(function(){const B=Ht(this),R=B.attr("id").replace("-background",""),T=m.select(`#${CSS.escape(R)}`);if(!T.empty()){const C=T.attr("transform");B.attr("transform",C)}});const Q=8;Jt.insertTitle(m,"erDiagramTitleText",p?.titleTopMargin??25,h.db.getDiagramTitle()),Ft(m,Q,"erDiagram",p?.useMaxWidth??!0)},"draw"),xt=d((s,i)=>{const c=$t,h=c(s,"r"),l=c(s,"g"),p=c(s,"b");return Wt(h,l,p,i)},"fade"),nt=new Set(["redux-color","redux-dark-color"]),ie=d(s=>{const{theme:i,look:c,bkgColorArray:h,borderColorArray:l}=s;if(!nt.has(i))return"";const p=h?.length>0;let y="";for(let u=0;u{const{look:i,theme:c,erEdgeLabelBackground:h,strokeWidth:l}=s;return` + ${ie(s)} + .entityBox { + fill: ${s.mainBkg}; + stroke: ${s.nodeBorder}; + } + + .relationshipLabelBox { + fill: ${s.tertiaryColor}; + opacity: 0.7; + background-color: ${s.tertiaryColor}; + rect { + opacity: 0.5; + } + } + + .labelBkg { + background-color: ${nt.has(c)&&h?h:xt(s.tertiaryColor,.5)}; + } + + .edgeLabel { + background-color: ${nt.has(c)&&h?h:s.edgeLabelBackground}; + } + .edgeLabel .label rect { + fill: ${nt.has(c)&&h?h:s.edgeLabelBackground}; + } + .edgeLabel .label text { + fill: ${s.textColor}; + } + + .edgeLabel .label { + fill: ${s.nodeBorder}; + font-size: 14px; + } + + .label { + font-family: ${s.fontFamily}; + color: ${s.nodeTextColor||s.textColor}; + } + + .edge-pattern-dashed { + stroke-dasharray: 8,8; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon + { + fill: ${s.mainBkg}; + stroke: ${s.nodeBorder}; + stroke-width: ${i==="neo"?l:"1px"}; + } + + .relationshipLine { + stroke: ${s.lineColor}; + stroke-width: ${i==="neo"?l:"1px"}; + fill: none; + } + + .marker { + fill: none !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; + } + [data-look=neo].labelBkg { + background-color: ${xt(s.tertiaryColor,.5)}; + } +`},"getStyles"),ne=re,de={parser:te,get db(){return new ee},renderer:vt,styles:ne};export{de as diagram}; diff --git a/internal/webapp/static/assets/flowDiagram-UKHOOZJN-XwdembEj.js b/internal/webapp/static/assets/flowDiagram-UKHOOZJN-XwdembEj.js new file mode 100644 index 0000000..2f10c79 --- /dev/null +++ b/internal/webapp/static/assets/flowDiagram-UKHOOZJN-XwdembEj.js @@ -0,0 +1,156 @@ +import{g as Xe}from"./chunk-5VM5RSS4-DJhOL3Lj.js";import{g as Qe}from"./chunk-XXDRQBXY-BXTWinaX.js";import{s as Je}from"./chunk-KBJHAD2P-CHI3y1em.js";import{_ as k,b6 as Ze,F as Me,l as J,c as g1,u as $e,v as et,x as re,b as tt,s as st,n as it,a as rt,g as at,o as nt,k as ut,G as ot,J as lt,bo as ct,q as se,d as ie,N as ht,p as dt,b8 as pt,r as ft}from"./mermaid.core-B7WVQkyL.js";import{f as gt}from"./chunk-2GRJ4B5K-Bng47RDF.js";import{c as bt}from"./channel-BphRH4Sr.js";var At="flowchart-",G1,kt=(G1=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=tt,this.setAccDescription=st,this.setDiagramTitle=it,this.getAccTitle=rt,this.getAccDescription=at,this.getDiagramTitle=nt,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return ut.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const r of this.vertices.values())if(r.id===i)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,r,a,n,l,p,c={},g){if(!i||i.trim().length===0)return;let u;if(g!==void 0){let m;g.includes(` +`)?m=g+` +`:m=`{ +`+g+` +}`,u=ot(m,{schema:lt})}const A=this.edges.find(m=>m.id===i);if(A){const m=u;m?.animate!==void 0&&(A.animate=m.animate),m?.animation!==void 0&&(A.animation=m.animation),m?.curve!==void 0&&(A.interpolate=m.curve);return}let v,b=this.vertices.get(i);if(b===void 0&&(r===void 0&&a===void 0&&n!==void 0&&n!==null&&J.warn(`Style applied to unknown node "${i}". This may indicate a typo. The node will be created automatically.`),b={id:i,labelType:"text",domId:At+i+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(i,b)),this.vertexCounter++,r!==void 0?(this.config=g1(),v=this.sanitizeText(r.text.trim()),b.labelType=r.type,v.startsWith('"')&&v.endsWith('"')&&(v=v.substring(1,v.length-1)),b.text=v):b.text===void 0&&(b.text=i),a!==void 0&&(b.type=a),n?.forEach(m=>{b.styles.push(m)}),l?.forEach(m=>{b.classes.push(m)}),p!==void 0&&(b.dir=p),b.props===void 0?b.props=c:c!==void 0&&Object.assign(b.props,c),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!ct(u.shape))throw new Error(`No such shape: ${u.shape}.`);b.type=u?.shape}u?.label&&(b.text=u?.label,b.labelType=this.sanitizeNodeLabelType(u?.labelType)),u?.icon&&(b.icon=u?.icon,!u.label?.trim()&&b.text===i&&(b.text="")),u?.form&&(b.form=u?.form),u?.pos&&(b.pos=u?.pos),u?.img&&(b.img=u?.img,!u.label?.trim()&&b.text===i&&(b.text="")),u?.constraint&&(b.constraint=u.constraint),u.w&&(b.assetWidth=Number(u.w)),u.h&&(b.assetHeight=Number(u.h))}}addSingleLink(i,r,a,n){const c={start:i,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};J.info("abc78 Got edge...",c);const g=a.text;if(g!==void 0&&(c.text=this.sanitizeText(g.text.trim()),c.text.startsWith('"')&&c.text.endsWith('"')&&(c.text=c.text.substring(1,c.text.length-1)),c.labelType=this.sanitizeNodeLabelType(g.type)),a!==void 0&&(c.type=a.type,c.stroke=a.stroke,c.length=a.length>10?10:a.length),n&&!this.edges.some(u=>u.id===n))c.id=n,c.isUserDefinedId=!0;else{const u=this.edges.filter(A=>A.start===c.start&&A.end===c.end);u.length===0?c.id=se(c.start,c.end,{counter:0,prefix:"L"}):c.id=se(c.start,c.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))J.info("Pushing edge..."),this.edges.push(c);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. + +Initialize mermaid with maxEdges set to a higher number to allow more edges. +You cannot set this config via configuration inside the diagram as it is a secure config. +You have to call mermaid.initialize.`)}isLinkData(i){return i!==null&&typeof i=="object"&&"id"in i&&typeof i.id=="string"}addLink(i,r,a){const n=this.isLinkData(a)?a.id.replace("@",""):void 0;J.info("addLink",i,r,n);for(const l of i)for(const p of r){const c=l===i[i.length-1],g=p===r[0];c&&g?this.addSingleLink(l,p,a,n):this.addSingleLink(l,p,a,void 0)}}updateLinkInterpolate(i,r){i.forEach(a=>{a==="default"?this.edges.defaultInterpolate=r:this.edges[a].interpolate=r})}updateLink(i,r){i.forEach(a=>{if(typeof a=="number"&&a>=this.edges.length)throw new Error(`The index ${a} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);a==="default"?this.edges.defaultStyle=r:(this.edges[a].style=r,(this.edges[a]?.style?.length??0)>0&&!this.edges[a]?.style?.some(n=>n?.startsWith("fill"))&&this.edges[a]?.style?.push("fill:none"))})}addClass(i,r){const a=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i.split(",").forEach(n=>{let l=this.classes.get(n);l===void 0&&(l={id:n,styles:[],textStyles:[]},this.classes.set(n,l)),a?.forEach(p=>{if(/color/.exec(p)){const c=p.replace("fill","bgFill");l.textStyles.push(c)}l.styles.push(p)})})}setDirection(i){this.direction=i.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(i,r){for(const a of i.split(",")){const n=this.vertices.get(a);n&&n.classes.push(r);const l=this.edges.find(c=>c.id===a);l&&l.classes.push(r);const p=this.subGraphLookup.get(a);p&&p.classes.push(r)}}setTooltip(i,r){if(r!==void 0){r=this.sanitizeText(r);for(const a of i.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(a):a,r)}}setClickFun(i,r,a){if(g1().securityLevel!=="loose"||r===void 0)return;let n=[];if(typeof a=="string"){n=a.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let p=0;p{const p=this.lookUpDomId(i),c=document.querySelector(`[id="${p}"]`);c!==null&&c.addEventListener("click",()=>{re.runFunc(r,...n)},!1)}))}setLink(i,r,a){i.split(",").forEach(n=>{const l=this.vertices.get(n);l!==void 0&&(l.link=re.formatUrl(r,this.config),l.linkTarget=a)}),this.setClass(i,"clickable")}getTooltip(i){return this.tooltips.get(i)}setClickEvent(i,r,a){i.split(",").forEach(n=>{this.setClickFun(n,r,a)}),this.setClass(i,"clickable")}bindFunctions(i){this.funs.forEach(r=>{r(i)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(i){const r=gt();ie(i).select("svg").selectAll("g.node").on("mouseover",l=>{const p=ie(l.currentTarget),c=p.attr("title");if(c===null)return;const g=l.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(p.attr("title")).style("left",window.scrollX+g.left+(g.right-g.left)/2+"px").style("top",window.scrollY+g.bottom+"px"),r.html(ht.sanitize(c)),p.classed("hover",!0)}).on("mouseout",l=>{r.transition().duration(500).style("opacity",0),ie(l.currentTarget).classed("hover",!1)})}clear(i="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=i,this.config=g1(),dt()}setGen(i){this.version=i||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(i,r,a){let n=i.text.trim(),l=a.text;i===a&&/\s/.exec(a.text)&&(n=void 0);const c=k(S=>{const B={boolean:{},number:{},string:{}},b1=[];let A1;return{nodeList:S.filter(function(K){const h1=typeof K;return K.stmt&&K.stmt==="dir"?(A1=K.value,!1):K.trim()===""?!1:h1 in B?B[h1].hasOwnProperty(K)?!1:B[h1][K]=!0:b1.includes(K)?!1:b1.push(K)}),dir:A1}},"uniq")(r.flat()),g=c.nodeList,u=c.dir,A=u!==void 0,v=g1().flowchart??{},b=u??(v.inheritDir?this.getDirection()??g1().direction??void 0:void 0);if(this.version==="gen-1")for(let S=0;S2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===i)return{result:!0,count:0};let n=0,l=1;for(;n=0){const c=this.indexNodes2(i,p);if(c.result)return{result:!0,count:l+c.count};l=l+c.count}n=n+1}return{result:!1,count:l}}getDepthFirstPos(i){return this.posCrossRef[i]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(i){let r=i.trim(),a="arrow_open";switch(r[0]){case"<":a="arrow_point",r=r.slice(1);break;case"x":a="arrow_cross",r=r.slice(1);break;case"o":a="arrow_circle",r=r.slice(1);break}let n="normal";return r.includes("=")&&(n="thick"),r.includes(".")&&(n="dotted"),{type:a,stroke:n}}countChar(i,r){const a=r.length;let n=0;for(let l=0;l":n="arrow_point",r.startsWith("<")&&(n="double_"+n,a=a.slice(1));break;case"o":n="arrow_circle",r.startsWith("o")&&(n="double_"+n,a=a.slice(1));break}let l="normal",p=a.length-1;a.startsWith("=")&&(l="thick"),a.startsWith("~")&&(l="invisible");const c=this.countChar(".",a);return c&&(l="dotted",p=c),{type:n,stroke:l,length:p}}destructLink(i,r){const a=this.destructEndLink(i);let n;if(r){if(n=this.destructStartLink(r),n.stroke!==a.stroke)return{type:"INVALID",stroke:"INVALID"};if(n.type==="arrow_open")n.type=a.type;else{if(n.type!==a.type)return{type:"INVALID",stroke:"INVALID"};n.type="double_"+n.type}return n.type==="double_arrow"&&(n.type="double_arrow_point"),n.length=a.length,n}return a}exists(i,r){for(const a of i)if(a.nodes.includes(r))return!0;return!1}makeUniq(i,r){const a=[];return i.nodes.forEach((n,l)=>{this.exists(r,n)||a.push(i.nodes[l])}),{nodes:a}}getTypeFromVertex(i){if(i.img)return"imageSquare";if(i.icon)return i.form==="circle"?"iconCircle":i.form==="square"?"iconSquare":i.form==="rounded"?"iconRounded":"icon";switch(i.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return i.type}}findNode(i,r){return i.find(a=>a.id===r)}destructEdgeType(i){let r="none",a="arrow_point";switch(i){case"arrow_point":case"arrow_circle":case"arrow_cross":a=i;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=i.replace("double_",""),a=r;break}return{arrowTypeStart:r,arrowTypeEnd:a}}addNodeFromVertex(i,r,a,n,l,p){const c=a.get(i.id),g=n.get(i.id)??!1,u=this.findNode(r,i.id);if(u)u.cssStyles=i.styles,u.cssCompiledStyles=this.getCompiledStyles(i.classes),u.cssClasses=i.classes.join(" ");else{const A={id:i.id,label:i.text,labelType:i.labelType,labelStyle:"",parentId:c,padding:l.flowchart?.padding||8,cssStyles:i.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...i.classes]),cssClasses:"default "+i.classes.join(" "),dir:i.dir,domId:i.domId,look:p,link:i.link,linkTarget:i.linkTarget,tooltip:this.getTooltip(i.id),icon:i.icon,pos:i.pos,img:i.img,assetWidth:i.assetWidth,assetHeight:i.assetHeight,constraint:i.constraint};g?r.push({...A,isGroup:!0,shape:"rect"}):r.push({...A,isGroup:!1,shape:this.getTypeFromVertex(i)})}}getCompiledStyles(i){let r=[];for(const a of i){const n=this.classes.get(a);n?.styles&&(r=[...r,...n.styles??[]].map(l=>l.trim())),n?.textStyles&&(r=[...r,...n.textStyles??[]].map(l=>l.trim()))}return r}getData(){const i=g1(),r=[],a=[],n=this.getSubGraphs(),l=new Map,p=new Map;for(let u=n.length-1;u>=0;u--){const A=n[u];A.nodes.length>0&&p.set(A.id,!0);for(const v of A.nodes)l.set(v,A.id)}for(let u=n.length-1;u>=0;u--){const A=n[u];r.push({id:A.id,label:A.title,labelStyle:"",labelType:A.labelType,parentId:l.get(A.id),padding:8,cssCompiledStyles:this.getCompiledStyles(A.classes),cssClasses:A.classes.join(" "),shape:"rect",dir:A.dir==="TD"?"TB":A.dir,explicitDir:A.hasExplicitDir,isGroup:!0,look:i.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,l,p,i,i.look||"classic")});const g=this.getEdges();return g.forEach((u,A)=>{const{arrowTypeStart:v,arrowTypeEnd:b}=this.destructEdgeType(u.type),m=[...g.defaultStyle??[]];u.style&&m.push(...u.style);const S={id:se(u.start,u.end,{counter:A,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelType:u.labelType,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:u?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:u?.stroke==="invisible"||u?.type==="arrow_open"?"none":v,arrowTypeEnd:u?.stroke==="invisible"||u?.type==="arrow_open"?"none":b,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:m,style:m,pattern:u.stroke,look:i.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||i.flowchart?.curve};a.push(S)}),{nodes:r,edges:a,other:{},config:i}}defaultConfig(){return pt.flowchart}},k(G1,"FlowDB"),G1),mt=k(function(s,i){return i.db.getClasses()},"getClasses"),Dt=k(async function(s,i,r,a,n){J.info("REF0:"),J.info("Drawing state diagram (v2)",i);const{securityLevel:l,flowchart:p,layout:c}=g1();a.db.setDiagramId(i),J.debug("Before getData: ");const g=a.db.getData();J.debug("Data: ",g);const u=Qe(i,l),A=a.db.getDirection();g.type=a.type,g.layoutAlgorithm=$e(c),g.layoutAlgorithm==="dagre"&&c==="elk"&&J.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),g.direction=A,g.nodeSpacing=p?.nodeSpacing||50,g.rankSpacing=p?.rankSpacing||50,g.markers=["point","circle","cross"],g.diagramId=i,J.debug("REF1:",g),await et(g,u,n);const v=g.config.flowchart?.diagramPadding??8;re.insertTitle(u,"flowchartTitleText",p?.titleTopMargin||0,a.db.getDiagramTitle()),Je(u,v,"flowchart",p?.useMaxWidth||!1)},"draw"),Ct={getClasses:mt,draw:Dt},ae=(function(){var s=k(function(f1,h,d,f){for(d=d||{},f=f1.length;f--;d[f1[f]]=h);return d},"o"),i=[1,4],r=[1,3],a=[1,5],n=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],l=[2,2],p=[1,13],c=[1,14],g=[1,15],u=[1,16],A=[1,23],v=[1,25],b=[1,26],m=[1,27],S=[1,50],B=[1,49],b1=[1,29],A1=[1,30],P1=[1,31],K=[1,32],h1=[1,33],V=[1,45],I=[1,47],w=[1,43],R=[1,48],N=[1,44],G=[1,51],P=[1,46],O=[1,52],M=[1,53],M1=[1,34],U1=[1,35],z1=[1,36],W1=[1,37],j1=[1,38],d1=[1,58],y=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],$=[1,62],e1=[1,61],t1=[1,63],C1=[8,9,11,75,77,78],ne=[1,79],E1=[1,92],T1=[1,97],S1=[1,96],y1=[1,93],x1=[1,89],F1=[1,95],_1=[1,91],B1=[1,98],v1=[1,94],L1=[1,99],V1=[1,90],k1=[8,9,10,11,40,75,77,78],z=[8,9,10,11,40,46,75,77,78],H=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],ue=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],I1=[44,60,89,102,105,106,109,111,114,115,116],oe=[1,122],le=[1,123],K1=[1,125],Y1=[1,124],ce=[44,60,62,74,89,102,105,106,109,111,114,115,116],he=[1,134],de=[1,148],pe=[1,149],fe=[1,150],ge=[1,151],be=[1,136],Ae=[1,138],ke=[1,142],me=[1,143],De=[1,144],Ce=[1,145],Ee=[1,146],Te=[1,147],Se=[1,152],ye=[1,153],xe=[1,132],Fe=[1,133],_e=[1,140],Be=[1,135],ve=[1,139],Le=[1,137],Q1=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Ve=[1,155],Ie=[1,157],_=[8,9,11],q=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],D=[1,177],W=[1,173],j=[1,174],C=[1,178],E=[1,175],T=[1,176],w1=[77,116,119],x=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],we=[10,106],p1=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],s1=[1,248],i1=[1,246],r1=[1,250],a1=[1,244],n1=[1,245],u1=[1,247],o1=[1,249],l1=[1,251],R1=[1,269],Re=[8,9,11,106],Z=[8,9,10,11,60,84,105,106,109,110,111,112],J1={trace:k(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:k(function(h,d,f,o,F,e,O1){var t=e.length-1;switch(F){case 2:this.$=[];break;case 3:(!Array.isArray(e[t])||e[t].length>0)&&e[t-1].push(e[t]),this.$=e[t-1];break;case 4:case 183:this.$=e[t];break;case 11:o.setDirection("TB"),this.$="TB";break;case 12:o.setDirection(e[t-1]),this.$=e[t-1];break;case 27:this.$=e[t-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=o.addSubGraph(e[t-6],e[t-1],e[t-4]);break;case 34:this.$=o.addSubGraph(e[t-3],e[t-1],e[t-3]);break;case 35:this.$=o.addSubGraph(void 0,e[t-1],void 0);break;case 37:this.$=e[t].trim(),o.setAccTitle(this.$);break;case 38:case 39:this.$=e[t].trim(),o.setAccDescription(this.$);break;case 43:this.$=e[t-1]+e[t];break;case 44:this.$=e[t];break;case 45:o.addVertex(e[t-1][e[t-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,e[t]),o.addLink(e[t-3].stmt,e[t-1],e[t-2]),this.$={stmt:e[t-1],nodes:e[t-1].concat(e[t-3].nodes)};break;case 46:o.addLink(e[t-2].stmt,e[t],e[t-1]),this.$={stmt:e[t],nodes:e[t].concat(e[t-2].nodes)};break;case 47:o.addLink(e[t-3].stmt,e[t-1],e[t-2]),this.$={stmt:e[t-1],nodes:e[t-1].concat(e[t-3].nodes)};break;case 48:this.$={stmt:e[t-1],nodes:e[t-1]};break;case 49:o.addVertex(e[t-1][e[t-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,e[t]),this.$={stmt:e[t-1],nodes:e[t-1],shapeData:e[t]};break;case 50:this.$={stmt:e[t],nodes:e[t]};break;case 51:this.$=[e[t]];break;case 52:o.addVertex(e[t-5][e[t-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,e[t-4]),this.$=e[t-5].concat(e[t]);break;case 53:this.$=e[t-4].concat(e[t]);break;case 54:this.$=e[t];break;case 55:this.$=e[t-2],o.setClass(e[t-2],e[t]);break;case 56:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"square");break;case 57:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"doublecircle");break;case 58:this.$=e[t-5],o.addVertex(e[t-5],e[t-2],"circle");break;case 59:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"ellipse");break;case 60:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"stadium");break;case 61:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"subroutine");break;case 62:this.$=e[t-7],o.addVertex(e[t-7],e[t-1],"rect",void 0,void 0,void 0,Object.fromEntries([[e[t-5],e[t-3]]]));break;case 63:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"cylinder");break;case 64:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"round");break;case 65:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"diamond");break;case 66:this.$=e[t-5],o.addVertex(e[t-5],e[t-2],"hexagon");break;case 67:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"odd");break;case 68:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"trapezoid");break;case 69:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"inv_trapezoid");break;case 70:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"lean_right");break;case 71:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"lean_left");break;case 72:this.$=e[t],o.addVertex(e[t]);break;case 73:e[t-1].text=e[t],this.$=e[t-1];break;case 74:case 75:e[t-2].text=e[t-1],this.$=e[t-2];break;case 76:this.$=e[t];break;case 77:var L=o.destructLink(e[t],e[t-2]);this.$={type:L.type,stroke:L.stroke,length:L.length,text:e[t-1]};break;case 78:var L=o.destructLink(e[t],e[t-2]);this.$={type:L.type,stroke:L.stroke,length:L.length,text:e[t-1],id:e[t-3]};break;case 79:this.$={text:e[t],type:"text"};break;case 80:this.$={text:e[t-1].text+""+e[t],type:e[t-1].type};break;case 81:this.$={text:e[t],type:"string"};break;case 82:this.$={text:e[t],type:"markdown"};break;case 83:var L=o.destructLink(e[t]);this.$={type:L.type,stroke:L.stroke,length:L.length};break;case 84:var L=o.destructLink(e[t]);this.$={type:L.type,stroke:L.stroke,length:L.length,id:e[t-1]};break;case 85:this.$=e[t-1];break;case 86:this.$={text:e[t],type:"text"};break;case 87:this.$={text:e[t-1].text+""+e[t],type:e[t-1].type};break;case 88:this.$={text:e[t],type:"string"};break;case 89:case 104:this.$={text:e[t],type:"markdown"};break;case 101:this.$={text:e[t],type:"text"};break;case 102:this.$={text:e[t-1].text+""+e[t],type:e[t-1].type};break;case 103:this.$={text:e[t],type:"text"};break;case 105:this.$=e[t-4],o.addClass(e[t-2],e[t]);break;case 106:this.$=e[t-4],o.setClass(e[t-2],e[t]);break;case 107:case 115:this.$=e[t-1],o.setClickEvent(e[t-1],e[t]);break;case 108:case 116:this.$=e[t-3],o.setClickEvent(e[t-3],e[t-2]),o.setTooltip(e[t-3],e[t]);break;case 109:this.$=e[t-2],o.setClickEvent(e[t-2],e[t-1],e[t]);break;case 110:this.$=e[t-4],o.setClickEvent(e[t-4],e[t-3],e[t-2]),o.setTooltip(e[t-4],e[t]);break;case 111:this.$=e[t-2],o.setLink(e[t-2],e[t]);break;case 112:this.$=e[t-4],o.setLink(e[t-4],e[t-2]),o.setTooltip(e[t-4],e[t]);break;case 113:this.$=e[t-4],o.setLink(e[t-4],e[t-2],e[t]);break;case 114:this.$=e[t-6],o.setLink(e[t-6],e[t-4],e[t]),o.setTooltip(e[t-6],e[t-2]);break;case 117:this.$=e[t-1],o.setLink(e[t-1],e[t]);break;case 118:this.$=e[t-3],o.setLink(e[t-3],e[t-2]),o.setTooltip(e[t-3],e[t]);break;case 119:this.$=e[t-3],o.setLink(e[t-3],e[t-2],e[t]);break;case 120:this.$=e[t-5],o.setLink(e[t-5],e[t-4],e[t]),o.setTooltip(e[t-5],e[t-2]);break;case 121:this.$=e[t-4],o.addVertex(e[t-2],void 0,void 0,e[t]);break;case 122:this.$=e[t-4],o.updateLink([e[t-2]],e[t]);break;case 123:this.$=e[t-4],o.updateLink(e[t-2],e[t]);break;case 124:this.$=e[t-8],o.updateLinkInterpolate([e[t-6]],e[t-2]),o.updateLink([e[t-6]],e[t]);break;case 125:this.$=e[t-8],o.updateLinkInterpolate(e[t-6],e[t-2]),o.updateLink(e[t-6],e[t]);break;case 126:this.$=e[t-6],o.updateLinkInterpolate([e[t-4]],e[t]);break;case 127:this.$=e[t-6],o.updateLinkInterpolate(e[t-4],e[t]);break;case 128:case 130:this.$=[e[t]];break;case 129:case 131:e[t-2].push(e[t]),this.$=e[t-2];break;case 133:this.$=e[t-1]+e[t];break;case 181:this.$=e[t];break;case 182:this.$=e[t-1]+""+e[t];break;case 184:this.$=e[t-1]+""+e[t];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:i,10:r,12:a},{1:[3]},s(n,l,{5:6}),{4:7,9:i,10:r,12:a},{4:8,9:i,10:r,12:a},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:p,9:c,10:g,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:A,33:24,34:v,36:b,38:m,42:28,43:39,44:S,45:40,47:41,60:B,84:b1,85:A1,86:P1,87:K,88:h1,89:V,102:I,105:w,106:R,109:N,111:G,113:42,114:P,115:O,116:M,121:M1,122:U1,123:z1,124:W1,125:j1},s(n,[2,9]),s(n,[2,10]),s(n,[2,11]),{8:[1,55],9:[1,56],10:d1,15:54,18:57},s(y,[2,3]),s(y,[2,4]),s(y,[2,5]),s(y,[2,6]),s(y,[2,7]),s(y,[2,8]),{8:$,9:e1,11:t1,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:$,9:e1,11:t1,21:68},{8:$,9:e1,11:t1,21:69},{8:$,9:e1,11:t1,21:70},{8:$,9:e1,11:t1,21:71},{8:$,9:e1,11:t1,21:72},{8:$,9:e1,10:[1,73],11:t1,21:74},s(y,[2,36]),{35:[1,75]},{37:[1,76]},s(y,[2,39]),s(C1,[2,50],{18:77,39:78,10:d1,40:ne}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:E1,44:T1,60:S1,80:[1,87],89:y1,95:[1,84],97:[1,85],101:86,105:x1,106:F1,109:_1,111:B1,114:v1,115:L1,116:V1,120:88},s(y,[2,185]),s(y,[2,186]),s(y,[2,187]),s(y,[2,188]),s(y,[2,189]),s(k1,[2,51]),s(k1,[2,54],{46:[1,100]}),s(z,[2,72],{113:113,29:[1,101],44:S,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:B,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:V,102:I,105:w,106:R,109:N,111:G,114:P,115:O,116:M}),s(H,[2,181]),s(H,[2,142]),s(H,[2,143]),s(H,[2,144]),s(H,[2,145]),s(H,[2,146]),s(H,[2,147]),s(H,[2,148]),s(H,[2,149]),s(H,[2,150]),s(H,[2,151]),s(H,[2,152]),s(n,[2,12]),s(n,[2,18]),s(n,[2,19]),{9:[1,114]},s(ue,[2,26],{18:115,10:d1}),s(y,[2,27]),{42:116,43:39,44:S,45:40,47:41,60:B,89:V,102:I,105:w,106:R,109:N,111:G,113:42,114:P,115:O,116:M},s(y,[2,40]),s(y,[2,41]),s(y,[2,42]),s(I1,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:oe,81:le,116:K1,119:Y1},{75:[1,126],77:[1,127]},s(ce,[2,83]),s(y,[2,28]),s(y,[2,29]),s(y,[2,30]),s(y,[2,31]),s(y,[2,32]),{10:he,12:de,14:pe,27:fe,28:128,32:ge,44:be,60:Ae,75:ke,80:[1,130],81:[1,131],83:141,84:me,85:De,86:Ce,87:Ee,88:Te,89:Se,90:ye,91:129,105:xe,109:Fe,111:_e,114:Be,115:ve,116:Le},s(Q1,l,{5:154}),s(y,[2,37]),s(y,[2,38]),s(C1,[2,48],{44:Ve}),s(C1,[2,49],{18:156,10:d1,40:Ie}),s(k1,[2,44]),{44:S,47:158,60:B,89:V,102:I,105:w,106:R,109:N,111:G,113:42,114:P,115:O,116:M},{102:[1,159],103:160,105:[1,161]},{44:S,47:162,60:B,89:V,102:I,105:w,106:R,109:N,111:G,113:42,114:P,115:O,116:M},{44:S,47:163,60:B,89:V,102:I,105:w,106:R,109:N,111:G,113:42,114:P,115:O,116:M},s(_,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},s(_,[2,115],{120:168,10:[1,167],14:E1,44:T1,60:S1,89:y1,105:x1,106:F1,109:_1,111:B1,114:v1,115:L1,116:V1}),s(_,[2,117],{10:[1,169]}),s(q,[2,183]),s(q,[2,170]),s(q,[2,171]),s(q,[2,172]),s(q,[2,173]),s(q,[2,174]),s(q,[2,175]),s(q,[2,176]),s(q,[2,177]),s(q,[2,178]),s(q,[2,179]),s(q,[2,180]),{44:S,47:170,60:B,89:V,102:I,105:w,106:R,109:N,111:G,113:42,114:P,115:O,116:M},{30:171,67:D,80:W,81:j,82:172,116:C,117:E,118:T},{30:179,67:D,80:W,81:j,82:172,116:C,117:E,118:T},{30:181,50:[1,180],67:D,80:W,81:j,82:172,116:C,117:E,118:T},{30:182,67:D,80:W,81:j,82:172,116:C,117:E,118:T},{30:183,67:D,80:W,81:j,82:172,116:C,117:E,118:T},{30:184,67:D,80:W,81:j,82:172,116:C,117:E,118:T},{109:[1,185]},{30:186,67:D,80:W,81:j,82:172,116:C,117:E,118:T},{30:187,65:[1,188],67:D,80:W,81:j,82:172,116:C,117:E,118:T},{30:189,67:D,80:W,81:j,82:172,116:C,117:E,118:T},{30:190,67:D,80:W,81:j,82:172,116:C,117:E,118:T},{30:191,67:D,80:W,81:j,82:172,116:C,117:E,118:T},s(H,[2,182]),s(n,[2,20]),s(ue,[2,25]),s(C1,[2,46],{39:192,18:193,10:d1,40:ne}),s(I1,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:D,80:W,81:j,82:172,116:C,117:E,118:T},{77:[1,197],79:198,116:K1,119:Y1},s(w1,[2,79]),s(w1,[2,81]),s(w1,[2,82]),s(w1,[2,168]),s(w1,[2,169]),{76:199,79:121,80:oe,81:le,116:K1,119:Y1},s(ce,[2,84]),{8:$,9:e1,10:he,11:t1,12:de,14:pe,21:201,27:fe,29:[1,200],32:ge,44:be,60:Ae,75:ke,83:141,84:me,85:De,86:Ce,87:Ee,88:Te,89:Se,90:ye,91:202,105:xe,109:Fe,111:_e,114:Be,115:ve,116:Le},s(x,[2,101]),s(x,[2,103]),s(x,[2,104]),s(x,[2,157]),s(x,[2,158]),s(x,[2,159]),s(x,[2,160]),s(x,[2,161]),s(x,[2,162]),s(x,[2,163]),s(x,[2,164]),s(x,[2,165]),s(x,[2,166]),s(x,[2,167]),s(x,[2,90]),s(x,[2,91]),s(x,[2,92]),s(x,[2,93]),s(x,[2,94]),s(x,[2,95]),s(x,[2,96]),s(x,[2,97]),s(x,[2,98]),s(x,[2,99]),s(x,[2,100]),{6:11,7:12,8:p,9:c,10:g,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:A,32:[1,203],33:24,34:v,36:b,38:m,42:28,43:39,44:S,45:40,47:41,60:B,84:b1,85:A1,86:P1,87:K,88:h1,89:V,102:I,105:w,106:R,109:N,111:G,113:42,114:P,115:O,116:M,121:M1,122:U1,123:z1,124:W1,125:j1},{10:d1,18:204},{44:[1,205]},s(k1,[2,43]),{10:[1,206],44:S,60:B,89:V,102:I,105:w,106:R,109:N,111:G,113:113,114:P,115:O,116:M},{10:[1,207]},{10:[1,208],106:[1,209]},s(we,[2,128]),{10:[1,210],44:S,60:B,89:V,102:I,105:w,106:R,109:N,111:G,113:113,114:P,115:O,116:M},{10:[1,211],44:S,60:B,89:V,102:I,105:w,106:R,109:N,111:G,113:113,114:P,115:O,116:M},{80:[1,212]},s(_,[2,109],{10:[1,213]}),s(_,[2,111],{10:[1,214]}),{80:[1,215]},s(q,[2,184]),{80:[1,216],98:[1,217]},s(k1,[2,55],{113:113,44:S,60:B,89:V,102:I,105:w,106:R,109:N,111:G,114:P,115:O,116:M}),{31:[1,218],67:D,82:219,116:C,117:E,118:T},s(p1,[2,86]),s(p1,[2,88]),s(p1,[2,89]),s(p1,[2,153]),s(p1,[2,154]),s(p1,[2,155]),s(p1,[2,156]),{49:[1,220],67:D,82:219,116:C,117:E,118:T},{30:221,67:D,80:W,81:j,82:172,116:C,117:E,118:T},{51:[1,222],67:D,82:219,116:C,117:E,118:T},{53:[1,223],67:D,82:219,116:C,117:E,118:T},{55:[1,224],67:D,82:219,116:C,117:E,118:T},{57:[1,225],67:D,82:219,116:C,117:E,118:T},{60:[1,226]},{64:[1,227],67:D,82:219,116:C,117:E,118:T},{66:[1,228],67:D,82:219,116:C,117:E,118:T},{30:229,67:D,80:W,81:j,82:172,116:C,117:E,118:T},{31:[1,230],67:D,82:219,116:C,117:E,118:T},{67:D,69:[1,231],71:[1,232],82:219,116:C,117:E,118:T},{67:D,69:[1,234],71:[1,233],82:219,116:C,117:E,118:T},s(C1,[2,45],{18:156,10:d1,40:Ie}),s(C1,[2,47],{44:Ve}),s(I1,[2,75]),s(I1,[2,74]),{62:[1,235],67:D,82:219,116:C,117:E,118:T},s(I1,[2,77]),s(w1,[2,80]),{77:[1,236],79:198,116:K1,119:Y1},{30:237,67:D,80:W,81:j,82:172,116:C,117:E,118:T},s(Q1,l,{5:238}),s(x,[2,102]),s(y,[2,35]),{43:239,44:S,45:40,47:41,60:B,89:V,102:I,105:w,106:R,109:N,111:G,113:42,114:P,115:O,116:M},{10:d1,18:240},{10:s1,60:i1,84:r1,92:241,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:252,104:[1,253],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:254,104:[1,255],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{105:[1,256]},{10:s1,60:i1,84:r1,92:257,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{44:S,47:258,60:B,89:V,102:I,105:w,106:R,109:N,111:G,113:42,114:P,115:O,116:M},s(_,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},s(_,[2,116]),s(_,[2,118],{10:[1,262]}),s(_,[2,119]),s(z,[2,56]),s(p1,[2,87]),s(z,[2,57]),{51:[1,263],67:D,82:219,116:C,117:E,118:T},s(z,[2,64]),s(z,[2,59]),s(z,[2,60]),s(z,[2,61]),{109:[1,264]},s(z,[2,63]),s(z,[2,65]),{66:[1,265],67:D,82:219,116:C,117:E,118:T},s(z,[2,67]),s(z,[2,68]),s(z,[2,70]),s(z,[2,69]),s(z,[2,71]),s([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),s(I1,[2,78]),{31:[1,266],67:D,82:219,116:C,117:E,118:T},{6:11,7:12,8:p,9:c,10:g,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:A,32:[1,267],33:24,34:v,36:b,38:m,42:28,43:39,44:S,45:40,47:41,60:B,84:b1,85:A1,86:P1,87:K,88:h1,89:V,102:I,105:w,106:R,109:N,111:G,113:42,114:P,115:O,116:M,121:M1,122:U1,123:z1,124:W1,125:j1},s(k1,[2,53]),{43:268,44:S,45:40,47:41,60:B,89:V,102:I,105:w,106:R,109:N,111:G,113:42,114:P,115:O,116:M},s(_,[2,121],{106:R1}),s(Re,[2,130],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),s(Z,[2,132]),s(Z,[2,134]),s(Z,[2,135]),s(Z,[2,136]),s(Z,[2,137]),s(Z,[2,138]),s(Z,[2,139]),s(Z,[2,140]),s(Z,[2,141]),s(_,[2,122],{106:R1}),{10:[1,271]},s(_,[2,123],{106:R1}),{10:[1,272]},s(we,[2,129]),s(_,[2,105],{106:R1}),s(_,[2,106],{113:113,44:S,60:B,89:V,102:I,105:w,106:R,109:N,111:G,114:P,115:O,116:M}),s(_,[2,110]),s(_,[2,112],{10:[1,273]}),s(_,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:$,9:e1,11:t1,21:278},s(y,[2,34]),s(k1,[2,52]),{10:s1,60:i1,84:r1,105:a1,107:279,108:243,109:n1,110:u1,111:o1,112:l1},s(Z,[2,133]),{14:E1,44:T1,60:S1,89:y1,101:280,105:x1,106:F1,109:_1,111:B1,114:v1,115:L1,116:V1,120:88},{14:E1,44:T1,60:S1,89:y1,101:281,105:x1,106:F1,109:_1,111:B1,114:v1,115:L1,116:V1,120:88},{98:[1,282]},s(_,[2,120]),s(z,[2,58]),{30:283,67:D,80:W,81:j,82:172,116:C,117:E,118:T},s(z,[2,66]),s(Q1,l,{5:284}),s(Re,[2,131],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),s(_,[2,126],{120:168,10:[1,285],14:E1,44:T1,60:S1,89:y1,105:x1,106:F1,109:_1,111:B1,114:v1,115:L1,116:V1}),s(_,[2,127],{120:168,10:[1,286],14:E1,44:T1,60:S1,89:y1,105:x1,106:F1,109:_1,111:B1,114:v1,115:L1,116:V1}),s(_,[2,114]),{31:[1,287],67:D,82:219,116:C,117:E,118:T},{6:11,7:12,8:p,9:c,10:g,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:A,32:[1,288],33:24,34:v,36:b,38:m,42:28,43:39,44:S,45:40,47:41,60:B,84:b1,85:A1,86:P1,87:K,88:h1,89:V,102:I,105:w,106:R,109:N,111:G,113:42,114:P,115:O,116:M,121:M1,122:U1,123:z1,124:W1,125:j1},{10:s1,60:i1,84:r1,92:289,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:290,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},s(z,[2,62]),s(y,[2,33]),s(_,[2,124],{106:R1}),s(_,[2,125],{106:R1})],defaultActions:{},parseError:k(function(h,d){if(d.recoverable)this.trace(h);else{var f=new Error(h);throw f.hash=d,f}},"parseError"),parse:k(function(h){var d=this,f=[0],o=[],F=[null],e=[],O1=this.table,t="",L=0,Ne=0,Ke=2,Ge=1,Ye=e.slice.call(arguments,1),U=Object.create(this.lexer),m1={yy:{}};for(var Z1 in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Z1)&&(m1.yy[Z1]=this.yy[Z1]);U.setInput(h,m1.yy),m1.yy.lexer=U,m1.yy.parser=this,typeof U.yylloc>"u"&&(U.yylloc={});var $1=U.yylloc;e.push($1);var He=U.options&&U.options.ranges;typeof m1.yy.parseError=="function"?this.parseError=m1.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function qe(X){f.length=f.length-2*X,F.length=F.length-X,e.length=e.length-X}k(qe,"popStack");function Pe(){var X;return X=o.pop()||U.lex()||Ge,typeof X!="number"&&(X instanceof Array&&(o=X,X=o.pop()),X=d.symbols_[X]||X),X}k(Pe,"lex");for(var Y,D1,Q,ee,N1={},q1,c1,Oe,X1;;){if(D1=f[f.length-1],this.defaultActions[D1]?Q=this.defaultActions[D1]:((Y===null||typeof Y>"u")&&(Y=Pe()),Q=O1[D1]&&O1[D1][Y]),typeof Q>"u"||!Q.length||!Q[0]){var te="";X1=[];for(q1 in O1[D1])this.terminals_[q1]&&q1>Ke&&X1.push("'"+this.terminals_[q1]+"'");U.showPosition?te="Parse error on line "+(L+1)+`: +`+U.showPosition()+` +Expecting `+X1.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":te="Parse error on line "+(L+1)+": Unexpected "+(Y==Ge?"end of input":"'"+(this.terminals_[Y]||Y)+"'"),this.parseError(te,{text:U.match,token:this.terminals_[Y]||Y,line:U.yylineno,loc:$1,expected:X1})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+D1+", token: "+Y);switch(Q[0]){case 1:f.push(Y),F.push(U.yytext),e.push(U.yylloc),f.push(Q[1]),Y=null,Ne=U.yyleng,t=U.yytext,L=U.yylineno,$1=U.yylloc;break;case 2:if(c1=this.productions_[Q[1]][1],N1.$=F[F.length-c1],N1._$={first_line:e[e.length-(c1||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(c1||1)].first_column,last_column:e[e.length-1].last_column},He&&(N1._$.range=[e[e.length-(c1||1)].range[0],e[e.length-1].range[1]]),ee=this.performAction.apply(N1,[t,Ne,L,m1.yy,Q[1],F,e].concat(Ye)),typeof ee<"u")return ee;c1&&(f=f.slice(0,-1*c1*2),F=F.slice(0,-1*c1),e=e.slice(0,-1*c1)),f.push(this.productions_[Q[1]][0]),F.push(N1.$),e.push(N1._$),Oe=O1[f[f.length-2]][f[f.length-1]],f.push(Oe);break;case 3:return!0}}return!0},"parse")},je=(function(){var f1={EOF:1,parseError:k(function(d,f){if(this.yy.parser)this.yy.parser.parseError(d,f);else throw new Error(d)},"parseError"),setInput:k(function(h,d){return this.yy=d||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var d=h.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:k(function(h){var d=h.length,f=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),f.length-1&&(this.yylineno-=f.length-1);var F=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===o.length?this.yylloc.first_column:0)+o[o.length-f.length].length-f[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[F[0],F[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(h){this.unput(this.match.slice(h))},"less"),pastInput:k(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var h=this.pastInput(),d=new Array(h.length+1).join("-");return h+this.upcomingInput()+` +`+d+"^"},"showPosition"),test_match:k(function(h,d){var f,o,F;if(this.options.backtrack_lexer&&(F={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(F.yylloc.range=this.yylloc.range.slice(0))),o=h[0].match(/(?:\r\n?|\n).*/g),o&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(h[0].length),this.matched+=h[0],f=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)return f;if(this._backtrack){for(var e in F)this[e]=F[e];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var h,d,f,o;this._more||(this.yytext="",this.match="");for(var F=this._currentRules(),e=0;ed[0].length)){if(d=f,o=e,this.options.backtrack_lexer){if(h=this.test_match(f,F[e]),h!==!1)return h;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(h=this.test_match(d,F[o]),h!==!1?h:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var d=this.next();return d||this.lex()},"lex"),begin:k(function(d){this.conditionStack.push(d)},"begin"),popState:k(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:k(function(d){this.begin(d)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:k(function(d,f,o,F){switch(o){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),f.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const e=/\n\s*/g;return f.yytext=f.yytext.replace(e,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return d.lex.firstGraph()&&this.begin("dir"),12;case 36:return d.lex.firstGraph()&&this.begin("dir"),12;case 37:return d.lex.firstGraph()&&this.begin("dir"),12;case 38:return d.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState("thickEdgeText"),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState("dottedEdgeText"),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return f1})();J1.lexer=je;function H1(){this.yy={}}return k(H1,"Parser"),H1.prototype=J1,J1.Parser=H1,new H1})();ae.parser=ae;var Ue=ae,ze=Object.assign({},Ue);ze.parse=s=>{const i=s.replace(/}\s*\n/g,`} +`);return Ue.parse(i)};var Et=ze,Tt=k((s,i)=>{const r=bt,a=r(s,"r"),n=r(s,"g"),l=r(s,"b");return ft(a,n,l,i)},"fade"),St=k(s=>`.label { + font-family: ${s.fontFamily}; + color: ${s.nodeTextColor||s.textColor}; + } + .cluster-label text { + fill: ${s.titleColor}; + } + .cluster-label span { + color: ${s.titleColor}; + } + .cluster-label span p { + background-color: transparent; + } + + .label text,span { + fill: ${s.nodeTextColor||s.textColor}; + color: ${s.nodeTextColor||s.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${s.mainBkg}; + stroke: ${s.nodeBorder}; + stroke-width: ${s.strokeWidth??1}px; + } + .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label { + text-anchor: middle; + } + + .node .katex path { + fill: #000; + stroke: #000; + stroke-width: 1px; + } + + .rough-node .label,.node .label, .image-shape .label, .icon-shape .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + + .root .anchor path { + fill: ${s.lineColor} !important; + stroke-width: 0; + stroke: ${s.lineColor}; + } + + .arrowheadPath { + fill: ${s.arrowheadColor}; + } + + .edgePath .path { + stroke: ${s.lineColor}; + stroke-width: ${s.strokeWidth??2}px; + } + + .flowchart-link { + stroke: ${s.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${s.edgeLabelBackground}; + p { + background-color: ${s.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${s.edgeLabelBackground}; + fill: ${s.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${Tt(s.edgeLabelBackground,.5)}; + // background-color: + } + + .cluster rect { + fill: ${s.clusterBkg}; + stroke: ${s.clusterBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${s.titleColor}; + } + + .cluster span { + color: ${s.titleColor}; + } + /* .cluster div { + color: ${s.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${s.fontFamily}; + font-size: 12px; + background: ${s.tertiaryColor}; + border: 1px solid ${s.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${s.textColor}; + } + + rect.text { + fill: none; + stroke-width: 0; + } + + .icon-shape, .image-shape { + background-color: ${s.edgeLabelBackground}; + p { + background-color: ${s.edgeLabelBackground}; + padding: 2px; + } + .label rect { + opacity: 0.5; + background-color: ${s.edgeLabelBackground}; + fill: ${s.edgeLabelBackground}; + } + text-align: center; + } + ${Xe()} +`,"getStyles"),yt=St,We=k(({defaultLayout:s,styles:i=yt}={})=>({parser:Et,get db(){return new kt},renderer:Ct,styles:i,init:k(r=>{r.flowchart||(r.flowchart={});const a=Ze().layout??s??r.layout;a&&Me({layout:a}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,Me({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),xt=We();const It=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:We,diagram:xt},Symbol.toStringTag,{value:"Module"}));export{We as c,It as f,yt as s}; diff --git a/internal/webapp/static/assets/ganttDiagram-PKOTCBZU-lpLvMD-8.js b/internal/webapp/static/assets/ganttDiagram-PKOTCBZU-lpLvMD-8.js new file mode 100644 index 0000000..5663e20 --- /dev/null +++ b/internal/webapp/static/assets/ganttDiagram-PKOTCBZU-lpLvMD-8.js @@ -0,0 +1,292 @@ +import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,g as Nn,s as Pn,o as Vn,n as Rn,a as zn,b as qn,_ as d,c as Yt,d as Zt,e as Bn,bn as it,l as Tt,k as Zn,j as Xn,p as Gn,x as jn}from"./mermaid.core-B7WVQkyL.js";import{g as oe}from"./_commonjsHelpers-CqkleIqs.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-DIpgEtso.js";import{i as er}from"./init-Gi6I4Gst.js";import"./mermaid-CP2pUOT9.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: +`+H.showPosition()+` +Expecting `+Bt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":ce="Parse error on line "+(K+1)+": Unexpected "+(A==O?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(ce,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Bt})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(Z[0]){case 1:b.push(A),I.push(H.yytext),o.push(H.yylloc),b.push(Z[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[Z[1]][1],at.$=I[I.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,Z[1],I,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),I=I.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[Z[1]][0]),I.push(at.$),o.push(at._$),He=W[b[b.length-2]][b[b.length-1]],b.push(He);break;case 3:return!0}}return!0},"parse")},C=(function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+` +`+g+"^"},"showPosition"),test_match:d(function(c,g){var b,m,I;if(this.options.backtrack_lexer&&(I={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(I.yylloc.range=this.yylloc.range.slice(0))),m=c[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(c[0].length),this.matched+=c[0],b=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var o in I)this[o]=I[o];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,g,b,m;this._more||(this.yytext="",this.match="");for(var I=this._currentRules(),o=0;og[0].length)){if(g=b,m=o,this.options.backtrack_lexer){if(c=this.test_match(b,I[o]),c!==!1)return c;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(c=this.test_match(g,I[m]),c!==!1?c:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var g=this.next();return g||this.lex()},"lex"),begin:d(function(g){this.conditionStack.push(g)},"begin"),popState:d(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:d(function(g){this.begin(g)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(g,b,m,I){switch(m){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return D})();x.lexer=C;function M(){this.yy={}}return d(M,"Parser"),M.prototype=x,x.Parser=M,new M})();we.parser=we;var Qi=we;it.extend(Oi);it.extend(Vi);it.extend(Bi);var rn={friday:5,saturday:6},lt="",Ye="",Fe=void 0,Ue="",Lt=[],At=[],Ee=new Map,Ie=[],se=[],Wt="",Le="",Yn=["active","done","crit","milestone","vert"],Ae=[],_t="",qt=!1,We=!1,$e="sunday",ae="saturday",De=0,Ji=d(function(){Ie=[],se=[],Wt="",Ae=[],te=0,Ce=void 0,ee=void 0,et=[],lt="",Ye="",Le="",Fe=void 0,Ue="",Lt=[],At=[],qt=!1,We=!1,De=0,Ee=new Map,_t="",Gn(),$e="sunday",ae="saturday"},"clear"),Ki=d(function(t){_t=t},"setDiagramId"),ts=d(function(t){Ye=t},"setAxisFormat"),es=d(function(){return Ye},"getAxisFormat"),ns=d(function(t){Fe=t},"setTickInterval"),rs=d(function(){return Fe},"getTickInterval"),is=d(function(t){Ue=t},"setTodayMarker"),ss=d(function(){return Ue},"getTodayMarker"),as=d(function(t){lt=t},"setDateFormat"),os=d(function(){qt=!0},"enableInclusiveEndDates"),cs=d(function(){return qt},"endDatesAreInclusive"),us=d(function(){We=!0},"enableTopAxis"),ls=d(function(){return We},"topAxisEnabled"),fs=d(function(t){Le=t},"setDisplayMode"),ds=d(function(){return Le},"getDisplayMode"),hs=d(function(){return lt},"getDateFormat"),Fn=d((t,e)=>{const n=e.toLowerCase().split(/[\s,]+/).filter(r=>r!=="");return[...new Set([...t,...n])]},"mergeTokens"),ms=d(function(t){Lt=Fn(Lt,t)},"setIncludes"),gs=d(function(){return Lt},"getIncludes"),ys=d(function(t){At=Fn(At,t)},"setExcludes"),ks=d(function(){return At},"getExcludes"),ps=d(function(){return Ee},"getLinks"),vs=d(function(t){Wt=t,Ie.push(t)},"addSection"),Ts=d(function(){return Ie},"getSections"),xs=d(function(){let t=sn();const e=10;let n=0;for(;!t&&ny))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,a]},"fixTaskDates"),Me=d(function(t,e,n){if(n=n.trim(),d(y=>{const F=y.trim();return F==="x"||F==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(n))return new Date(Number(n));const s=/^after\s+(?[\d\w- ]+)/.exec(n);if(s!==null){let y=null;for(const S of s.groups.ids.split(" ")){let w=Ct(S);w!==void 0&&(!y||w.endTime>y.endTime)&&(y=w)}if(y)return y.endTime;const F=new Date;return F.setHours(0,0,0,0),F}let a=it(n,e.trim(),!0);if(a.isValid())return a.toDate();{Tt.debug("Invalid date:"+n),Tt.debug("With date format:"+e.trim());const y=new Date(n);if(y===void 0||isNaN(y.getTime())||y.getFullYear()<-1e4||y.getFullYear()>1e4)throw new Error("Invalid date:"+n);return y}},"getStartDate"),In=d(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),Ln=d(function(t,e,n,r=!1){n=n.trim();const s=/^until\s+(?[\d\w- ]+)/.exec(n);if(s!==null){let w=null;for(const _ of s.groups.ids.split(" ")){let Y=Ct(_);Y!==void 0&&(!w||Y.startTime{window.open(n,"_self")}),Ee.set(r,n))}),Wn(t,"clickable")},"setLink"),Wn=d(function(t,e){t.split(",").forEach(function(n){let r=Ct(n);r!==void 0&&r.classes.push(e)})},"setClass"),Us=d(function(t,e,n){if(Yt().securityLevel!=="loose"||e===void 0)return;let r=[];if(typeof n=="string"){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{jn.runFunc(e,...r)})},"setClickFun"),$n=d(function(t,e){Ae.push(function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}"]`);r!==null&&r.addEventListener("click",function(){e()})},function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}-text"]`);r!==null&&r.addEventListener("click",function(){e()})})},"pushFun"),Es=d(function(t,e,n){t.split(",").forEach(function(r){Us(r,e,n)}),Wn(t,"clickable")},"setClickEvent"),Is=d(function(t){Ae.forEach(function(e){e(t)})},"bindFunctions"),Ls={getConfig:d(()=>Yt().gantt,"getConfig"),clear:Ji,setDateFormat:as,getDateFormat:hs,enableInclusiveEndDates:os,endDatesAreInclusive:cs,enableTopAxis:us,topAxisEnabled:ls,setAxisFormat:ts,getAxisFormat:es,setTickInterval:ns,getTickInterval:rs,setTodayMarker:is,getTodayMarker:ss,setAccTitle:qn,getAccTitle:zn,setDiagramTitle:Rn,getDiagramTitle:Vn,setDiagramId:Ki,setDisplayMode:fs,getDisplayMode:ds,setAccDescription:Pn,getAccDescription:Nn,addSection:vs,getSections:Ts,getTasks:xs,addTask:_s,findTaskById:Ct,addTaskOrg:Ys,setIncludes:ms,getIncludes:gs,setExcludes:ys,getExcludes:ks,setClickEvent:Es,setLink:Fs,getLinks:ps,bindFunctions:Is,parseDuration:In,isInvalidDate:Un,setWeekday:bs,getWeekday:ws,setWeekend:Ds};function Oe(t,e,n){let r=!0;for(;r;)r=!1,n.forEach(function(i){const s="^\\s*"+i+"\\s*$",a=new RegExp(s);t[0].match(a)&&(e[i]=!0,t.shift(1),r=!0)})}d(Oe,"getTaskTags");it.extend(ji);var As=d(function(){Tt.debug("Something is calling, setConf, remove the call")},"setConf"),an={monday:Vt,tuesday:vn,wednesday:Tn,thursday:bt,friday:xn,saturday:bn,sunday:zt},Ws=d((t,e)=>{let n=[...t].map(()=>-1/0),r=[...t].sort((s,a)=>s.startTime-a.startTime||s.order-a.order),i=0;for(const s of r)for(let a=0;a=n[a]){n[a]=s.endTime,s.order=a+e,a>i&&(i=a);break}return i},"getMaxIntersections"),dt,Te=1e4,$s=d(function(t,e,n,r){const i=Yt().gantt;r.db.setDiagramId(e);const s=Yt().securityLevel;let a;s==="sandbox"&&(a=Zt("#i"+e));const y=s==="sandbox"?Zt(a.nodes()[0].contentDocument.body):Zt("body"),F=s==="sandbox"?a.nodes()[0].contentDocument:document,S=F.getElementById(e);dt=S.parentElement.offsetWidth,dt===void 0&&(dt=1200),i.useWidth!==void 0&&(dt=i.useWidth);const w=r.db.getTasks(),P=w.filter(x=>!x.vert);let _=[];for(const x of P)_.push(x.type);_=L(_);const Y={};let X=2*i.topPadding;if(r.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const x={};for(const M of P)x[M.section]===void 0?x[M.section]=[M]:x[M.section].push(M);let C=0;for(const M of Object.keys(x)){const D=Ws(x[M],C)+1;C+=D,X+=D*(i.barHeight+i.barGap),Y[M]=D}}else{X+=P.length*(i.barHeight+i.barGap);for(const x of _)Y[x]=P.filter(C=>C.type===x).length}S.setAttribute("viewBox","0 0 "+dt+" "+X);const B=y.select(`[id="${e}"]`),v=Li().domain([rr(w,function(x){return x.startTime}),nr(w,function(x){return x.endTime})]).rangeRound([0,dt-i.leftPadding-i.rightPadding]);function U(x,C){const M=x.startTime,D=C.startTime;let c=0;return M>D?c=1:Ml.vert===$.vert?0:l.vert?1:-1);const m=x.filter(l=>!l.vert),o=[...new Set(m.map(l=>l.order))].map(l=>m.find($=>$.order===l));B.append("g").selectAll("rect").data(o).enter().append("rect").attr("x",0).attr("y",function(l,$){return $=l.order,$*C+M-2}).attr("width",function(){return b-i.rightPadding/2}).attr("height",C).attr("class",function(l){for(const[$,O]of _.entries())if(l.type===O)return"section section"+$%i.numberSectionStyles;return"section section0"}).enter();const W=B.append("g").selectAll("rect").data(x).enter(),u=r.db.getLinks();if(W.append("rect").attr("id",function(l){return e+"-"+l.id}).attr("rx",3).attr("ry",3).attr("x",function(l){return l.milestone?v(l.startTime)+D+.5*(v(l.endTime)-v(l.startTime))-.5*c:v(l.startTime)+D}).attr("y",function(l,$){return $=l.order,l.vert?i.gridLineStartPadding:$*C+M}).attr("width",function(l){return l.milestone?c:l.vert?.08*c:v(l.renderEndTime||l.endTime)-v(l.startTime)}).attr("height",function(l){return l.vert?m.length*(i.barHeight+i.barGap)+i.barHeight*2:c}).attr("transform-origin",function(l,$){return $=l.order,(v(l.startTime)+D+.5*(v(l.endTime)-v(l.startTime))).toString()+"px "+($*C+M+.5*c).toString()+"px"}).attr("class",function(l){const $="task";let O="";l.classes.length>0&&(O=l.classes.join(" "));let j=0;for(const[J,h]of _.entries())l.type===h&&(j=J%i.numberSectionStyles);let H="";return l.active?l.crit?H+=" activeCrit":H=" active":l.done?l.crit?H=" doneCrit":H=" done":l.crit&&(H+=" crit"),H.length===0&&(H=" task"),l.milestone&&(H=" milestone "+H),l.vert&&(H=" vert "+H),H+=j,H+=" "+O,$+H}),W.append("text").attr("id",function(l){return e+"-"+l.id+"-text"}).text(function(l){return l.task}).attr("font-size",i.fontSize).attr("x",function(l){let $=v(l.startTime),O=v(l.renderEndTime||l.endTime);if(l.milestone&&($+=.5*(v(l.endTime)-v(l.startTime))-.5*c,O=$+c),l.vert)return v(l.startTime)+D;const j=this.getBBox().width;return j>O-$?O+j+1.5*i.leftPadding>b?$+D-5:O+D+5:(O-$)/2+$+D}).attr("y",function(l,$){return l.vert?i.gridLineStartPadding+m.length*(i.barHeight+i.barGap)+60:($=l.order,$*C+i.barHeight/2+(i.fontSize/2-2)+M)}).attr("text-height",c).attr("class",function(l){const $=v(l.startTime);let O=v(l.endTime);l.milestone&&(O=$+c);const j=this.getBBox().width;let H="";l.classes.length>0&&(H=l.classes.join(" "));let J=0;for(const[N,V]of _.entries())l.type===V&&(J=N%i.numberSectionStyles);let h="";return l.active&&(l.crit?h="activeCritText"+J:h="activeText"+J),l.done?l.crit?h=h+" doneCritText"+J:h=h+" doneText"+J:l.crit&&(h=h+" critText"+J),l.milestone&&(h+=" milestoneText"),l.vert&&(h+=" vertText"),j>O-$?O+j+1.5*i.leftPadding>b?H+" taskTextOutsideLeft taskTextOutside"+J+" "+h:H+" taskTextOutsideRight taskTextOutside"+J+" "+h+" width-"+j:H+" taskText taskText"+J+" "+h+" width-"+j}),Yt().securityLevel==="sandbox"){let l;l=Zt("#i"+e);const $=l.nodes()[0].contentDocument;W.filter(function(O){return u.has(O.id)}).each(function(O){var j=$.querySelector("#"+CSS.escape(e+"-"+O.id)),H=$.querySelector("#"+CSS.escape(e+"-"+O.id+"-text"));const J=j.parentNode;var h=$.createElement("a");h.setAttribute("xlink:href",u.get(O.id)),h.setAttribute("target","_top"),J.appendChild(h),h.appendChild(j),h.appendChild(H)})}}d(E,"drawRects");function z(x,C,M,D,c,g,b,m){if(b.length===0&&m.length===0)return;let I,o;for(const{startTime:O,endTime:j}of g)(I===void 0||Oo)&&(o=j);if(!I||!o)return;if(it(o).diff(it(I),"year")>5){Tt.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const W=r.db.getDateFormat(),u=[];let K=null,l=it(I);for(;l.valueOf()<=o;)r.db.isInvalidDate(l,W,b,m)?K?K.end=l:K={start:l,end:l}:K&&(u.push(K),K=null),l=l.add(1,"d");B.append("g").selectAll("rect").data(u).enter().append("rect").attr("id",O=>e+"-exclude-"+O.start.format("YYYY-MM-DD")).attr("x",O=>v(O.start.startOf("day"))+M).attr("y",i.gridLineStartPadding).attr("width",O=>v(O.end.endOf("day"))-v(O.start.startOf("day"))).attr("height",c-C-i.gridLineStartPadding).attr("transform-origin",function(O,j){return(v(O.start)+M+.5*(v(O.end)-v(O.start))).toString()+"px "+(j*x+.5*c).toString()+"px"}).attr("class","exclude-range")}d(z,"drawExcludeDays");function G(x,C,M,D){if(M<=0||x>C)return 1/0;const c=C-x,g=it.duration({[D??"day"]:M}).asMilliseconds();return g<=0?1/0:Math.ceil(c/g)}d(G,"getEstimatedTickCount");function T(x,C,M,D){const c=r.db.getDateFormat(),g=r.db.getAxisFormat();let b;g?b=g:c==="D"?b="%d":b=i.axisFormat??"%Y-%m-%d";let m=fr(v).tickSize(-D+C+i.gridLineStartPadding).tickFormat(ie(b));const o=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||i.tickInterval);if(o!==null){const W=parseInt(o[1],10);if(isNaN(W)||W<=0)Tt.warn(`Invalid tick interval value: "${o[1]}". Skipping custom tick interval.`);else{const u=o[2],K=r.db.getWeekday()||i.weekday,l=v.domain(),$=l[0],O=l[1],j=G($,O,W,u);if(j>Te)Tt.warn(`The tick interval "${W}${u}" would generate ${j} ticks, which exceeds the maximum allowed (${Te}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(u){case"millisecond":m.ticks(Et.every(W));break;case"second":m.ticks(vt.every(W));break;case"minute":m.ticks(Nt.every(W));break;case"hour":m.ticks(Pt.every(W));break;case"day":m.ticks(xt.every(W));break;case"week":m.ticks(an[K].every(W));break;case"month":m.ticks(Rt.every(W));break}}}if(B.append("g").attr("class","grid").attr("transform","translate("+x+", "+(D-50)+")").call(m).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),r.db.topAxisEnabled()||i.topAxis){let W=lr(v).tickSize(-D+C+i.gridLineStartPadding).tickFormat(ie(b));if(o!==null){const u=parseInt(o[1],10);if(isNaN(u)||u<=0)Tt.warn(`Invalid tick interval value: "${o[1]}". Skipping custom tick interval.`);else{const K=o[2],l=r.db.getWeekday()||i.weekday,$=v.domain(),O=$[0],j=$[1];if(G(O,j,u,K)<=Te)switch(K){case"millisecond":W.ticks(Et.every(u));break;case"second":W.ticks(vt.every(u));break;case"minute":W.ticks(Nt.every(u));break;case"hour":W.ticks(Pt.every(u));break;case"day":W.ticks(xt.every(u));break;case"week":W.ticks(an[l].every(u));break;case"month":W.ticks(Rt.every(u));break}}}B.append("g").attr("class","grid").attr("transform","translate("+x+", "+C+")").call(W).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}d(T,"makeGrid");function k(x,C){let M=0;const D=Object.keys(Y).map(c=>[c,Y[c]]);B.append("g").selectAll("text").data(D).enter().append(function(c){const g=c[0].split(Zn.lineBreakRegex),b=-(g.length-1)/2,m=F.createElementNS("http://www.w3.org/2000/svg","text");m.setAttribute("dy",b+"em");for(const[I,o]of g.entries()){const W=F.createElementNS("http://www.w3.org/2000/svg","tspan");W.setAttribute("alignment-baseline","central"),W.setAttribute("x","10"),I>0&&W.setAttribute("dy","1em"),W.textContent=o,m.appendChild(W)}return m}).attr("x",10).attr("y",function(c,g){if(g>0)for(let b=0;b` + .mermaid-main-font { + font-family: ${t.fontFamily}; + } + + .exclude-range { + fill: ${t.excludeBkgColor}; + } + + .section { + stroke: none; + opacity: 0.2; + } + + .section0 { + fill: ${t.sectionBkgColor}; + } + + .section2 { + fill: ${t.sectionBkgColor2}; + } + + .section1, + .section3 { + fill: ${t.altSectionBkgColor}; + opacity: 0.2; + } + + .sectionTitle0 { + fill: ${t.titleColor}; + } + + .sectionTitle1 { + fill: ${t.titleColor}; + } + + .sectionTitle2 { + fill: ${t.titleColor}; + } + + .sectionTitle3 { + fill: ${t.titleColor}; + } + + .sectionTitle { + text-anchor: start; + font-family: ${t.fontFamily}; + } + + + /* Grid and axis */ + + .grid .tick { + stroke: ${t.gridColor}; + opacity: 0.8; + shape-rendering: crispEdges; + } + + .grid .tick text { + font-family: ${t.fontFamily}; + fill: ${t.textColor}; + } + + .grid path { + stroke-width: 0; + } + + + /* Today line */ + + .today { + fill: none; + stroke: ${t.todayLineColor}; + stroke-width: 2px; + } + + + /* Task styling */ + + /* Default task */ + + .task { + stroke-width: 2; + } + + .taskText { + text-anchor: middle; + font-family: ${t.fontFamily}; + } + + .taskTextOutsideRight { + fill: ${t.taskTextDarkColor}; + text-anchor: start; + font-family: ${t.fontFamily}; + } + + .taskTextOutsideLeft { + fill: ${t.taskTextDarkColor}; + text-anchor: end; + } + + + /* Special case clickable */ + + .task.clickable { + cursor: pointer; + } + + .taskText.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideLeft.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideRight.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + + /* Specific task settings for the sections*/ + + .taskText0, + .taskText1, + .taskText2, + .taskText3 { + fill: ${t.taskTextColor}; + } + + .task0, + .task1, + .task2, + .task3 { + fill: ${t.taskBkgColor}; + stroke: ${t.taskBorderColor}; + } + + .taskTextOutside0, + .taskTextOutside2 + { + fill: ${t.taskTextOutsideColor}; + } + + .taskTextOutside1, + .taskTextOutside3 { + fill: ${t.taskTextOutsideColor}; + } + + + /* Active task */ + + .active0, + .active1, + .active2, + .active3 { + fill: ${t.activeTaskBkgColor}; + stroke: ${t.activeTaskBorderColor}; + } + + .activeText0, + .activeText1, + .activeText2, + .activeText3 { + fill: ${t.taskTextDarkColor} !important; + } + + + /* Completed task */ + + .done0, + .done1, + .done2, + .done3 { + stroke: ${t.doneTaskBorderColor}; + fill: ${t.doneTaskBkgColor}; + stroke-width: 2; + } + + .doneText0, + .doneText1, + .doneText2, + .doneText3 { + fill: ${t.taskTextDarkColor} !important; + } + + /* Done task text displayed outside the bar sits against the diagram background, + not against the done-task bar, so it must use the outside/contrast color. */ + .doneText0.taskTextOutsideLeft, + .doneText0.taskTextOutsideRight, + .doneText1.taskTextOutsideLeft, + .doneText1.taskTextOutsideRight, + .doneText2.taskTextOutsideLeft, + .doneText2.taskTextOutsideRight, + .doneText3.taskTextOutsideLeft, + .doneText3.taskTextOutsideRight { + fill: ${t.taskTextOutsideColor} !important; + } + + + /* Tasks on the critical line */ + + .crit0, + .crit1, + .crit2, + .crit3 { + stroke: ${t.critBorderColor}; + fill: ${t.critBkgColor}; + stroke-width: 2; + } + + .activeCrit0, + .activeCrit1, + .activeCrit2, + .activeCrit3 { + stroke: ${t.critBorderColor}; + fill: ${t.activeTaskBkgColor}; + stroke-width: 2; + } + + .doneCrit0, + .doneCrit1, + .doneCrit2, + .doneCrit3 { + stroke: ${t.critBorderColor}; + fill: ${t.doneTaskBkgColor}; + stroke-width: 2; + cursor: pointer; + shape-rendering: crispEdges; + } + + .milestone { + transform: rotate(45deg) scale(0.8,0.8); + } + + .milestoneText { + font-style: italic; + } + .doneCritText0, + .doneCritText1, + .doneCritText2, + .doneCritText3 { + fill: ${t.taskTextDarkColor} !important; + } + + /* Done-crit task text outside the bar — same reasoning as doneText above. */ + .doneCritText0.taskTextOutsideLeft, + .doneCritText0.taskTextOutsideRight, + .doneCritText1.taskTextOutsideLeft, + .doneCritText1.taskTextOutsideRight, + .doneCritText2.taskTextOutsideLeft, + .doneCritText2.taskTextOutsideRight, + .doneCritText3.taskTextOutsideLeft, + .doneCritText3.taskTextOutsideRight { + fill: ${t.taskTextOutsideColor} !important; + } + + .vert { + stroke: ${t.vertLineColor}; + } + + .vertText { + font-size: 15px; + text-anchor: middle; + fill: ${t.vertLineColor} !important; + } + + .activeCritText0, + .activeCritText1, + .activeCritText2, + .activeCritText3 { + fill: ${t.taskTextDarkColor} !important; + } + + .titleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.titleColor||t.textColor}; + font-family: ${t.fontFamily}; + } +`,"getStyles"),Ns=Hs,Zs={parser:Qi,db:Ls,renderer:Os,styles:Ns};export{Zs as diagram}; diff --git a/internal/webapp/static/assets/gitGraphDiagram-DS77QQ5N-BAf_Q-WY.js b/internal/webapp/static/assets/gitGraphDiagram-DS77QQ5N-BAf_Q-WY.js new file mode 100644 index 0000000..657b9b7 --- /dev/null +++ b/internal/webapp/static/assets/gitGraphDiagram-DS77QQ5N-BAf_Q-WY.js @@ -0,0 +1,106 @@ +import{I as le}from"./chunk-2Q5K7J3B-Krb_H4ce.js";import{p as he}from"./chunk-JWPE2WC7-Czg53Rx5.js";import{o as $e,n as fe,s as ge,g as ue,a as ye,b as xe,_ as h,y as J,l as w,d as me,c as q,x as pe,z as be,p as we,k as B,A as ke,B as ve,C as Ce}from"./mermaid.core-B7WVQkyL.js";import{p as Ee}from"./cynefin-VYW2F7L2-CdOzebfq.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=h(function(){return d.records.currBranch},"getCurrentBranch"),We=h(function(){return d.records.direction},"getDirection"),qe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:Pe,getDirection:We,getHead:qe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,P=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),P.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=q(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` + ${s-i/2-L/2},${x+R} + ${s-i/2-L/2},${x-R} + ${t.posWithOffset-i/2-L},${x-c-R} + ${t.posWithOffset+i/2+L},${x-c-R} + ${t.posWithOffset+i/2+L},${x+c+R} + ${t.posWithOffset-i/2-L},${x+c+R}`),f.attr("cy",x).attr("cx",s-i/2+L/2).attr("r",1.5).attr("class","tag-hole"),y==="TB"||y==="BT"){const u=s+$;g.attr("class","tag-label-bkg").attr("points",` + ${t.x},${u+2} + ${t.x},${u-2} + ${t.x+O},${u-c-2} + ${t.x+O+i+4},${u-c-2} + ${t.x+O+i+4},${u+c+2} + ${t.x+O},${u+c+2}`).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),f.attr("cx",t.x+L/2).attr("cy",u).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),l.attr("x",t.x+5).attr("y",u+3).attr("transform","translate(14,14) rotate(45, "+t.x+","+s+")")}}}},"drawCommitTags"),cr=h(e=>{switch(e.customType??e.type){case m.NORMAL:return"commit-normal";case m.REVERSE:return"commit-reverse";case m.HIGHLIGHT:return"commit-highlight";case m.MERGE:return"commit-merge";case m.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ir=h((e,r,t,s)=>{const o={x:0,y:0};if(e.parents.length>0){const i=ce(e.parents);if(i){const n=s.get(i)??o;return r==="TB"?n.y+_:r==="BT"?(s.get(e.id)??o).y-_:n.x+_}}else return r==="TB"?F:r==="BT"?(s.get(e.id)??o).y-_:0;return 0},"calculatePosition"),dr=h((e,r,t)=>{const s=y==="BT"&&t?r:r+O,o=C.get(e.branch)?.pos,i=y==="TB"||y==="BT"?C.get(e.branch)?.pos:s;if(i===void 0||o===void 0)throw new Error(`Position were undefined for commit ${e.id}`);const n=j.has(q().theme??""),a=y==="TB"||y==="BT"?s:o+(n?X/2+1:-2);return{x:i,y:a,posWithOffset:s}},"getCommitPosition"),re=h((e,r,t,s)=>{const o=e.append("g").attr("class","commit-bullets"),i=e.append("g").attr("class","commit-labels");let n=y==="TB"||y==="BT"?F:0;const a=[...r.keys()],l=s.parallelCommits??!1,f=h(($,c)=>{const x=r.get($)?.seq,u=r.get(c)?.seq;return x!==void 0&&u!==void 0?x-u:0},"sortKeys");let g=a.sort(f);y==="BT"&&(l&&Ze(g,r,n),g=g.reverse()),g.forEach($=>{const c=r.get($);if(!c)throw new Error(`Commit not found for key ${$}`);l&&(n=ir(c,y,n,E));const x=dr(c,n,l);if(t){const u=cr(c),p=c.customType??c.type,b=C.get(c.branch)?.index??0;nr(o,c,x,u,b,p),sr(i,c,x,n,s),or(i,c,x,n)}y==="TB"||y==="BT"?E.set(c.id,{x:x.x,y:x.posWithOffset}):E.set(c.id,{x:x.posWithOffset,y:x.y}),n=y==="BT"&&l?n+_:n+_+O,n>I&&(I=n)})},"drawCommits"),lr=h((e,r,t,s,o)=>{const n=(y==="TB"||y==="BT"?t.xf.branch===n,"isOnBranchToGetCurve"),l=h(f=>f.seq>e.seq&&f.seql(f)&&a(f))},"shouldRerouteArrow"),W=h((e,r,t=0)=>{const s=e+Math.abs(e-r)/2;if(t>5)return s;if(z.every(n=>Math.abs(n-s)>=10))return z.push(s),s;const i=Math.abs(e-r);return W(e,r-i/5,t+1)},"findLane"),hr=h((e,r,t,s)=>{const{theme:o}=q(),i=Z.has(o??""),n=E.get(r.id),a=E.get(t.id);if(n===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${t.id}`);const l=lr(r,t,n,a,s);let f="",g="",$=0,c=0,x=C.get(t.branch)?.index;t.type===m.MERGE&&r.id!==t.parents[0]&&(x=C.get(r.branch)?.index);let u;if(l){f="A 10 10, 0, 0, 0,",g="A 10 10, 0, 0, 1,",$=10,c=10;const p=n.ya.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${g} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${f} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):y==="BT"?(n.xa.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${f} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${g} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):(n.ya.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y===a.y&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`));if(u===void 0)throw new Error("Line definition not found");e.append("path").attr("d",u).attr("class","arrow arrow"+H(x,G,i))},"drawArrow"),$r=h((e,r)=>{const t=e.append("g").attr("class","commit-arrows");[...r.keys()].forEach(s=>{const o=r.get(s);o.parents&&o.parents.length>0&&o.parents.forEach(i=>{hr(t,r.get(i),o,r)})})},"drawArrows"),fr=h((e,r,t,s)=>{const{look:o,theme:i,themeVariables:n}=q(),{dropShadow:a,THEME_COLOR_LIMIT:l}=n,f=j.has(i??""),g=Z.has(i??""),$=e.append("g");r.forEach((c,x)=>{const u=H(x,f?l:G,g),p=C.get(c.name)?.pos;if(p===void 0)throw new Error(`Position not found for branch ${c.name}`);const b=y==="TB"||y==="BT"?p:f?p+X/2+1:p-2,k=$.append("line");k.attr("x1",0),k.attr("y1",b),k.attr("x2",I),k.attr("y2",b),k.attr("class","branch branch"+u),y==="TB"?(k.attr("y1",F),k.attr("x1",p),k.attr("y2",I),k.attr("x2",p)):y==="BT"&&(k.attr("y1",I),k.attr("x1",p),k.attr("y2",F),k.attr("x2",p)),z.push(b);const U=c.name,D=oe(U),T=$.insert("rect"),M=$.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+u);M.node().appendChild(D);const v=D.getBBox(),ee=f?0:4,N=f?16:0,A=f?X:0;o==="neo"&&T.attr("data-look","neo"),T.attr("class","branchLabelBkg label"+u).attr("style",o==="neo"?`filter:${f?`url(#${s}-drop-shadow)`:a}`:"").attr("rx",ee).attr("ry",ee).attr("x",-v.width-4-(t.rotateCommitLabel===!0?30:0)).attr("y",-v.height/2+10).attr("width",v.width+18+N).attr("height",v.height+4+A),M.attr("transform","translate("+(-v.width-14-(t.rotateCommitLabel===!0?30:0)+N/2)+", "+(b-v.height/2-2)+")"),y==="TB"?(T.attr("x",p-v.width/2-10).attr("y",0),M.attr("transform","translate("+(p-v.width/2-5)+", 0)"),f&&(T.attr("transform",`translate(${-N/2-3}, ${-A-10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(-A*2+7)+")"))):y==="BT"?(T.attr("x",p-v.width/2-10).attr("y",I),M.attr("transform","translate("+(p-v.width/2-5)+", "+I+")"),f&&(T.attr("transform",`translate(${-N/2-3}, ${A+10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(I+A*2+4)+")"))):T.attr("transform","translate(-19, "+(b-12-A/2)+")")})},"drawBranches"),gr=h(function(e,r,t,s,o){return C.set(e,{pos:r,index:t}),r+=50+(o?40:0)+(y==="TB"||y==="BT"?s.width/2:0),r},"setBranchPosition"),ur=h(function(e,r,t,s){Je(),w.debug("in gitgraph renderer",e+` +`,"id:",r,t);const o=s.db;if(!o.getConfig){w.error("getConfig method is not available on db");return}const i=o.getConfig(),n=i.rotateCommitLabel??!1;P=o.getCommits();const a=o.getBranchesAsObjArray();y=o.getDirection();const l=me(`[id="${r}"]`),{look:f,theme:g,themeVariables:$}=q(),{useGradient:c,gradientStart:x,gradientStop:u,filterColor:p}=$;if(c){const k=l.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");k.append("stop").attr("offset","0%").attr("stop-color",x).attr("stop-opacity",1),k.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}f==="neo"&&j.has(g??"")&&l.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",p);let b=0;a.forEach((k,U)=>{const D=oe(k.name),T=l.append("g"),K=T.insert("g").attr("class","branchLabel"),M=K.insert("g").attr("class","label branch-label");M.node()?.appendChild(D);const v=D.getBBox();b=gr(k.name,b,U,v,n),M.remove(),K.remove(),T.remove()}),re(l,P,!1,i),i.showBranches&&fr(l,a,i,r),$r(l,P),re(l,P,!0,i),pe.insertTitle(l,"gitTitleText",i.titleTopMargin??0,o.getDiagramTitle()),be(void 0,l,i.diagramPadding,i.useMaxWidth)},"draw"),yr={draw:ur},ie=8,de=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),xr=new Set(["redux-color","redux-dark-color"]),mr=new Set(["neo","neo-dark"]),pr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),br=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),wr=h(e=>{const{svgId:r}=e;let t="";if(e.useGradient&&r)for(let s=0;s{const r=J(),{theme:t,themeVariables:s}=r,{borderColorArray:o}=s,i=de.has(t);if(mr.has(t)){let n="";for(let a=0;a`${Array.from({length:e.THEME_COLOR_LIMIT},(r,t)=>t).map(r=>{const t=r%ie;return` + .branch-label${r} { fill: ${e["gitBranchLabel"+t]}; } + .commit${r} { stroke: ${e["git"+t]}; fill: ${e["git"+t]}; } + .commit-highlight${r} { stroke: ${e["gitInv"+t]}; fill: ${e["gitInv"+t]}; } + .label${r} { fill: ${e["git"+t]}; } + .arrow${r} { stroke: ${e["git"+t]}; } + `}).join(` +`)}`,"normalTheme"),Cr=h(e=>{const r=J(),{theme:t}=r,s=br.has(t);return` + .commit-id, + .commit-msg, + .branch-label { + fill: lightgrey; + color: lightgrey; + font-family: 'trebuchet ms', verdana, arial, sans-serif; + font-family: var(--mermaid-font-family); + } + + ${s?kr(e):vr(e)} + + .branch { + stroke-width: ${e.strokeWidth}; + stroke: ${e.commitLineColor??e.lineColor}; + stroke-dasharray: ${s?"4 2":"2"}; + } + .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${s?e.nodeBorder:e.commitLabelColor}; ${s?`font-weight:${e.noteFontWeight};`:""}} + .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${s?"transparent":e.commitLabelBackground}; opacity: ${s?"":.5}; } + .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};} + .tag-label-bkg { fill: ${s?e.mainBkg:e.tagLabelBackground}; stroke: ${s?e.nodeBorder:e.tagLabelBorder}; ${s?`filter:${e.dropShadow}`:""} } + .tag-hole { fill: ${e.textColor}; } + + .commit-merge { + stroke: ${s?e.mainBkg:e.primaryColor}; + fill: ${s?e.mainBkg:e.primaryColor}; + } + .commit-reverse { + stroke: ${s?e.mainBkg:e.primaryColor}; + fill: ${s?e.mainBkg:e.primaryColor}; + stroke-width: ${s?e.strokeWidth:3}; + } + .commit-highlight-outer { + } + .commit-highlight-inner { + stroke: ${s?e.mainBkg:e.primaryColor}; + fill: ${s?e.mainBkg:e.primaryColor}; + } + + .arrow { + /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ + stroke-width: ${de.has(t)?e.strokeWidth:8}; + stroke-linecap: round; + fill: none + } + .gitTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } +`},"getStyles"),Er=Cr,Or={parser:Ve,db:se,renderer:yr,styles:Er};export{Or as diagram}; diff --git a/internal/webapp/static/assets/graph-DOmOIIwC.js b/internal/webapp/static/assets/graph-DOmOIIwC.js new file mode 100644 index 0000000..2f01f98 --- /dev/null +++ b/internal/webapp/static/assets/graph-DOmOIIwC.js @@ -0,0 +1 @@ +var Ze=typeof global=="object"&&global&&global.Object===Object&&global,pt=typeof self=="object"&&self&&self.Object===Object&&self,w=Ze||pt||Function("return this")(),y=w.Symbol,We=Object.prototype,_t=We.hasOwnProperty,bt=We.toString,D=y?y.toStringTag:void 0;function yt(e){var t=_t.call(e,D),r=e[D];try{e[D]=void 0;var n=!0}catch{}var i=bt.call(e);return n&&(t?e[D]=r:delete e[D]),i}var vt=Object.prototype,Ot=vt.toString;function mt(e){return Ot.call(e)}var wt="[object Null]",Tt="[object Undefined]",Oe=y?y.toStringTag:void 0;function M(e){return e==null?e===void 0?Tt:wt:Oe&&Oe in Object(e)?yt(e):mt(e)}function j(e){return e!=null&&typeof e=="object"}var At="[object Symbol]";function he(e){return typeof e=="symbol"||j(e)&&M(e)==At}function Je(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r0){if(++t>=Bt)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function F(e){return function(){return e}}var Ae=(function(){try{var e=L(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Yt=Ae?function(e,t){return Ae(e,"toString",{configurable:!0,enumerable:!1,value:F(t),writable:!0})}:J,Zt=Xt(Yt);function Wt(e,t){for(var r=-1,n=e==null?0:e.length;++r-1}var tr=9007199254740991,rr=/^(?:0|[1-9]\d*)$/;function Ve(e,t){var r=typeof e;return t=t??tr,!!t&&(r=="number"||r!="symbol"&&rr.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=sr}function Q(e){return e!=null&&le(e.length)&&!Z(e)}var ar=Object.prototype;function et(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ar;return e===r}function or(e,t){for(var r=-1,n=Array(e);++r-1}function gn(e,t){var r=this.__data__,n=k(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function T(e){var t=-1,r=e==null?0:e.length;for(this.clear();++to))return!1;var f=s.get(e),d=s.get(t);if(f&&d)return f==t&&d==e;var c=-1,l=!0,v=r&ei?new B:void 0;for(s.set(e,t),s.set(t,e);++c=ki){var f=Vi(e);if(f)return _e(f);a=!1,i=ft,u=new B}else u=o;e:for(;++n1?i.setNode(s,r):i.setNode(s)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=C,this._children[t]={},this._children[C][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],S(this.children(t),n=>{this.setParent(n)}),delete this._children[t]),S(b(this._in[t]),r),delete this._in[t],delete this._preds[t],S(b(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(R(r))r=C;else{r+="";for(var n=r;!R(n);n=this.parent(n))if(n===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==C)return r}}children(t){if(R(t)&&(t=C),this._isCompound){var r=this._children[t];if(r)return b(r)}else{if(t===C)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return b(r)}successors(t){var r=this._sucs[t];if(r)return b(r)}neighbors(t){var r=this.predecessors(t);if(r)return ts(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;S(this._nodes,function(a,o){t(o)&&r.setNode(o,a)}),S(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,n.edge(a))});var i={};function s(a){var o=n.parent(a);return o===void 0||r.hasNode(o)?(i[a]=o,o):o in i?i[o]:s(o)}return this._isCompound&&S(r.nodes(),function(a){r.setParent(a,s(a))}),r}setDefaultEdgeLabel(t){return Z(t)||(t=F(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return se(this._edgeObjs)}setPath(t,r){var n=this,i=arguments;return Ji(t,function(s,a){return i.length>1?n.setEdge(s,a,r):n.setEdge(s,a),a}),this}setEdge(){var t,r,n,i,s=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,r=a.w,n=a.name,arguments.length===2&&(i=arguments[1],s=!0)):(t=a,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),t=""+t,r=""+r,R(n)||(n=""+n);var o=G(this._isDirected,t,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return s&&(this._edgeLabels[o]=i),this;if(!R(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[o]=s?i:this._defaultEdgeLabelFn(t,r,n);var u=ns(this._isDirected,t,r,n);return t=u.v,r=u.w,Object.freeze(u),this._edgeObjs[o]=u,Xe(this._preds[r],t),Xe(this._sucs[t],r),this._in[r][o]=u,this._out[t][o]=u,this._edgeCount++,this}edge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n);return this._edgeLabels[i]}hasEdge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n),s=this._edgeObjs[i];return s&&(t=s.v,r=s.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Ye(this._preds[r],t),Ye(this._sucs[t],r),delete this._in[r][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,r){var n=this._in[t];if(n){var i=se(n);return r?Y(i,function(s){return s.v===r}):i}}outEdges(t,r){var n=this._out[t];if(n){var i=se(n);return r?Y(i,function(s){return s.w===r}):i}}nodeEdges(t,r){var n=this.inEdges(t,r);if(n)return n.concat(this.outEdges(t,r))}}gt.prototype._nodeCount=0;gt.prototype._edgeCount=0;function Xe(e,t){e[t]?e[t]++:e[t]=1}function Ye(e,t){--e[t]||delete e[t]}function G(e,t,r,n){var i=""+t,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}return i+qe+s+qe+(R(n)?rs:n)}function ns(e,t,r,n){var i=""+t,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}var o={v:i,w:s};return n&&(o.name=n),o}function ae(e,t){return G(e,t.v,t.w,t.name)}export{Y as $,he as A,Ve as B,ir as C,jn as D,Zt as E,nr as F,gt as G,M as H,de as I,zi as J,V as K,Z as L,Fi as M,Jt as N,Hi as O,Gi as P,Ci as Q,J as R,y as S,st as T,Ge as U,te as V,at as W,ji as X,$n as Y,S as Z,F as _,ce as a,se as a0,Ji as a1,et as b,Q as c,Ae as d,ke as e,Br as f,zn as g,ot as h,R as i,Hn as j,b as k,j as l,O as m,Gr as n,Kr as o,Ce as p,W as q,w as r,Fn as s,m as t,Wt as u,g as v,Le as w,ye as x,dt as y,Je as z}; diff --git a/internal/webapp/static/assets/index-Do25j1to.css b/internal/webapp/static/assets/index-Bhy4rJG7.css similarity index 95% rename from internal/webapp/static/assets/index-Do25j1to.css rename to internal/webapp/static/assets/index-Bhy4rJG7.css index f63ce17..e581424 100644 --- a/internal/webapp/static/assets/index-Do25j1to.css +++ b/internal/webapp/static/assets/index-Bhy4rJG7.css @@ -1 +1 @@ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--tracking-widest:.1em;--radius-xs:.125rem;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--color-background:#0a0b0d;--color-foreground:#eef0f3;--color-card:#15171b;--color-card-foreground:#eef0f3;--color-popover:#15171b;--color-popover-foreground:#eef0f3;--color-primary:#f5a623;--color-primary-foreground:#1a1204;--color-secondary:#ffffff08;--color-secondary-foreground:#eef0f3;--color-muted:#ffffff0f;--color-muted-foreground:#9aa0a9;--color-accent:#ffffff0f;--color-accent-foreground:#eef0f3;--color-destructive:#f26d6d;--color-border:#ffffff12;--color-input:#ffffff1c;--color-ring:#f5a623;--radius-ctl:7px}}@layer base,components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.top-4{top:calc(var(--spacing) * 4)}.top-20{top:calc(var(--spacing) * 20)}.top-\[50\%\]{top:50%}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.left-2{left:calc(var(--spacing) * 2)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.z-50{z-index:50}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.field-sizing-content{field-sizing:content}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.min-h-16{min-height:calc(var(--spacing) * 16)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-lg{max-width:var(--container-lg)}.min-w-0{min-width:0}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.resize{resize:both}.scroll-my-1{scroll-margin-block:var(--spacing)}.scroll-py-1{scroll-padding-block:var(--spacing)}.auto-rows-min{grid-auto-rows:min-content}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[2px\]{border-radius:2px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-xs{border-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-input{border-color:var(--color-input)}.bg-background{background-color:var(--color-background)}.bg-black\/5{background-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.bg-black\/5{background-color:color-mix(in oklab,var(--color-black) 5%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-border{background-color:var(--color-border)}.bg-card{background-color:var(--color-card)}.bg-destructive{background-color:var(--color-destructive)}.bg-foreground{background-color:var(--color-foreground)}.bg-muted\/50{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.bg-popover{background-color:var(--color-popover)}.bg-primary{background-color:var(--color-primary)}.bg-secondary{background-color:var(--color-secondary)}.bg-transparent{background-color:#0000}.fill-current{fill:currentColor}.fill-foreground{fill:var(--color-foreground)}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.align-middle{vertical-align:middle}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-background{color:var(--color-background)}.text-card-foreground{color:var(--color-card-foreground)}.text-destructive{color:var(--color-destructive)}.text-foreground{color:var(--color-foreground)}.text-muted-foreground{color:var(--color-muted-foreground)}.text-popover-foreground{color:var(--color-popover-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-secondary-foreground{color:var(--color-secondary-foreground)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--color-background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background-color\,border-color\,color\]{transition-property:background-color,border-color,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.running{animation-play-state:running}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.selection\:bg-primary ::selection{background-color:var(--color-primary)}.selection\:bg-primary::selection{background-color:var(--color-primary)}.selection\:text-primary-foreground ::selection{color:var(--color-primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--color-primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--color-foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--color-muted-foreground)}@media(hover:hover){.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-destructive\/90:hover{background-color:#f26d6de6}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--color-destructive) 90%,transparent)}}.hover\:bg-muted\/50:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.hover\:bg-primary\/90:hover{background-color:#f5a623e6}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--color-primary) 90%,transparent)}}.hover\:bg-secondary\/80:hover{background-color:#ffffff06}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--color-secondary) 80%,transparent)}}.hover\:text-accent-foreground:hover{color:var(--color-accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:bg-accent:focus{background-color:var(--color-accent)}.focus\:text-accent-foreground:focus{color:var(--color-accent-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--color-ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:border-ring:focus-visible{border-color:var(--color-ring)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:#f26d6d33}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 20%, transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:#f5a62380}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-ring) 50%, transparent)}}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-\[\>svg\]\:px-1\.5:has(>svg){padding-inline:calc(var(--spacing) * 1.5)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--color-destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:#f26d6d33}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 20%, transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[error\=true\]\:text-destructive[data-error=true]{color:var(--color-destructive)}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing) * 8)}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--color-muted-foreground)}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:var(--color-accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--color-accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing) * 9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing) * 8)}:is(.\*\*\:data-\[slot\=command-input-wrapper\]\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing) * 12)}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing) * 2)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--color-accent)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--color-accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--color-muted-foreground)}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--color-muted)}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--color-destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:#f26d6d1a}@supports (color:color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--color-destructive) 10%,transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--color-destructive)}@media(min-width:40rem){.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(prefers-color-scheme:dark){.dark\:border-input{border-color:var(--color-input)}.dark\:bg-destructive\/60{background-color:#f26d6d99}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60{background-color:color-mix(in oklab,var(--color-destructive) 60%,transparent)}}.dark\:bg-input\/30{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30{background-color:color-mix(in oklab,var(--color-input) 30%,transparent)}}.dark\:bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-white\/10{background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}@media(hover:hover){.dark\:hover\:bg-accent\/50:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:hover{background-color:color-mix(in oklab,var(--color-accent) 50%,transparent)}}.dark\:hover\:bg-input\/50:hover{background-color:#ffffff0e}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:hover{background-color:color-mix(in oklab,var(--color-input) 50%,transparent)}}}.dark\:focus-visible\:ring-destructive\/40:focus-visible{--tw-ring-color:#f26d6d66}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40[aria-invalid=true]{--tw-ring-color:#f26d6d66}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 40%, transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20[data-variant=destructive]:focus{background-color:#f26d6d33}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--color-destructive) 20%,transparent)}}}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--color-muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing) * 12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing) * 3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing) * 5)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--color-muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing) * 6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing) * 6)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:text-destructive\![data-variant=destructive]>*):is(svg){color:var(--color-destructive)!important}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}:root{color-scheme:dark;--bg: #0a0b0d;--bg-side: #0c0e10;--bg-raise: #15171b;--surface: rgba(255,255,255,.03);--hover: rgba(255,255,255,.06);--border: rgba(255,255,255,.07);--border-2: rgba(255,255,255,.11);--code-bg: #0d0f12;--text: #eef0f3;--text-dim: #9aa0a9;--text-faint: #868b93;--text-ghost: #666b74;--accent: #f5a623;--accent-bright: #ffcf85;--accent-dim: #d3861a;--accent-press: #e0951a;--glow: rgba(245,166,35,.13);--add: #4cc38a;--del: #f26d6d;--mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;--ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;--r-ctl: 7px;--r-card: 10px;--r-over: 14px;--page-read: 768px;--page-app: 768px;--page-wide: 1200px;--hero-top: clamp(32px, 8vh, 88px)}@font-face{font-family:"Jersey 10";font-style:normal;font-weight:400;font-display:swap;src:url(/assets/jersey-10-COnnvJff.woff2) format("woff2")}@font-face{font-family:Logo Fallback;src:local("Helvetica Neue"),local("Arial"),local("Segoe UI"),local("Roboto");size-adjust:73%}*{box-sizing:border-box}[hidden]{display:none!important}html,body{height:100%;margin:0}#root{display:contents}body{display:flex;background:var(--bg);color:var(--text);font:13px/1.5 var(--ui);letter-spacing:-.006em;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}::selection{background:var(--glow);color:var(--accent-bright)}:focus-visible{outline:2px solid var(--accent);outline-offset:1px;border-radius:5px}:focus-visible{outline-color:var(--accent)}.admin input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}input[type=checkbox]{accent-color:var(--accent);width:20px;height:20px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.sprite{position:absolute}.ico{width:16px;height:16px;flex:none;stroke:currentColor;stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round}button,input,a.btn{font-family:inherit}#sidebar{width:264px;min-width:210px;background:var(--bg-side);border-right:1px solid var(--border);display:flex;flex-direction:column;overflow:hidden}#vault{display:flex;align-items:center;gap:9px;height:52px;padding:0 12px 0 14px;border-bottom:1px solid var(--border);position:relative;z-index:45}#vault-badge{flex:none;display:grid;place-items:center;color:var(--accent)}#vault-name{font-family:"Jersey 10","Logo Fallback",var(--ui);font-size:18px;font-weight:400;font-synthesis:none;letter-spacing:.01em;line-height:1;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vault-actions{display:flex;align-items:center;gap:4px}#vault #signout,.icon-btn2{width:28px;height:28px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;color:var(--text-ghost);background:transparent;border:none;cursor:pointer;text-decoration:none}#vault #signout:hover,.icon-btn2:hover{color:var(--text);background:var(--hover)}#vault #signout .ico,.icon-btn2 .ico{width:16px;height:16px}#projects{flex:none;max-height:32%;overflow-y:auto;padding:10px 8px 8px;border-bottom:1px solid var(--border)}.nav-head{display:flex;align-items:center;justify-content:space-between;padding:6px 8px;font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint)}.nav-add{display:grid;place-items:center;width:18px;height:18px;border:none;background:transparent;color:var(--text-ghost);cursor:pointer;border-radius:5px}.nav-add .ico{width:14px;height:14px}.nav-add:hover{color:var(--text);background:var(--hover)}#projects ul{list-style:none;margin:0;padding:0}#projects .row{display:flex;align-items:center;gap:9px;height:31px;padding:0 8px;border-radius:7px;color:var(--text-dim);cursor:pointer;position:relative;white-space:nowrap;overflow:hidden}.proj-mark{width:17px;height:17px;border-radius:5px;flex:none;display:grid;place-items:center;font-size:10px;font-weight:700;color:#0a0b0d;letter-spacing:-.02em;text-transform:uppercase}.proj-mark svg{width:11px;height:11px}.proj-menu [data-slot=select-item]{display:flex;align-items:center;gap:8px}#projects .row .label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}#projects .row:hover{background:var(--hover);color:var(--text)}#projects .row.active{background:var(--glow);color:var(--accent-bright)}#projects .row.active:before{content:"";position:absolute;left:0;top:6px;bottom:6px;width:2px;border-radius:2px;background:var(--accent)}#tree{flex:1;overflow-y:auto;padding:8px 8px 24px}.tguide{position:absolute;top:0;bottom:0;width:1px;background:var(--border);pointer-events:none}#tree .row{display:flex;align-items:center;gap:6px;height:28px;padding:0 8px;border-radius:7px;color:var(--text-dim);cursor:pointer;position:relative;white-space:nowrap;overflow:hidden}#tree .row:hover{background:var(--hover);color:var(--text)}#tree .row.active{background:var(--glow);color:var(--accent-bright)}#tree .row.active:before{content:"";position:absolute;left:0;top:5px;bottom:5px;width:2px;border-radius:2px;background:var(--accent)}#tree .chev{width:14px;height:14px;flex:none;color:var(--text-ghost);transition:transform .12s;display:flex;align-items:center;justify-content:center}#tree .chev .ico{width:13px;height:13px}#tree .ticon{flex:none;display:flex;color:var(--text-ghost)}#tree .ticon .ico{width:15px;height:15px}#tree .row:hover .ticon,#tree .row:hover .chev{color:var(--text-faint)}#tree .row.active .ticon,#tree .row.active .chev{color:var(--accent)}#tree .label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}#tree .file .label{font-size:12.5px}#tree .file .chev{visibility:hidden}#tree .row.collapsed .chev{transform:rotate(-90deg)}.field-err{color:var(--del);font-size:12px;margin:6px 2px 0}.modal,#palette{translate:none}.admin-card-table{padding:0}.admin-table{width:100%;border-collapse:collapse;table-layout:fixed}.admin-table td .ai-main,.admin-table td a.ai-main,.admin-table td .ai-copy,.admin-table td .ai-tag{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-table th:last-child,.admin-table td:last-child{width:186px;text-align:right}.admin-table tr:last-child td{border-bottom:none}.admin-table th{text-align:left;font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--text-faint);padding:0;border-bottom:1px solid var(--border);-webkit-user-select:none;user-select:none}.admin-table td{padding:0;border-bottom:1px solid var(--border);overflow:hidden;text-overflow:ellipsis}.admin-table tr.admin-item{display:table-row}.admin-table tr.admin-item td{padding:8px 10px}.admin-card-table{overflow-x:auto}.shares-table .admin-table th:last-child,.shares-table .admin-table td:last-child{width:110px}.shares-table .admin-table td .ai-tag{white-space:normal;overflow:visible;text-overflow:clip}.share-banner{margin:0 0 18px;padding:12px 14px;border:1px solid var(--border);border-left:3px solid var(--accent);border-radius:var(--r-ctl);background:var(--surface)}.share-banner .sb-head{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text)}.share-banner .sb-head .ico,.share-banner .sb-head svg{width:15px;height:15px;flex:none;color:var(--accent)}.share-banner .sb-count{color:var(--text-faint);font-size:12px}.share-banner .sb-note{margin:6px 0 10px;font-size:12.5px;line-height:1.55;color:var(--text-faint);max-width:64ch}.share-banner .sb-link{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-top:8px;border-top:1px solid var(--border)}.share-banner .sb-link+.sb-link{margin-top:8px}.share-banner .sb-url{flex:1 1 260px;min-width:0;font-size:12px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.share-banner .sb-meta{font-size:11.5px;color:var(--text-faint)}.share-banner .sb-actions{display:flex;align-items:center;gap:6px;margin-left:auto}.nav-menu{list-style:none;margin:6px 0 0;padding:0}.nav-menu .row .ico{width:15px;height:15px;flex:none;color:var(--text-ghost)}.nav-menu .row.active .ico{color:var(--accent-bright)}.proj-row{display:flex;align-items:center;gap:4px;padding:0 10px 4px 12px}#project-select{flex:1;min-width:0;height:30px;padding:0 9px;display:inline-flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface);color:var(--text);font:inherit;font-size:12.5px;font-weight:500;cursor:pointer;white-space:nowrap;outline:none}#project-select>span:last-of-type{overflow:hidden;text-overflow:ellipsis}#project-select:hover{background:var(--hover);border-color:var(--border-2)}#project-select svg{color:var(--text-ghost)}.proj-menu{z-index:80;min-width:var(--radix-select-trigger-width, 200px);border:1px solid var(--border-2);border-radius:9px;padding:4px;background:var(--bg-raise);box-shadow:0 10px 32px #00000059}.proj-menu [role=option]{font-size:12.5px;color:var(--text-dim);border-radius:6px;outline:none}.proj-menu [role=option][data-highlighted]{background:var(--hover);color:var(--text)}#accountbar{position:relative;border-top:1px solid var(--border);padding:7px 10px}.gh-star{display:flex;align-items:center;gap:8px;padding:4px 8px;margin-bottom:2px;border-radius:7px;color:var(--text-faint);font-size:11px;text-decoration:none}.gh-star:hover{background:var(--hover);color:var(--text)}.gh-star .gh-mark{width:12px;height:12px;flex:none}.gh-star .ext{margin-left:auto;font-size:9px}#account-btn{width:100%;display:flex;align-items:center;gap:9px;text-align:left;padding:6px 8px;border:none;border-radius:7px;background:transparent;color:var(--text-dim);cursor:pointer;font:inherit}#account-btn:hover{background:var(--hover);color:var(--text)}#account-btn .avatar{width:26px;height:26px;flex:none;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-size:12px;font-weight:700}#account-btn .acct{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}#account-btn .acct b{font-size:12.5px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#account-btn .acct small{font-size:11px;color:var(--text-faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#account-btn>.ico{width:14px;height:14px;color:var(--text-ghost)}#account-menu{min-width:var(--radix-dropdown-menu-trigger-width, 220px);padding:5px;border:1px solid var(--border-2);border-radius:9px;background:var(--bg-raise);box-shadow:0 10px 32px #00000059;display:flex;flex-direction:column;z-index:80;outline:none}#account-menu [role=menuitem]{outline:none}#account-menu [role=menuitem][data-highlighted]{background:var(--hover);color:var(--text)}#account-menu .menu-sec{padding:7px 9px 3px;font-size:10.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text-faint)}#account-menu [role=menuitem]{display:flex;align-items:center;gap:8px;padding:7px 9px;border:none;border-radius:6px;background:transparent;text-align:left;color:var(--text-dim);font:inherit;font-size:12.5px;cursor:pointer;text-decoration:none}#account-menu [role=menuitem]:hover{background:var(--hover);color:var(--text)}#account-menu [role=menuitem] b{font-weight:600}#account-menu [role=menuitem] .ico{width:15px;height:15px}#account-menu .plan-chip{margin-left:auto;color:var(--accent);border-color:var(--border-2)}#account-menu #signout{color:var(--del)}#account-menu #signout:hover{color:var(--del);background:var(--hover)}#billing-view .plan-chip{color:var(--accent)}.plan-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}@media(max-width:700px){.plan-grid{grid-template-columns:1fr}}.usage-bar{background:var(--surface);border:1px solid var(--border);border-radius:4px;height:6px;overflow:hidden}.usage-bar>div{background:var(--accent);height:100%}.plan-price{font-size:20px;font-weight:700;margin:0 0 10px}.plan-price small{font-size:12px;color:var(--text-dim);font-weight:500}.muted-note{color:var(--text-dim);font-size:13px}#main{flex:1;display:flex;flex-direction:column;min-width:0}#topbar{position:relative;display:flex;align-items:center;gap:9px;height:52px;padding:0 16px;border-bottom:1px solid var(--border)}.icon-btn{display:none;width:34px;height:34px;border:none;background:transparent;color:var(--text-dim);cursor:pointer;border-radius:7px;align-items:center;justify-content:center}.icon-btn:hover{color:var(--text);background:var(--hover)}#crumb{font-size:12.5px;color:var(--text);font-weight:500;letter-spacing:-.01em;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#crumb .crumb-seg{color:var(--text-dim);cursor:pointer}#crumb .crumb-seg:hover{color:var(--accent-bright)}#crumb .crumb-sep{color:var(--text-ghost);margin:0 5px}#meta{flex:1;min-width:0;font-size:12px;color:var(--text-faint);text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.btn{display:inline-flex;align-items:center;gap:6px;flex:none;height:30px;padding:0 11px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text-dim);font-size:12.5px;font-weight:500;cursor:pointer;text-decoration:none}.btn:hover{background:var(--hover);color:var(--text);border-color:var(--border-2)}.btn .ico{width:15px;height:15px}.btn.ghost{color:var(--text-dim)}.tipcard{display:flex;align-items:center;gap:7px;white-space:nowrap;padding:6px 9px;border-radius:8px;border:1px solid var(--border-2);background:var(--surface-solid, var(--bg-raise));color:var(--text);font-size:12.5px;font-weight:500;box-shadow:0 8px 24px #00000059;z-index:80}.tipcard kbd{font:11px var(--ui);color:var(--text-faint);background:var(--hover);border:1px solid var(--border-2);border-radius:5px;padding:1px 5px}#more-menu{position:absolute;right:12px;top:calc(100% - 4px);z-index:80;background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-card);box-shadow:0 18px 44px -14px #000000bf;padding:6px;min-width:168px}.more-item{display:block;width:100%;text-align:left;min-height:40px;padding:0 12px;background:transparent;border:none;cursor:pointer;color:var(--text);font:inherit;font-size:13.5px;border-radius:var(--r-ctl)}.more-item:hover{background:var(--hover)}#content{flex:1;overflow-y:auto;padding:44px 40px 110px;scroll-behavior:smooth;scrollbar-gutter:stable}@media(pointer:fine){#content::-webkit-scrollbar{width:10px}#content::-webkit-scrollbar-thumb{background:var(--border-2);border-radius:5px}#content::-webkit-scrollbar-track{background:transparent}@supports not selector(::-webkit-scrollbar){#content{scrollbar-width:thin;scrollbar-color:var(--border-2) transparent}}}.page{width:100%;max-width:var(--page-app);margin-inline:auto;min-width:0}.page.read{max-width:var(--page-read)}.page.wide{max-width:var(--page-wide)}.empty{color:var(--text-faint);text-align:center;margin-top:var(--hero-top)}.empty-hint{display:block;margin-top:6px;font-size:12px;color:var(--text-faint)}.onboard{max-width:560px;margin:var(--hero-top) auto 0}.onboard h1{font-size:25px;font-weight:640;letter-spacing:-.02em;margin:0 0 8px;color:#f4f6f9}.onboard>p{color:var(--text-dim);margin:0 0 28px;font-size:14px}.ob-card{background:var(--bg-side);border:1px solid var(--border);border-radius:var(--r-card);padding:20px 22px;margin-bottom:14px}.ob-card h3{margin:0 0 6px;font-size:14.5px;font-weight:600}.ob-card p{margin:0 0 14px;font-size:13px;color:var(--text-dim)}.ob-card.ob-start{border-color:var(--border-2);box-shadow:inset 2px 0 0 var(--accent)}.ob-card.ob-start .pbtn{margin-top:2px}.ob-alt{margin:12px 0 0}.ob-alt a{color:var(--text-faint);font-size:12.5px;font-weight:600;text-decoration:none}.ob-alt a:hover{color:var(--text)}.pbtn{display:inline-flex;align-items:center;gap:6px;flex:none;height:32px;padding:0 14px;border-radius:var(--r-ctl);border:none;background:var(--accent);color:#241704;font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap;text-decoration:none}.pbtn:hover{background:var(--accent-bright)}.pbtn .ico{width:15px;height:15px}.danger-btn{display:inline-flex;align-items:center;height:32px;padding:0 14px;border-radius:var(--r-ctl);border:none;background:#b3382e;color:#fff;font-size:13px;font-weight:600;cursor:pointer}.danger-btn:hover{background:#c94336}[data-slot=input],[data-slot=textarea]{font:inherit;color:var(--text)}[data-slot=input][aria-invalid=true]:focus-visible,[data-slot=textarea][aria-invalid=true]:focus-visible{border-color:var(--del)}[data-slot=card],[data-slot=dropdown-menu-content]{border-color:var(--border)}.project-settings{display:flex;flex-direction:column;gap:14px}.project-settings>h2{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.ps-form{display:flex;flex-direction:column;gap:18px}.ps-field{display:flex;flex-direction:column;gap:7px}.ps-field label{font-size:12.5px;color:var(--text-dim)}.ps-opt{color:var(--text-ghost);font-weight:400}.ps-icon-row{display:flex;align-items:center;gap:10px}.ps-icon-row .proj-mark{width:26px;height:26px;border-radius:7px}.ps-icon-row .proj-mark svg{width:15px;height:15px}.ps-meta{display:flex;align-items:baseline;justify-content:space-between;gap:12px}.ps-meta .field-err{flex:0 1 auto;margin:0}.ps-count{font-size:11.5px;color:var(--text-faint);font-variant-numeric:tabular-nums}.ps-actions{display:flex;justify-content:flex-end}.ps-icon-grid{display:grid;grid-template-columns:repeat(6,30px);gap:4px;padding:8px}.ps-icon-cell{display:grid;place-items:center;width:30px;height:30px;border-radius:7px;border:1px solid transparent;background:none;color:var(--text-dim);cursor:pointer}.ps-icon-cell svg{width:16px;height:16px}.ps-icon-cell:hover{background:var(--hover);color:var(--text)}.ps-icon-cell.active{border-color:var(--accent);color:var(--accent-bright)}.ps-danger [data-slot=card-title]{font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:#d2695e;font-weight:600}.ps-chip{margin-left:10px;padding:2px 8px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--text-faint);font-size:11px;font-weight:600;letter-spacing:.02em;vertical-align:middle}.ps-people h4{font-size:12.5px;font-weight:600;color:var(--text-dim);margin:0}.ps-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px;color:var(--text-dim);margin:0 0 10px}.ps-people select{height:28px;padding:0 8px;border-radius:6px;border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:12.5px}.ps-people select:disabled{opacity:.6;cursor:default}.ps-note{color:var(--text-faint);font-size:12.5px;margin:0 0 12px;max-width:56ch;line-height:1.55}.ps-people-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:20px 0 8px}.ps-danger p{color:var(--text-dim);font-size:13px;margin:0 0 14px;max-width:52ch;line-height:1.55}.ps-facts{display:grid;grid-template-columns:auto 1fr;gap:8px 20px;margin:0;font-size:13px}.ps-facts dt{color:var(--text-faint)}.ps-facts dd{margin:0;color:var(--text-dim)}.admin h1{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 6px;color:#f4f6f9}.admin h3{font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint);font-weight:600;margin:30px 0 10px}.admin-lbl{flex:1 1 100%;margin:0 0 6px;font-size:12.5px;font-weight:600;color:var(--text-dim)}.admin-sub{color:var(--text-dim);font-size:13.5px;margin:-2px 0 16px;line-height:1.55}.admin-h{display:flex;align-items:center;justify-content:space-between;margin:30px 0 10px}.admin-h h3{margin:0}.admin-row{display:flex;gap:9px;margin-bottom:8px}.admin-row input{flex:1;height:34px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:13px;outline:none}.admin-row input:focus{border-color:var(--accent);background:var(--hover)}.admin-list{border:1px solid var(--border);border-radius:var(--r-card);overflow:hidden;background:var(--bg-side)}.admin-list.admin-card-table{overflow-x:auto;overflow-y:hidden}.admin-item{display:flex;align-items:center;gap:11px;padding:11px 14px;border-bottom:1px solid var(--border);font-size:13.5px}.modal-actions .ai-btn{height:32px}.empty a{color:var(--accent);text-decoration:none;display:inline-block;padding:6px 10px}.empty a:hover{text-decoration:underline}.empty h3{margin:0 0 8px;font-size:16px;color:var(--text)}.ai-copy{text-align:left;background:none;border:0;padding:6px 0;cursor:pointer}.ai-copy:hover{color:var(--text)}a.ai-main{color:var(--text-dim);text-decoration:none;padding:6px 0}a.ai-main:hover{color:var(--accent)}.th-sort{display:block;width:100%;text-align:left;background:none;border:0;padding:6px 10px;font:inherit;color:inherit;letter-spacing:inherit;text-transform:inherit;cursor:pointer}.th-sort:hover{color:var(--text-dim)}.proj-trigger>[data-slot=select-value]{display:block;flex:1 1 auto;min-width:0;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.role-cell{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;justify-items:start}.admin-table td .role-static{text-align:left}.role-chip-row{margin:-6px 0 12px}.role-chip{margin-left:0;padding:2px 8px;border:1px solid var(--border-2);border-radius:99px;vertical-align:middle}.ext{margin-left:4px;color:var(--text-faint);font-size:11px}.admin-item:last-child{border-bottom:none}.admin-item:hover{background:var(--hover)}.field-err{flex:1 1 100%;margin:6px 0 0}.admin-row{flex-wrap:wrap}.admin-row input[aria-invalid=true]{border-color:var(--del)}.ai-main{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}.admin-item>.ai-main{flex:1 1 55%;min-width:22ch}.admin-item>.ai-tag{flex:0 0 auto;min-width:0;max-width:45%}@media(max-width:1000px){.admin-item{flex-wrap:wrap}.admin-item>.ai-tag{flex:1 1 100%;max-width:100%}}.admin-table td .ai-main{min-width:0}.ai-main.mono{font:12px var(--mono);color:var(--text-dim);cursor:pointer}.ai-tag{font-size:11.5px;color:var(--text-faint);flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-item select{height:28px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:0 8px;font:inherit;font-size:12.5px;cursor:pointer}.admin-item select:hover{border-color:var(--border-2)}.ai-btn,.ai-del{flex:none;height:27px;padding:0 11px;border-radius:6px;border:1px solid var(--border);background:var(--surface);color:var(--text-dim);font:inherit;font-size:12px;font-weight:500;cursor:pointer}.ai-del{color:var(--del);border-color:#f26d6d47}.ai-del:hover{background:#f26d6d1f;border-color:var(--del);color:#ff8b8b}.ai-btn:hover{background:var(--hover);color:var(--text);border-color:var(--border-2)}.admin-empty{padding:14px;color:var(--text-faint);font-size:13px}.admin-item.toggle{cursor:pointer;align-items:flex-start}.admin-item.toggle .ai-main{white-space:normal}.tg-label{font-size:13.5px;font-weight:550;color:var(--text)}.tg-desc{font-size:12px;color:var(--text-faint);margin-top:3px;line-height:1.5}.admin-item.toggle input{margin-top:2px;flex:none}.dl-title{display:flex;align-items:center;gap:10px;font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.dl-title-icon{display:flex;color:var(--accent)}.dl-title-icon .ico{width:20px;height:20px}.dl-sub{color:var(--text-faint);font-size:12.5px;margin:0 0 18px}.dl-items{border:1px solid var(--border);border-radius:var(--r-card);overflow:hidden;background:var(--bg-side)}.dl-row{display:flex;align-items:center;gap:11px;padding:10px 14px;border-bottom:1px solid var(--border);cursor:pointer}.dl-row:last-child{border-bottom:none}.dl-row:hover{background:var(--hover)}.dl-row .ticon{flex:none;display:flex;color:var(--text-ghost)}.dl-row .ticon .ico{width:16px;height:16px}.dl-row:hover .ticon{color:var(--text-faint)}.dl-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13.5px;color:var(--text)}.dl-name,#crumb,.hpath,.hnote,.hrun-note,.hdev,.ai-main{unicode-bidi:isolate-override;direction:ltr}.dl-meta{flex:none;font-size:12px;color:var(--text-faint);font-variant-numeric:tabular-nums}.heatdot{flex:none;width:7px;height:7px;border-radius:50%;background:var(--accent)}.heatdot.lvl1{opacity:.3}.heatdot.lvl2{opacity:.55}.heatdot.lvl3{opacity:.8}.heatdot.lvl4{opacity:1;box-shadow:0 0 6px #f5a6238c}.dl-empty{padding:24px 14px;color:var(--text-faint);font-size:13px;border:1px dashed var(--border);border-radius:var(--r-card);text-align:center}.dl-h3{margin:28px 0 8px;font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint);font-weight:600}.dl-hlist{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);overflow:hidden;max-width:none}.dl-hlist .hentry:last-child{border-bottom:none}.hentry.clickable{cursor:pointer}.hentry.clickable:hover{background:var(--hover)}.dl-more{margin-top:10px}#vault-name.vault-link{cursor:pointer}#vault-name.vault-link:hover{color:var(--accent-bright)}#account-btn.active{background:var(--glow)}#account-btn.active .acct b{color:var(--accent-bright)}.gd-body{margin-top:18px}.gd-desc{margin:2px 0 8px;color:var(--text-faint);font-size:13px;line-height:1.5}.gd-list{margin:4px 0 8px;padding-left:18px;display:grid;gap:6px}.gd-code{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px;margin:6px 0 10px;padding:10px 12px;background:var(--bg-raise);border:1px solid var(--border);border-radius:var(--r-card);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.6;color:var(--text)}.gd-code>code{display:block;min-width:0;overflow-x:auto;white-space:pre}.gd-copy{align-self:start;font:inherit;font-family:inherit;font-size:11px;font-weight:600;padding:3px 9px;border-radius:6px;border:1px solid var(--border-2);background:var(--bg-raise);color:var(--text-faint);cursor:pointer}.gd-copy:hover{color:var(--accent-bright);border-color:var(--accent-dim)}.gd-manual{margin:10px 0 0}.gd-manual>summary{display:inline-block;font-size:12.5px;font-weight:600;color:var(--text-faint);cursor:pointer;padding:4px 0}.gd-manual>summary:before{content:"▸ ";color:var(--text-ghost)}.gd-manual[open]>summary:before{content:"▾ "}.gd-manual>summary:hover{color:var(--text)}.home-insights{margin-top:30px;padding-top:22px;border-top:1px solid var(--border)}.in-title{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.in-title .in-scope{color:var(--text-ghost);font-weight:500;font-size:15px}.gd-head{display:flex;align-items:center;gap:9px}.gd-head .proj-mark{width:22px;height:22px;border-radius:6px}.gd-head .proj-mark svg{width:13px;height:13px}.in-desc{color:var(--text-dim);font-size:13.5px;line-height:1.55;margin:0 0 10px;max-width:62ch}.in-blank{display:grid;justify-items:center;gap:10px;padding:40px 18px;margin-top:14px;max-width:760px}.in-blank p{margin:0;max-width:52ch;line-height:1.55}.in-blank p:first-child{color:var(--text);font-size:14.5px;font-weight:600}.in-blank .pbtn{margin-top:6px}.in-lens{display:flex;gap:6px;margin:0 0 14px}.in-lens-btn{font:inherit;font-size:12px;padding:5px 12px;border-radius:999px;border:1px solid var(--border);background:none;color:var(--text-faint);cursor:pointer}.in-lens-btn:hover{color:var(--text)}.in-lens-btn.active{color:var(--accent);border-color:var(--accent)}.in-chart{width:100%;max-width:760px;height:auto;border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);margin-bottom:6px}.in-axis{stroke:var(--border);stroke-width:1}.in-threshold{stroke:var(--border);stroke-width:1;stroke-dasharray:4 4}.in-danger-zone{fill:#f26d6d0d}.in-label{fill:var(--text-ghost);font-size:11px}.in-quad{fill:var(--text-ghost);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em}.in-quad-danger{fill:#e07070}.in-pt{fill:var(--accent);opacity:.5;cursor:pointer}.in-pt:hover{opacity:1}.in-pt.cold{fill:var(--text-ghost);opacity:.25}.in-pt.danger{fill:#e05d5d;opacity:.6}.in-pt-label{fill:var(--text-faint);font-size:11px;pointer-events:none}.in-h3-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;max-width:760px}.in-cap{font-size:11.5px;color:var(--text-faint);font-weight:400;text-transform:none;letter-spacing:0}.in-treemap{background:#0c0d10}.in-tm-group{fill:none;stroke:var(--border);stroke-width:1;cursor:pointer;pointer-events:all}.in-tm-glabel{fill:var(--text-faint);font-size:10px;text-transform:uppercase;letter-spacing:.05em;cursor:pointer}.in-tm-cell{cursor:pointer}.in-tm-cell:hover{stroke:#fff;stroke-width:1}.in-tm-label{fill:#0c0d10;font-size:10.5px;font-weight:620;cursor:pointer;pointer-events:none}.in-hotpath{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);overflow:hidden}.in-hp-row{display:flex;align-items:center;gap:10px;padding:6px 12px;border-bottom:1px solid var(--border);cursor:pointer}.in-hp-row:last-child{border-bottom:none}.in-hp-row:hover{background:var(--hover)}.in-hp-name{flex:0 0 300px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;color:var(--text)}.in-hp-name.danger{color:var(--accent)}.in-hp-bar{flex:1;display:flex;height:10px;border-radius:3px;overflow:hidden}.in-hp-agent{background:var(--accent)}.in-hp-human{background:#5b8def}.in-hp-share{background:#b478e8}.in-hp-gone{flex:none;font-size:11.5px;color:var(--text-ghost);white-space:nowrap}.in-hp-count{flex:none;width:40px;text-align:right;font-size:11.5px;color:var(--text-faint);font-variant-numeric:tabular-nums}.in-legend{margin:8px 2px 0;font-size:11.5px;color:var(--text-faint)}.in-sw{display:inline-block;width:10px;height:10px;border-radius:2px;vertical-align:-1px}.in-sw.agent{background:var(--accent)}.in-sw.human{background:#5b8def}.in-sw.share{background:#b478e8}.in-sw-age{width:84px;margin:0 5px}.in-sw-flat{filter:grayscale(1);opacity:.45}.in-tm-range{margin-left:14px;color:var(--text-ghost)}.in-matrix rect{transition:opacity .1s}.in-matrix rect:hover{opacity:.85}.hfilters{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:0 0 12px;border-bottom:1px solid var(--border);margin-bottom:4px}.hf-search{position:relative;display:flex;align-items:center;flex:1 1 200px;min-width:160px}.hf-search .ico{position:absolute;left:9px;width:14px;height:14px;color:var(--text-ghost);pointer-events:none}.hf-search input{height:30px;padding-left:29px;font-size:12.5px;border-radius:var(--r-ctl);background:var(--surface)}.hf-search input::-webkit-search-cancel-button{filter:invert(.6)}.hf-user{height:30px;max-width:190px;padding:0 8px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:12.5px;cursor:pointer}.hf-dates{display:flex;align-items:center;gap:6px}.hf-lbl{font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--text-ghost)}.hf-date{width:140px;height:30px;font-size:12.5px;border-radius:var(--r-ctl);background:var(--surface)}.hf-date::-webkit-calendar-picker-indicator{filter:invert(.6);cursor:pointer}.hf-dash{color:var(--text-ghost)}.hf-clear{height:30px;padding:0 10px;border:none;border-radius:var(--r-ctl);background:none;color:var(--text-dim);font:inherit;font-size:12.5px;cursor:pointer}.hf-clear:hover{color:var(--text);background:var(--hover)}.hf-clear-empty{margin-top:12px}.hentry{padding:11px 12px;border-bottom:1px solid var(--border);--hindent: 72px}.hentry:hover{background:#ffffff04}.hline{display:flex;gap:10px;align-items:center}.hkind{flex:none;width:62px;white-space:nowrap;text-align:center;font-size:10px;text-transform:uppercase;letter-spacing:.06em;font-weight:600;padding:2px 6px;border-radius:4px;color:var(--add);background:#4cc38a1f}.hentry.edit .hkind{color:var(--accent-bright);background:var(--glow)}.hentry.delete .hkind{color:#ff8b8b;background:#f26d6d1f}.hpath{font-weight:500;cursor:pointer;color:var(--text);font-size:13px}.hpath:hover{color:var(--accent-bright)}.htime{margin-left:auto;color:var(--text-faint);font-size:12px;font-variant-numeric:tabular-nums}.hmore{display:flex;margin:14px auto}.hmore:disabled{opacity:.6;cursor:default}.hmeta{display:flex;align-items:center;gap:14px;margin-top:4px;padding-left:var(--hindent);font-size:12px;color:var(--text-dim)}.hdev,.hsize{color:var(--text-faint)}.hsize{font-variant-numeric:tabular-nums;white-space:nowrap;flex:none}.hnote{margin-top:4px;padding-left:var(--hindent);font-size:12px;color:var(--text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.hnote:hover{color:var(--text)}.hnote.open{white-space:normal;overflow-wrap:anywhere}.hnote:before{content:"›";display:inline-block;margin-right:5px;color:var(--text-ghost);transition:transform .12s}.hnote.open:before{transform:rotate(90deg)}.hnote a{color:var(--accent-bright);text-decoration:none}.hnote a:hover{text-decoration:underline}.hrun{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);margin:10px 0;overflow:hidden}.hrun-head{display:flex;align-items:center;gap:9px;width:100%;padding:9px 12px;color:var(--text);font-size:12.5px}.hrun-toggle{display:flex;flex:none;padding:2px;border:none;border-radius:4px;background:none;color:var(--text-faint);cursor:pointer}.hrun-toggle:hover{color:var(--text);background:var(--hover)}.hrun-toggle .ico{width:13px;height:13px}.hrun-note{font-weight:560;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:46%}.hrun-note a{color:var(--accent-bright);text-decoration:none}.hrun-note a:hover{text-decoration:underline}.hrun-meta{color:var(--text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hrun-time{margin-left:auto;flex:none;color:var(--text-faint);font-variant-numeric:tabular-nums}.hrun-body{border-top:1px solid var(--border)}.hrun-body .hentry:last-child{border-bottom:none}.hread{flex:none;padding:2px 6px;border-radius:4px;font-size:10px;text-transform:uppercase;letter-spacing:.06em;font-weight:600;color:var(--text-dim);background:var(--hover)}.hrun-reads{border-top:1px solid var(--border);padding:4px 0 6px}.hrun-reads-head{padding:6px 14px 4px;font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--text-faint)}.hrun-read{display:flex;gap:10px;align-items:center;width:100%;padding:5px 14px;border:none;background:none;font:inherit;text-align:left;cursor:pointer}.hrun-read:hover{background:#ffffff04}.hrun-read .hkind{color:var(--text-dim);background:var(--hover)}.hrun-foot{padding:8px 14px 10px;border-top:1px solid var(--border);font-size:11.5px;color:var(--text-faint)}.hrestore-btn,.hremove-btn{display:inline-flex;align-items:center;gap:4px;margin-left:auto;padding:2px 8px 2px 5px;border:1px solid var(--border);border-radius:5px;background:none;color:var(--text-faint);font:inherit;font-size:12px;cursor:pointer}.hrestore-btn:hover{color:var(--accent-bright);border-color:var(--border-2);background:var(--hover)}.hremove-btn:hover{color:var(--del);border-color:#f26d6d61;background:var(--hover)}.hrestore-btn:disabled,.hremove-btn:disabled{opacity:.5;cursor:default}.hrestore-btn .ico,.hremove-btn .ico{width:12px;height:12px}.hactions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:6px 0 0 23px}.hdiff-btn,.hver-btn{display:inline-flex;align-items:center;gap:4px;padding:2px 7px 2px 4px;border:1px solid var(--border);border-radius:5px;background:none;color:var(--text-faint);font:inherit;font-size:12px;cursor:pointer;text-decoration:none}.hdiff-btn:hover,.hver-btn:hover{color:var(--text);border-color:var(--border-2);background:var(--hover)}.hdiff-btn .ico,.hver-btn .ico{width:12px;height:12px}.hdiff-none{flex-basis:100%;font-size:12px;color:var(--text-ghost)}.dv{margin:8px 0 2px 23px;border:1px solid var(--border);border-radius:6px;overflow:hidden}.dv-msg{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:9px 11px;font-size:12px;color:var(--text-faint)}.dv-dl{display:flex;gap:12px}.dv-msg a{color:var(--accent-bright);text-decoration:none}.dv-msg a:hover{text-decoration:underline}.dv-head{display:flex;align-items:center;gap:10px;padding:5px 11px;border-bottom:1px solid var(--border);font-size:11px;font-variant-numeric:tabular-nums}.dv-add{color:var(--add);font-weight:600}.dv-del{color:var(--del);font-weight:600}.dv-same{color:var(--text-ghost)}.dv-body{overflow-x:auto;padding:4px 0}.dv-line{display:flex;font-family:var(--mono);font-size:12px;line-height:1.55;white-space:pre}.dv-n{flex:none;width:34px;padding-right:8px;text-align:right;color:var(--text-ghost);-webkit-user-select:none;user-select:none;font-variant-numeric:tabular-nums}.dv-mark{flex:none;width:16px;text-align:center;-webkit-user-select:none;user-select:none}.dv-text{padding-right:12px}.dv-ins{background:#4cc38a1a;color:var(--add)}.dv-rm{background:#f26d6d1a;color:#ff8b8b}.dv-ctx{color:var(--text-dim)}#palette{position:fixed;top:12vh;left:50%;transform:translate(-50%);z-index:151;display:block;width:min(560px,92vw);background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-over);box-shadow:0 24px 70px -18px #000c;overflow:hidden;outline:none;padding:0}#palette-inputwrap{display:flex;align-items:center;gap:11px;padding:14px 16px;border-bottom:1px solid var(--border)}#palette-inputwrap [data-slot=command-input-wrapper]{flex:1;display:flex;border-bottom:0;padding:0;height:auto}#palette-inputwrap [data-slot=command-input-wrapper]>svg:not(.ico){display:none}#palette input,#palette input:focus{flex:1;width:100%;border:none;background:transparent;box-shadow:none;color:var(--text);font:inherit;font-size:15px;letter-spacing:-.01em;outline:none;padding:0}#palette input::placeholder{color:var(--text-ghost)}#palette-inputwrap .ico{width:17px;height:17px;color:var(--text-faint)}#palette [cmdk-list]{list-style:none;margin:0;padding:8px;max-height:46vh;overflow-y:auto}#palette [cmdk-item]{display:flex;align-items:center;gap:11px;height:38px;padding:0 10px;border-radius:9px;cursor:pointer;color:var(--text-dim);font-size:13.5px}#palette [cmdk-item][data-selected=true]{background:var(--glow)}#palette [cmdk-item][data-selected=true] .picon{color:var(--accent)}#palette [cmdk-item][data-selected=true] .plabel,#palette [cmdk-item][data-selected=true] .plabel b{color:var(--accent-bright)}#palette [cmdk-item] .picon{width:18px;flex:none;display:flex;justify-content:center;color:var(--text-faint)}#palette [cmdk-item] .picon .ico{width:15px;height:15px}#palette [cmdk-item] .plabel{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text)}#palette [cmdk-item] .plabel b{color:var(--accent-bright);font-weight:600}#palette [cmdk-item] .pkind{flex:none;font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-ghost)}#palette [cmdk-list] .pempty{color:var(--text-faint);cursor:default;justify-content:center;height:auto;padding:14px}#palette-hint{padding:9px 16px;border-top:1px solid var(--border);font-size:11px;color:var(--text-ghost)}[data-slot=dialog-overlay]{position:fixed;inset:0;background:#06070999;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:150}.modal{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:151;display:block;background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-over);padding:22px 24px;width:min(460px,calc(100vw - 40px));box-shadow:0 24px 70px -18px #000c;outline:none}.modal h3{margin:0 0 10px;font-size:16px;font-weight:620;letter-spacing:-.01em}.modal p{margin:0 0 16px;font-size:13.5px;color:var(--text-dim);line-height:1.55}.modal p b{color:var(--text)}.modal-url{font:12px var(--mono);background:var(--surface);border:1px solid var(--border);border-radius:var(--r-ctl);padding:9px 11px;color:var(--text-dim);word-break:break-all;margin-bottom:16px}.modal-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.modal-expiry{display:flex;align-items:center;gap:8px;margin-bottom:16px;font-size:12.5px;color:var(--text-dim)}.modal-expiry select{height:28px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:0 8px;font:inherit;font-size:12.5px;cursor:pointer}.modal-expiry select:disabled{opacity:.6;cursor:default}.modal-expiry-note{margin-left:auto;color:var(--text-dim)}.modal-label{display:block;font-size:12.5px;color:var(--text-dim);margin:0 0 6px}.modal-msg{margin:0 0 16px;font-size:13.5px;color:var(--text-dim);line-height:1.55}.modal-input{width:100%;height:36px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:14px;margin-bottom:16px;outline:none}.modal-input:focus{border-color:var(--accent);background:var(--hover)}.start-points{border:0;margin:0 0 18px;padding:0}.start-points legend{padding:0}.start-point{display:flex;align-items:flex-start;gap:10px;padding:9px 11px;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface);cursor:pointer;margin-bottom:6px}.start-point:hover{background:var(--hover)}.start-point.on{border-color:var(--accent);background:var(--hover)}.start-point input{accent-color:var(--accent);margin:2px 0 0;flex:none}.sp-text{display:flex;flex-direction:column;gap:2px;min-width:0}.sp-title{font-size:13.5px;color:var(--text);display:flex;align-items:center;gap:8px}.sp-rec{font-size:10.5px;letter-spacing:.02em;text-transform:uppercase;color:var(--accent);border:1px solid var(--accent);border-radius:999px;padding:0 6px;line-height:15px}.sp-blurb{font-size:12px;color:var(--text-dim);overflow-wrap:anywhere}.start-point.sp-rule{margin-top:16px}.modal{max-height:calc(100vh - 32px);overflow-y:auto}.gd-note{margin:-4px 0 16px;font-size:13px;color:var(--text-dim);border-left:2px solid var(--accent);padding-left:11px;line-height:1.55}[data-sonner-toast]{background:var(--bg-raise)!important;color:var(--text)!important;border:1px solid var(--border-2)!important;border-radius:10px!important;font-size:13.5px!important;box-shadow:0 18px 44px -12px #000000b3!important}[data-sonner-toast][data-type=error]{border-color:#f26d6d80!important;color:#ffb0aa!important}#sb-backdrop{display:none}@media(max-width:900px){#sidebar{position:fixed;z-index:60;top:0;left:0;height:100%;transform:translate(-100%);transition:transform .2s ease;box-shadow:0 0 40px #0009}body.sb-open #sidebar{transform:translate(0)}body.sb-open #sb-backdrop{display:block;position:fixed;inset:0;background:#0000008c;z-index:50}.icon-btn,#search-btn{display:inline-flex;width:44px;height:44px}#content{padding:24px 18px 70px}#topbar{padding:0 8px;gap:4px}.btn .lbl{display:none}#topbar .btn{min-width:44px;min-height:44px;padding:0;justify-content:center;gap:0}#topbar .btn .ico{width:18px;height:18px}#more-btn:not([hidden]){display:inline-flex}#history-btn,#upload-btn,#download{display:none!important}#topbar{flex-wrap:wrap;height:auto;min-height:52px}#meta{order:1;flex:1 1 100%;text-align:left;white-space:normal;overflow:visible;padding:0 0 8px}#meta:empty{display:none}#crumb{flex:1}#vault{padding:0 8px 0 12px}.icon-btn2,#signout,#tree .row,#projects .row{height:44px}#account-btn,#project-select{min-height:44px}.nav-add{min-width:44px;min-height:44px}.markdown table,pre.plain{display:block;overflow-x:auto;max-width:100%}.admin-item{flex-wrap:wrap;row-gap:8px;padding:12px 14px}.admin-item select,.hf-search input,.hf-user,.hf-date,.hf-clear{height:44px}.hf-dates{flex:1 1 100%}.hf-date{flex:1;width:auto;min-width:0}.hrun-head{flex-wrap:wrap;row-gap:4px}.hrun-note{max-width:none;white-space:normal;overflow:visible}.hrun-meta{order:1;flex:1 1 100%;white-space:normal;overflow:visible}.ai-btn,.ai-del{height:auto;min-height:44px;padding:0 12px}.admin-table thead{display:none}.admin-table,.admin-table tbody,.admin-table td{display:block;width:auto}.admin-table tr.admin-item{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.admin-table tr.admin-item td{padding:0;border-bottom:none}.admin-table tr.admin-item td:first-child{flex:1 1 100%;width:auto}.admin-table tr.admin-item td:last-child{width:auto;text-align:left}[data-slot=dropdown-menu-item]{min-height:44px}#projects{flex:0 1 auto;max-height:none}.admin-row{flex-wrap:wrap}.admin-row input{flex:1 1 100%;min-height:44px}.admin-row button{flex:0 0 auto;align-self:flex-start;min-height:44px}.admin-item .ai-main{flex:1 1 100%;white-space:normal;overflow-wrap:anywhere}.admin-table td{white-space:normal}.admin-table td .ai-main,.admin-table td a.ai-main,.admin-table td .ai-copy,.admin-table td .ai-tag{white-space:normal;overflow-wrap:anywhere}.admin-item .ai-tag{flex:1 1 100%;max-width:100%;white-space:normal;overflow-wrap:anywhere}.ai-copy{min-height:44px;display:block;padding:12px 0;white-space:normal;overflow-wrap:anywhere;text-overflow:clip}a.ai-main{min-height:44px;display:flex;align-items:center}.gd-code{min-height:62px;padding-top:12px;padding-bottom:12px}.gd-copy{min-height:44px;padding:0 14px}.gd-tab{min-height:44px}.in-lens-btn{min-height:44px;padding:0 14px}.modal-input{height:44px}.modal-actions button{height:auto;min-height:44px}.modal-expiry select{height:44px}.pbtn,#palette [cmdk-item]{height:auto;min-height:44px}.more-item{min-height:44px}}.modal-actions .ai-del{margin-right:auto}@media(max-width:430px){.dl-row{flex-wrap:wrap;row-gap:2px}.dl-meta{flex:1 1 100%;padding-left:27px}.ai-tag{font-size:11px}.htime{white-space:nowrap;font-size:12px}.hline{flex-wrap:wrap}.hentry{--hindent: 0px}.modal-actions .ai-del{flex:0 0 100%;justify-content:center;text-align:center}}.markdown h1,.markdown h2,.markdown h3,.markdown h4{color:#f4f6f9;line-height:1.25;letter-spacing:-.018em;margin:1.5em 0 .5em;text-wrap:balance}.markdown h1:first-child{margin-top:0}.markdown h1{font-size:1.85em;font-weight:660;letter-spacing:-.024em}.markdown h2{font-size:1.32em;font-weight:620;margin-top:1.7em}.markdown h3{font-size:1.08em;font-weight:620}.markdown p,.markdown li{color:#c6cbd3;font-size:14.5px;line-height:1.72}.markdown p{margin:0 0 1em}.markdown strong{color:var(--text);font-weight:620}.markdown a{color:var(--accent-bright);text-decoration:none;border-bottom:1px solid rgba(245,166,35,.28)}.markdown a:hover{border-bottom-color:var(--accent)}.markdown ul,.markdown ol{margin:0 0 1em;padding-left:1.4em}.markdown li{margin-bottom:.4em}.markdown li::marker{color:var(--text-ghost)}.markdown code{background:var(--hover);border:1px solid var(--border);padding:.1em .4em;border-radius:5px;font:12.5px/1.5 var(--mono);color:#e4d9c4}.markdown pre{background:var(--code-bg);border:1px solid var(--border);border-radius:var(--r-card);padding:14px 16px;overflow-x:auto;margin:1.3em 0}.markdown pre code{background:none;border:none;padding:0;color:#c6cbd3}.markdown blockquote{margin:1.3em 0;padding:.3em 1em;border-left:2px solid var(--accent);background:linear-gradient(90deg,var(--glow),transparent);border-radius:0 8px 8px 0;color:#d8cdb6}.markdown blockquote p{margin:.3em 0;color:#d8cdb6}.markdown table{border-collapse:collapse;margin:1.3em 0;font-size:13.5px}.markdown th,.markdown td{border-bottom:1px solid var(--border);padding:9px 13px;text-align:left}.markdown th{color:var(--text-faint);font-size:11px;text-transform:uppercase;letter-spacing:.05em;font-weight:600;border-bottom-color:var(--border-2)}.markdown tr:hover td{background:#ffffff05}.markdown img{max-width:100%;border-radius:8px;border:1px solid var(--border)}.markdown hr{border:none;border-top:1px solid var(--border);margin:2.2em 0}.markdown table.frontmatter{margin:0 0 1.8em;font-size:12px;background:var(--surface);border:1px solid var(--border);border-radius:8px;border-collapse:separate;border-spacing:0}.markdown table.frontmatter th{text-transform:none;letter-spacing:0;font-size:11.5px;color:var(--text-faint);font-weight:600;text-align:left;white-space:nowrap;vertical-align:top;padding:6px 14px 6px 12px;border-bottom:1px solid var(--border)}.markdown table.frontmatter td{color:var(--text-dim);padding:6px 12px 6px 0;border-bottom:1px solid var(--border)}.markdown table.frontmatter tr:last-child th,.markdown table.frontmatter tr:last-child td{border-bottom:none}.markdown table.frontmatter code{white-space:pre-wrap;font-size:11px}.markdown .admin input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.admin input[aria-invalid=true]:focus-visible{outline-color:var(--del)}[role=dialog] input[aria-invalid=true]{border-color:var(--del)}[role=dialog] input[aria-invalid=true]:focus-visible{outline-color:var(--del)}button:disabled,.btn:disabled{cursor:default}input[type=checkbox]{accent-color:var(--accent)}.htmlview,.pdfview{display:block;width:100%;height:calc(100vh - 150px);border:1px solid var(--border);border-radius:var(--r-card);background:#fff}.notfound{margin-top:var(--hero-top);text-align:center;color:var(--text-dim)}.notfound h1{color:var(--text);font-size:1.4em;margin-bottom:.5em}.notfound code{background:var(--hover);border:1px solid var(--border);padding:.15em .5em;border-radius:6px}.notfound .nf-sub{max-width:440px;margin:12px auto 20px;font-size:13px;color:var(--text-faint);line-height:1.6}.vbanner{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 22px;padding:11px 14px;border:1px solid var(--accent-dim);border-radius:var(--r-card);background:var(--glow)}.vbanner .vb-icon{flex:none;display:flex;color:var(--accent-bright)}.vbanner .vb-text{flex:1 1 220px;min-width:0;display:flex;flex-direction:column;gap:1px;font-size:12.5px;line-height:1.45}.vbanner .vb-text b{color:var(--accent-bright);font-weight:600}.vbanner .vb-text span{color:var(--text-dim)}.vbanner .vb-actions{flex:none;display:flex;gap:8px}.vbanner .vb-actions .ai-btn{display:inline-flex;align-items:center;text-decoration:none}pre.plain{background:var(--code-bg);border:1px solid var(--border);border-radius:var(--r-card);padding:14px 16px;overflow-x:auto;font:12.5px/1.6 var(--mono);color:#c6cbd3;white-space:pre-wrap;overflow-wrap:anywhere}.csvbox{overflow-x:auto;width:fit-content;max-width:100%;border:1px solid var(--border);border-radius:var(--r-card);background:var(--code-bg)}.csvbox .csvview{display:table;max-width:none;overflow:visible;margin:0;border-collapse:collapse;font:12.5px/1.5 var(--mono);font-variant-numeric:tabular-nums}.csvbox .csvview th,.csvbox .csvview td{border-bottom:1px solid var(--border);padding:8px 14px;text-align:left;white-space:pre;vertical-align:top;color:#c6cbd3;font-size:12.5px}.csvbox .csvview th{background:var(--surface);color:var(--text-faint);font-size:11px;text-transform:uppercase;letter-spacing:.05em;font-weight:600;border-bottom-color:var(--border-2)}.csvbox .csvview tr:last-child td{border-bottom:none}.csvbox .csvview tbody tr:hover td{background:#ffffff05}.csvnote{color:var(--text-faint);font-size:12px;margin:10px 2px 0}.filecard{margin-top:var(--hero-top);text-align:center;color:var(--text-dim)}.filecard .name{font-size:1.2em;color:var(--text);margin-bottom:.3em}.filecard .btn{margin-top:14px} +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--tracking-widest:.1em;--radius-xs:.125rem;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--color-background:#0a0b0d;--color-foreground:#eef0f3;--color-card:#15171b;--color-card-foreground:#eef0f3;--color-popover:#15171b;--color-popover-foreground:#eef0f3;--color-primary:#f5a623;--color-primary-foreground:#1a1204;--color-secondary:#ffffff08;--color-secondary-foreground:#eef0f3;--color-muted:#ffffff0f;--color-muted-foreground:#9aa0a9;--color-accent:#ffffff0f;--color-accent-foreground:#eef0f3;--color-destructive:#f26d6d;--color-border:#ffffff12;--color-input:#ffffff1c;--color-ring:#f5a623;--radius-ctl:7px}}@layer base,components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.top-4{top:calc(var(--spacing) * 4)}.top-20{top:calc(var(--spacing) * 20)}.top-\[50\%\]{top:50%}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.left-2{left:calc(var(--spacing) * 2)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.z-50{z-index:50}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.field-sizing-content{field-sizing:content}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.min-h-16{min-height:calc(var(--spacing) * 16)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-lg{max-width:var(--container-lg)}.min-w-0{min-width:0}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.resize{resize:both}.scroll-my-1{scroll-margin-block:var(--spacing)}.scroll-py-1{scroll-padding-block:var(--spacing)}.auto-rows-min{grid-auto-rows:min-content}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[2px\]{border-radius:2px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-xs{border-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-input{border-color:var(--color-input)}.bg-background{background-color:var(--color-background)}.bg-black\/5{background-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.bg-black\/5{background-color:color-mix(in oklab,var(--color-black) 5%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-border{background-color:var(--color-border)}.bg-card{background-color:var(--color-card)}.bg-destructive{background-color:var(--color-destructive)}.bg-foreground{background-color:var(--color-foreground)}.bg-muted\/50{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.bg-popover{background-color:var(--color-popover)}.bg-primary{background-color:var(--color-primary)}.bg-secondary{background-color:var(--color-secondary)}.bg-transparent{background-color:#0000}.fill-current{fill:currentColor}.fill-foreground{fill:var(--color-foreground)}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.align-middle{vertical-align:middle}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-background{color:var(--color-background)}.text-card-foreground{color:var(--color-card-foreground)}.text-destructive{color:var(--color-destructive)}.text-foreground{color:var(--color-foreground)}.text-muted-foreground{color:var(--color-muted-foreground)}.text-popover-foreground{color:var(--color-popover-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-secondary-foreground{color:var(--color-secondary-foreground)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--color-background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background-color\,border-color\,color\]{transition-property:background-color,border-color,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.running{animation-play-state:running}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.selection\:bg-primary ::selection{background-color:var(--color-primary)}.selection\:bg-primary::selection{background-color:var(--color-primary)}.selection\:text-primary-foreground ::selection{color:var(--color-primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--color-primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--color-foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--color-muted-foreground)}@media(hover:hover){.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-destructive\/90:hover{background-color:#f26d6de6}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--color-destructive) 90%,transparent)}}.hover\:bg-muted\/50:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.hover\:bg-primary\/90:hover{background-color:#f5a623e6}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--color-primary) 90%,transparent)}}.hover\:bg-secondary\/80:hover{background-color:#ffffff06}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--color-secondary) 80%,transparent)}}.hover\:text-accent-foreground:hover{color:var(--color-accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:bg-accent:focus{background-color:var(--color-accent)}.focus\:text-accent-foreground:focus{color:var(--color-accent-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--color-ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:border-ring:focus-visible{border-color:var(--color-ring)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:#f26d6d33}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 20%, transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:#f5a62380}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-ring) 50%, transparent)}}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-\[\>svg\]\:px-1\.5:has(>svg){padding-inline:calc(var(--spacing) * 1.5)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--color-destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:#f26d6d33}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 20%, transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[error\=true\]\:text-destructive[data-error=true]{color:var(--color-destructive)}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing) * 8)}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--color-muted-foreground)}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:var(--color-accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--color-accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing) * 9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing) * 8)}:is(.\*\*\:data-\[slot\=command-input-wrapper\]\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing) * 12)}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing) * 2)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--color-accent)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--color-accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--color-muted-foreground)}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--color-muted)}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--color-destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:#f26d6d1a}@supports (color:color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--color-destructive) 10%,transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--color-destructive)}@media(min-width:40rem){.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(prefers-color-scheme:dark){.dark\:border-input{border-color:var(--color-input)}.dark\:bg-destructive\/60{background-color:#f26d6d99}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60{background-color:color-mix(in oklab,var(--color-destructive) 60%,transparent)}}.dark\:bg-input\/30{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30{background-color:color-mix(in oklab,var(--color-input) 30%,transparent)}}.dark\:bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-white\/10{background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}@media(hover:hover){.dark\:hover\:bg-accent\/50:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:hover{background-color:color-mix(in oklab,var(--color-accent) 50%,transparent)}}.dark\:hover\:bg-input\/50:hover{background-color:#ffffff0e}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:hover{background-color:color-mix(in oklab,var(--color-input) 50%,transparent)}}}.dark\:focus-visible\:ring-destructive\/40:focus-visible{--tw-ring-color:#f26d6d66}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40[aria-invalid=true]{--tw-ring-color:#f26d6d66}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 40%, transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20[data-variant=destructive]:focus{background-color:#f26d6d33}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--color-destructive) 20%,transparent)}}}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--color-muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing) * 12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing) * 3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing) * 5)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--color-muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing) * 6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing) * 6)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:text-destructive\![data-variant=destructive]>*):is(svg){color:var(--color-destructive)!important}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}:root{color-scheme:dark;--bg: #0a0b0d;--bg-side: #0c0e10;--bg-raise: #15171b;--surface: rgba(255,255,255,.03);--hover: rgba(255,255,255,.06);--border: rgba(255,255,255,.07);--border-2: rgba(255,255,255,.11);--code-bg: #0d0f12;--text: #eef0f3;--text-dim: #9aa0a9;--text-faint: #868b93;--text-ghost: #666b74;--accent: #f5a623;--accent-bright: #ffcf85;--accent-dim: #d3861a;--accent-press: #e0951a;--glow: rgba(245,166,35,.13);--add: #4cc38a;--del: #f26d6d;--mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;--ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;--r-ctl: 7px;--r-card: 10px;--r-over: 14px;--page-read: 768px;--page-app: 768px;--page-wide: 1200px;--hero-top: clamp(32px, 8vh, 88px)}@font-face{font-family:"Jersey 10";font-style:normal;font-weight:400;font-display:swap;src:url(/assets/jersey-10-COnnvJff.woff2) format("woff2")}@font-face{font-family:Logo Fallback;src:local("Helvetica Neue"),local("Arial"),local("Segoe UI"),local("Roboto");size-adjust:73%}*{box-sizing:border-box}[hidden]{display:none!important}html,body{height:100%;margin:0}#root{display:contents}body{display:flex;background:var(--bg);color:var(--text);font:13px/1.5 var(--ui);letter-spacing:-.006em;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}::selection{background:var(--glow);color:var(--accent-bright)}:focus-visible{outline:2px solid var(--accent);outline-offset:1px;border-radius:5px}:focus-visible{outline-color:var(--accent)}.admin input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}input[type=checkbox]{accent-color:var(--accent);width:20px;height:20px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.sprite{position:absolute}.ico{width:16px;height:16px;flex:none;stroke:currentColor;stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round}button,input,a.btn{font-family:inherit}#sidebar{width:264px;min-width:210px;background:var(--bg-side);border-right:1px solid var(--border);display:flex;flex-direction:column;overflow:hidden}#vault{display:flex;align-items:center;gap:9px;height:52px;padding:0 12px 0 14px;border-bottom:1px solid var(--border);position:relative;z-index:45}#vault-badge{flex:none;display:grid;place-items:center;color:var(--accent)}#vault-name{font-family:"Jersey 10","Logo Fallback",var(--ui);font-size:18px;font-weight:400;font-synthesis:none;letter-spacing:.01em;line-height:1;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vault-actions{display:flex;align-items:center;gap:4px}#vault #signout,.icon-btn2{width:28px;height:28px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;color:var(--text-ghost);background:transparent;border:none;cursor:pointer;text-decoration:none}#vault #signout:hover,.icon-btn2:hover{color:var(--text);background:var(--hover)}#vault #signout .ico,.icon-btn2 .ico{width:16px;height:16px}#projects{flex:none;max-height:32%;overflow-y:auto;padding:10px 8px 8px;border-bottom:1px solid var(--border)}.nav-head{display:flex;align-items:center;justify-content:space-between;padding:6px 8px;font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint)}.nav-add{display:grid;place-items:center;width:18px;height:18px;border:none;background:transparent;color:var(--text-ghost);cursor:pointer;border-radius:5px}.nav-add .ico{width:14px;height:14px}.nav-add:hover{color:var(--text);background:var(--hover)}#projects ul{list-style:none;margin:0;padding:0}#projects .row{display:flex;align-items:center;gap:9px;height:31px;padding:0 8px;border-radius:7px;color:var(--text-dim);cursor:pointer;position:relative;white-space:nowrap;overflow:hidden}.proj-mark{width:17px;height:17px;border-radius:5px;flex:none;display:grid;place-items:center;font-size:10px;font-weight:700;color:#0a0b0d;letter-spacing:-.02em;text-transform:uppercase}.proj-mark svg{width:11px;height:11px}.proj-menu [data-slot=select-item]{display:flex;align-items:center;gap:8px}#projects .row .label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}#projects .row:hover{background:var(--hover);color:var(--text)}#projects .row.active{background:var(--glow);color:var(--accent-bright)}#projects .row.active:before{content:"";position:absolute;left:0;top:6px;bottom:6px;width:2px;border-radius:2px;background:var(--accent)}#tree{flex:1;overflow-y:auto;padding:8px 8px 24px}.tguide{position:absolute;top:0;bottom:0;width:1px;background:var(--border);pointer-events:none}#tree .row{display:flex;align-items:center;gap:6px;height:28px;padding:0 8px;border-radius:7px;color:var(--text-dim);cursor:pointer;position:relative;white-space:nowrap;overflow:hidden}#tree .row:hover{background:var(--hover);color:var(--text)}#tree .row.active{background:var(--glow);color:var(--accent-bright)}#tree .row.active:before{content:"";position:absolute;left:0;top:5px;bottom:5px;width:2px;border-radius:2px;background:var(--accent)}#tree .chev{width:14px;height:14px;flex:none;color:var(--text-ghost);transition:transform .12s;display:flex;align-items:center;justify-content:center}#tree .chev .ico{width:13px;height:13px}#tree .ticon{flex:none;display:flex;color:var(--text-ghost)}#tree .ticon .ico{width:15px;height:15px}#tree .row:hover .ticon,#tree .row:hover .chev{color:var(--text-faint)}#tree .row.active .ticon,#tree .row.active .chev{color:var(--accent)}#tree .label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}#tree .file .label{font-size:12.5px}#tree .file .chev{visibility:hidden}#tree .row.collapsed .chev{transform:rotate(-90deg)}.field-err{color:var(--del);font-size:12px;margin:6px 2px 0}.modal,#palette{translate:none}.admin-card-table{padding:0}.admin-table{width:100%;border-collapse:collapse;table-layout:fixed}.admin-table td .ai-main,.admin-table td a.ai-main,.admin-table td .ai-copy,.admin-table td .ai-tag{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-table th:last-child,.admin-table td:last-child{width:186px;text-align:right}.admin-table tr:last-child td{border-bottom:none}.admin-table th{text-align:left;font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--text-faint);padding:0;border-bottom:1px solid var(--border);-webkit-user-select:none;user-select:none}.admin-table td{padding:0;border-bottom:1px solid var(--border);overflow:hidden;text-overflow:ellipsis}.admin-table tr.admin-item{display:table-row}.admin-table tr.admin-item td{padding:8px 10px}.admin-card-table{overflow-x:auto}.shares-table .admin-table th:last-child,.shares-table .admin-table td:last-child{width:110px}.shares-table .admin-table td .ai-tag{white-space:normal;overflow:visible;text-overflow:clip}.share-banner{margin:0 0 18px;padding:12px 14px;border:1px solid var(--border);border-left:3px solid var(--accent);border-radius:var(--r-ctl);background:var(--surface)}.share-banner .sb-head{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text)}.share-banner .sb-head .ico,.share-banner .sb-head svg{width:15px;height:15px;flex:none;color:var(--accent)}.share-banner .sb-count{color:var(--text-faint);font-size:12px}.share-banner .sb-note{margin:6px 0 10px;font-size:12.5px;line-height:1.55;color:var(--text-faint);max-width:64ch}.share-banner .sb-link{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-top:8px;border-top:1px solid var(--border)}.share-banner .sb-link+.sb-link{margin-top:8px}.share-banner .sb-url{flex:1 1 260px;min-width:0;font-size:12px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.share-banner .sb-meta{font-size:11.5px;color:var(--text-faint)}.share-banner .sb-actions{display:flex;align-items:center;gap:6px;margin-left:auto}.nav-menu{list-style:none;margin:6px 0 0;padding:0}.nav-menu .row .ico{width:15px;height:15px;flex:none;color:var(--text-ghost)}.nav-menu .row.active .ico{color:var(--accent-bright)}.proj-row{display:flex;align-items:center;gap:4px;padding:0 10px 4px 12px}#project-select{flex:1;min-width:0;height:30px;padding:0 9px;display:inline-flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface);color:var(--text);font:inherit;font-size:12.5px;font-weight:500;cursor:pointer;white-space:nowrap;outline:none}#project-select>span:last-of-type{overflow:hidden;text-overflow:ellipsis}#project-select:hover{background:var(--hover);border-color:var(--border-2)}#project-select svg{color:var(--text-ghost)}.proj-menu{z-index:80;min-width:var(--radix-select-trigger-width, 200px);border:1px solid var(--border-2);border-radius:9px;padding:4px;background:var(--bg-raise);box-shadow:0 10px 32px #00000059}.proj-menu [role=option]{font-size:12.5px;color:var(--text-dim);border-radius:6px;outline:none}.proj-menu [role=option][data-highlighted]{background:var(--hover);color:var(--text)}#accountbar{position:relative;border-top:1px solid var(--border);padding:7px 10px}.gh-star{display:flex;align-items:center;gap:8px;padding:4px 8px;margin-bottom:2px;border-radius:7px;color:var(--text-faint);font-size:11px;text-decoration:none}.gh-star:hover{background:var(--hover);color:var(--text)}.gh-star .gh-mark{width:12px;height:12px;flex:none}.gh-star .ext{margin-left:auto;font-size:9px}#account-btn{width:100%;display:flex;align-items:center;gap:9px;text-align:left;padding:6px 8px;border:none;border-radius:7px;background:transparent;color:var(--text-dim);cursor:pointer;font:inherit}#account-btn:hover{background:var(--hover);color:var(--text)}#account-btn .avatar{width:26px;height:26px;flex:none;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-size:12px;font-weight:700}#account-btn .acct{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}#account-btn .acct b{font-size:12.5px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#account-btn .acct small{font-size:11px;color:var(--text-faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#account-btn>.ico{width:14px;height:14px;color:var(--text-ghost)}#account-menu{min-width:var(--radix-dropdown-menu-trigger-width, 220px);padding:5px;border:1px solid var(--border-2);border-radius:9px;background:var(--bg-raise);box-shadow:0 10px 32px #00000059;display:flex;flex-direction:column;z-index:80;outline:none}#account-menu [role=menuitem]{outline:none}#account-menu [role=menuitem][data-highlighted]{background:var(--hover);color:var(--text)}#account-menu .menu-sec{padding:7px 9px 3px;font-size:10.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text-faint)}#account-menu [role=menuitem]{display:flex;align-items:center;gap:8px;padding:7px 9px;border:none;border-radius:6px;background:transparent;text-align:left;color:var(--text-dim);font:inherit;font-size:12.5px;cursor:pointer;text-decoration:none}#account-menu [role=menuitem]:hover{background:var(--hover);color:var(--text)}#account-menu [role=menuitem] b{font-weight:600}#account-menu [role=menuitem] .ico{width:15px;height:15px}#account-menu .plan-chip{margin-left:auto;color:var(--accent);border-color:var(--border-2)}#account-menu #signout{color:var(--del)}#account-menu #signout:hover{color:var(--del);background:var(--hover)}#billing-view .plan-chip{color:var(--accent)}.plan-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}@media(max-width:700px){.plan-grid{grid-template-columns:1fr}}.usage-bar{background:var(--surface);border:1px solid var(--border);border-radius:4px;height:6px;overflow:hidden}.usage-bar>div{background:var(--accent);height:100%}.plan-price{font-size:20px;font-weight:700;margin:0 0 10px}.plan-price small{font-size:12px;color:var(--text-dim);font-weight:500}.muted-note{color:var(--text-dim);font-size:13px}#main{flex:1;display:flex;flex-direction:column;min-width:0}#topbar{position:relative;display:flex;align-items:center;gap:9px;height:52px;padding:0 16px;border-bottom:1px solid var(--border)}.icon-btn{display:none;width:34px;height:34px;border:none;background:transparent;color:var(--text-dim);cursor:pointer;border-radius:7px;align-items:center;justify-content:center}.icon-btn:hover{color:var(--text);background:var(--hover)}#crumb{font-size:12.5px;color:var(--text);font-weight:500;letter-spacing:-.01em;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#crumb .crumb-seg{color:var(--text-dim);cursor:pointer}#crumb .crumb-seg:hover{color:var(--accent-bright)}#crumb .crumb-sep{color:var(--text-ghost);margin:0 5px}#meta{flex:1;min-width:0;font-size:12px;color:var(--text-faint);text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.btn{display:inline-flex;align-items:center;gap:6px;flex:none;height:30px;padding:0 11px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text-dim);font-size:12.5px;font-weight:500;cursor:pointer;text-decoration:none}.btn:hover{background:var(--hover);color:var(--text);border-color:var(--border-2)}.btn .ico{width:15px;height:15px}.btn.ghost{color:var(--text-dim)}.tipcard{display:flex;align-items:center;gap:7px;white-space:nowrap;padding:6px 9px;border-radius:8px;border:1px solid var(--border-2);background:var(--surface-solid, var(--bg-raise));color:var(--text);font-size:12.5px;font-weight:500;box-shadow:0 8px 24px #00000059;z-index:80}.tipcard kbd{font:11px var(--ui);color:var(--text-faint);background:var(--hover);border:1px solid var(--border-2);border-radius:5px;padding:1px 5px}#more-menu{position:absolute;right:12px;top:calc(100% - 4px);z-index:80;background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-card);box-shadow:0 18px 44px -14px #000000bf;padding:6px;min-width:168px}.more-item{display:block;width:100%;text-align:left;min-height:40px;padding:0 12px;background:transparent;border:none;cursor:pointer;color:var(--text);font:inherit;font-size:13.5px;border-radius:var(--r-ctl)}.more-item:hover{background:var(--hover)}#content{flex:1;overflow-y:auto;padding:44px 40px 110px;scroll-behavior:smooth;scrollbar-gutter:stable}@media(pointer:fine){#content::-webkit-scrollbar{width:10px}#content::-webkit-scrollbar-thumb{background:var(--border-2);border-radius:5px}#content::-webkit-scrollbar-track{background:transparent}@supports not selector(::-webkit-scrollbar){#content{scrollbar-width:thin;scrollbar-color:var(--border-2) transparent}}}.page{width:100%;max-width:var(--page-app);margin-inline:auto;min-width:0}.page.read{max-width:var(--page-read)}.page.wide{max-width:var(--page-wide)}.empty{color:var(--text-faint);text-align:center;margin-top:var(--hero-top)}.empty-hint{display:block;margin-top:6px;font-size:12px;color:var(--text-faint)}.onboard{max-width:560px;margin:var(--hero-top) auto 0}.onboard h1{font-size:25px;font-weight:640;letter-spacing:-.02em;margin:0 0 8px;color:#f4f6f9}.onboard>p{color:var(--text-dim);margin:0 0 28px;font-size:14px}.ob-card{background:var(--bg-side);border:1px solid var(--border);border-radius:var(--r-card);padding:20px 22px;margin-bottom:14px}.ob-card h3{margin:0 0 6px;font-size:14.5px;font-weight:600}.ob-card p{margin:0 0 14px;font-size:13px;color:var(--text-dim)}.ob-card.ob-start{border-color:var(--border-2);box-shadow:inset 2px 0 0 var(--accent)}.ob-card.ob-start .pbtn{margin-top:2px}.ob-alt{margin:12px 0 0}.ob-alt a{color:var(--text-faint);font-size:12.5px;font-weight:600;text-decoration:none}.ob-alt a:hover{color:var(--text)}.pbtn{display:inline-flex;align-items:center;gap:6px;flex:none;height:32px;padding:0 14px;border-radius:var(--r-ctl);border:none;background:var(--accent);color:#241704;font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap;text-decoration:none}.pbtn:hover{background:var(--accent-bright)}.pbtn .ico{width:15px;height:15px}.danger-btn{display:inline-flex;align-items:center;height:32px;padding:0 14px;border-radius:var(--r-ctl);border:none;background:#b3382e;color:#fff;font-size:13px;font-weight:600;cursor:pointer}.danger-btn:hover{background:#c94336}[data-slot=input],[data-slot=textarea]{font:inherit;color:var(--text)}[data-slot=input][aria-invalid=true]:focus-visible,[data-slot=textarea][aria-invalid=true]:focus-visible{border-color:var(--del)}[data-slot=card],[data-slot=dropdown-menu-content]{border-color:var(--border)}.project-settings{display:flex;flex-direction:column;gap:14px}.project-settings>h2{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.ps-form{display:flex;flex-direction:column;gap:18px}.ps-field{display:flex;flex-direction:column;gap:7px}.ps-field label{font-size:12.5px;color:var(--text-dim)}.ps-opt{color:var(--text-ghost);font-weight:400}.ps-icon-row{display:flex;align-items:center;gap:10px}.ps-icon-row .proj-mark{width:26px;height:26px;border-radius:7px}.ps-icon-row .proj-mark svg{width:15px;height:15px}.ps-meta{display:flex;align-items:baseline;justify-content:space-between;gap:12px}.ps-meta .field-err{flex:0 1 auto;margin:0}.ps-count{font-size:11.5px;color:var(--text-faint);font-variant-numeric:tabular-nums}.ps-actions{display:flex;justify-content:flex-end}.ps-icon-grid{display:grid;grid-template-columns:repeat(6,30px);gap:4px;padding:8px}.ps-icon-cell{display:grid;place-items:center;width:30px;height:30px;border-radius:7px;border:1px solid transparent;background:none;color:var(--text-dim);cursor:pointer}.ps-icon-cell svg{width:16px;height:16px}.ps-icon-cell:hover{background:var(--hover);color:var(--text)}.ps-icon-cell.active{border-color:var(--accent);color:var(--accent-bright)}.ps-danger [data-slot=card-title]{font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:#d2695e;font-weight:600}.ps-chip{margin-left:10px;padding:2px 8px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--text-faint);font-size:11px;font-weight:600;letter-spacing:.02em;vertical-align:middle}.ps-people h4{font-size:12.5px;font-weight:600;color:var(--text-dim);margin:0}.ps-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px;color:var(--text-dim);margin:0 0 10px}.ps-people select{height:28px;padding:0 8px;border-radius:6px;border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:12.5px}.ps-people select:disabled{opacity:.6;cursor:default}.ps-note{color:var(--text-faint);font-size:12.5px;margin:0 0 12px;max-width:56ch;line-height:1.55}.ps-people-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:20px 0 8px}.ps-danger p{color:var(--text-dim);font-size:13px;margin:0 0 14px;max-width:52ch;line-height:1.55}.ps-facts{display:grid;grid-template-columns:auto 1fr;gap:8px 20px;margin:0;font-size:13px}.ps-facts dt{color:var(--text-faint)}.ps-facts dd{margin:0;color:var(--text-dim)}.admin h1{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 6px;color:#f4f6f9}.admin h3{font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint);font-weight:600;margin:30px 0 10px}.admin-lbl{flex:1 1 100%;margin:0 0 6px;font-size:12.5px;font-weight:600;color:var(--text-dim)}.admin-sub{color:var(--text-dim);font-size:13.5px;margin:-2px 0 16px;line-height:1.55}.admin-h{display:flex;align-items:center;justify-content:space-between;margin:30px 0 10px}.admin-h h3{margin:0}.admin-row{display:flex;gap:9px;margin-bottom:8px}.admin-row input{flex:1;height:34px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:13px;outline:none}.admin-row input:focus{border-color:var(--accent);background:var(--hover)}.admin-list{border:1px solid var(--border);border-radius:var(--r-card);overflow:hidden;background:var(--bg-side)}.admin-list.admin-card-table{overflow-x:auto;overflow-y:hidden}.admin-item{display:flex;align-items:center;gap:11px;padding:11px 14px;border-bottom:1px solid var(--border);font-size:13.5px}.modal-actions .ai-btn{height:32px}.empty a{color:var(--accent);text-decoration:none;display:inline-block;padding:6px 10px}.empty a:hover{text-decoration:underline}.empty h3{margin:0 0 8px;font-size:16px;color:var(--text)}.ai-copy{text-align:left;background:none;border:0;padding:6px 0;cursor:pointer}.ai-copy:hover{color:var(--text)}a.ai-main{color:var(--text-dim);text-decoration:none;padding:6px 0}a.ai-main:hover{color:var(--accent)}.th-sort{display:block;width:100%;text-align:left;background:none;border:0;padding:6px 10px;font:inherit;color:inherit;letter-spacing:inherit;text-transform:inherit;cursor:pointer}.th-sort:hover{color:var(--text-dim)}.proj-trigger>[data-slot=select-value]{display:block;flex:1 1 auto;min-width:0;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.role-cell{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;justify-items:start}.admin-table td .role-static{text-align:left}.role-chip-row{margin:-6px 0 12px}.role-chip{margin-left:0;padding:2px 8px;border:1px solid var(--border-2);border-radius:99px;vertical-align:middle}.ext{margin-left:4px;color:var(--text-faint);font-size:11px}.admin-item:last-child{border-bottom:none}.admin-item:hover{background:var(--hover)}.field-err{flex:1 1 100%;margin:6px 0 0}.admin-row{flex-wrap:wrap}.admin-row input[aria-invalid=true]{border-color:var(--del)}.ai-main{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}.admin-item>.ai-main{flex:1 1 55%;min-width:22ch}.admin-item>.ai-tag{flex:0 0 auto;min-width:0;max-width:45%}@media(max-width:1000px){.admin-item{flex-wrap:wrap}.admin-item>.ai-tag{flex:1 1 100%;max-width:100%}}.admin-table td .ai-main{min-width:0}.ai-main.mono{font:12px var(--mono);color:var(--text-dim);cursor:pointer}.ai-tag{font-size:11.5px;color:var(--text-faint);flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-item select{height:28px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:0 8px;font:inherit;font-size:12.5px;cursor:pointer}.admin-item select:hover{border-color:var(--border-2)}.ai-btn,.ai-del{flex:none;height:27px;padding:0 11px;border-radius:6px;border:1px solid var(--border);background:var(--surface);color:var(--text-dim);font:inherit;font-size:12px;font-weight:500;cursor:pointer}.ai-del{color:var(--del);border-color:#f26d6d47}.ai-del:hover{background:#f26d6d1f;border-color:var(--del);color:#ff8b8b}.ai-btn:hover{background:var(--hover);color:var(--text);border-color:var(--border-2)}.admin-empty{padding:14px;color:var(--text-faint);font-size:13px}.admin-item.toggle{cursor:pointer;align-items:flex-start}.admin-item.toggle .ai-main{white-space:normal}.tg-label{font-size:13.5px;font-weight:550;color:var(--text)}.tg-desc{font-size:12px;color:var(--text-faint);margin-top:3px;line-height:1.5}.admin-item.toggle input{margin-top:2px;flex:none}.dl-title{display:flex;align-items:center;gap:10px;font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.dl-title-icon{display:flex;color:var(--accent)}.dl-title-icon .ico{width:20px;height:20px}.dl-sub{color:var(--text-faint);font-size:12.5px;margin:0 0 18px}.dl-items{border:1px solid var(--border);border-radius:var(--r-card);overflow:hidden;background:var(--bg-side)}.dl-row{display:flex;align-items:center;gap:11px;padding:10px 14px;border-bottom:1px solid var(--border);cursor:pointer}.dl-row:last-child{border-bottom:none}.dl-row:hover{background:var(--hover)}.dl-row .ticon{flex:none;display:flex;color:var(--text-ghost)}.dl-row .ticon .ico{width:16px;height:16px}.dl-row:hover .ticon{color:var(--text-faint)}.dl-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13.5px;color:var(--text)}.dl-name,#crumb,.hpath,.hnote,.hrun-note,.hdev,.ai-main{unicode-bidi:isolate-override;direction:ltr}.dl-meta{flex:none;font-size:12px;color:var(--text-faint);font-variant-numeric:tabular-nums}.heatdot{flex:none;width:7px;height:7px;border-radius:50%;background:var(--accent)}.heatdot.lvl1{opacity:.3}.heatdot.lvl2{opacity:.55}.heatdot.lvl3{opacity:.8}.heatdot.lvl4{opacity:1;box-shadow:0 0 6px #f5a6238c}.dl-empty{padding:24px 14px;color:var(--text-faint);font-size:13px;border:1px dashed var(--border);border-radius:var(--r-card);text-align:center}.dl-h3{margin:28px 0 8px;font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint);font-weight:600}.dl-hlist{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);overflow:hidden;max-width:none}.dl-hlist .hentry:last-child{border-bottom:none}.hentry.clickable{cursor:pointer}.hentry.clickable:hover{background:var(--hover)}.dl-more{margin-top:10px}#vault-name.vault-link{cursor:pointer}#vault-name.vault-link:hover{color:var(--accent-bright)}#account-btn.active{background:var(--glow)}#account-btn.active .acct b{color:var(--accent-bright)}.gd-body{margin-top:18px}.gd-desc{margin:2px 0 8px;color:var(--text-faint);font-size:13px;line-height:1.5}.gd-list{margin:4px 0 8px;padding-left:18px;display:grid;gap:6px}.gd-code{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px;margin:6px 0 10px;padding:10px 12px;background:var(--bg-raise);border:1px solid var(--border);border-radius:var(--r-card);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.6;color:var(--text)}.gd-code>code{display:block;min-width:0;overflow-x:auto;white-space:pre}.gd-copy{align-self:start;font:inherit;font-family:inherit;font-size:11px;font-weight:600;padding:3px 9px;border-radius:6px;border:1px solid var(--border-2);background:var(--bg-raise);color:var(--text-faint);cursor:pointer}.gd-copy:hover{color:var(--accent-bright);border-color:var(--accent-dim)}.gd-manual{margin:10px 0 0}.gd-manual>summary{display:inline-block;font-size:12.5px;font-weight:600;color:var(--text-faint);cursor:pointer;padding:4px 0}.gd-manual>summary:before{content:"▸ ";color:var(--text-ghost)}.gd-manual[open]>summary:before{content:"▾ "}.gd-manual>summary:hover{color:var(--text)}.home-insights{margin-top:30px;padding-top:22px;border-top:1px solid var(--border)}.in-title{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.in-title .in-scope{color:var(--text-ghost);font-weight:500;font-size:15px}.gd-head{display:flex;align-items:center;gap:9px}.gd-head .proj-mark{width:22px;height:22px;border-radius:6px}.gd-head .proj-mark svg{width:13px;height:13px}.in-desc{color:var(--text-dim);font-size:13.5px;line-height:1.55;margin:0 0 10px;max-width:62ch}.in-blank{display:grid;justify-items:center;gap:10px;padding:40px 18px;margin-top:14px;max-width:760px}.in-blank p{margin:0;max-width:52ch;line-height:1.55}.in-blank p:first-child{color:var(--text);font-size:14.5px;font-weight:600}.in-blank .pbtn{margin-top:6px}.in-lens{display:flex;gap:6px;margin:0 0 14px}.in-lens-btn{font:inherit;font-size:12px;padding:5px 12px;border-radius:999px;border:1px solid var(--border);background:none;color:var(--text-faint);cursor:pointer}.in-lens-btn:hover{color:var(--text)}.in-lens-btn.active{color:var(--accent);border-color:var(--accent)}.in-chart{width:100%;max-width:760px;height:auto;border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);margin-bottom:6px}.in-axis{stroke:var(--border);stroke-width:1}.in-threshold{stroke:var(--border);stroke-width:1;stroke-dasharray:4 4}.in-danger-zone{fill:#f26d6d0d}.in-label{fill:var(--text-ghost);font-size:11px}.in-quad{fill:var(--text-ghost);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em}.in-quad-danger{fill:#e07070}.in-pt{fill:var(--accent);opacity:.5;cursor:pointer}.in-pt:hover{opacity:1}.in-pt.cold{fill:var(--text-ghost);opacity:.25}.in-pt.danger{fill:#e05d5d;opacity:.6}.in-pt-label{fill:var(--text-faint);font-size:11px;pointer-events:none}.in-h3-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;max-width:760px}.in-cap{font-size:11.5px;color:var(--text-faint);font-weight:400;text-transform:none;letter-spacing:0}.in-treemap{background:#0c0d10}.in-tm-group{fill:none;stroke:var(--border);stroke-width:1;cursor:pointer;pointer-events:all}.in-tm-glabel{fill:var(--text-faint);font-size:10px;text-transform:uppercase;letter-spacing:.05em;cursor:pointer}.in-tm-cell{cursor:pointer}.in-tm-cell:hover{stroke:#fff;stroke-width:1}.in-tm-label{fill:#0c0d10;font-size:10.5px;font-weight:620;cursor:pointer;pointer-events:none}.in-hotpath{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);overflow:hidden}.in-hp-row{display:flex;align-items:center;gap:10px;padding:6px 12px;border-bottom:1px solid var(--border);cursor:pointer}.in-hp-row:last-child{border-bottom:none}.in-hp-row:hover{background:var(--hover)}.in-hp-name{flex:0 0 300px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;color:var(--text)}.in-hp-name.danger{color:var(--accent)}.in-hp-bar{flex:1;display:flex;height:10px;border-radius:3px;overflow:hidden}.in-hp-agent{background:var(--accent)}.in-hp-human{background:#5b8def}.in-hp-share{background:#b478e8}.in-hp-gone{flex:none;font-size:11.5px;color:var(--text-ghost);white-space:nowrap}.in-hp-count{flex:none;width:40px;text-align:right;font-size:11.5px;color:var(--text-faint);font-variant-numeric:tabular-nums}.in-legend{margin:8px 2px 0;font-size:11.5px;color:var(--text-faint)}.in-sw{display:inline-block;width:10px;height:10px;border-radius:2px;vertical-align:-1px}.in-sw.agent{background:var(--accent)}.in-sw.human{background:#5b8def}.in-sw.share{background:#b478e8}.in-sw-age{width:84px;margin:0 5px}.in-sw-flat{filter:grayscale(1);opacity:.45}.in-tm-range{margin-left:14px;color:var(--text-ghost)}.in-matrix rect{transition:opacity .1s}.in-matrix rect:hover{opacity:.85}.hfilters{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:0 0 12px;border-bottom:1px solid var(--border);margin-bottom:4px}.hf-search{position:relative;display:flex;align-items:center;flex:1 1 200px;min-width:160px}.hf-search .ico{position:absolute;left:9px;width:14px;height:14px;color:var(--text-ghost);pointer-events:none}.hf-search input{height:30px;padding-left:29px;font-size:12.5px;border-radius:var(--r-ctl);background:var(--surface)}.hf-search input::-webkit-search-cancel-button{filter:invert(.6)}.hf-user{height:30px;max-width:190px;padding:0 8px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:12.5px;cursor:pointer}.hf-dates{display:flex;align-items:center;gap:6px}.hf-lbl{font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--text-ghost)}.hf-date{width:140px;height:30px;font-size:12.5px;border-radius:var(--r-ctl);background:var(--surface)}.hf-date::-webkit-calendar-picker-indicator{filter:invert(.6);cursor:pointer}.hf-dash{color:var(--text-ghost)}.hf-clear{height:30px;padding:0 10px;border:none;border-radius:var(--r-ctl);background:none;color:var(--text-dim);font:inherit;font-size:12.5px;cursor:pointer}.hf-clear:hover{color:var(--text);background:var(--hover)}.hf-clear-empty{margin-top:12px}.hentry{padding:11px 12px;border-bottom:1px solid var(--border);--hindent: 72px}.hentry:hover{background:#ffffff04}.hline{display:flex;gap:10px;align-items:center}.hkind{flex:none;width:62px;white-space:nowrap;text-align:center;font-size:10px;text-transform:uppercase;letter-spacing:.06em;font-weight:600;padding:2px 6px;border-radius:4px;color:var(--add);background:#4cc38a1f}.hentry.edit .hkind{color:var(--accent-bright);background:var(--glow)}.hentry.delete .hkind{color:#ff8b8b;background:#f26d6d1f}.hpath{font-weight:500;cursor:pointer;color:var(--text);font-size:13px}.hpath:hover{color:var(--accent-bright)}.htime{margin-left:auto;color:var(--text-faint);font-size:12px;font-variant-numeric:tabular-nums}.hmore{display:flex;margin:14px auto}.hmore:disabled{opacity:.6;cursor:default}.hmeta{display:flex;align-items:center;gap:14px;margin-top:4px;padding-left:var(--hindent);font-size:12px;color:var(--text-dim)}.hdev,.hsize{color:var(--text-faint)}.hsize{font-variant-numeric:tabular-nums;white-space:nowrap;flex:none}.hnote{margin-top:4px;padding-left:var(--hindent);font-size:12px;color:var(--text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.hnote:hover{color:var(--text)}.hnote.open{white-space:normal;overflow-wrap:anywhere}.hnote:before{content:"›";display:inline-block;margin-right:5px;color:var(--text-ghost);transition:transform .12s}.hnote.open:before{transform:rotate(90deg)}.hnote a{color:var(--accent-bright);text-decoration:none}.hnote a:hover{text-decoration:underline}.hrun{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);margin:10px 0;overflow:hidden}.hrun-head{display:flex;align-items:center;gap:9px;width:100%;padding:9px 12px;color:var(--text);font-size:12.5px}.hrun-toggle{display:flex;flex:none;padding:2px;border:none;border-radius:4px;background:none;color:var(--text-faint);cursor:pointer}.hrun-toggle:hover{color:var(--text);background:var(--hover)}.hrun-toggle .ico{width:13px;height:13px}.hrun-note{font-weight:560;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:46%}.hrun-note a{color:var(--accent-bright);text-decoration:none}.hrun-note a:hover{text-decoration:underline}.hrun-meta{color:var(--text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hrun-time{margin-left:auto;flex:none;color:var(--text-faint);font-variant-numeric:tabular-nums}.hrun-body{border-top:1px solid var(--border)}.hrun-body .hentry:last-child{border-bottom:none}.hread{flex:none;padding:2px 6px;border-radius:4px;font-size:10px;text-transform:uppercase;letter-spacing:.06em;font-weight:600;color:var(--text-dim);background:var(--hover)}.hrun-reads{border-top:1px solid var(--border);padding:4px 0 6px}.hrun-reads-head{padding:6px 14px 4px;font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--text-faint)}.hrun-read{display:flex;gap:10px;align-items:center;width:100%;padding:5px 14px;border:none;background:none;font:inherit;text-align:left;cursor:pointer}.hrun-read:hover{background:#ffffff04}.hrun-read .hkind{color:var(--text-dim);background:var(--hover)}.hrun-foot{padding:8px 14px 10px;border-top:1px solid var(--border);font-size:11.5px;color:var(--text-faint)}.hrestore-btn,.hremove-btn{display:inline-flex;align-items:center;gap:4px;margin-left:auto;padding:2px 8px 2px 5px;border:1px solid var(--border);border-radius:5px;background:none;color:var(--text-faint);font:inherit;font-size:12px;cursor:pointer}.hrestore-btn:hover{color:var(--accent-bright);border-color:var(--border-2);background:var(--hover)}.hremove-btn:hover{color:var(--del);border-color:#f26d6d61;background:var(--hover)}.hrestore-btn:disabled,.hremove-btn:disabled{opacity:.5;cursor:default}.hrestore-btn .ico,.hremove-btn .ico{width:12px;height:12px}.hactions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:6px 0 0 23px}.hdiff-btn,.hver-btn{display:inline-flex;align-items:center;gap:4px;padding:2px 7px 2px 4px;border:1px solid var(--border);border-radius:5px;background:none;color:var(--text-faint);font:inherit;font-size:12px;cursor:pointer;text-decoration:none}.hdiff-btn:hover,.hver-btn:hover{color:var(--text);border-color:var(--border-2);background:var(--hover)}.hdiff-btn .ico,.hver-btn .ico{width:12px;height:12px}.hdiff-none{flex-basis:100%;font-size:12px;color:var(--text-ghost)}.dv{margin:8px 0 2px 23px;border:1px solid var(--border);border-radius:6px;overflow:hidden}.dv-msg{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:9px 11px;font-size:12px;color:var(--text-faint)}.dv-dl{display:flex;gap:12px}.dv-msg a{color:var(--accent-bright);text-decoration:none}.dv-msg a:hover{text-decoration:underline}.dv-head{display:flex;align-items:center;gap:10px;padding:5px 11px;border-bottom:1px solid var(--border);font-size:11px;font-variant-numeric:tabular-nums}.dv-add{color:var(--add);font-weight:600}.dv-del{color:var(--del);font-weight:600}.dv-same{color:var(--text-ghost)}.dv-body{overflow-x:auto;padding:4px 0}.dv-line{display:flex;font-family:var(--mono);font-size:12px;line-height:1.55;white-space:pre}.dv-n{flex:none;width:34px;padding-right:8px;text-align:right;color:var(--text-ghost);-webkit-user-select:none;user-select:none;font-variant-numeric:tabular-nums}.dv-mark{flex:none;width:16px;text-align:center;-webkit-user-select:none;user-select:none}.dv-text{padding-right:12px}.dv-ins{background:#4cc38a1a;color:var(--add)}.dv-rm{background:#f26d6d1a;color:#ff8b8b}.dv-ctx{color:var(--text-dim)}#palette{position:fixed;top:12vh;left:50%;transform:translate(-50%);z-index:151;display:block;width:min(560px,92vw);background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-over);box-shadow:0 24px 70px -18px #000c;overflow:hidden;outline:none;padding:0}#palette-inputwrap{display:flex;align-items:center;gap:11px;padding:14px 16px;border-bottom:1px solid var(--border)}#palette-inputwrap [data-slot=command-input-wrapper]{flex:1;display:flex;border-bottom:0;padding:0;height:auto}#palette-inputwrap [data-slot=command-input-wrapper]>svg:not(.ico){display:none}#palette input,#palette input:focus{flex:1;width:100%;border:none;background:transparent;box-shadow:none;color:var(--text);font:inherit;font-size:15px;letter-spacing:-.01em;outline:none;padding:0}#palette input::placeholder{color:var(--text-ghost)}#palette-inputwrap .ico{width:17px;height:17px;color:var(--text-faint)}#palette [cmdk-list]{list-style:none;margin:0;padding:8px;max-height:46vh;overflow-y:auto}#palette [cmdk-item]{display:flex;align-items:center;gap:11px;height:38px;padding:0 10px;border-radius:9px;cursor:pointer;color:var(--text-dim);font-size:13.5px}#palette [cmdk-item][data-selected=true]{background:var(--glow)}#palette [cmdk-item][data-selected=true] .picon{color:var(--accent)}#palette [cmdk-item][data-selected=true] .plabel,#palette [cmdk-item][data-selected=true] .plabel b{color:var(--accent-bright)}#palette [cmdk-item] .picon{width:18px;flex:none;display:flex;justify-content:center;color:var(--text-faint)}#palette [cmdk-item] .picon .ico{width:15px;height:15px}#palette [cmdk-item] .plabel{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text)}#palette [cmdk-item] .plabel b{color:var(--accent-bright);font-weight:600}#palette [cmdk-item] .pkind{flex:none;font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-ghost)}#palette [cmdk-list] .pempty{color:var(--text-faint);cursor:default;justify-content:center;height:auto;padding:14px}#palette-hint{padding:9px 16px;border-top:1px solid var(--border);font-size:11px;color:var(--text-ghost)}[data-slot=dialog-overlay]{position:fixed;inset:0;background:#06070999;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:150}.modal{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:151;display:block;background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-over);padding:22px 24px;width:min(460px,calc(100vw - 40px));box-shadow:0 24px 70px -18px #000c;outline:none}.modal h3{margin:0 0 10px;font-size:16px;font-weight:620;letter-spacing:-.01em}.modal p{margin:0 0 16px;font-size:13.5px;color:var(--text-dim);line-height:1.55}.modal p b{color:var(--text)}.modal-url{font:12px var(--mono);background:var(--surface);border:1px solid var(--border);border-radius:var(--r-ctl);padding:9px 11px;color:var(--text-dim);word-break:break-all;margin-bottom:16px}.modal-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.modal-expiry{display:flex;align-items:center;gap:8px;margin-bottom:16px;font-size:12.5px;color:var(--text-dim)}.modal-expiry select{height:28px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:0 8px;font:inherit;font-size:12.5px;cursor:pointer}.modal-expiry select:disabled{opacity:.6;cursor:default}.modal-expiry-note{margin-left:auto;color:var(--text-dim)}.modal-label{display:block;font-size:12.5px;color:var(--text-dim);margin:0 0 6px}.modal-msg{margin:0 0 16px;font-size:13.5px;color:var(--text-dim);line-height:1.55}.modal-input{width:100%;height:36px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:14px;margin-bottom:16px;outline:none}.modal-input:focus{border-color:var(--accent);background:var(--hover)}.start-points{border:0;margin:0 0 18px;padding:0}.start-points legend{padding:0}.start-point{display:flex;align-items:flex-start;gap:10px;padding:9px 11px;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface);cursor:pointer;margin-bottom:6px}.start-point:hover{background:var(--hover)}.start-point.on{border-color:var(--accent);background:var(--hover)}.start-point input{accent-color:var(--accent);margin:2px 0 0;flex:none}.sp-text{display:flex;flex-direction:column;gap:2px;min-width:0}.sp-title{font-size:13.5px;color:var(--text);display:flex;align-items:center;gap:8px}.sp-rec{font-size:10.5px;letter-spacing:.02em;text-transform:uppercase;color:var(--accent);border:1px solid var(--accent);border-radius:999px;padding:0 6px;line-height:15px}.sp-blurb{font-size:12px;color:var(--text-dim);overflow-wrap:anywhere}.start-point.sp-rule{margin-top:16px}.modal{max-height:calc(100vh - 32px);overflow-y:auto}.gd-note{margin:-4px 0 16px;font-size:13px;color:var(--text-dim);border-left:2px solid var(--accent);padding-left:11px;line-height:1.55}[data-sonner-toast]{background:var(--bg-raise)!important;color:var(--text)!important;border:1px solid var(--border-2)!important;border-radius:10px!important;font-size:13.5px!important;box-shadow:0 18px 44px -12px #000000b3!important}[data-sonner-toast][data-type=error]{border-color:#f26d6d80!important;color:#ffb0aa!important}#sb-backdrop{display:none}@media(max-width:900px){#sidebar{position:fixed;z-index:60;top:0;left:0;height:100%;transform:translate(-100%);transition:transform .2s ease;box-shadow:0 0 40px #0009}body.sb-open #sidebar{transform:translate(0)}body.sb-open #sb-backdrop{display:block;position:fixed;inset:0;background:#0000008c;z-index:50}.icon-btn,#search-btn{display:inline-flex;width:44px;height:44px}#content{padding:24px 18px 70px}#topbar{padding:0 8px;gap:4px}.btn .lbl{display:none}#topbar .btn{min-width:44px;min-height:44px;padding:0;justify-content:center;gap:0}#topbar .btn .ico{width:18px;height:18px}#more-btn:not([hidden]){display:inline-flex}#history-btn,#upload-btn,#download{display:none!important}#topbar{flex-wrap:wrap;height:auto;min-height:52px}#meta{order:1;flex:1 1 100%;text-align:left;white-space:normal;overflow:visible;padding:0 0 8px}#meta:empty{display:none}#crumb{flex:1}#vault{padding:0 8px 0 12px}.icon-btn2,#signout,#tree .row,#projects .row{height:44px}#account-btn,#project-select{min-height:44px}.nav-add{min-width:44px;min-height:44px}.markdown table,pre.plain{display:block;overflow-x:auto;max-width:100%}.admin-item{flex-wrap:wrap;row-gap:8px;padding:12px 14px}.admin-item select,.hf-search input,.hf-user,.hf-date,.hf-clear{height:44px}.hf-dates{flex:1 1 100%}.hf-date{flex:1;width:auto;min-width:0}.hrun-head{flex-wrap:wrap;row-gap:4px}.hrun-note{max-width:none;white-space:normal;overflow:visible}.hrun-meta{order:1;flex:1 1 100%;white-space:normal;overflow:visible}.ai-btn,.ai-del{height:auto;min-height:44px;padding:0 12px}.admin-table thead{display:none}.admin-table,.admin-table tbody,.admin-table td{display:block;width:auto}.admin-table tr.admin-item{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.admin-table tr.admin-item td{padding:0;border-bottom:none}.admin-table tr.admin-item td:first-child{flex:1 1 100%;width:auto}.admin-table tr.admin-item td:last-child{width:auto;text-align:left}[data-slot=dropdown-menu-item]{min-height:44px}#projects{flex:0 1 auto;max-height:none}.admin-row{flex-wrap:wrap}.admin-row input{flex:1 1 100%;min-height:44px}.admin-row button{flex:0 0 auto;align-self:flex-start;min-height:44px}.admin-item .ai-main{flex:1 1 100%;white-space:normal;overflow-wrap:anywhere}.admin-table td{white-space:normal}.admin-table td .ai-main,.admin-table td a.ai-main,.admin-table td .ai-copy,.admin-table td .ai-tag{white-space:normal;overflow-wrap:anywhere}.admin-item .ai-tag{flex:1 1 100%;max-width:100%;white-space:normal;overflow-wrap:anywhere}.ai-copy{min-height:44px;display:block;padding:12px 0;white-space:normal;overflow-wrap:anywhere;text-overflow:clip}a.ai-main{min-height:44px;display:flex;align-items:center}.gd-code{min-height:62px;padding-top:12px;padding-bottom:12px}.gd-copy{min-height:44px;padding:0 14px}.gd-tab{min-height:44px}.in-lens-btn{min-height:44px;padding:0 14px}.modal-input{height:44px}.modal-actions button{height:auto;min-height:44px}.modal-expiry select{height:44px}.pbtn,#palette [cmdk-item]{height:auto;min-height:44px}.more-item{min-height:44px}}.modal-actions .ai-del{margin-right:auto}@media(max-width:430px){.dl-row{flex-wrap:wrap;row-gap:2px}.dl-meta{flex:1 1 100%;padding-left:27px}.ai-tag{font-size:11px}.htime{white-space:nowrap;font-size:12px}.hline{flex-wrap:wrap}.hentry{--hindent: 0px}.modal-actions .ai-del{flex:0 0 100%;justify-content:center;text-align:center}}.markdown h1,.markdown h2,.markdown h3,.markdown h4{color:#f4f6f9;line-height:1.25;letter-spacing:-.018em;margin:1.5em 0 .5em;text-wrap:balance}.markdown h1:first-child{margin-top:0}.markdown h1{font-size:1.85em;font-weight:660;letter-spacing:-.024em}.markdown h2{font-size:1.32em;font-weight:620;margin-top:1.7em}.markdown h3{font-size:1.08em;font-weight:620}.markdown p,.markdown li{color:#c6cbd3;font-size:14.5px;line-height:1.72}.markdown p{margin:0 0 1em}.markdown strong{color:var(--text);font-weight:620}.markdown a{color:var(--accent-bright);text-decoration:none;border-bottom:1px solid rgba(245,166,35,.28)}.markdown a:hover{border-bottom-color:var(--accent)}.markdown ul,.markdown ol{margin:0 0 1em;padding-left:1.4em}.markdown li{margin-bottom:.4em}.markdown li::marker{color:var(--text-ghost)}.markdown code{background:var(--hover);border:1px solid var(--border);padding:.1em .4em;border-radius:5px;font:12.5px/1.5 var(--mono);color:#e4d9c4}.markdown pre{background:var(--code-bg);border:1px solid var(--border);border-radius:var(--r-card);padding:14px 16px;overflow-x:auto;margin:1.3em 0}.markdown pre code{background:none;border:none;padding:0;color:#c6cbd3}.markdown blockquote{margin:1.3em 0;padding:.3em 1em;border-left:2px solid var(--accent);background:linear-gradient(90deg,var(--glow),transparent);border-radius:0 8px 8px 0;color:#d8cdb6}.markdown blockquote p{margin:.3em 0;color:#d8cdb6}.markdown table{border-collapse:collapse;margin:1.3em 0;font-size:13.5px}.markdown th,.markdown td{border-bottom:1px solid var(--border);padding:9px 13px;text-align:left}.markdown th{color:var(--text-faint);font-size:11px;text-transform:uppercase;letter-spacing:.05em;font-weight:600;border-bottom-color:var(--border-2)}.markdown tr:hover td{background:#ffffff05}.markdown img{max-width:100%;border-radius:8px;border:1px solid var(--border)}.markdown hr{border:none;border-top:1px solid var(--border);margin:2.2em 0}.markdown .mermaid-diagram{margin:1.3em 0;overflow-x:auto}.markdown .mermaid-diagram svg{max-width:100%;height:auto}.markdown .mermaid-err{margin:-.9em 0 1.3em;font-size:12px;color:var(--text-faint)}.markdown table.frontmatter{margin:0 0 1.8em;font-size:12px;background:var(--surface);border:1px solid var(--border);border-radius:8px;border-collapse:separate;border-spacing:0}.markdown table.frontmatter th{text-transform:none;letter-spacing:0;font-size:11.5px;color:var(--text-faint);font-weight:600;text-align:left;white-space:nowrap;vertical-align:top;padding:6px 14px 6px 12px;border-bottom:1px solid var(--border)}.markdown table.frontmatter td{color:var(--text-dim);padding:6px 12px 6px 0;border-bottom:1px solid var(--border)}.markdown table.frontmatter tr:last-child th,.markdown table.frontmatter tr:last-child td{border-bottom:none}.markdown table.frontmatter code{white-space:pre-wrap;font-size:11px}.markdown .admin input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.admin input[aria-invalid=true]:focus-visible{outline-color:var(--del)}[role=dialog] input[aria-invalid=true]{border-color:var(--del)}[role=dialog] input[aria-invalid=true]:focus-visible{outline-color:var(--del)}button:disabled,.btn:disabled{cursor:default}input[type=checkbox]{accent-color:var(--accent)}.htmlview,.pdfview{display:block;width:100%;height:calc(100vh - 150px);border:1px solid var(--border);border-radius:var(--r-card);background:#fff}.notfound{margin-top:var(--hero-top);text-align:center;color:var(--text-dim)}.notfound h1{color:var(--text);font-size:1.4em;margin-bottom:.5em}.notfound code{background:var(--hover);border:1px solid var(--border);padding:.15em .5em;border-radius:6px}.notfound .nf-sub{max-width:440px;margin:12px auto 20px;font-size:13px;color:var(--text-faint);line-height:1.6}.vbanner{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 22px;padding:11px 14px;border:1px solid var(--accent-dim);border-radius:var(--r-card);background:var(--glow)}.vbanner .vb-icon{flex:none;display:flex;color:var(--accent-bright)}.vbanner .vb-text{flex:1 1 220px;min-width:0;display:flex;flex-direction:column;gap:1px;font-size:12.5px;line-height:1.45}.vbanner .vb-text b{color:var(--accent-bright);font-weight:600}.vbanner .vb-text span{color:var(--text-dim)}.vbanner .vb-actions{flex:none;display:flex;gap:8px}.vbanner .vb-actions .ai-btn{display:inline-flex;align-items:center;text-decoration:none}pre.plain{background:var(--code-bg);border:1px solid var(--border);border-radius:var(--r-card);padding:14px 16px;overflow-x:auto;font:12.5px/1.6 var(--mono);color:#c6cbd3;white-space:pre-wrap;overflow-wrap:anywhere}.csvbox{overflow-x:auto;width:fit-content;max-width:100%;border:1px solid var(--border);border-radius:var(--r-card);background:var(--code-bg)}.csvbox .csvview{display:table;max-width:none;overflow:visible;margin:0;border-collapse:collapse;font:12.5px/1.5 var(--mono);font-variant-numeric:tabular-nums}.csvbox .csvview th,.csvbox .csvview td{border-bottom:1px solid var(--border);padding:8px 14px;text-align:left;white-space:pre;vertical-align:top;color:#c6cbd3;font-size:12.5px}.csvbox .csvview th{background:var(--surface);color:var(--text-faint);font-size:11px;text-transform:uppercase;letter-spacing:.05em;font-weight:600;border-bottom-color:var(--border-2)}.csvbox .csvview tr:last-child td{border-bottom:none}.csvbox .csvview tbody tr:hover td{background:#ffffff05}.csvnote{color:var(--text-faint);font-size:12px;margin:10px 2px 0}.filecard{margin-top:var(--hero-top);text-align:center;color:var(--text-dim)}.filecard .name{font-size:1.2em;color:var(--text);margin-bottom:.3em}.filecard .btn{margin-top:14px} diff --git a/internal/webapp/static/assets/index-Q_8ZOeQ7.js b/internal/webapp/static/assets/index-D7MxmRut.js similarity index 74% rename from internal/webapp/static/assets/index-Q_8ZOeQ7.js rename to internal/webapp/static/assets/index-D7MxmRut.js index e0c59b1..9c8a210 100644 --- a/internal/webapp/static/assets/index-Q_8ZOeQ7.js +++ b/internal/webapp/static/assets/index-D7MxmRut.js @@ -1,13 +1,13 @@ -function y2(e,n){for(var r=0;ri[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=r(o);fetch(o.href,l)}})();function bw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rh={exports:{}},Fo={};var lb;function b2(){if(lb)return Fo;lb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(i,o,l){var u=null;if(l!==void 0&&(u=""+l),o.key!==void 0&&(u=""+o.key),"key"in o){l={};for(var d in o)d!=="key"&&(l[d]=o[d])}else l=o;return o=l.ref,{$$typeof:e,type:i,key:u,ref:o!==void 0?o:null,props:l}}return Fo.Fragment=n,Fo.jsx=r,Fo.jsxs=r,Fo}var cb;function x2(){return cb||(cb=1,Rh.exports=b2()),Rh.exports}var f=x2(),jh={exports:{}},Pe={};var ub;function w2(){if(ub)return Pe;ub=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),b=Symbol.iterator;function x(z){return z===null||typeof z!="object"?null:(z=b&&z[b]||z["@@iterator"],typeof z=="function"?z:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,E={};function R(z,N,B){this.props=z,this.context=N,this.refs=E,this.updater=B||S}R.prototype.isReactComponent={},R.prototype.setState=function(z,N){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,N,"setState")},R.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function T(){}T.prototype=R.prototype;function O(z,N,B){this.props=z,this.context=N,this.refs=E,this.updater=B||S}var M=O.prototype=new T;M.constructor=O,_(M,R.prototype),M.isPureReactComponent=!0;var D=Array.isArray;function P(){}var F={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function ve(z,N,B){var J=B.ref;return{$$typeof:e,type:z,key:N,ref:J!==void 0?J:null,props:B}}function be(z,N){return ve(z.type,N,z.props)}function he(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function ue(z){var N={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(B){return N[B]})}var X=/\/+/g;function pe(z,N){return typeof z=="object"&&z!==null&&z.key!=null?ue(""+z.key):N.toString(36)}function ge(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(P,P):(z.status="pending",z.then(function(N){z.status==="pending"&&(z.status="fulfilled",z.value=N)},function(N){z.status==="pending"&&(z.status="rejected",z.reason=N)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function L(z,N,B,J,K){var le=typeof z;(le==="undefined"||le==="boolean")&&(z=null);var ae=!1;if(z===null)ae=!0;else switch(le){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(z.$$typeof){case e:case n:ae=!0;break;case y:return ae=z._init,L(ae(z._payload),N,B,J,K)}}if(ae)return K=K(z),ae=J===""?"."+pe(z,0):J,D(K)?(B="",ae!=null&&(B=ae.replace(X,"$&/")+"/"),L(K,N,B,"",function(Oe){return Oe})):K!=null&&(he(K)&&(K=be(K,B+(K.key==null||z&&z.key===K.key?"":(""+K.key).replace(X,"$&/")+"/")+ae)),N.push(K)),1;ae=0;var ye=J===""?".":J+":";if(D(z))for(var xe=0;xe>>1,ne=L[ee];if(0>>1;eeo(B,re))Jo(K,B)?(L[ee]=K,L[J]=re,ee=J):(L[ee]=B,L[N]=re,ee=N);else if(Jo(K,re))L[ee]=K,L[J]=re,ee=J;else break e}}return Z}function o(L,Z){var re=L.sortIndex-Z.sortIndex;return re!==0?re:L.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var p=[],m=[],y=1,v=null,b=3,x=!1,S=!1,_=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function M(L){for(var Z=r(m);Z!==null;){if(Z.callback===null)i(m);else if(Z.startTime<=L)i(m),Z.sortIndex=Z.expirationTime,n(p,Z);else break;Z=r(m)}}function D(L){if(_=!1,M(L),!S)if(r(p)!==null)S=!0,P||(P=!0,ue());else{var Z=r(m);Z!==null&&ge(D,Z.startTime-L)}}var P=!1,F=-1,V=5,ve=-1;function be(){return E?!0:!(e.unstable_now()-veL&&be());){var ee=v.callback;if(typeof ee=="function"){v.callback=null,b=v.priorityLevel;var ne=ee(v.expirationTime<=L);if(L=e.unstable_now(),typeof ne=="function"){v.callback=ne,M(L),Z=!0;break t}v===r(p)&&i(p),M(L)}else i(p);v=r(p)}if(v!==null)Z=!0;else{var z=r(m);z!==null&&ge(D,z.startTime-L),Z=!1}}break e}finally{v=null,b=re,x=!1}Z=void 0}}finally{Z?ue():P=!1}}}var ue;if(typeof O=="function")ue=function(){O(he)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,pe=X.port2;X.port1.onmessage=he,ue=function(){pe.postMessage(null)}}else ue=function(){R(he,0)};function ge(L,Z){F=R(function(){L(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125ee?(L.sortIndex=re,n(m,L),r(p)===null&&L===r(m)&&(_?(T(F),F=-1):_=!0,ge(D,re-ee))):(L.sortIndex=ne,n(p,L),S||x||(S=!0,P||(P=!0,ue()))),L},e.unstable_shouldYield=be,e.unstable_wrapCallback=function(L){var Z=b;return function(){var re=b;b=Z;try{return L.apply(this,arguments)}finally{b=re}}}})(Ah)),Ah}var hb;function _2(){return hb||(hb=1,Oh.exports=S2()),Oh.exports}var Mh={exports:{}},cn={};var mb;function C2(){if(mb)return cn;mb=1;var e=np();function n(p){var m="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Mh.exports=C2(),Mh.exports}var gb;function E2(){if(gb)return Vo;gb=1;var e=_2(),n=np(),r=xw();function i(t){var a="https://react.dev/errors/"+t;if(1ne||(t.current=ee[ne],ee[ne]=null,ne--)}function B(t,a){ne++,ee[ne]=t.current,t.current=a}var J=z(null),K=z(null),le=z(null),ae=z(null);function ye(t,a){switch(B(le,a),B(K,t),B(J,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?M0(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=M0(a),t=N0(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}N(J),B(J,t)}function xe(){N(J),N(K),N(le)}function Oe(t){t.memoizedState!==null&&B(ae,t);var a=J.current,s=N0(a,t.type);a!==s&&(B(K,t),B(J,s))}function Ie(t){K.current===t&&(N(J),N(K)),ae.current===t&&(N(ae),Lo._currentValue=re)}var Ve,it;function Qe(t){if(Ve===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Ve=a&&a[1]||"",it=-1i[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=r(o);fetch(o.href,l)}})();var Rh={exports:{}},Fo={};var lb;function w2(){if(lb)return Fo;lb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(i,o,l){var u=null;if(l!==void 0&&(u=""+l),o.key!==void 0&&(u=""+o.key),"key"in o){l={};for(var d in o)d!=="key"&&(l[d]=o[d])}else l=o;return o=l.ref,{$$typeof:e,type:i,key:u,ref:o!==void 0?o:null,props:l}}return Fo.Fragment=n,Fo.jsx=r,Fo.jsxs=r,Fo}var cb;function S2(){return cb||(cb=1,Rh.exports=w2()),Rh.exports}var f=S2(),jh={exports:{}},Pe={};var ub;function _2(){if(ub)return Pe;ub=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),b=Symbol.iterator;function x(z){return z===null||typeof z!="object"?null:(z=b&&z[b]||z["@@iterator"],typeof z=="function"?z:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,E={};function R(z,N,B){this.props=z,this.context=N,this.refs=E,this.updater=B||w}R.prototype.isReactComponent={},R.prototype.setState=function(z,N){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,N,"setState")},R.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function T(){}T.prototype=R.prototype;function O(z,N,B){this.props=z,this.context=N,this.refs=E,this.updater=B||w}var M=O.prototype=new T;M.constructor=O,_(M,R.prototype),M.isPureReactComponent=!0;var D=Array.isArray;function P(){}var F={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function ve(z,N,B){var J=B.ref;return{$$typeof:e,type:z,key:N,ref:J!==void 0?J:null,props:B}}function be(z,N){return ve(z.type,N,z.props)}function he(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function ue(z){var N={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(B){return N[B]})}var X=/\/+/g;function pe(z,N){return typeof z=="object"&&z!==null&&z.key!=null?ue(""+z.key):N.toString(36)}function ge(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(P,P):(z.status="pending",z.then(function(N){z.status==="pending"&&(z.status="fulfilled",z.value=N)},function(N){z.status==="pending"&&(z.status="rejected",z.reason=N)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function L(z,N,B,J,K){var le=typeof z;(le==="undefined"||le==="boolean")&&(z=null);var ae=!1;if(z===null)ae=!0;else switch(le){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(z.$$typeof){case e:case n:ae=!0;break;case y:return ae=z._init,L(ae(z._payload),N,B,J,K)}}if(ae)return K=K(z),ae=J===""?"."+pe(z,0):J,D(K)?(B="",ae!=null&&(B=ae.replace(X,"$&/")+"/"),L(K,N,B,"",function(Oe){return Oe})):K!=null&&(he(K)&&(K=be(K,B+(K.key==null||z&&z.key===K.key?"":(""+K.key).replace(X,"$&/")+"/")+ae)),N.push(K)),1;ae=0;var ye=J===""?".":J+":";if(D(z))for(var xe=0;xe>>1,ne=L[ee];if(0>>1;eeo(B,re))Jo(K,B)?(L[ee]=K,L[J]=re,ee=J):(L[ee]=B,L[N]=re,ee=N);else if(Jo(K,re))L[ee]=K,L[J]=re,ee=J;else break e}}return Z}function o(L,Z){var re=L.sortIndex-Z.sortIndex;return re!==0?re:L.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var p=[],m=[],y=1,v=null,b=3,x=!1,w=!1,_=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function M(L){for(var Z=r(m);Z!==null;){if(Z.callback===null)i(m);else if(Z.startTime<=L)i(m),Z.sortIndex=Z.expirationTime,n(p,Z);else break;Z=r(m)}}function D(L){if(_=!1,M(L),!w)if(r(p)!==null)w=!0,P||(P=!0,ue());else{var Z=r(m);Z!==null&&ge(D,Z.startTime-L)}}var P=!1,F=-1,V=5,ve=-1;function be(){return E?!0:!(e.unstable_now()-veL&&be());){var ee=v.callback;if(typeof ee=="function"){v.callback=null,b=v.priorityLevel;var ne=ee(v.expirationTime<=L);if(L=e.unstable_now(),typeof ne=="function"){v.callback=ne,M(L),Z=!0;break t}v===r(p)&&i(p),M(L)}else i(p);v=r(p)}if(v!==null)Z=!0;else{var z=r(m);z!==null&&ge(D,z.startTime-L),Z=!1}}break e}finally{v=null,b=re,x=!1}Z=void 0}}finally{Z?ue():P=!1}}}var ue;if(typeof O=="function")ue=function(){O(he)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,pe=X.port2;X.port1.onmessage=he,ue=function(){pe.postMessage(null)}}else ue=function(){R(he,0)};function ge(L,Z){F=R(function(){L(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125ee?(L.sortIndex=re,n(m,L),r(p)===null&&L===r(m)&&(_?(T(F),F=-1):_=!0,ge(D,re-ee))):(L.sortIndex=ne,n(p,L),w||x||(w=!0,P||(P=!0,ue()))),L},e.unstable_shouldYield=be,e.unstable_wrapCallback=function(L){var Z=b;return function(){var re=b;b=Z;try{return L.apply(this,arguments)}finally{b=re}}}})(Ah)),Ah}var hb;function E2(){return hb||(hb=1,Oh.exports=C2()),Oh.exports}var Mh={exports:{}},cn={};var mb;function R2(){if(mb)return cn;mb=1;var e=np();function n(p){var m="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Mh.exports=R2(),Mh.exports}var gb;function j2(){if(gb)return Vo;gb=1;var e=E2(),n=np(),r=xw();function i(t){var a="https://react.dev/errors/"+t;if(1ne||(t.current=ee[ne],ee[ne]=null,ne--)}function B(t,a){ne++,ee[ne]=t.current,t.current=a}var J=z(null),K=z(null),le=z(null),ae=z(null);function ye(t,a){switch(B(le,a),B(K,t),B(J,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?M0(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=M0(a),t=N0(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}N(J),B(J,t)}function xe(){N(J),N(K),N(le)}function Oe(t){t.memoizedState!==null&&B(ae,t);var a=J.current,s=N0(a,t.type);a!==s&&(B(K,t),B(J,s))}function Ie(t){K.current===t&&(N(J),N(K)),ae.current===t&&(N(ae),Lo._currentValue=re)}var Ve,it;function Qe(t){if(Ve===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Ve=a&&a[1]||"",it=-1)":-1h||k[c]!==G[h]){var ie=` `+k[c].replace(" at new "," at ");return t.displayName&&ie.includes("")&&(ie=ie.replace("",t.displayName)),ie}while(1<=c&&0<=h);break}}}finally{fn=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Qe(s):""}function Qt(t,a){switch(t.tag){case 26:case 27:case 5:return Qe(t.type);case 16:return Qe("Lazy");case 13:return t.child!==a&&a!==null?Qe("Suspense Fallback"):Qe("Suspense");case 19:return Qe("SuspenseList");case 0:case 15:return hn(t.type,!1);case 11:return hn(t.type.render,!1);case 1:return hn(t.type,!0);case 31:return Qe("Activity");default:return""}}function br(t){try{var a="",s=null;do a+=Qt(t,s),s=t,t=t.return;while(t);return a}catch(c){return` Error generating stack: `+c.message+` -`+c.stack}}var jt=Object.prototype.hasOwnProperty,rr=e.unstable_scheduleCallback,xr=e.unstable_cancelCallback,Tt=e.unstable_shouldYield,Vn=e.unstable_requestPaint,Dt=e.unstable_now,kr=e.unstable_getCurrentPriorityLevel,ar=e.unstable_ImmediatePriority,ir=e.unstable_UserBlockingPriority,wr=e.unstable_NormalPriority,sr=e.unstable_LowPriority,mn=e.unstable_IdlePriority,A=e.log,I=e.unstable_setDisableYieldValue,U=null,ce=null;function Y(t){if(typeof A=="function"&&I(t),ce&&typeof ce.setStrictMode=="function")try{ce.setStrictMode(U,t)}catch{}}var W=Math.clz32?Math.clz32:_e,de=Math.log,we=Math.LN2;function _e(t){return t>>>=0,t===0?32:31-(de(t)/we|0)|0}var Xe=256,wt=262144,Xt=4194304;function zt(t){var a=t&42;if(a!==0)return a;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ne(t,a,s){var c=t.pendingLanes;if(c===0)return 0;var h=0,g=t.suspendedLanes,C=t.pingedLanes;t=t.warmLanes;var j=c&134217727;return j!==0?(c=j&~g,c!==0?h=zt(c):(C&=j,C!==0?h=zt(C):s||(s=j&~t,s!==0&&(h=zt(s))))):(j=c&~g,j!==0?h=zt(j):C!==0?h=zt(C):s||(s=c&~t,s!==0&&(h=zt(s)))),h===0?0:a!==0&&a!==h&&(a&g)===0&&(g=h&-h,s=a&-a,g>=s||g===32&&(s&4194048)!==0)?a:h}function ht(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function yt(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qt(){var t=Xt;return Xt<<=1,(Xt&62914560)===0&&(Xt=4194304),t}function or(t){for(var a=[],s=0;31>s;s++)a.push(t);return a}function St(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function yn(t,a,s,c,h,g){var C=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var j=t.entanglements,k=t.expirationTimes,G=t.hiddenUpdates;for(s=C&~s;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var fE=/[\n"\\]/g;function Hn(t){return t.replace(fE,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function bd(t,a,s,c,h,g,C,j){t.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.type=C:t.removeAttribute("type"),a!=null?C==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+Un(a)):t.value!==""+Un(a)&&(t.value=""+Un(a)):C!=="submit"&&C!=="reset"||t.removeAttribute("value"),a!=null?xd(t,C,Un(a)):s!=null?xd(t,C,Un(s)):c!=null&&t.removeAttribute("value"),h==null&&g!=null&&(t.defaultChecked=!!g),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?t.name=""+Un(j):t.removeAttribute("name")}function Eg(t,a,s,c,h,g,C,j){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.type=g),a!=null||s!=null){if(!(g!=="submit"&&g!=="reset"||a!=null)){yd(t);return}s=s!=null?""+Un(s):"",a=a!=null?""+Un(a):s,j||a===t.value||(t.value=a),t.defaultValue=a}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=j?t.checked:!!c,t.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(t.name=C),yd(t)}function xd(t,a,s){a==="number"&&Al(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function Hi(t,a,s,c){if(t=t.options,a){a={};for(var h=0;h"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ed=!1;if(Ir)try{var Ws={};Object.defineProperty(Ws,"passive",{get:function(){Ed=!0}}),window.addEventListener("test",Ws,Ws),window.removeEventListener("test",Ws,Ws)}catch{Ed=!1}var la=null,Rd=null,Nl=null;function Ng(){if(Nl)return Nl;var t,a=Rd,s=a.length,c,h="value"in la?la.value:la.textContent,g=h.length;for(t=0;t=no),Ig=" ",Pg=!1;function Fg(t,a){switch(t){case"keyup":return FE.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Zi=!1;function UE(t,a){switch(t){case"compositionend":return Vg(a);case"keypress":return a.which!==32?null:(Pg=!0,Ig);case"textInput":return t=a.data,t===Ig&&Pg?null:t;default:return null}}function HE(t,a){if(Zi)return t==="compositionend"||!Md&&Fg(t,a)?(t=Ng(),Nl=Rd=la=null,Zi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:s,offset:a-t};t=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Yg(s)}}function Xg(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?Xg(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function Jg(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=Al(t.document);a instanceof t.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)t=a.contentWindow;else break;a=Al(t.document)}return a}function zd(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}var XE=Ir&&"documentMode"in document&&11>=document.documentMode,Ki=null,kd=null,so=null,Ld=!1;function Wg(t,a,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Ld||Ki==null||Ki!==Al(c)||(c=Ki,"selectionStart"in c&&zd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),so&&io(so,c)||(so=c,c=Ec(kd,"onSelect"),0>=C,h-=C,Sr=1<<32-W(a)+h|s<Ue?(Ze=Te,Te=null):Ze=Te.sibling;var et=Q(H,Te,q[Ue],se);if(et===null){Te===null&&(Te=Ze);break}t&&Te&&et.alternate===null&&a(H,Te),$=g(et,$,Ue),We===null?Ae=et:We.sibling=et,We=et,Te=Ze}if(Ue===q.length)return s(H,Te),Ye&&Fr(H,Ue),Ae;if(Te===null){for(;UeUe?(Ze=Te,Te=null):Ze=Te.sibling;var Aa=Q(H,Te,et.value,se);if(Aa===null){Te===null&&(Te=Ze);break}t&&Te&&Aa.alternate===null&&a(H,Te),$=g(Aa,$,Ue),We===null?Ae=Aa:We.sibling=Aa,We=Aa,Te=Ze}if(et.done)return s(H,Te),Ye&&Fr(H,Ue),Ae;if(Te===null){for(;!et.done;Ue++,et=q.next())et=oe(H,et.value,se),et!==null&&($=g(et,$,Ue),We===null?Ae=et:We.sibling=et,We=et);return Ye&&Fr(H,Ue),Ae}for(Te=c(Te);!et.done;Ue++,et=q.next())et=te(Te,H,Ue,et.value,se),et!==null&&(t&&et.alternate!==null&&Te.delete(et.key===null?Ue:et.key),$=g(et,$,Ue),We===null?Ae=et:We.sibling=et,We=et);return t&&Te.forEach(function(v2){return a(H,v2)}),Ye&&Fr(H,Ue),Ae}function lt(H,$,q,se){if(typeof q=="object"&&q!==null&&q.type===_&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case x:e:{for(var Ae=q.key;$!==null;){if($.key===Ae){if(Ae=q.type,Ae===_){if($.tag===7){s(H,$.sibling),se=h($,q.props.children),se.return=H,H=se;break e}}else if($.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===V&&ui(Ae)===$.type){s(H,$.sibling),se=h($,q.props),ho(se,q),se.return=H,H=se;break e}s(H,$);break}else a(H,$);$=$.sibling}q.type===_?(se=ii(q.props.children,H.mode,se,q.key),se.return=H,H=se):(se=Ul(q.type,q.key,q.props,null,H.mode,se),ho(se,q),se.return=H,H=se)}return C(H);case S:e:{for(Ae=q.key;$!==null;){if($.key===Ae)if($.tag===4&&$.stateNode.containerInfo===q.containerInfo&&$.stateNode.implementation===q.implementation){s(H,$.sibling),se=h($,q.children||[]),se.return=H,H=se;break e}else{s(H,$);break}else a(H,$);$=$.sibling}se=Hd(q,H.mode,se),se.return=H,H=se}return C(H);case V:return q=ui(q),lt(H,$,q,se)}if(ge(q))return Re(H,$,q,se);if(ue(q)){if(Ae=ue(q),typeof Ae!="function")throw Error(i(150));return q=Ae.call(q),De(H,$,q,se)}if(typeof q.then=="function")return lt(H,$,Yl(q),se);if(q.$$typeof===O)return lt(H,$,ql(H,q),se);Ql(H,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,$!==null&&$.tag===6?(s(H,$.sibling),se=h($,q),se.return=H,H=se):(s(H,$),se=Ud(q,H.mode,se),se.return=H,H=se),C(H)):s(H,$)}return function(H,$,q,se){try{fo=0;var Ae=lt(H,$,q,se);return is=null,Ae}catch(Te){if(Te===as||Te===Zl)throw Te;var We=Nn(29,Te,null,H.mode);return We.lanes=se,We.return=H,We}}}var fi=Sv(!0),_v=Sv(!1),ha=!1;function tf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nf(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ma(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function pa(t,a,s){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(tt&2)!==0){var h=c.pending;return h===null?a.next=a:(a.next=h.next,h.next=a),c.pending=a,a=Vl(t),sv(t,null,s),a}return Fl(t,c,a,s),Vl(t)}function mo(t,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var c=a.lanes;c&=t.pendingLanes,s|=c,a.lanes=s,bn(t,s)}}function rf(t,a){var s=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var h=null,g=null;if(s=s.firstBaseUpdate,s!==null){do{var C={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};g===null?h=g=C:g=g.next=C,s=s.next}while(s!==null);g===null?h=g=a:g=g.next=a}else h=g=a;s={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:c.shared,callbacks:c.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=a:t.next=a,s.lastBaseUpdate=a}var af=!1;function po(){if(af){var t=rs;if(t!==null)throw t}}function go(t,a,s,c){af=!1;var h=t.updateQueue;ha=!1;var g=h.firstBaseUpdate,C=h.lastBaseUpdate,j=h.shared.pending;if(j!==null){h.shared.pending=null;var k=j,G=k.next;k.next=null,C===null?g=G:C.next=G,C=k;var ie=t.alternate;ie!==null&&(ie=ie.updateQueue,j=ie.lastBaseUpdate,j!==C&&(j===null?ie.firstBaseUpdate=G:j.next=G,ie.lastBaseUpdate=k))}if(g!==null){var oe=h.baseState;C=0,ie=G=k=null,j=g;do{var Q=j.lane&-536870913,te=Q!==j.lane;if(te?(Ge&Q)===Q:(c&Q)===Q){Q!==0&&Q===ns&&(af=!0),ie!==null&&(ie=ie.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var Re=t,De=j;Q=a;var lt=s;switch(De.tag){case 1:if(Re=De.payload,typeof Re=="function"){oe=Re.call(lt,oe,Q);break e}oe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=De.payload,Q=typeof Re=="function"?Re.call(lt,oe,Q):Re,Q==null)break e;oe=v({},oe,Q);break e;case 2:ha=!0}}Q=j.callback,Q!==null&&(t.flags|=64,te&&(t.flags|=8192),te=h.callbacks,te===null?h.callbacks=[Q]:te.push(Q))}else te={lane:Q,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ie===null?(G=ie=te,k=oe):ie=ie.next=te,C|=Q;if(j=j.next,j===null){if(j=h.shared.pending,j===null)break;te=j,j=te.next,te.next=null,h.lastBaseUpdate=te,h.shared.pending=null}}while(!0);ie===null&&(k=oe),h.baseState=k,h.firstBaseUpdate=G,h.lastBaseUpdate=ie,g===null&&(h.shared.lanes=0),xa|=C,t.lanes=C,t.memoizedState=oe}}function Cv(t,a){if(typeof t!="function")throw Error(i(191,t));t.call(a)}function Ev(t,a){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;tg?g:8;var C=L.T,j={};L.T=j,Cf(t,!1,a,s);try{var k=h(),G=L.S;if(G!==null&&G(j,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var ie=sR(k,c);bo(t,a,ie,$n(t))}else bo(t,a,c,$n(t))}catch(oe){bo(t,a,{then:function(){},status:"rejected",reason:oe},$n())}finally{Z.p=g,C!==null&&j.types!==null&&(C.types=j.types),L.T=C}}function fR(){}function Sf(t,a,s,c){if(t.tag!==5)throw Error(i(476));var h=ry(t).queue;ny(t,h,a,re,s===null?fR:function(){return ay(t),s(c)})}function ry(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Br,lastRenderedState:re},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Br,lastRenderedState:s},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function ay(t){var a=ry(t);a.next===null&&(a=t.alternate.memoizedState),bo(t,a.next.queue,{},$n())}function _f(){return en(Lo)}function iy(){return At().memoizedState}function sy(){return At().memoizedState}function hR(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var s=$n();t=ma(s);var c=pa(a,t,s);c!==null&&(jn(c,a,s),mo(c,a,s)),a={cache:Xd()},t.payload=a;return}a=a.return}}function mR(t,a,s){var c=$n();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},sc(t)?ly(a,s):(s=Fd(t,a,s,c),s!==null&&(jn(s,t,c),cy(s,a,c)))}function oy(t,a,s){var c=$n();bo(t,a,s,c)}function bo(t,a,s,c){var h={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(sc(t))ly(a,h);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=a.lastRenderedReducer,g!==null))try{var C=a.lastRenderedState,j=g(C,s);if(h.hasEagerState=!0,h.eagerState=j,Mn(j,C))return Fl(t,a,h,0),ft===null&&Pl(),!1}catch{}if(s=Fd(t,a,h,c),s!==null)return jn(s,t,c),cy(s,a,c),!0}return!1}function Cf(t,a,s,c){if(c={lane:2,revertLane:nh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},sc(t)){if(a)throw Error(i(479))}else a=Fd(t,s,c,2),a!==null&&jn(a,t,2)}function sc(t){var a=t.alternate;return t===Fe||a!==null&&a===Fe}function ly(t,a){os=Wl=!0;var s=t.pending;s===null?a.next=a:(a.next=s.next,s.next=a),t.pending=a}function cy(t,a,s){if((s&4194048)!==0){var c=a.lanes;c&=t.pendingLanes,s|=c,a.lanes=s,bn(t,s)}}var xo={readContext:en,use:nc,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};xo.useEffectEvent=Ct;var uy={readContext:en,use:nc,useCallback:function(t,a){return pn().memoizedState=[t,a===void 0?null:a],t},useContext:en,useEffect:Zv,useImperativeHandle:function(t,a,s){s=s!=null?s.concat([t]):null,ac(4194308,4,Xv.bind(null,a,t),s)},useLayoutEffect:function(t,a){return ac(4194308,4,t,a)},useInsertionEffect:function(t,a){ac(4,2,t,a)},useMemo:function(t,a){var s=pn();a=a===void 0?null:a;var c=t();if(hi){Y(!0);try{t()}finally{Y(!1)}}return s.memoizedState=[c,a],c},useReducer:function(t,a,s){var c=pn();if(s!==void 0){var h=s(a);if(hi){Y(!0);try{s(a)}finally{Y(!1)}}}else h=a;return c.memoizedState=c.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},c.queue=t,t=t.dispatch=mR.bind(null,Fe,t),[c.memoizedState,t]},useRef:function(t){var a=pn();return t={current:t},a.memoizedState=t},useState:function(t){t=vf(t);var a=t.queue,s=oy.bind(null,Fe,a);return a.dispatch=s,[t.memoizedState,s]},useDebugValue:xf,useDeferredValue:function(t,a){var s=pn();return wf(s,t,a)},useTransition:function(){var t=vf(!1);return t=ny.bind(null,Fe,t.queue,!0,!1),pn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,s){var c=Fe,h=pn();if(Ye){if(s===void 0)throw Error(i(407));s=s()}else{if(s=a(),ft===null)throw Error(i(349));(Ge&127)!==0||Mv(c,a,s)}h.memoizedState=s;var g={value:s,getSnapshot:a};return h.queue=g,Zv(Dv.bind(null,c,g,t),[t]),c.flags|=2048,cs(9,{destroy:void 0},Nv.bind(null,c,g,s,a),null),s},useId:function(){var t=pn(),a=ft.identifierPrefix;if(Ye){var s=_r,c=Sr;s=(c&~(1<<32-W(c)-1)).toString(32)+s,a="_"+a+"R_"+s,s=ec++,0<\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof c.is=="string"?C.createElement("select",{is:c.is}):C.createElement("select"),c.multiple?g.multiple=!0:c.size&&(g.size=c.size);break;default:g=typeof c.is=="string"?C.createElement(h,{is:c.is}):C.createElement(h)}}g[Jt]=a,g[wn]=c;e:for(C=a.child;C!==null;){if(C.tag===5||C.tag===6)g.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===a)break e;for(;C.sibling===null;){if(C.return===null||C.return===a)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}a.stateNode=g;e:switch(nn(g,h,c),h){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Gr(a)}}return pt(a),If(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,s),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==c&&Gr(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(i(166));if(t=le.current,es(a)){if(t=a.stateNode,s=a.memoizedProps,c=null,h=Wt,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}t[Jt]=a,t=!!(t.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||O0(t.nodeValue,s)),t||da(a,!0)}else t=Rc(t).createTextNode(c),t[Jt]=a,a.stateNode=t}return pt(a),null;case 31:if(s=a.memoizedState,t===null||t.memoizedState!==null){if(c=es(a),s!==null){if(t===null){if(!c)throw Error(i(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(557));t[Jt]=a}else si(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;pt(a),t=!1}else s=Zd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return a.flags&256?(zn(a),a):(zn(a),null);if((a.flags&128)!==0)throw Error(i(558))}return pt(a),null;case 13:if(c=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=es(a),c!==null&&c.dehydrated!==null){if(t===null){if(!h)throw Error(i(318));if(h=a.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(i(317));h[Jt]=a}else si(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;pt(a),h=!1}else h=Zd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return a.flags&256?(zn(a),a):(zn(a),null)}return zn(a),(a.flags&128)!==0?(a.lanes=s,a):(s=c!==null,t=t!==null&&t.memoizedState!==null,s&&(c=a.child,h=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(h=c.alternate.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==h&&(c.flags|=2048)),s!==t&&s&&(a.child.flags|=8192),dc(a,a.updateQueue),pt(a),null);case 4:return xe(),t===null&&sh(a.stateNode.containerInfo),pt(a),null;case 10:return Ur(a.type),pt(a),null;case 19:if(N(Ot),c=a.memoizedState,c===null)return pt(a),null;if(h=(a.flags&128)!==0,g=c.rendering,g===null)if(h)So(c,!1);else{if(Et!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(g=Jl(t),g!==null){for(a.flags|=128,So(c,!1),t=g.updateQueue,a.updateQueue=t,dc(a,t),a.subtreeFlags=0,t=s,s=a.child;s!==null;)ov(s,t),s=s.sibling;return B(Ot,Ot.current&1|2),Ye&&Fr(a,c.treeForkCount),a.child}t=t.sibling}c.tail!==null&&Dt()>gc&&(a.flags|=128,h=!0,So(c,!1),a.lanes=4194304)}else{if(!h)if(t=Jl(g),t!==null){if(a.flags|=128,h=!0,t=t.updateQueue,a.updateQueue=t,dc(a,t),So(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!Ye)return pt(a),null}else 2*Dt()-c.renderingStartTime>gc&&s!==536870912&&(a.flags|=128,h=!0,So(c,!1),a.lanes=4194304);c.isBackwards?(g.sibling=a.child,a.child=g):(t=c.last,t!==null?t.sibling=g:a.child=g,c.last=g)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Dt(),t.sibling=null,s=Ot.current,B(Ot,h?s&1|2:s&1),Ye&&Fr(a,c.treeForkCount),t):(pt(a),null);case 22:case 23:return zn(a),of(),c=a.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(s&536870912)!==0&&(a.flags&128)===0&&(pt(a),a.subtreeFlags&6&&(a.flags|=8192)):pt(a),s=a.updateQueue,s!==null&&dc(a,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048),t!==null&&N(ci),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Ur(kt),pt(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function bR(t,a){switch(qd(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return Ur(kt),xe(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return Ie(a),null;case 31:if(a.memoizedState!==null){if(zn(a),a.alternate===null)throw Error(i(340));si()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(zn(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(i(340));si()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return N(Ot),null;case 4:return xe(),null;case 10:return Ur(a.type),null;case 22:case 23:return zn(a),of(),t!==null&&N(ci),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return Ur(kt),null;case 25:return null;default:return null}}function zy(t,a){switch(qd(a),a.tag){case 3:Ur(kt),xe();break;case 26:case 27:case 5:Ie(a);break;case 4:xe();break;case 31:a.memoizedState!==null&&zn(a);break;case 13:zn(a);break;case 19:N(Ot);break;case 10:Ur(a.type);break;case 22:case 23:zn(a),of(),t!==null&&N(ci);break;case 24:Ur(kt)}}function _o(t,a){try{var s=a.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var h=c.next;s=h;do{if((s.tag&t)===t){c=void 0;var g=s.create,C=s.inst;c=g(),C.destroy=c}s=s.next}while(s!==h)}}catch(j){at(a,a.return,j)}}function ya(t,a,s){try{var c=a.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var g=h.next;c=g;do{if((c.tag&t)===t){var C=c.inst,j=C.destroy;if(j!==void 0){C.destroy=void 0,h=a;var k=s,G=j;try{G()}catch(ie){at(h,k,ie)}}}c=c.next}while(c!==g)}}catch(ie){at(a,a.return,ie)}}function ky(t){var a=t.updateQueue;if(a!==null){var s=t.stateNode;try{Ev(a,s)}catch(c){at(t,t.return,c)}}}function Ly(t,a,s){s.props=mi(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(c){at(t,a,c)}}function Co(t,a){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof s=="function"?t.refCleanup=s(c):s.current=c}}catch(h){at(t,a,h)}}function Cr(t,a){var s=t.ref,c=t.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(h){at(t,a,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(h){at(t,a,h)}else s.current=null}function $y(t){var a=t.type,s=t.memoizedProps,c=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(h){at(t,t.return,h)}}function Pf(t,a,s){try{var c=t.stateNode;VR(c,t.type,s,a),c[wn]=a}catch(h){at(t,t.return,h)}}function Iy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ea(t.type)||t.tag===4}function Ff(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Iy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Ea(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Vf(t,a,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(t),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=$r));else if(c!==4&&(c===27&&Ea(t.type)&&(s=t.stateNode,a=null),t=t.child,t!==null))for(Vf(t,a,s),t=t.sibling;t!==null;)Vf(t,a,s),t=t.sibling}function fc(t,a,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,a?s.insertBefore(t,a):s.appendChild(t);else if(c!==4&&(c===27&&Ea(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(fc(t,a,s),t=t.sibling;t!==null;)fc(t,a,s),t=t.sibling}function Py(t){var a=t.stateNode,s=t.memoizedProps;try{for(var c=t.type,h=a.attributes;h.length;)a.removeAttributeNode(h[0]);nn(a,c,s),a[Jt]=t,a[wn]=s}catch(g){at(t,t.return,g)}}var Zr=!1,It=!1,Uf=!1,Fy=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function xR(t,a){if(t=t.containerInfo,ch=Dc,t=Jg(t),zd(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var h=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{s.nodeType,g.nodeType}catch{s=null;break e}var C=0,j=-1,k=-1,G=0,ie=0,oe=t,Q=null;t:for(;;){for(var te;oe!==s||h!==0&&oe.nodeType!==3||(j=C+h),oe!==g||c!==0&&oe.nodeType!==3||(k=C+c),oe.nodeType===3&&(C+=oe.nodeValue.length),(te=oe.firstChild)!==null;)Q=oe,oe=te;for(;;){if(oe===t)break t;if(Q===s&&++G===h&&(j=C),Q===g&&++ie===c&&(k=C),(te=oe.nextSibling)!==null)break;oe=Q,Q=oe.parentNode}oe=te}s=j===-1||k===-1?null:{start:j,end:k}}else s=null}s=s||{start:0,end:0}}else s=null;for(uh={focusedElem:t,selectionRange:s},Dc=!1,Zt=a;Zt!==null;)if(a=Zt,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,Zt=t;else for(;Zt!==null;){switch(a=Zt,g=a.alternate,t=a.flags,a.tag){case 0:if((t&4)!==0&&(t=a.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s title"))),nn(g,c,s),g[Jt]=t,Gt(g),c=g;break e;case"link":var C=G0("link","href",h).get(c+(s.href||""));if(C){for(var j=0;jlt&&(C=lt,lt=De,De=C);var H=Qg(j,De),$=Qg(j,lt);if(H&&$&&(te.rangeCount!==1||te.anchorNode!==H.node||te.anchorOffset!==H.offset||te.focusNode!==$.node||te.focusOffset!==$.offset)){var q=oe.createRange();q.setStart(H.node,H.offset),te.removeAllRanges(),De>lt?(te.addRange(q),te.extend($.node,$.offset)):(q.setEnd($.node,$.offset),te.addRange(q))}}}}for(oe=[],te=j;te=te.parentNode;)te.nodeType===1&&oe.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;js?32:s,L.T=null,s=Yf,Yf=null;var g=Sa,C=Jr;if(Ut=0,ms=Sa=null,Jr=0,(tt&6)!==0)throw Error(i(331));var j=tt;if(tt|=4,Xy(g.current),Ky(g,g.current,C,s),tt=j,Ao(0,!1),ce&&typeof ce.onPostCommitFiberRoot=="function")try{ce.onPostCommitFiberRoot(U,g)}catch{}return!0}finally{Z.p=h,L.T=c,p0(t,a)}}function v0(t,a,s){a=qn(s,a),a=Tf(t.stateNode,a,2),t=pa(t,a,2),t!==null&&(St(t,2),Er(t))}function at(t,a,s){if(t.tag===3)v0(t,t,s);else for(;a!==null;){if(a.tag===3){v0(a,t,s);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(wa===null||!wa.has(c))){t=qn(s,t),s=yy(2),c=pa(a,s,2),c!==null&&(by(s,c,a,t),St(c,2),Er(c));break}}a=a.return}}function Wf(t,a,s){var c=t.pingCache;if(c===null){c=t.pingCache=new _R;var h=new Set;c.set(a,h)}else h=c.get(a),h===void 0&&(h=new Set,c.set(a,h));h.has(s)||(qf=!0,h.add(s),t=TR.bind(null,t,a,s),a.then(t,t))}function TR(t,a,s){var c=t.pingCache;c!==null&&c.delete(a),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,ft===t&&(Ge&s)===s&&(Et===4||Et===3&&(Ge&62914560)===Ge&&300>Dt()-pc?(tt&2)===0&&ps(t,0):Gf|=s,hs===Ge&&(hs=0)),Er(t)}function y0(t,a){a===0&&(a=qt()),t=ai(t,a),t!==null&&(St(t,a),Er(t))}function OR(t){var a=t.memoizedState,s=0;a!==null&&(s=a.retryLane),y0(t,s)}function AR(t,a){var s=0;switch(t.tag){case 31:case 13:var c=t.stateNode,h=t.memoizedState;h!==null&&(s=h.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(a),y0(t,s)}function MR(t,a){return rr(t,a)}var Sc=null,vs=null,eh=!1,_c=!1,th=!1,Ca=0;function Er(t){t!==vs&&t.next===null&&(vs===null?Sc=vs=t:vs=vs.next=t),_c=!0,eh||(eh=!0,DR())}function Ao(t,a){if(!th&&_c){th=!0;do for(var s=!1,c=Sc;c!==null;){if(t!==0){var h=c.pendingLanes;if(h===0)var g=0;else{var C=c.suspendedLanes,j=c.pingedLanes;g=(1<<31-W(42|t)+1)-1,g&=h&~(C&~j),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(s=!0,S0(c,g))}else g=Ge,g=Ne(c,c===ft?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||ht(c,g)||(s=!0,S0(c,g));c=c.next}while(s);th=!1}}function NR(){b0()}function b0(){_c=eh=!1;var t=0;Ca!==0&&HR()&&(t=Ca);for(var a=Dt(),s=null,c=Sc;c!==null;){var h=c.next,g=x0(c,a);g===0?(c.next=null,s===null?Sc=h:s.next=h,h===null&&(vs=s)):(s=c,(t!==0||(g&3)!==0)&&(_c=!0)),c=h}Ut!==0&&Ut!==5||Ao(t),Ca!==0&&(Ca=0)}function x0(t,a){for(var s=t.suspendedLanes,c=t.pingedLanes,h=t.expirationTimes,g=t.pendingLanes&-62914561;0j)break;var ie=k.transferSize,oe=k.initiatorType;ie&&A0(oe)&&(k=k.responseEnd,C+=ie*(k"u"?null:document;function U0(t,a,s){var c=ys;if(c&&typeof a=="string"&&a){var h=Hn(a);h='link[rel="'+t+'"][href="'+h+'"]',typeof s=="string"&&(h+='[crossorigin="'+s+'"]'),V0.has(h)||(V0.add(h),t={rel:t,crossOrigin:s,href:a},c.querySelector(h)===null&&(a=c.createElement("link"),nn(a,"link",t),Gt(a),c.head.appendChild(a)))}}function JR(t){Wr.D(t),U0("dns-prefetch",t,null)}function WR(t,a){Wr.C(t,a),U0("preconnect",t,a)}function e2(t,a,s){Wr.L(t,a,s);var c=ys;if(c&&t&&a){var h='link[rel="preload"][as="'+Hn(a)+'"]';a==="image"&&s&&s.imageSrcSet?(h+='[imagesrcset="'+Hn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(h+='[imagesizes="'+Hn(s.imageSizes)+'"]')):h+='[href="'+Hn(t)+'"]';var g=h;switch(a){case"style":g=bs(t);break;case"script":g=xs(t)}Xn.has(g)||(t=v({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:t,as:a},s),Xn.set(g,t),c.querySelector(h)!==null||a==="style"&&c.querySelector(zo(g))||a==="script"&&c.querySelector(ko(g))||(a=c.createElement("link"),nn(a,"link",t),Gt(a),c.head.appendChild(a)))}}function t2(t,a){Wr.m(t,a);var s=ys;if(s&&t){var c=a&&typeof a.as=="string"?a.as:"script",h='link[rel="modulepreload"][as="'+Hn(c)+'"][href="'+Hn(t)+'"]',g=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=xs(t)}if(!Xn.has(g)&&(t=v({rel:"modulepreload",href:t},a),Xn.set(g,t),s.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ko(g)))return}c=s.createElement("link"),nn(c,"link",t),Gt(c),s.head.appendChild(c)}}}function n2(t,a,s){Wr.S(t,a,s);var c=ys;if(c&&t){var h=Vi(c).hoistableStyles,g=bs(t);a=a||"default";var C=h.get(g);if(!C){var j={loading:0,preload:null};if(C=c.querySelector(zo(g)))j.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":a},s),(s=Xn.get(g))&&vh(t,s);var k=C=c.createElement("link");Gt(k),nn(k,"link",t),k._p=new Promise(function(G,ie){k.onload=G,k.onerror=ie}),k.addEventListener("load",function(){j.loading|=1}),k.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Tc(C,a,c)}C={type:"stylesheet",instance:C,count:1,state:j},h.set(g,C)}}}function r2(t,a){Wr.X(t,a);var s=ys;if(s&&t){var c=Vi(s).hoistableScripts,h=xs(t),g=c.get(h);g||(g=s.querySelector(ko(h)),g||(t=v({src:t,async:!0},a),(a=Xn.get(h))&&yh(t,a),g=s.createElement("script"),Gt(g),nn(g,"link",t),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function a2(t,a){Wr.M(t,a);var s=ys;if(s&&t){var c=Vi(s).hoistableScripts,h=xs(t),g=c.get(h);g||(g=s.querySelector(ko(h)),g||(t=v({src:t,async:!0,type:"module"},a),(a=Xn.get(h))&&yh(t,a),g=s.createElement("script"),Gt(g),nn(g,"link",t),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function H0(t,a,s,c){var h=(h=le.current)?jc(h):null;if(!h)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=bs(s.href),s=Vi(h).hoistableStyles,c=s.get(a),c||(c={type:"style",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=bs(s.href);var g=Vi(h).hoistableStyles,C=g.get(t);if(C||(h=h.ownerDocument||h,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(t,C),(g=h.querySelector(zo(t)))&&!g._p&&(C.instance=g,C.state.loading=5),Xn.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Xn.set(t,s),g||i2(h,t,s,C.state))),a&&c===null)throw Error(i(528,""));return C}if(a&&c!==null)throw Error(i(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=xs(s),s=Vi(h).hoistableScripts,c=s.get(a),c||(c={type:"script",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function bs(t){return'href="'+Hn(t)+'"'}function zo(t){return'link[rel="stylesheet"]['+t+"]"}function B0(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function i2(t,a,s,c){t.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=t.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),nn(a,"link",s),Gt(a),t.head.appendChild(a))}function xs(t){return'[src="'+Hn(t)+'"]'}function ko(t){return"script[async]"+t}function q0(t,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var c=t.querySelector('style[data-href~="'+Hn(s.href)+'"]');if(c)return a.instance=c,Gt(c),c;var h=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),Gt(c),nn(c,"style",h),Tc(c,s.precedence,t),a.instance=c;case"stylesheet":h=bs(s.href);var g=t.querySelector(zo(h));if(g)return a.state.loading|=4,a.instance=g,Gt(g),g;c=B0(s),(h=Xn.get(h))&&vh(c,h),g=(t.ownerDocument||t).createElement("link"),Gt(g);var C=g;return C._p=new Promise(function(j,k){C.onload=j,C.onerror=k}),nn(g,"link",c),a.state.loading|=4,Tc(g,s.precedence,t),a.instance=g;case"script":return g=xs(s.src),(h=t.querySelector(ko(g)))?(a.instance=h,Gt(h),h):(c=s,(h=Xn.get(g))&&(c=v({},s),yh(c,h)),t=t.ownerDocument||t,h=t.createElement("script"),Gt(h),nn(h,"link",c),t.head.appendChild(h),a.instance=h);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(c=a.instance,a.state.loading|=4,Tc(c,s.precedence,t));return a.instance}function Tc(t,a,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=c.length?c[c.length-1]:null,g=h,C=0;C title"):null)}function s2(t,a,s){if(s===1||a.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(t=a.disabled,typeof a.precedence=="string"&&t==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function K0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function o2(t,a,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var h=bs(c.href),g=a.querySelector(zo(h));if(g){a=g._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=Ac.bind(t),a.then(t,t)),s.state.loading|=4,s.instance=g,Gt(g);return}g=a.ownerDocument||a,c=B0(c),(h=Xn.get(h))&&vh(c,h),g=g.createElement("link"),Gt(g);var C=g;C._p=new Promise(function(j,k){C.onload=j,C.onerror=k}),nn(g,"link",c),s.instance=g}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Ac.bind(t),a.addEventListener("load",s),a.addEventListener("error",s))}}var bh=0;function l2(t,a){return t.stylesheets&&t.count===0&&Nc(t,t.stylesheets),0bh?50:800)+a);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(h)}}:null}function Ac(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Mc=null;function Nc(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Mc=new Map,a.forEach(c2,t),Mc=null,Ac.call(t))}function c2(t,a){if(!(a.state.loading&4)){var s=Mc.get(t);if(s)var c=s.get(null);else{s=new Map,Mc.set(t,s);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Th.exports=E2(),Th.exports}var j2=R2(),gl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},T2=class extends gl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},rp=new T2,O2={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},A2=class{#e=O2;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,n){return this.#e.setTimeout(e,n)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,n){return this.#e.setInterval(e,n)}clearInterval(e){this.#e.clearInterval(e)}},xi=new A2;function M2(e){setTimeout(e,0)}var N2=typeof window>"u"||"Deno"in globalThis;function On(){}function D2(e,n){return typeof e=="function"?e(n):e}function um(e){return typeof e=="number"&&e>=0&&e!==1/0}function ww(e,n){return Math.max(e+(n||0)-Date.now(),0)}function La(e,n){return typeof e=="function"?e(n):e}function In(e,n){return typeof e=="function"?e(n):e}function yb(e,n){const{type:r="all",exact:i,fetchStatus:o,predicate:l,queryKey:u,stale:d}=e;if(u){if(i){if(n.queryHash!==ap(u,n.options))return!1}else if(!rl(n.queryKey,u))return!1}if(r!=="all"){const p=n.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof d=="boolean"&&n.isStale()!==d||o&&o!==n.state.fetchStatus||l&&!l(n))}function bb(e,n){const{exact:r,status:i,predicate:o,mutationKey:l}=e;if(l){if(!n.options.mutationKey)return!1;if(r){if(nl(n.options.mutationKey)!==nl(l))return!1}else if(!rl(n.options.mutationKey,l))return!1}return!(i&&n.state.status!==i||o&&!o(n))}function ap(e,n){return(n?.queryKeyHashFn||nl)(e)}function nl(e){return JSON.stringify(e,(n,r)=>fm(r)?Object.keys(r).sort().reduce((i,o)=>(i[o]=r[o],i),{}):r)}function rl(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(r=>rl(e[r],n[r])):!1}var z2=Object.prototype.hasOwnProperty;function Sw(e,n,r=0){if(e===n)return e;if(r>500)return n;const i=xb(e)&&xb(n);if(!i&&!(fm(e)&&fm(n)))return n;const l=(i?e:Object.keys(e)).length,u=i?n:Object.keys(n),d=u.length,p=i?new Array(d):{};let m=0;for(let y=0;y{xi.setTimeout(n,e)})}function hm(e,n,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,n):r.structuralSharing!==!1?Sw(e,n):n}function L2(e,n,r=0){const i=[...e,n];return r&&i.length>r?i.slice(1):i}function $2(e,n,r=0){const i=[n,...e];return r&&i.length>r?i.slice(0,-1):i}var ip=Symbol();function _w(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===ip?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Cw(e,n){return typeof e=="function"?e(...n):!!e}function I2(e,n,r){let i=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=n(),i||(i=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var al=(()=>{let e=()=>N2;return{isServer(){return e()},setIsServer(n){e=n}}})();function mm(){let e,n;const r=new Promise((o,l)=>{e=o,n=l});r.status="pending",r.catch(()=>{});function i(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{i({status:"fulfilled",value:o}),e(o)},r.reject=o=>{i({status:"rejected",reason:o}),n(o)},r}var P2=M2;function F2(){let e=[],n=0,r=d=>{d()},i=d=>{d()},o=P2;const l=d=>{n?e.push(d):o(()=>{r(d)})},u=()=>{const d=e;e=[],d.length&&o(()=>{i(()=>{d.forEach(p=>{r(p)})})})};return{batch:d=>{let p;n++;try{p=d()}finally{n--,n||u()}return p},batchCalls:d=>(...p)=>{l(()=>{d(...p)})},schedule:l,setNotifyFunction:d=>{r=d},setBatchNotifyFunction:d=>{i=d},setScheduler:d=>{o=d}}}var sn=F2(),V2=class extends gl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},fu=new V2;function U2(e){return Math.min(1e3*2**e,3e4)}function Ew(e){return(e??"online")==="online"?fu.isOnline():!0}var pm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Rw(e){let n=!1,r=0,i;const o=mm(),l=()=>o.status!=="pending",u=_=>{if(!l()){const E=new pm(_);b(E),e.onCancel?.(E)}},d=()=>{n=!0},p=()=>{n=!1},m=()=>rp.isFocused()&&(e.networkMode==="always"||fu.isOnline())&&e.canRun(),y=()=>Ew(e.networkMode)&&e.canRun(),v=_=>{l()||(i?.(),o.resolve(_))},b=_=>{l()||(i?.(),o.reject(_))},x=()=>new Promise(_=>{i=E=>{(l()||m())&&_(E)},e.onPause?.()}).then(()=>{i=void 0,l()||e.onContinue?.()}),S=()=>{if(l())return;let _;const E=r===0?e.initialPromise:void 0;try{_=E??e.fn()}catch(R){_=Promise.reject(R)}Promise.resolve(_).then(v).catch(R=>{if(l())return;const T=e.retry??(al.isServer()?0:3),O=e.retryDelay??U2,M=typeof O=="function"?O(r,R):O,D=T===!0||typeof T=="number"&&rm()?void 0:x()).then(()=>{n?b(R):S()})})};return{promise:o,status:()=>o.status,cancel:u,continue:()=>(i?.(),o),cancelRetry:d,continueRetry:p,canStart:y,start:()=>(y()?S():x().then(S),o)}}var jw=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),um(this.gcTime)&&(this.#e=xi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(al.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(xi.clearTimeout(this.#e),this.#e=void 0)}};function H2(e){return{onFetch:(n,r)=>{const i=n.options,o=n.fetchOptions?.meta?.fetchMore?.direction,l=n.state.data?.pages||[],u=n.state.data?.pageParams||[];let d={pages:[],pageParams:[]},p=0;const m=async()=>{let y=!1;const v=S=>{I2(S,()=>n.signal,()=>y=!0)},b=_w(n.options,n.fetchOptions),x=async(S,_,E)=>{if(y)return Promise.reject(n.signal.reason);if(_==null&&S.pages.length)return Promise.resolve(S);const T=(()=>{const P={client:n.client,queryKey:n.queryKey,pageParam:_,direction:E?"backward":"forward",meta:n.options.meta};return v(P),P})(),O=await b(T),{maxPages:M}=n.options,D=E?$2:L2;return{pages:D(S.pages,O,M),pageParams:D(S.pageParams,_,M)}};if(o&&l.length){const S=o==="backward",_=S?Tw:gm,E={pages:l,pageParams:u},R=_(i,E);d=await x(E,R,S)}else{const S=e??l.length;do{const _=p===0?u[0]??i.initialPageParam:gm(i,d);if(p>0&&_==null)break;d=await x(d,_),p++}while(pn.options.persister?.(m,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},r):n.fetchFn=m}}}function gm(e,{pages:n,pageParams:r}){const i=n.length-1;return n.length>0?e.getNextPageParam(n[i],n,r[i],r):void 0}function Tw(e,{pages:n,pageParams:r}){return n.length>0?e.getPreviousPageParam?.(n[0],n,r[0],r):void 0}function B2(e,n){return n?gm(e,n)!=null:!1}function q2(e,n){return!n||!e.getPreviousPageParam?!1:Tw(e,n)!=null}var G2=class extends jw{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=_b(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=_b(this.options);n.data!==void 0&&(this.setState(Sb(n.data,n.dataUpdatedAt)),this.#t=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,n){const r=hm(this.state.data,e,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),r}setState(e){this.#l({type:"setState",state:e})}cancel(e){const n=this.#a?.promise;return this.#a?.cancel(e),n?n.then(On).catch(On):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>In(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ip||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>La(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!ww(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#a&&(this.#s||this.#u()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(m=>m.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(this.#s=!0,r.signal)})},o=()=>{const p=_w(this.options,n),y=(()=>{const v={client:this.#i,queryKey:this.queryKey,meta:this.meta};return i(v),v})();return this.#s=!1,this.options.persister?this.options.persister(p,y,this):p(y)},u=(()=>{const p={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:o};return i(p),p})();(this.#e==="infinite"?H2(this.options.pages):this.options.behavior)?.onFetch(u,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#l({type:"fetch",meta:u.fetchOptions?.meta}),this.#a=Rw({initialPromise:n?.initialPromise,fn:u.fetchFn,onCancel:p=>{p instanceof pm&&p.revert&&this.setState({...this.#n,fetchStatus:"idle"}),r.abort()},onFail:(p,m)=>{this.#l({type:"failed",failureCount:p,error:m})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const p=await this.#a.start();if(p===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(p),this.#r.config.onSuccess?.(p,this),this.#r.config.onSettled?.(p,this.state.error,this),p}catch(p){if(p instanceof pm){if(p.silent)return this.#a.promise;if(p.revert){if(this.state.data===void 0)throw p;return this.state.data}}throw this.#l({type:"error",error:p}),this.#r.config.onError?.(p,this),this.#r.config.onSettled?.(this.state.data,p,this),p}finally{this.scheduleGc()}}#l(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Ow(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...Sb(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?i:void 0,i;case"error":const o=e.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),sn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Ow(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ew(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Sb(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function _b(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,r=n!==void 0,i=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Aw=class extends gl{constructor(e,n){super(),this.options=n,this.#e=e,this.#s=null,this.#o=mm(),this.bindMethods(),this.setOptions(n)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#u;#l;#m;#d;#f;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Cb(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vm(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vm(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const n=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof In(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),n._defaulted&&!dm(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&Eb(this.#t,r,this.options,n)&&this.#h(),this.updateResult(),i&&(this.#t!==r||In(this.options.enabled,this.#t)!==In(n.enabled,this.#t)||La(this.options.staleTime,this.#t)!==La(n.staleTime,this.#t))&&this.#g();const o=this.#v();i&&(this.#t!==r||In(this.options.enabled,this.#t)!==In(n.enabled,this.#t)||o!==this.#c)&&this.#y(o)}getOptimisticResult(e){const n=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(n,e);return K2(this,r)&&(this.#r=r,this.#a=this.options,this.#i=this.#t.state),r}getCurrentResult(){return this.#r}trackResult(e,n){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),n?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let n=this.#t.fetch(this.options,e);return e?.throwOnError||(n=n.catch(On)),n}#g(){this.#x();const e=La(this.options.staleTime,this.#t);if(al.isServer()||this.#r.isStale||!um(e))return;const r=ww(this.#r.dataUpdatedAt,e)+1;this.#d=xi.setTimeout(()=>{this.#r.isStale||this.updateResult()},r)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#c=e,!(al.isServer()||In(this.options.enabled,this.#t)===!1||!um(this.#c)||this.#c===0)&&(this.#f=xi.setInterval(()=>{(this.options.refetchIntervalInBackground||rp.isFocused())&&this.#h()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#d!==void 0&&(xi.clearTimeout(this.#d),this.#d=void 0)}#w(){this.#f!==void 0&&(xi.clearInterval(this.#f),this.#f=void 0)}createResult(e,n){const r=this.#t,i=this.options,o=this.#r,l=this.#i,u=this.#a,p=e!==r?e.state:this.#n,{state:m}=e;let y={...m},v=!1,b;if(n._optimisticResults){const V=this.hasListeners(),ve=!V&&Cb(e,n),be=V&&Eb(e,r,n,i);(ve||be)&&(y={...y,...Ow(m.data,e.options)}),n._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:_}=y;b=y.data;let E=!1;if(n.placeholderData!==void 0&&b===void 0&&_==="pending"){let V;o?.isPlaceholderData&&n.placeholderData===u?.placeholderData?(V=o.data,E=!0):V=typeof n.placeholderData=="function"?n.placeholderData(this.#m?.state.data,this.#m):n.placeholderData,V!==void 0&&(_="success",b=hm(o?.data,V,n),v=!0)}if(n.select&&b!==void 0&&!E)if(o&&b===l?.data&&n.select===this.#u)b=this.#l;else try{this.#u=n.select,b=n.select(b),b=hm(o?.data,b,n),this.#l=b,this.#s=null}catch(V){this.#s=V}this.#s&&(x=this.#s,b=this.#l,S=Date.now(),_="error");const R=y.fetchStatus==="fetching",T=_==="pending",O=_==="error",M=T&&R,D=b!==void 0,F={status:_,fetchStatus:y.fetchStatus,isPending:T,isSuccess:_==="success",isError:O,isInitialLoading:M,isLoading:M,data:b,dataUpdatedAt:y.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:y.dataUpdateCount>p.dataUpdateCount||y.errorUpdateCount>p.errorUpdateCount,isFetching:R,isRefetching:R&&!T,isLoadingError:O&&!D,isPaused:y.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:O&&D,isStale:sp(e,n),refetch:this.refetch,promise:this.#o,isEnabled:In(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const V=F.data!==void 0,ve=F.status==="error"&&!V,be=X=>{ve?X.reject(F.error):V&&X.resolve(F.data)},he=()=>{const X=this.#o=F.promise=mm();be(X)},ue=this.#o;switch(ue.status){case"pending":e.queryHash===r.queryHash&&be(ue);break;case"fulfilled":(ve||F.data!==ue.value)&&he();break;case"rejected":(!ve||F.error!==ue.reason)&&he();break}}return F}updateResult(){const e=this.#r,n=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#m=this.#t),dm(n,e))return;this.#r=n;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!this.#p.size)return!0;const l=new Set(o??this.#p);return this.options.throwOnError&&l.add("error"),Object.keys(this.#r).some(u=>{const d=u;return this.#r[d]!==e[d]&&l.has(d)})};this.#_({listeners:r()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const n=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(n?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){sn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Z2(e,n){return In(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&In(n.retryOnMount,e)===!1)}function Cb(e,n){return Z2(e,n)||e.state.data!==void 0&&vm(e,n,n.refetchOnMount)}function vm(e,n,r){if(In(n.enabled,e)!==!1&&La(n.staleTime,e)!=="static"){const i=typeof r=="function"?r(e):r;return i==="always"||i!==!1&&sp(e,n)}return!1}function Eb(e,n,r,i){return(e!==n||In(i.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&sp(e,r)}function sp(e,n){return In(n.enabled,e)!==!1&&e.isStaleByTime(La(n.staleTime,e))}function K2(e,n){return!dm(e.getCurrentResult(),n)}var Y2=class extends Aw{constructor(e,n){super(e,n)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,n){const{state:r}=e,i=super.createResult(e,n),{isFetching:o,isRefetching:l,isError:u,isRefetchError:d}=i,p=r.fetchMeta?.fetchMore?.direction,m=u&&p==="forward",y=o&&p==="forward",v=u&&p==="backward",b=o&&p==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:B2(n,r.data),hasPreviousPage:q2(n,r.data),isFetchNextPageError:m,isFetchingNextPage:y,isFetchPreviousPageError:v,isFetchingPreviousPage:b,isRefetchError:d&&!m&&!v,isRefetching:l&&!y&&!b}}},Q2=class extends jw{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||X2(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(n=>n!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Rw({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(l,u)=>{this.#i({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#i({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",o=!this.#r.canStart();try{if(i)n();else{this.#i({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);const u=await this.options.onMutate?.(e,r);u!==this.state.context&&this.#i({type:"pending",context:u,variables:e,isPaused:o})}const l=await this.#r.start();return await this.#n.config.onSuccess?.(l,e,this.state.context,this,r),await this.options.onSuccess?.(l,e,this.state.context,r),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(l,null,e,this.state.context,r),this.#i({type:"success",data:l}),l}catch(l){try{await this.#n.config.onError?.(l,e,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onError?.(l,e,this.state.context,r)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,l,e,this.state.context,r)}catch(u){Promise.reject(u)}throw this.#i({type:"error",error:l}),l}finally{this.#n.runNext(this)}}#i(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),sn.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function X2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var J2=class extends gl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,r){const i=new Q2({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){this.#e.add(e);const n=Fc(e);if(typeof n=="string"){const r=this.#t.get(n);r?r.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=Fc(e);if(typeof n=="string"){const r=this.#t.get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Fc(e);if(typeof n=="string"){const i=this.#t.get(n)?.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){const n=Fc(e);return typeof n=="string"?this.#t.get(n)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){sn.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(r=>bb(n,r))}findAll(e={}){return this.getAll().filter(n=>bb(e,n))}notify(e){sn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return sn.batch(()=>Promise.all(e.map(n=>n.continue().catch(On))))}};function Fc(e){return e.options.scope?.id}var W2=class extends gl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,r){const i=n.queryKey,o=n.queryHash??ap(i,n);let l=this.get(o);return l||(l=new G2({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){sn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>yb(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>yb(e,r)):n}notify(e){sn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){sn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){sn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ej=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new W2,this.#t=e.mutationCache||new J2,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=rp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=fu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),r=this.#e.build(this,n),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(La(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(e,n,r){const i=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(i.queryHash)?.state.data,u=D2(n,l);if(u!==void 0)return this.#e.build(this,i).setData(u,{...r,manual:!0})}setQueriesData(e,n,r){return sn.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;sn.batch(()=>{n.findAll(e).forEach(r=>{n.remove(r)})})}resetQueries(e,n){const r=this.#e;return sn.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const r={revert:!0,...n},i=sn.batch(()=>this.#e.findAll(e).map(o=>o.cancel(r)));return Promise.all(i).then(On).catch(On)}invalidateQueries(e,n={}){return sn.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},i=sn.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let l=o.fetch(void 0,r);return r.throwOnError||(l=l.catch(On)),o.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(On)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const r=this.#e.build(this,n);return r.isStaleByTime(La(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(On).catch(On)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(On).catch(On)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return fu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#r.set(nl(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#r.values()],r={};return n.forEach(i=>{rl(e,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(e,n){this.#i.set(nl(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#i.values()],r={};return n.forEach(i=>{rl(e,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=ap(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===ip&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Mw=w.createContext(void 0),Ai=e=>{const n=w.useContext(Mw);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},tj=({client:e,children:n})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(Mw.Provider,{value:e,children:n})),Nw=w.createContext(!1),nj=()=>w.useContext(Nw);Nw.Provider;function rj(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var aj=w.createContext(rj()),ij=()=>w.useContext(aj),sj=(e,n,r)=>{const i=r?.state.error&&typeof e.throwOnError=="function"?Cw(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(n.isReset()||(e.retryOnMount=!1))},oj=e=>{w.useEffect(()=>{e.clearReset()},[e])},lj=({result:e,errorResetBoundary:n,throwOnError:r,query:i,suspense:o})=>e.isError&&!n.isReset()&&!e.isFetching&&i&&(o&&e.data===void 0||Cw(r,[e.error,i])),cj=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...o)=>r(i(...o)):r(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},uj=(e,n)=>e.isLoading&&e.isFetching&&!n,dj=(e,n)=>e?.suspense&&n.isPending,Rb=(e,n,r)=>n.fetchOptimistic(e).catch(()=>{r.clearReset()});function Dw(e,n,r){const i=nj(),o=ij(),l=Ai(),u=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const d=l.getQueryCache().get(u.queryHash),p=e.subscribed!==!1;u._optimisticResults=i?"isRestoring":p?"optimistic":void 0,cj(u),sj(u,o,d),oj(o);const m=!l.getQueryCache().get(u.queryHash),[y]=w.useState(()=>new n(l,u)),v=y.getOptimisticResult(u),b=!i&&p;if(w.useSyncExternalStore(w.useCallback(x=>{const S=b?y.subscribe(sn.batchCalls(x)):On;return y.updateResult(),S},[y,b]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),w.useEffect(()=>{y.setOptions(u)},[u,y]),dj(u,v))throw Rb(u,y,o);if(lj({result:v,errorResetBoundary:o,throwOnError:u.throwOnError,query:d,suspense:u.suspense}))throw v.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(u,v),u.experimental_prefetchInRender&&!al.isServer()&&uj(v,i)&&(m?Rb(u,y,o):d?.promise)?.catch(On).finally(()=>{y.updateResult()}),u.notifyOnChangeProps?v:y.trackResult(v)}function Pt(e,n){return Dw(e,Aw)}function fj(e,n){return Dw(e,Y2)}let jb=!1;function hj(e){const n=e.analytics;if(!n?.key||jb)return;jb=!0;const r=document.createElement("script");r.src=n.host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",r.async=!0,r.onload=()=>{const i=window.posthog;i&&(i.init(n.key,{api_host:n.host,defaults:"2026-05-30",capture_pageview:"history_change",session_recording:{maskAllInputs:!0,maskTextSelector:"*"}}),e.me&&i.identify(e.me.email,{email:e.me.email,name:e.me.name,...e.billing?{plan:e.billing.plan}:{}}))},document.head.appendChild(r)}function zw(e,n){window.posthog?.capture(e,n)}const mj=[[/^POST \/api\/projects$/,"project_created"],[/^DELETE \/api\/projects\//,"project_deleted"],[/^POST \/api\/p\/[^/]+\/restore$/,"file_restored"],[/^DELETE \/api\/shares\//,"share_revoked"],[/^PATCH \/api\/shares\//,"share_expiry_changed"],[/^POST \/api\/orgs\/[^/]+\/invites$/,"invite_created"],[/^DELETE \/api\/orgs\/[^/]+\/invites\//,"invite_revoked"],[/^POST \/api\/invites\//,"invite_accepted"],[/^PUT \/api\/p\/[^/]+\/permissions\/./,"project_access_granted"],[/^DELETE \/api\/p\/[^/]+\/permissions\/./,"project_access_revoked"]];function kw(e,n){const r=e+" "+n.split("?")[0],i=mj.find(([o])=>o.test(r));i&&zw(i[1])}function op(){throw location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),new Error("signing in…")}function pj(e,n){const r=n.trim();switch(e){case 403:return r.includes("seat")?"This plan is out of seats. Upgrade to add more people.":r.includes("owner")?"Only owners can do that.":"You don't have access to that.";case 409:return r?r[0].toUpperCase()+r.slice(1):"That is managed outside this hub.";case 404:return"That is gone — it may have been removed already.";case 413:return"This project is over its plan limit.";case 429:return"Too many requests. Give it a moment.";default:return e>=500?"The server had a problem. Try again.":r?r[0].toUpperCase()+r.slice(1):"Something went wrong."}}async function Mu(e){throw new Error(pj(e.status,await e.text()))}async function Bt(e){const n=await fetch(e,{headers:{Accept:"application/json"}});return n.status===401&&op(),n.ok||await Mu(n),n.json()}async function gj(e){const n=await fetch(e);return n.status===401&&op(),n.ok||await Mu(n),n}async function Wn(e,n,r){const i={method:e};r!==void 0&&(i.headers={"Content-Type":"application/json"},i.body=JSON.stringify(r));const o=await fetch(n,i);return o.ok||await Mu(o),kw(e,n),o.status===204?{}:o.json()}async function Si(e,n){const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n||{})});return r.status===401&&op(),r.ok||await Mu(r),kw("POST",e),r.json()}function vj(){return Pt({queryKey:["config"],queryFn:async()=>{const e=await Bt("/api/config");return e.auth.enabled&&!e.me&&(location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),await new Promise(()=>{})),hj(e),e},staleTime:1/0})}var Mi=xw();const yj=bw(Mi);function Tb(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Ps(...e){return n=>{let r=!1;const i=e.map(o=>{const l=Tb(o,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let o=0;o{let{children:o,...l}=r,u=null,d=!1;const p=[];Ob(o)&&typeof Vc=="function"&&(o=Vc(o._payload)),w.Children.forEach(o,b=>{if(Cj(b)){d=!0;const x=b;let S="child"in x.props?x.props.child:x.props.children;Ob(S)&&typeof Vc=="function"&&(S=Vc(S._payload)),u=wj(x,S),p.push(u?.props?.children)}else p.push(b)}),u?u=w.cloneElement(u,void 0,p):!d&&w.Children.count(o)===1&&w.isValidElement(o)&&(u=o);const m=u?_j(u):void 0,y=nt(i,m);if(!u){if(o||o===0)throw new Error(d?Tj(e):jj(e));return o}const v=Sj(l,u.props??{});return u.type!==w.Fragment&&(v.ref=i?y:m),w.cloneElement(u,v)});return n.displayName=`${e}.Slot`,n}var bj=_i("Slot"),Lw=Symbol.for("radix.slottable");function xj(e){const n=r=>"child"in r?r.children(r.child):r.children;return n.displayName=`${e}.Slottable`,n.__radixId=Lw,n}var wj=(e,n)=>{if("child"in e.props){const r=e.props.child;return w.isValidElement(r)?w.cloneElement(r,void 0,e.props.children(r.props.children)):null}return w.isValidElement(n)?n:null};function Sj(e,n){const r={...n};for(const i in n){const o=e[i],l=n[i];/^on[A-Z]/.test(i)?o&&l?r[i]=(...d)=>{const p=l(...d);return o(...d),p}:o&&(r[i]=o):i==="style"?r[i]={...o,...l}:i==="className"&&(r[i]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}function _j(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Cj(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Lw}var Ej=Symbol.for("react.lazy");function Ob(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Ej&&"_payload"in e&&Rj(e._payload)}function Rj(e){return typeof e=="object"&&e!==null&&"then"in e}var jj=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Tj=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Vc=Au[" use ".trim().toString()],Oj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$e=Oj.reduce((e,n)=>{const r=_i(`Primitive.${n}`),i=w.forwardRef((o,l)=>{const{asChild:u,...d}=o,p=u?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(p,{...d,ref:l})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function $w(e,n){e&&Mi.flushSync(()=>e.dispatchEvent(n))}var Iw=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Aj="VisuallyHidden",Pw=w.forwardRef((e,n)=>f.jsx($e.span,{...e,ref:n,style:{...Iw,...e.style}}));Pw.displayName=Aj;var Mj=Pw;function Ga(e,n=[]){let r=[];function i(l,u){const d=w.createContext(u);d.displayName=l+"Context";const p=r.length;r=[...r,u];const m=v=>{const{scope:b,children:x,...S}=v,_=b?.[e]?.[p]||d,E=w.useMemo(()=>S,Object.values(S));return f.jsx(_.Provider,{value:E,children:x})};m.displayName=l+"Provider";function y(v,b,x={}){const{optional:S=!1}=x,_=b?.[e]?.[p]||d,E=w.useContext(_);if(E)return E;if(u!==void 0)return u;if(!S)throw new Error(`\`${v}\` must be used within \`${l}\``)}return[m,y]}const o=()=>{const l=r.map(u=>w.createContext(u));return function(d){const p=d?.[e]||l;return w.useMemo(()=>({[`__scope${e}`]:{...d,[e]:p}}),[d,p])}};return o.scopeName=e,[i,Nj(o,...n)]}function Nj(...e){const n=e[0];if(e.length===1)return n;const r=()=>{const i=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const u=i.reduce((d,{useScope:p,scopeName:m})=>{const v=p(l)[`__scope${m}`];return{...d,...v}},{});return w.useMemo(()=>({[`__scope${n.scopeName}`]:u}),[u])}};return r.scopeName=n.scopeName,r}function lp(e){const n=e+"CollectionProvider",[r,i]=Ga(n),[o,l]=r(n,{collectionRef:{current:null},itemMap:new Map}),u=_=>{const{scope:E,children:R}=_,T=w.useRef(null),O=w.useRef(new Map).current;return f.jsx(o,{scope:E,itemMap:O,collectionRef:T,children:R})};u.displayName=n;const d=e+"CollectionSlot",p=_i(d),m=w.forwardRef((_,E)=>{const{scope:R,children:T}=_,O=l(d,R),M=nt(E,O.collectionRef);return f.jsx(p,{ref:M,children:T})});m.displayName=d;const y=e+"CollectionItemSlot",v="data-radix-collection-item",b=_i(y),x=w.forwardRef((_,E)=>{const{scope:R,children:T,...O}=_,M=w.useRef(null),D=nt(E,M),P=l(y,R);return w.useEffect(()=>(P.itemMap.set(M,{ref:M,...O}),()=>{P.itemMap.delete(M)})),f.jsx(b,{[v]:"",ref:D,children:T})});x.displayName=y;function S(_){const E=l(e+"CollectionConsumer",_);return w.useCallback(()=>{const T=E.collectionRef.current;if(!T)return[];const O=Array.from(T.querySelectorAll(`[${v}]`));return Array.from(E.itemMap.values()).sort((P,F)=>O.indexOf(P.ref.current)-O.indexOf(F.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:u,Slot:m,ItemSlot:x},S,i]}function je(e,n,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o||!o.defaultPrevented)return n?.(o)}}var Yt=globalThis?.document?w.useLayoutEffect:()=>{},Dj=Au[" useInsertionEffect ".trim().toString()]||Yt;function Fs({prop:e,defaultProp:n,onChange:r=()=>{},caller:i}){const[o,l,u]=zj({defaultProp:n,onChange:r}),d=e!==void 0,p=d?e:o;{const y=w.useRef(e!==void 0);w.useEffect(()=>{const v=y.current;v!==d&&console.warn(`${i} is changing from ${v?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=d},[d,i])}const m=w.useCallback(y=>{if(d){const v=kj(y)?y(e):y;v!==e&&u.current?.(v)}else l(y)},[d,e,l,u]);return[p,m]}function zj({defaultProp:e,onChange:n}){const[r,i]=w.useState(e),o=w.useRef(r),l=w.useRef(n);return Dj(()=>{l.current=n},[n]),w.useEffect(()=>{o.current!==r&&(l.current?.(r),o.current=r)},[r,o]),[r,i,l]}function kj(e){return typeof e=="function"}function Lj(e,n){return w.useReducer((r,i)=>n[r][i]??r,e)}var vr=e=>{const{present:n,children:r}=e,i=$j(n),o=typeof r=="function"?r({present:i.isPresent}):w.Children.only(r),l=Ij(i.ref,Pj(o));return typeof r=="function"||i.isPresent?w.cloneElement(o,{ref:l}):null};vr.displayName="Presence";function $j(e){const[n,r]=w.useState(),i=w.useRef(null),o=w.useRef(e),l=w.useRef("none"),u=w.useRef(void 0),d=e?"mounted":"unmounted",[p,m]=Lj(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{p==="mounted"?(l.current=u.current??Uo(i.current),u.current=void 0):l.current="none"},[p]),Yt(()=>{const y=i.current,v=o.current;if(v!==e){const x=l.current,S=Uo(y);e?(u.current=S,m("MOUNT")):S==="none"||y?.display==="none"?m("UNMOUNT"):m(v&&x!==S?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,m]),Yt(()=>{if(n){let y;const v=n.ownerDocument.defaultView??window,b=S=>{const E=Uo(i.current).includes(CSS.escape(S.animationName));if(S.target===n&&E&&(m("ANIMATION_END"),!o.current)){const R=n.style.animationFillMode;n.style.animationFillMode="forwards",y=v.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=R)})}},x=S=>{S.target===n&&(l.current=Uo(i.current))};return n.addEventListener("animationstart",x),n.addEventListener("animationcancel",b),n.addEventListener("animationend",b),()=>{v.clearTimeout(y),n.removeEventListener("animationstart",x),n.removeEventListener("animationcancel",b),n.removeEventListener("animationend",b)}}else m("ANIMATION_END")},[n,m]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:w.useCallback(y=>{if(y){const v=getComputedStyle(y);i.current=v,u.current=Uo(v)}else i.current=null;r(y)},[])}}function Ab(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Ij(...e){const n=w.useRef(e);return n.current=e,w.useCallback(r=>{const i=n.current;let o=!1;const l=i.map(u=>{const d=Ab(u,r);return!o&&typeof d=="function"&&(o=!0),d});if(o)return()=>{for(let u=0;u{}),Vj=0;function dn(e){const[n,r]=w.useState(Fj());return Yt(()=>{r(i=>i??String(Vj++))},[e]),n?`radix-${n}`:""}var Uj=w.createContext(void 0);function cp(e){const n=w.useContext(Uj);return e||n||"ltr"}function tr(e){const n=w.useRef(e);return w.useEffect(()=>{n.current=e}),w.useMemo(()=>((...r)=>n.current?.(...r)),[])}var Hj="DismissableLayer",ym="dismissableLayer.update",Bj="dismissableLayer.pointerDownOutside",qj="dismissableLayer.focusOutside",Mb,up=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),vl=w.forwardRef((e,n)=>{const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,onDismiss:p,...m}=e,y=w.useContext(up),[v,b]=w.useState(null),x=v?.ownerDocument??globalThis?.document,[,S]=w.useState({}),_=nt(n,b),E=Array.from(y.layers),[R]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),T=R?E.indexOf(R):-1,O=v?E.indexOf(v):-1,M=y.layersWithOutsidePointerEventsDisabled.size>0,D=O>=T,P=w.useRef(!1),F=Qj(he=>{l?.(he),d?.(he),he.defaultPrevented||p?.()},{ownerDocument:x,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:P,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:w.useCallback(he=>{if(!(he instanceof Node))return!1;const ue=[...y.branches].some(X=>X.contains(he));return D&&!ue},[y.branches,D])}),V=Xj(he=>{if(i&&P.current)return;const ue=he.target;[...y.branches].some(pe=>pe.contains(ue))||(u?.(he),d?.(he),he.defaultPrevented||p?.())},x),ve=v?O===E.length-1:!1,be=tr(he=>{he.key==="Escape"&&(o?.(he),!he.defaultPrevented&&p&&(he.preventDefault(),p()))});return w.useEffect(()=>{if(ve)return x.addEventListener("keydown",be,{capture:!0}),()=>x.removeEventListener("keydown",be,{capture:!0})},[x,ve,be]),w.useEffect(()=>{if(v)return r&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(Mb=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(v)),y.layers.add(v),Nb(),()=>{r&&(y.layersWithOutsidePointerEventsDisabled.delete(v),y.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=Mb))}},[v,x,r,y]),w.useEffect(()=>()=>{v&&(y.layers.delete(v),y.layersWithOutsidePointerEventsDisabled.delete(v),Nb())},[v,y]),w.useEffect(()=>{const he=()=>S({});return document.addEventListener(ym,he),()=>document.removeEventListener(ym,he)},[]),f.jsx($e.div,{...m,ref:_,style:{pointerEvents:M?D?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,V.onFocusCapture),onBlurCapture:je(e.onBlurCapture,V.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,F.onPointerDownCapture)})});vl.displayName=Hj;var Gj="DismissableLayerBranch",Zj=w.forwardRef((e,n)=>{const r=w.useContext(up),i=w.useRef(null),o=nt(n,i);return w.useEffect(()=>{const l=i.current;if(l)return r.branches.add(l),()=>{r.branches.delete(l)}},[r.branches]),f.jsx($e.div,{...e,ref:o})});Zj.displayName=Gj;function Kj(){const e=w.useContext(up),[n,r]=w.useState(null);return w.useEffect(()=>{if(n)return e.dismissableSurfaces.add(n),()=>{e.dismissableSurfaces.delete(n)}},[n,e.dismissableSurfaces]),r}var Yj=()=>!0;function Qj(e,n){const{ownerDocument:r=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:l,shouldHandlePointerDownOutside:u=Yj}=n,d=tr(e),p=w.useRef(!1),m=w.useRef(!1),y=w.useRef(new Map),v=w.useRef(()=>{});return w.useEffect(()=>{function b(){m.current=!1,o.current=!1,y.current.clear()}function x(){return Array.from(y.current.values()).some(Boolean)}function S(O){if(!m.current)return;const M=O.target;M instanceof Node&&[...l].some(P=>P.contains(M))||y.current.set(O.type,!0),O.type==="click"&&window.setTimeout(()=>{m.current&&v.current()},0)}function _(O){m.current&&y.current.set(O.type,!1)}const E=O=>{if(O.target&&!p.current){let M=function(){r.removeEventListener("click",v.current);const P=x();b(),P||Fw(Bj,d,D,{discrete:!0})};if(!u(O.target)){r.removeEventListener("click",v.current),b(),p.current=!1;return}const D={originalEvent:O};m.current=!0,o.current=i&&O.button===0,y.current.clear(),!i||O.button!==0?M():(r.removeEventListener("click",v.current),v.current=M,r.addEventListener("click",v.current,{once:!0}))}else r.removeEventListener("click",v.current),b();p.current=!1},R=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const O of R)r.addEventListener(O,S,!0),r.addEventListener(O,_);const T=window.setTimeout(()=>{r.addEventListener("pointerdown",E)},0);return()=>{window.clearTimeout(T),r.removeEventListener("pointerdown",E),r.removeEventListener("click",v.current);for(const O of R)r.removeEventListener(O,S,!0),r.removeEventListener(O,_)}},[r,d,i,o,l,u]),{onPointerDownCapture:()=>p.current=!0}}function Xj(e,n=globalThis?.document){const r=tr(e),i=w.useRef(!1);return w.useEffect(()=>{const o=l=>{l.target&&!i.current&&Fw(qj,r,{originalEvent:l},{discrete:!1})};return n.addEventListener("focusin",o),()=>n.removeEventListener("focusin",o)},[n,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Nb(){const e=new CustomEvent(ym);document.dispatchEvent(e)}function Fw(e,n,r,{discrete:i}){const o=r.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});n&&o.addEventListener(e,n,{once:!0}),i?$w(o,l):o.dispatchEvent(l)}var Nh="focusScope.autoFocusOnMount",Dh="focusScope.autoFocusOnUnmount",Db={bubbles:!1,cancelable:!0},Jj="FocusScope",Nu=w.forwardRef((e,n)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=e,[d,p]=w.useState(null),m=tr(o),y=tr(l),v=w.useRef(null),b=nt(n,p),x=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(i){let _=function(O){if(x.paused||!d)return;const M=O.target;d.contains(M)?v.current=M:Na(v.current,{select:!0})},E=function(O){if(x.paused||!d)return;const M=O.relatedTarget;M!==null&&(d.contains(M)||Na(v.current,{select:!0}))},R=function(O){if(document.activeElement===document.body)for(const D of O)D.removedNodes.length>0&&Na(d)};document.addEventListener("focusin",_),document.addEventListener("focusout",E);const T=new MutationObserver(R);return d&&T.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",E),T.disconnect()}}},[i,d,x.paused]),w.useEffect(()=>{if(d){kb.add(x);const _=document.activeElement;if(!d.contains(_)){const R=new CustomEvent(Nh,Db);d.addEventListener(Nh,m),d.dispatchEvent(R),R.defaultPrevented||(Wj(aT(Vw(d)),{select:!0}),document.activeElement===_&&Na(d))}return()=>{d.removeEventListener(Nh,m),setTimeout(()=>{const R=new CustomEvent(Dh,Db);d.addEventListener(Dh,y),d.dispatchEvent(R),R.defaultPrevented||Na(_??document.body,{select:!0}),d.removeEventListener(Dh,y),kb.remove(x)},0)}}},[d,m,y,x]);const S=w.useCallback(_=>{if(!r&&!i||x.paused)return;const E=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,R=document.activeElement;if(E&&R){const T=_.currentTarget,[O,M]=eT(T);O&&M?!_.shiftKey&&R===M?(_.preventDefault(),r&&Na(O,{select:!0})):_.shiftKey&&R===O&&(_.preventDefault(),r&&Na(M,{select:!0})):R===T&&_.preventDefault()}},[r,i,x.paused]);return f.jsx($e.div,{tabIndex:-1,...u,ref:b,onKeyDown:S})});Nu.displayName=Jj;function Wj(e,{select:n=!1}={}){const r=document.activeElement;for(const i of e)if(Na(i,{select:n}),document.activeElement!==r)return}function eT(e){const n=Vw(e),r=zb(n,e),i=zb(n.reverse(),e);return[r,i]}function Vw(e){const n=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const o=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||o?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)n.push(r.currentNode);return n}function zb(e,n){const r=typeof n.checkVisibility=="function"&&n.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(r?!i.checkVisibility({checkVisibilityCSS:!0}):tT(i,{upTo:n})))return i}function tT(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function nT(e){return e instanceof HTMLInputElement&&"select"in e}function Na(e,{select:n=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&nT(e)&&n&&e.select()}}var kb=rT();function rT(){let e=[];return{add(n){const r=e[0];n!==r&&r?.pause(),e=Lb(e,n),e.unshift(n)},remove(n){e=Lb(e,n),e[0]?.resume()}}}function Lb(e,n){const r=[...e],i=r.indexOf(n);return i!==-1&&r.splice(i,1),r}function aT(e){return e.filter(n=>n.tagName!=="A")}var iT="Portal",yl=w.forwardRef((e,n)=>{const{container:r,...i}=e,[o,l]=w.useState(!1);Yt(()=>l(!0),[]);const u=r||o&&globalThis?.document?.body;return u?Mi.createPortal(f.jsx($e.div,{...i,ref:n}),u):null});yl.displayName=iT;var Uc=0,Ss=null;function dp(){w.useEffect(()=>{Ss||(Ss={start:$b(),end:$b()});const{start:e,end:n}=Ss;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==n&&document.body.insertAdjacentElement("beforeend",n),Uc++,()=>{Uc===1&&(Ss?.start.remove(),Ss?.end.remove(),Ss=null),Uc=Math.max(0,Uc-1)}},[])}function $b(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ar=function(){return Ar=Object.assign||function(n){for(var r,i=1,o=arguments.length;i"u")return ST;var n=_T(e),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,i-r+n[2]-n[0])}},ET=qw(),zs="data-scroll-locked",RT=function(e,n,r,i){var o=e.left,l=e.top,u=e.right,d=e.gap;return r===void 0&&(r="margin"),` - .`.concat(oT,` { +`+c.stack}}var jt=Object.prototype.hasOwnProperty,rr=e.unstable_scheduleCallback,xr=e.unstable_cancelCallback,Tt=e.unstable_shouldYield,Vn=e.unstable_requestPaint,Dt=e.unstable_now,kr=e.unstable_getCurrentPriorityLevel,ar=e.unstable_ImmediatePriority,ir=e.unstable_UserBlockingPriority,wr=e.unstable_NormalPriority,sr=e.unstable_LowPriority,mn=e.unstable_IdlePriority,A=e.log,I=e.unstable_setDisableYieldValue,U=null,ce=null;function Y(t){if(typeof A=="function"&&I(t),ce&&typeof ce.setStrictMode=="function")try{ce.setStrictMode(U,t)}catch{}}var W=Math.clz32?Math.clz32:_e,de=Math.log,we=Math.LN2;function _e(t){return t>>>=0,t===0?32:31-(de(t)/we|0)|0}var Xe=256,wt=262144,Xt=4194304;function zt(t){var a=t&42;if(a!==0)return a;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ne(t,a,s){var c=t.pendingLanes;if(c===0)return 0;var h=0,g=t.suspendedLanes,C=t.pingedLanes;t=t.warmLanes;var j=c&134217727;return j!==0?(c=j&~g,c!==0?h=zt(c):(C&=j,C!==0?h=zt(C):s||(s=j&~t,s!==0&&(h=zt(s))))):(j=c&~g,j!==0?h=zt(j):C!==0?h=zt(C):s||(s=c&~t,s!==0&&(h=zt(s)))),h===0?0:a!==0&&a!==h&&(a&g)===0&&(g=h&-h,s=a&-a,g>=s||g===32&&(s&4194048)!==0)?a:h}function ht(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function yt(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qt(){var t=Xt;return Xt<<=1,(Xt&62914560)===0&&(Xt=4194304),t}function or(t){for(var a=[],s=0;31>s;s++)a.push(t);return a}function St(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function yn(t,a,s,c,h,g){var C=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var j=t.entanglements,k=t.expirationTimes,G=t.hiddenUpdates;for(s=C&~s;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var fE=/[\n"\\]/g;function Hn(t){return t.replace(fE,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function bd(t,a,s,c,h,g,C,j){t.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.type=C:t.removeAttribute("type"),a!=null?C==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+Un(a)):t.value!==""+Un(a)&&(t.value=""+Un(a)):C!=="submit"&&C!=="reset"||t.removeAttribute("value"),a!=null?xd(t,C,Un(a)):s!=null?xd(t,C,Un(s)):c!=null&&t.removeAttribute("value"),h==null&&g!=null&&(t.defaultChecked=!!g),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?t.name=""+Un(j):t.removeAttribute("name")}function Eg(t,a,s,c,h,g,C,j){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.type=g),a!=null||s!=null){if(!(g!=="submit"&&g!=="reset"||a!=null)){yd(t);return}s=s!=null?""+Un(s):"",a=a!=null?""+Un(a):s,j||a===t.value||(t.value=a),t.defaultValue=a}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=j?t.checked:!!c,t.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(t.name=C),yd(t)}function xd(t,a,s){a==="number"&&Al(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function Hi(t,a,s,c){if(t=t.options,a){a={};for(var h=0;h"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ed=!1;if(Ir)try{var Ws={};Object.defineProperty(Ws,"passive",{get:function(){Ed=!0}}),window.addEventListener("test",Ws,Ws),window.removeEventListener("test",Ws,Ws)}catch{Ed=!1}var la=null,Rd=null,Nl=null;function Ng(){if(Nl)return Nl;var t,a=Rd,s=a.length,c,h="value"in la?la.value:la.textContent,g=h.length;for(t=0;t=no),Ig=" ",Pg=!1;function Fg(t,a){switch(t){case"keyup":return FE.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Zi=!1;function UE(t,a){switch(t){case"compositionend":return Vg(a);case"keypress":return a.which!==32?null:(Pg=!0,Ig);case"textInput":return t=a.data,t===Ig&&Pg?null:t;default:return null}}function HE(t,a){if(Zi)return t==="compositionend"||!Md&&Fg(t,a)?(t=Ng(),Nl=Rd=la=null,Zi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:s,offset:a-t};t=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Yg(s)}}function Xg(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?Xg(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function Jg(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=Al(t.document);a instanceof t.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)t=a.contentWindow;else break;a=Al(t.document)}return a}function zd(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}var XE=Ir&&"documentMode"in document&&11>=document.documentMode,Ki=null,kd=null,so=null,Ld=!1;function Wg(t,a,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Ld||Ki==null||Ki!==Al(c)||(c=Ki,"selectionStart"in c&&zd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),so&&io(so,c)||(so=c,c=Ec(kd,"onSelect"),0>=C,h-=C,Sr=1<<32-W(a)+h|s<Ue?(Ze=Te,Te=null):Ze=Te.sibling;var et=Q(H,Te,q[Ue],se);if(et===null){Te===null&&(Te=Ze);break}t&&Te&&et.alternate===null&&a(H,Te),$=g(et,$,Ue),We===null?Ae=et:We.sibling=et,We=et,Te=Ze}if(Ue===q.length)return s(H,Te),Ye&&Fr(H,Ue),Ae;if(Te===null){for(;UeUe?(Ze=Te,Te=null):Ze=Te.sibling;var Aa=Q(H,Te,et.value,se);if(Aa===null){Te===null&&(Te=Ze);break}t&&Te&&Aa.alternate===null&&a(H,Te),$=g(Aa,$,Ue),We===null?Ae=Aa:We.sibling=Aa,We=Aa,Te=Ze}if(et.done)return s(H,Te),Ye&&Fr(H,Ue),Ae;if(Te===null){for(;!et.done;Ue++,et=q.next())et=oe(H,et.value,se),et!==null&&($=g(et,$,Ue),We===null?Ae=et:We.sibling=et,We=et);return Ye&&Fr(H,Ue),Ae}for(Te=c(Te);!et.done;Ue++,et=q.next())et=te(Te,H,Ue,et.value,se),et!==null&&(t&&et.alternate!==null&&Te.delete(et.key===null?Ue:et.key),$=g(et,$,Ue),We===null?Ae=et:We.sibling=et,We=et);return t&&Te.forEach(function(v2){return a(H,v2)}),Ye&&Fr(H,Ue),Ae}function lt(H,$,q,se){if(typeof q=="object"&&q!==null&&q.type===_&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case x:e:{for(var Ae=q.key;$!==null;){if($.key===Ae){if(Ae=q.type,Ae===_){if($.tag===7){s(H,$.sibling),se=h($,q.props.children),se.return=H,H=se;break e}}else if($.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===V&&ui(Ae)===$.type){s(H,$.sibling),se=h($,q.props),ho(se,q),se.return=H,H=se;break e}s(H,$);break}else a(H,$);$=$.sibling}q.type===_?(se=ii(q.props.children,H.mode,se,q.key),se.return=H,H=se):(se=Ul(q.type,q.key,q.props,null,H.mode,se),ho(se,q),se.return=H,H=se)}return C(H);case w:e:{for(Ae=q.key;$!==null;){if($.key===Ae)if($.tag===4&&$.stateNode.containerInfo===q.containerInfo&&$.stateNode.implementation===q.implementation){s(H,$.sibling),se=h($,q.children||[]),se.return=H,H=se;break e}else{s(H,$);break}else a(H,$);$=$.sibling}se=Hd(q,H.mode,se),se.return=H,H=se}return C(H);case V:return q=ui(q),lt(H,$,q,se)}if(ge(q))return Re(H,$,q,se);if(ue(q)){if(Ae=ue(q),typeof Ae!="function")throw Error(i(150));return q=Ae.call(q),De(H,$,q,se)}if(typeof q.then=="function")return lt(H,$,Yl(q),se);if(q.$$typeof===O)return lt(H,$,ql(H,q),se);Ql(H,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,$!==null&&$.tag===6?(s(H,$.sibling),se=h($,q),se.return=H,H=se):(s(H,$),se=Ud(q,H.mode,se),se.return=H,H=se),C(H)):s(H,$)}return function(H,$,q,se){try{fo=0;var Ae=lt(H,$,q,se);return is=null,Ae}catch(Te){if(Te===as||Te===Zl)throw Te;var We=Nn(29,Te,null,H.mode);return We.lanes=se,We.return=H,We}}}var fi=Sv(!0),_v=Sv(!1),ha=!1;function tf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nf(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ma(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function pa(t,a,s){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(tt&2)!==0){var h=c.pending;return h===null?a.next=a:(a.next=h.next,h.next=a),c.pending=a,a=Vl(t),sv(t,null,s),a}return Fl(t,c,a,s),Vl(t)}function mo(t,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var c=a.lanes;c&=t.pendingLanes,s|=c,a.lanes=s,bn(t,s)}}function rf(t,a){var s=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var h=null,g=null;if(s=s.firstBaseUpdate,s!==null){do{var C={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};g===null?h=g=C:g=g.next=C,s=s.next}while(s!==null);g===null?h=g=a:g=g.next=a}else h=g=a;s={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:c.shared,callbacks:c.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=a:t.next=a,s.lastBaseUpdate=a}var af=!1;function po(){if(af){var t=rs;if(t!==null)throw t}}function go(t,a,s,c){af=!1;var h=t.updateQueue;ha=!1;var g=h.firstBaseUpdate,C=h.lastBaseUpdate,j=h.shared.pending;if(j!==null){h.shared.pending=null;var k=j,G=k.next;k.next=null,C===null?g=G:C.next=G,C=k;var ie=t.alternate;ie!==null&&(ie=ie.updateQueue,j=ie.lastBaseUpdate,j!==C&&(j===null?ie.firstBaseUpdate=G:j.next=G,ie.lastBaseUpdate=k))}if(g!==null){var oe=h.baseState;C=0,ie=G=k=null,j=g;do{var Q=j.lane&-536870913,te=Q!==j.lane;if(te?(Ge&Q)===Q:(c&Q)===Q){Q!==0&&Q===ns&&(af=!0),ie!==null&&(ie=ie.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var Re=t,De=j;Q=a;var lt=s;switch(De.tag){case 1:if(Re=De.payload,typeof Re=="function"){oe=Re.call(lt,oe,Q);break e}oe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=De.payload,Q=typeof Re=="function"?Re.call(lt,oe,Q):Re,Q==null)break e;oe=v({},oe,Q);break e;case 2:ha=!0}}Q=j.callback,Q!==null&&(t.flags|=64,te&&(t.flags|=8192),te=h.callbacks,te===null?h.callbacks=[Q]:te.push(Q))}else te={lane:Q,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ie===null?(G=ie=te,k=oe):ie=ie.next=te,C|=Q;if(j=j.next,j===null){if(j=h.shared.pending,j===null)break;te=j,j=te.next,te.next=null,h.lastBaseUpdate=te,h.shared.pending=null}}while(!0);ie===null&&(k=oe),h.baseState=k,h.firstBaseUpdate=G,h.lastBaseUpdate=ie,g===null&&(h.shared.lanes=0),xa|=C,t.lanes=C,t.memoizedState=oe}}function Cv(t,a){if(typeof t!="function")throw Error(i(191,t));t.call(a)}function Ev(t,a){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;tg?g:8;var C=L.T,j={};L.T=j,Cf(t,!1,a,s);try{var k=h(),G=L.S;if(G!==null&&G(j,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var ie=sR(k,c);bo(t,a,ie,$n(t))}else bo(t,a,c,$n(t))}catch(oe){bo(t,a,{then:function(){},status:"rejected",reason:oe},$n())}finally{Z.p=g,C!==null&&j.types!==null&&(C.types=j.types),L.T=C}}function fR(){}function Sf(t,a,s,c){if(t.tag!==5)throw Error(i(476));var h=ry(t).queue;ny(t,h,a,re,s===null?fR:function(){return ay(t),s(c)})}function ry(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Br,lastRenderedState:re},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Br,lastRenderedState:s},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function ay(t){var a=ry(t);a.next===null&&(a=t.alternate.memoizedState),bo(t,a.next.queue,{},$n())}function _f(){return en(Lo)}function iy(){return At().memoizedState}function sy(){return At().memoizedState}function hR(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var s=$n();t=ma(s);var c=pa(a,t,s);c!==null&&(jn(c,a,s),mo(c,a,s)),a={cache:Xd()},t.payload=a;return}a=a.return}}function mR(t,a,s){var c=$n();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},sc(t)?ly(a,s):(s=Fd(t,a,s,c),s!==null&&(jn(s,t,c),cy(s,a,c)))}function oy(t,a,s){var c=$n();bo(t,a,s,c)}function bo(t,a,s,c){var h={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(sc(t))ly(a,h);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=a.lastRenderedReducer,g!==null))try{var C=a.lastRenderedState,j=g(C,s);if(h.hasEagerState=!0,h.eagerState=j,Mn(j,C))return Fl(t,a,h,0),ft===null&&Pl(),!1}catch{}if(s=Fd(t,a,h,c),s!==null)return jn(s,t,c),cy(s,a,c),!0}return!1}function Cf(t,a,s,c){if(c={lane:2,revertLane:nh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},sc(t)){if(a)throw Error(i(479))}else a=Fd(t,s,c,2),a!==null&&jn(a,t,2)}function sc(t){var a=t.alternate;return t===Fe||a!==null&&a===Fe}function ly(t,a){os=Wl=!0;var s=t.pending;s===null?a.next=a:(a.next=s.next,s.next=a),t.pending=a}function cy(t,a,s){if((s&4194048)!==0){var c=a.lanes;c&=t.pendingLanes,s|=c,a.lanes=s,bn(t,s)}}var xo={readContext:en,use:nc,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};xo.useEffectEvent=Ct;var uy={readContext:en,use:nc,useCallback:function(t,a){return pn().memoizedState=[t,a===void 0?null:a],t},useContext:en,useEffect:Zv,useImperativeHandle:function(t,a,s){s=s!=null?s.concat([t]):null,ac(4194308,4,Xv.bind(null,a,t),s)},useLayoutEffect:function(t,a){return ac(4194308,4,t,a)},useInsertionEffect:function(t,a){ac(4,2,t,a)},useMemo:function(t,a){var s=pn();a=a===void 0?null:a;var c=t();if(hi){Y(!0);try{t()}finally{Y(!1)}}return s.memoizedState=[c,a],c},useReducer:function(t,a,s){var c=pn();if(s!==void 0){var h=s(a);if(hi){Y(!0);try{s(a)}finally{Y(!1)}}}else h=a;return c.memoizedState=c.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},c.queue=t,t=t.dispatch=mR.bind(null,Fe,t),[c.memoizedState,t]},useRef:function(t){var a=pn();return t={current:t},a.memoizedState=t},useState:function(t){t=vf(t);var a=t.queue,s=oy.bind(null,Fe,a);return a.dispatch=s,[t.memoizedState,s]},useDebugValue:xf,useDeferredValue:function(t,a){var s=pn();return wf(s,t,a)},useTransition:function(){var t=vf(!1);return t=ny.bind(null,Fe,t.queue,!0,!1),pn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,s){var c=Fe,h=pn();if(Ye){if(s===void 0)throw Error(i(407));s=s()}else{if(s=a(),ft===null)throw Error(i(349));(Ge&127)!==0||Mv(c,a,s)}h.memoizedState=s;var g={value:s,getSnapshot:a};return h.queue=g,Zv(Dv.bind(null,c,g,t),[t]),c.flags|=2048,cs(9,{destroy:void 0},Nv.bind(null,c,g,s,a),null),s},useId:function(){var t=pn(),a=ft.identifierPrefix;if(Ye){var s=_r,c=Sr;s=(c&~(1<<32-W(c)-1)).toString(32)+s,a="_"+a+"R_"+s,s=ec++,0<\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof c.is=="string"?C.createElement("select",{is:c.is}):C.createElement("select"),c.multiple?g.multiple=!0:c.size&&(g.size=c.size);break;default:g=typeof c.is=="string"?C.createElement(h,{is:c.is}):C.createElement(h)}}g[Jt]=a,g[wn]=c;e:for(C=a.child;C!==null;){if(C.tag===5||C.tag===6)g.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===a)break e;for(;C.sibling===null;){if(C.return===null||C.return===a)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}a.stateNode=g;e:switch(nn(g,h,c),h){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Gr(a)}}return pt(a),If(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,s),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==c&&Gr(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(i(166));if(t=le.current,es(a)){if(t=a.stateNode,s=a.memoizedProps,c=null,h=Wt,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}t[Jt]=a,t=!!(t.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||O0(t.nodeValue,s)),t||da(a,!0)}else t=Rc(t).createTextNode(c),t[Jt]=a,a.stateNode=t}return pt(a),null;case 31:if(s=a.memoizedState,t===null||t.memoizedState!==null){if(c=es(a),s!==null){if(t===null){if(!c)throw Error(i(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(557));t[Jt]=a}else si(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;pt(a),t=!1}else s=Zd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return a.flags&256?(zn(a),a):(zn(a),null);if((a.flags&128)!==0)throw Error(i(558))}return pt(a),null;case 13:if(c=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=es(a),c!==null&&c.dehydrated!==null){if(t===null){if(!h)throw Error(i(318));if(h=a.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(i(317));h[Jt]=a}else si(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;pt(a),h=!1}else h=Zd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return a.flags&256?(zn(a),a):(zn(a),null)}return zn(a),(a.flags&128)!==0?(a.lanes=s,a):(s=c!==null,t=t!==null&&t.memoizedState!==null,s&&(c=a.child,h=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(h=c.alternate.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==h&&(c.flags|=2048)),s!==t&&s&&(a.child.flags|=8192),dc(a,a.updateQueue),pt(a),null);case 4:return xe(),t===null&&sh(a.stateNode.containerInfo),pt(a),null;case 10:return Ur(a.type),pt(a),null;case 19:if(N(Ot),c=a.memoizedState,c===null)return pt(a),null;if(h=(a.flags&128)!==0,g=c.rendering,g===null)if(h)So(c,!1);else{if(Et!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(g=Jl(t),g!==null){for(a.flags|=128,So(c,!1),t=g.updateQueue,a.updateQueue=t,dc(a,t),a.subtreeFlags=0,t=s,s=a.child;s!==null;)ov(s,t),s=s.sibling;return B(Ot,Ot.current&1|2),Ye&&Fr(a,c.treeForkCount),a.child}t=t.sibling}c.tail!==null&&Dt()>gc&&(a.flags|=128,h=!0,So(c,!1),a.lanes=4194304)}else{if(!h)if(t=Jl(g),t!==null){if(a.flags|=128,h=!0,t=t.updateQueue,a.updateQueue=t,dc(a,t),So(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!Ye)return pt(a),null}else 2*Dt()-c.renderingStartTime>gc&&s!==536870912&&(a.flags|=128,h=!0,So(c,!1),a.lanes=4194304);c.isBackwards?(g.sibling=a.child,a.child=g):(t=c.last,t!==null?t.sibling=g:a.child=g,c.last=g)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Dt(),t.sibling=null,s=Ot.current,B(Ot,h?s&1|2:s&1),Ye&&Fr(a,c.treeForkCount),t):(pt(a),null);case 22:case 23:return zn(a),of(),c=a.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(s&536870912)!==0&&(a.flags&128)===0&&(pt(a),a.subtreeFlags&6&&(a.flags|=8192)):pt(a),s=a.updateQueue,s!==null&&dc(a,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048),t!==null&&N(ci),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Ur(kt),pt(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function bR(t,a){switch(qd(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return Ur(kt),xe(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return Ie(a),null;case 31:if(a.memoizedState!==null){if(zn(a),a.alternate===null)throw Error(i(340));si()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(zn(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(i(340));si()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return N(Ot),null;case 4:return xe(),null;case 10:return Ur(a.type),null;case 22:case 23:return zn(a),of(),t!==null&&N(ci),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return Ur(kt),null;case 25:return null;default:return null}}function zy(t,a){switch(qd(a),a.tag){case 3:Ur(kt),xe();break;case 26:case 27:case 5:Ie(a);break;case 4:xe();break;case 31:a.memoizedState!==null&&zn(a);break;case 13:zn(a);break;case 19:N(Ot);break;case 10:Ur(a.type);break;case 22:case 23:zn(a),of(),t!==null&&N(ci);break;case 24:Ur(kt)}}function _o(t,a){try{var s=a.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var h=c.next;s=h;do{if((s.tag&t)===t){c=void 0;var g=s.create,C=s.inst;c=g(),C.destroy=c}s=s.next}while(s!==h)}}catch(j){at(a,a.return,j)}}function ya(t,a,s){try{var c=a.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var g=h.next;c=g;do{if((c.tag&t)===t){var C=c.inst,j=C.destroy;if(j!==void 0){C.destroy=void 0,h=a;var k=s,G=j;try{G()}catch(ie){at(h,k,ie)}}}c=c.next}while(c!==g)}}catch(ie){at(a,a.return,ie)}}function ky(t){var a=t.updateQueue;if(a!==null){var s=t.stateNode;try{Ev(a,s)}catch(c){at(t,t.return,c)}}}function Ly(t,a,s){s.props=mi(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(c){at(t,a,c)}}function Co(t,a){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof s=="function"?t.refCleanup=s(c):s.current=c}}catch(h){at(t,a,h)}}function Cr(t,a){var s=t.ref,c=t.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(h){at(t,a,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(h){at(t,a,h)}else s.current=null}function $y(t){var a=t.type,s=t.memoizedProps,c=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(h){at(t,t.return,h)}}function Pf(t,a,s){try{var c=t.stateNode;VR(c,t.type,s,a),c[wn]=a}catch(h){at(t,t.return,h)}}function Iy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ea(t.type)||t.tag===4}function Ff(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Iy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Ea(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Vf(t,a,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(t),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=$r));else if(c!==4&&(c===27&&Ea(t.type)&&(s=t.stateNode,a=null),t=t.child,t!==null))for(Vf(t,a,s),t=t.sibling;t!==null;)Vf(t,a,s),t=t.sibling}function fc(t,a,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,a?s.insertBefore(t,a):s.appendChild(t);else if(c!==4&&(c===27&&Ea(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(fc(t,a,s),t=t.sibling;t!==null;)fc(t,a,s),t=t.sibling}function Py(t){var a=t.stateNode,s=t.memoizedProps;try{for(var c=t.type,h=a.attributes;h.length;)a.removeAttributeNode(h[0]);nn(a,c,s),a[Jt]=t,a[wn]=s}catch(g){at(t,t.return,g)}}var Zr=!1,It=!1,Uf=!1,Fy=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function xR(t,a){if(t=t.containerInfo,ch=Dc,t=Jg(t),zd(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var h=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{s.nodeType,g.nodeType}catch{s=null;break e}var C=0,j=-1,k=-1,G=0,ie=0,oe=t,Q=null;t:for(;;){for(var te;oe!==s||h!==0&&oe.nodeType!==3||(j=C+h),oe!==g||c!==0&&oe.nodeType!==3||(k=C+c),oe.nodeType===3&&(C+=oe.nodeValue.length),(te=oe.firstChild)!==null;)Q=oe,oe=te;for(;;){if(oe===t)break t;if(Q===s&&++G===h&&(j=C),Q===g&&++ie===c&&(k=C),(te=oe.nextSibling)!==null)break;oe=Q,Q=oe.parentNode}oe=te}s=j===-1||k===-1?null:{start:j,end:k}}else s=null}s=s||{start:0,end:0}}else s=null;for(uh={focusedElem:t,selectionRange:s},Dc=!1,Zt=a;Zt!==null;)if(a=Zt,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,Zt=t;else for(;Zt!==null;){switch(a=Zt,g=a.alternate,t=a.flags,a.tag){case 0:if((t&4)!==0&&(t=a.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s title"))),nn(g,c,s),g[Jt]=t,Gt(g),c=g;break e;case"link":var C=G0("link","href",h).get(c+(s.href||""));if(C){for(var j=0;jlt&&(C=lt,lt=De,De=C);var H=Qg(j,De),$=Qg(j,lt);if(H&&$&&(te.rangeCount!==1||te.anchorNode!==H.node||te.anchorOffset!==H.offset||te.focusNode!==$.node||te.focusOffset!==$.offset)){var q=oe.createRange();q.setStart(H.node,H.offset),te.removeAllRanges(),De>lt?(te.addRange(q),te.extend($.node,$.offset)):(q.setEnd($.node,$.offset),te.addRange(q))}}}}for(oe=[],te=j;te=te.parentNode;)te.nodeType===1&&oe.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;js?32:s,L.T=null,s=Yf,Yf=null;var g=Sa,C=Jr;if(Ut=0,ms=Sa=null,Jr=0,(tt&6)!==0)throw Error(i(331));var j=tt;if(tt|=4,Xy(g.current),Ky(g,g.current,C,s),tt=j,Ao(0,!1),ce&&typeof ce.onPostCommitFiberRoot=="function")try{ce.onPostCommitFiberRoot(U,g)}catch{}return!0}finally{Z.p=h,L.T=c,p0(t,a)}}function v0(t,a,s){a=qn(s,a),a=Tf(t.stateNode,a,2),t=pa(t,a,2),t!==null&&(St(t,2),Er(t))}function at(t,a,s){if(t.tag===3)v0(t,t,s);else for(;a!==null;){if(a.tag===3){v0(a,t,s);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(wa===null||!wa.has(c))){t=qn(s,t),s=yy(2),c=pa(a,s,2),c!==null&&(by(s,c,a,t),St(c,2),Er(c));break}}a=a.return}}function Wf(t,a,s){var c=t.pingCache;if(c===null){c=t.pingCache=new _R;var h=new Set;c.set(a,h)}else h=c.get(a),h===void 0&&(h=new Set,c.set(a,h));h.has(s)||(qf=!0,h.add(s),t=TR.bind(null,t,a,s),a.then(t,t))}function TR(t,a,s){var c=t.pingCache;c!==null&&c.delete(a),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,ft===t&&(Ge&s)===s&&(Et===4||Et===3&&(Ge&62914560)===Ge&&300>Dt()-pc?(tt&2)===0&&ps(t,0):Gf|=s,hs===Ge&&(hs=0)),Er(t)}function y0(t,a){a===0&&(a=qt()),t=ai(t,a),t!==null&&(St(t,a),Er(t))}function OR(t){var a=t.memoizedState,s=0;a!==null&&(s=a.retryLane),y0(t,s)}function AR(t,a){var s=0;switch(t.tag){case 31:case 13:var c=t.stateNode,h=t.memoizedState;h!==null&&(s=h.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(a),y0(t,s)}function MR(t,a){return rr(t,a)}var Sc=null,vs=null,eh=!1,_c=!1,th=!1,Ca=0;function Er(t){t!==vs&&t.next===null&&(vs===null?Sc=vs=t:vs=vs.next=t),_c=!0,eh||(eh=!0,DR())}function Ao(t,a){if(!th&&_c){th=!0;do for(var s=!1,c=Sc;c!==null;){if(t!==0){var h=c.pendingLanes;if(h===0)var g=0;else{var C=c.suspendedLanes,j=c.pingedLanes;g=(1<<31-W(42|t)+1)-1,g&=h&~(C&~j),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(s=!0,S0(c,g))}else g=Ge,g=Ne(c,c===ft?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||ht(c,g)||(s=!0,S0(c,g));c=c.next}while(s);th=!1}}function NR(){b0()}function b0(){_c=eh=!1;var t=0;Ca!==0&&HR()&&(t=Ca);for(var a=Dt(),s=null,c=Sc;c!==null;){var h=c.next,g=x0(c,a);g===0?(c.next=null,s===null?Sc=h:s.next=h,h===null&&(vs=s)):(s=c,(t!==0||(g&3)!==0)&&(_c=!0)),c=h}Ut!==0&&Ut!==5||Ao(t),Ca!==0&&(Ca=0)}function x0(t,a){for(var s=t.suspendedLanes,c=t.pingedLanes,h=t.expirationTimes,g=t.pendingLanes&-62914561;0j)break;var ie=k.transferSize,oe=k.initiatorType;ie&&A0(oe)&&(k=k.responseEnd,C+=ie*(k"u"?null:document;function U0(t,a,s){var c=ys;if(c&&typeof a=="string"&&a){var h=Hn(a);h='link[rel="'+t+'"][href="'+h+'"]',typeof s=="string"&&(h+='[crossorigin="'+s+'"]'),V0.has(h)||(V0.add(h),t={rel:t,crossOrigin:s,href:a},c.querySelector(h)===null&&(a=c.createElement("link"),nn(a,"link",t),Gt(a),c.head.appendChild(a)))}}function JR(t){Wr.D(t),U0("dns-prefetch",t,null)}function WR(t,a){Wr.C(t,a),U0("preconnect",t,a)}function e2(t,a,s){Wr.L(t,a,s);var c=ys;if(c&&t&&a){var h='link[rel="preload"][as="'+Hn(a)+'"]';a==="image"&&s&&s.imageSrcSet?(h+='[imagesrcset="'+Hn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(h+='[imagesizes="'+Hn(s.imageSizes)+'"]')):h+='[href="'+Hn(t)+'"]';var g=h;switch(a){case"style":g=bs(t);break;case"script":g=xs(t)}Xn.has(g)||(t=v({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:t,as:a},s),Xn.set(g,t),c.querySelector(h)!==null||a==="style"&&c.querySelector(zo(g))||a==="script"&&c.querySelector(ko(g))||(a=c.createElement("link"),nn(a,"link",t),Gt(a),c.head.appendChild(a)))}}function t2(t,a){Wr.m(t,a);var s=ys;if(s&&t){var c=a&&typeof a.as=="string"?a.as:"script",h='link[rel="modulepreload"][as="'+Hn(c)+'"][href="'+Hn(t)+'"]',g=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=xs(t)}if(!Xn.has(g)&&(t=v({rel:"modulepreload",href:t},a),Xn.set(g,t),s.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ko(g)))return}c=s.createElement("link"),nn(c,"link",t),Gt(c),s.head.appendChild(c)}}}function n2(t,a,s){Wr.S(t,a,s);var c=ys;if(c&&t){var h=Vi(c).hoistableStyles,g=bs(t);a=a||"default";var C=h.get(g);if(!C){var j={loading:0,preload:null};if(C=c.querySelector(zo(g)))j.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":a},s),(s=Xn.get(g))&&vh(t,s);var k=C=c.createElement("link");Gt(k),nn(k,"link",t),k._p=new Promise(function(G,ie){k.onload=G,k.onerror=ie}),k.addEventListener("load",function(){j.loading|=1}),k.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Tc(C,a,c)}C={type:"stylesheet",instance:C,count:1,state:j},h.set(g,C)}}}function r2(t,a){Wr.X(t,a);var s=ys;if(s&&t){var c=Vi(s).hoistableScripts,h=xs(t),g=c.get(h);g||(g=s.querySelector(ko(h)),g||(t=v({src:t,async:!0},a),(a=Xn.get(h))&&yh(t,a),g=s.createElement("script"),Gt(g),nn(g,"link",t),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function a2(t,a){Wr.M(t,a);var s=ys;if(s&&t){var c=Vi(s).hoistableScripts,h=xs(t),g=c.get(h);g||(g=s.querySelector(ko(h)),g||(t=v({src:t,async:!0,type:"module"},a),(a=Xn.get(h))&&yh(t,a),g=s.createElement("script"),Gt(g),nn(g,"link",t),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function H0(t,a,s,c){var h=(h=le.current)?jc(h):null;if(!h)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=bs(s.href),s=Vi(h).hoistableStyles,c=s.get(a),c||(c={type:"style",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=bs(s.href);var g=Vi(h).hoistableStyles,C=g.get(t);if(C||(h=h.ownerDocument||h,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(t,C),(g=h.querySelector(zo(t)))&&!g._p&&(C.instance=g,C.state.loading=5),Xn.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Xn.set(t,s),g||i2(h,t,s,C.state))),a&&c===null)throw Error(i(528,""));return C}if(a&&c!==null)throw Error(i(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=xs(s),s=Vi(h).hoistableScripts,c=s.get(a),c||(c={type:"script",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function bs(t){return'href="'+Hn(t)+'"'}function zo(t){return'link[rel="stylesheet"]['+t+"]"}function B0(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function i2(t,a,s,c){t.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=t.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),nn(a,"link",s),Gt(a),t.head.appendChild(a))}function xs(t){return'[src="'+Hn(t)+'"]'}function ko(t){return"script[async]"+t}function q0(t,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var c=t.querySelector('style[data-href~="'+Hn(s.href)+'"]');if(c)return a.instance=c,Gt(c),c;var h=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),Gt(c),nn(c,"style",h),Tc(c,s.precedence,t),a.instance=c;case"stylesheet":h=bs(s.href);var g=t.querySelector(zo(h));if(g)return a.state.loading|=4,a.instance=g,Gt(g),g;c=B0(s),(h=Xn.get(h))&&vh(c,h),g=(t.ownerDocument||t).createElement("link"),Gt(g);var C=g;return C._p=new Promise(function(j,k){C.onload=j,C.onerror=k}),nn(g,"link",c),a.state.loading|=4,Tc(g,s.precedence,t),a.instance=g;case"script":return g=xs(s.src),(h=t.querySelector(ko(g)))?(a.instance=h,Gt(h),h):(c=s,(h=Xn.get(g))&&(c=v({},s),yh(c,h)),t=t.ownerDocument||t,h=t.createElement("script"),Gt(h),nn(h,"link",c),t.head.appendChild(h),a.instance=h);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(c=a.instance,a.state.loading|=4,Tc(c,s.precedence,t));return a.instance}function Tc(t,a,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=c.length?c[c.length-1]:null,g=h,C=0;C title"):null)}function s2(t,a,s){if(s===1||a.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(t=a.disabled,typeof a.precedence=="string"&&t==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function K0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function o2(t,a,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var h=bs(c.href),g=a.querySelector(zo(h));if(g){a=g._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=Ac.bind(t),a.then(t,t)),s.state.loading|=4,s.instance=g,Gt(g);return}g=a.ownerDocument||a,c=B0(c),(h=Xn.get(h))&&vh(c,h),g=g.createElement("link"),Gt(g);var C=g;C._p=new Promise(function(j,k){C.onload=j,C.onerror=k}),nn(g,"link",c),s.instance=g}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Ac.bind(t),a.addEventListener("load",s),a.addEventListener("error",s))}}var bh=0;function l2(t,a){return t.stylesheets&&t.count===0&&Nc(t,t.stylesheets),0bh?50:800)+a);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(h)}}:null}function Ac(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Mc=null;function Nc(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Mc=new Map,a.forEach(c2,t),Mc=null,Ac.call(t))}function c2(t,a){if(!(a.state.loading&4)){var s=Mc.get(t);if(s)var c=s.get(null);else{s=new Map,Mc.set(t,s);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Th.exports=j2(),Th.exports}var O2=T2(),gl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},A2=class extends gl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},rp=new A2,M2={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},N2=class{#e=M2;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,n){return this.#e.setTimeout(e,n)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,n){return this.#e.setInterval(e,n)}clearInterval(e){this.#e.clearInterval(e)}},xi=new N2;function D2(e){setTimeout(e,0)}var z2=typeof window>"u"||"Deno"in globalThis;function On(){}function k2(e,n){return typeof e=="function"?e(n):e}function um(e){return typeof e=="number"&&e>=0&&e!==1/0}function ww(e,n){return Math.max(e+(n||0)-Date.now(),0)}function La(e,n){return typeof e=="function"?e(n):e}function In(e,n){return typeof e=="function"?e(n):e}function yb(e,n){const{type:r="all",exact:i,fetchStatus:o,predicate:l,queryKey:u,stale:d}=e;if(u){if(i){if(n.queryHash!==ap(u,n.options))return!1}else if(!rl(n.queryKey,u))return!1}if(r!=="all"){const p=n.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof d=="boolean"&&n.isStale()!==d||o&&o!==n.state.fetchStatus||l&&!l(n))}function bb(e,n){const{exact:r,status:i,predicate:o,mutationKey:l}=e;if(l){if(!n.options.mutationKey)return!1;if(r){if(nl(n.options.mutationKey)!==nl(l))return!1}else if(!rl(n.options.mutationKey,l))return!1}return!(i&&n.state.status!==i||o&&!o(n))}function ap(e,n){return(n?.queryKeyHashFn||nl)(e)}function nl(e){return JSON.stringify(e,(n,r)=>fm(r)?Object.keys(r).sort().reduce((i,o)=>(i[o]=r[o],i),{}):r)}function rl(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(r=>rl(e[r],n[r])):!1}var L2=Object.prototype.hasOwnProperty;function Sw(e,n,r=0){if(e===n)return e;if(r>500)return n;const i=xb(e)&&xb(n);if(!i&&!(fm(e)&&fm(n)))return n;const l=(i?e:Object.keys(e)).length,u=i?n:Object.keys(n),d=u.length,p=i?new Array(d):{};let m=0;for(let y=0;y{xi.setTimeout(n,e)})}function hm(e,n,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,n):r.structuralSharing!==!1?Sw(e,n):n}function I2(e,n,r=0){const i=[...e,n];return r&&i.length>r?i.slice(1):i}function P2(e,n,r=0){const i=[n,...e];return r&&i.length>r?i.slice(0,-1):i}var ip=Symbol();function _w(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===ip?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Cw(e,n){return typeof e=="function"?e(...n):!!e}function F2(e,n,r){let i=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=n(),i||(i=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var al=(()=>{let e=()=>z2;return{isServer(){return e()},setIsServer(n){e=n}}})();function mm(){let e,n;const r=new Promise((o,l)=>{e=o,n=l});r.status="pending",r.catch(()=>{});function i(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{i({status:"fulfilled",value:o}),e(o)},r.reject=o=>{i({status:"rejected",reason:o}),n(o)},r}var V2=D2;function U2(){let e=[],n=0,r=d=>{d()},i=d=>{d()},o=V2;const l=d=>{n?e.push(d):o(()=>{r(d)})},u=()=>{const d=e;e=[],d.length&&o(()=>{i(()=>{d.forEach(p=>{r(p)})})})};return{batch:d=>{let p;n++;try{p=d()}finally{n--,n||u()}return p},batchCalls:d=>(...p)=>{l(()=>{d(...p)})},schedule:l,setNotifyFunction:d=>{r=d},setBatchNotifyFunction:d=>{i=d},setScheduler:d=>{o=d}}}var sn=U2(),H2=class extends gl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},fu=new H2;function B2(e){return Math.min(1e3*2**e,3e4)}function Ew(e){return(e??"online")==="online"?fu.isOnline():!0}var pm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Rw(e){let n=!1,r=0,i;const o=mm(),l=()=>o.status!=="pending",u=_=>{if(!l()){const E=new pm(_);b(E),e.onCancel?.(E)}},d=()=>{n=!0},p=()=>{n=!1},m=()=>rp.isFocused()&&(e.networkMode==="always"||fu.isOnline())&&e.canRun(),y=()=>Ew(e.networkMode)&&e.canRun(),v=_=>{l()||(i?.(),o.resolve(_))},b=_=>{l()||(i?.(),o.reject(_))},x=()=>new Promise(_=>{i=E=>{(l()||m())&&_(E)},e.onPause?.()}).then(()=>{i=void 0,l()||e.onContinue?.()}),w=()=>{if(l())return;let _;const E=r===0?e.initialPromise:void 0;try{_=E??e.fn()}catch(R){_=Promise.reject(R)}Promise.resolve(_).then(v).catch(R=>{if(l())return;const T=e.retry??(al.isServer()?0:3),O=e.retryDelay??B2,M=typeof O=="function"?O(r,R):O,D=T===!0||typeof T=="number"&&rm()?void 0:x()).then(()=>{n?b(R):w()})})};return{promise:o,status:()=>o.status,cancel:u,continue:()=>(i?.(),o),cancelRetry:d,continueRetry:p,canStart:y,start:()=>(y()?w():x().then(w),o)}}var jw=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),um(this.gcTime)&&(this.#e=xi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(al.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(xi.clearTimeout(this.#e),this.#e=void 0)}};function q2(e){return{onFetch:(n,r)=>{const i=n.options,o=n.fetchOptions?.meta?.fetchMore?.direction,l=n.state.data?.pages||[],u=n.state.data?.pageParams||[];let d={pages:[],pageParams:[]},p=0;const m=async()=>{let y=!1;const v=w=>{F2(w,()=>n.signal,()=>y=!0)},b=_w(n.options,n.fetchOptions),x=async(w,_,E)=>{if(y)return Promise.reject(n.signal.reason);if(_==null&&w.pages.length)return Promise.resolve(w);const T=(()=>{const P={client:n.client,queryKey:n.queryKey,pageParam:_,direction:E?"backward":"forward",meta:n.options.meta};return v(P),P})(),O=await b(T),{maxPages:M}=n.options,D=E?P2:I2;return{pages:D(w.pages,O,M),pageParams:D(w.pageParams,_,M)}};if(o&&l.length){const w=o==="backward",_=w?Tw:gm,E={pages:l,pageParams:u},R=_(i,E);d=await x(E,R,w)}else{const w=e??l.length;do{const _=p===0?u[0]??i.initialPageParam:gm(i,d);if(p>0&&_==null)break;d=await x(d,_),p++}while(pn.options.persister?.(m,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},r):n.fetchFn=m}}}function gm(e,{pages:n,pageParams:r}){const i=n.length-1;return n.length>0?e.getNextPageParam(n[i],n,r[i],r):void 0}function Tw(e,{pages:n,pageParams:r}){return n.length>0?e.getPreviousPageParam?.(n[0],n,r[0],r):void 0}function G2(e,n){return n?gm(e,n)!=null:!1}function Z2(e,n){return!n||!e.getPreviousPageParam?!1:Tw(e,n)!=null}var K2=class extends jw{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=_b(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=_b(this.options);n.data!==void 0&&(this.setState(Sb(n.data,n.dataUpdatedAt)),this.#t=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,n){const r=hm(this.state.data,e,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),r}setState(e){this.#l({type:"setState",state:e})}cancel(e){const n=this.#a?.promise;return this.#a?.cancel(e),n?n.then(On).catch(On):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>In(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ip||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>La(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!ww(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#a&&(this.#s||this.#u()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(m=>m.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(this.#s=!0,r.signal)})},o=()=>{const p=_w(this.options,n),y=(()=>{const v={client:this.#i,queryKey:this.queryKey,meta:this.meta};return i(v),v})();return this.#s=!1,this.options.persister?this.options.persister(p,y,this):p(y)},u=(()=>{const p={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:o};return i(p),p})();(this.#e==="infinite"?q2(this.options.pages):this.options.behavior)?.onFetch(u,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#l({type:"fetch",meta:u.fetchOptions?.meta}),this.#a=Rw({initialPromise:n?.initialPromise,fn:u.fetchFn,onCancel:p=>{p instanceof pm&&p.revert&&this.setState({...this.#n,fetchStatus:"idle"}),r.abort()},onFail:(p,m)=>{this.#l({type:"failed",failureCount:p,error:m})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const p=await this.#a.start();if(p===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(p),this.#r.config.onSuccess?.(p,this),this.#r.config.onSettled?.(p,this.state.error,this),p}catch(p){if(p instanceof pm){if(p.silent)return this.#a.promise;if(p.revert){if(this.state.data===void 0)throw p;return this.state.data}}throw this.#l({type:"error",error:p}),this.#r.config.onError?.(p,this),this.#r.config.onSettled?.(this.state.data,p,this),p}finally{this.scheduleGc()}}#l(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Ow(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...Sb(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?i:void 0,i;case"error":const o=e.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),sn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Ow(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ew(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Sb(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function _b(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,r=n!==void 0,i=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Aw=class extends gl{constructor(e,n){super(),this.options=n,this.#e=e,this.#s=null,this.#o=mm(),this.bindMethods(),this.setOptions(n)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#u;#l;#m;#d;#f;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Cb(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vm(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vm(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const n=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof In(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),n._defaulted&&!dm(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&Eb(this.#t,r,this.options,n)&&this.#h(),this.updateResult(),i&&(this.#t!==r||In(this.options.enabled,this.#t)!==In(n.enabled,this.#t)||La(this.options.staleTime,this.#t)!==La(n.staleTime,this.#t))&&this.#g();const o=this.#v();i&&(this.#t!==r||In(this.options.enabled,this.#t)!==In(n.enabled,this.#t)||o!==this.#c)&&this.#y(o)}getOptimisticResult(e){const n=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(n,e);return Q2(this,r)&&(this.#r=r,this.#a=this.options,this.#i=this.#t.state),r}getCurrentResult(){return this.#r}trackResult(e,n){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),n?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let n=this.#t.fetch(this.options,e);return e?.throwOnError||(n=n.catch(On)),n}#g(){this.#x();const e=La(this.options.staleTime,this.#t);if(al.isServer()||this.#r.isStale||!um(e))return;const r=ww(this.#r.dataUpdatedAt,e)+1;this.#d=xi.setTimeout(()=>{this.#r.isStale||this.updateResult()},r)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#c=e,!(al.isServer()||In(this.options.enabled,this.#t)===!1||!um(this.#c)||this.#c===0)&&(this.#f=xi.setInterval(()=>{(this.options.refetchIntervalInBackground||rp.isFocused())&&this.#h()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#d!==void 0&&(xi.clearTimeout(this.#d),this.#d=void 0)}#w(){this.#f!==void 0&&(xi.clearInterval(this.#f),this.#f=void 0)}createResult(e,n){const r=this.#t,i=this.options,o=this.#r,l=this.#i,u=this.#a,p=e!==r?e.state:this.#n,{state:m}=e;let y={...m},v=!1,b;if(n._optimisticResults){const V=this.hasListeners(),ve=!V&&Cb(e,n),be=V&&Eb(e,r,n,i);(ve||be)&&(y={...y,...Ow(m.data,e.options)}),n._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:x,errorUpdatedAt:w,status:_}=y;b=y.data;let E=!1;if(n.placeholderData!==void 0&&b===void 0&&_==="pending"){let V;o?.isPlaceholderData&&n.placeholderData===u?.placeholderData?(V=o.data,E=!0):V=typeof n.placeholderData=="function"?n.placeholderData(this.#m?.state.data,this.#m):n.placeholderData,V!==void 0&&(_="success",b=hm(o?.data,V,n),v=!0)}if(n.select&&b!==void 0&&!E)if(o&&b===l?.data&&n.select===this.#u)b=this.#l;else try{this.#u=n.select,b=n.select(b),b=hm(o?.data,b,n),this.#l=b,this.#s=null}catch(V){this.#s=V}this.#s&&(x=this.#s,b=this.#l,w=Date.now(),_="error");const R=y.fetchStatus==="fetching",T=_==="pending",O=_==="error",M=T&&R,D=b!==void 0,F={status:_,fetchStatus:y.fetchStatus,isPending:T,isSuccess:_==="success",isError:O,isInitialLoading:M,isLoading:M,data:b,dataUpdatedAt:y.dataUpdatedAt,error:x,errorUpdatedAt:w,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:y.dataUpdateCount>p.dataUpdateCount||y.errorUpdateCount>p.errorUpdateCount,isFetching:R,isRefetching:R&&!T,isLoadingError:O&&!D,isPaused:y.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:O&&D,isStale:sp(e,n),refetch:this.refetch,promise:this.#o,isEnabled:In(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const V=F.data!==void 0,ve=F.status==="error"&&!V,be=X=>{ve?X.reject(F.error):V&&X.resolve(F.data)},he=()=>{const X=this.#o=F.promise=mm();be(X)},ue=this.#o;switch(ue.status){case"pending":e.queryHash===r.queryHash&&be(ue);break;case"fulfilled":(ve||F.data!==ue.value)&&he();break;case"rejected":(!ve||F.error!==ue.reason)&&he();break}}return F}updateResult(){const e=this.#r,n=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#m=this.#t),dm(n,e))return;this.#r=n;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!this.#p.size)return!0;const l=new Set(o??this.#p);return this.options.throwOnError&&l.add("error"),Object.keys(this.#r).some(u=>{const d=u;return this.#r[d]!==e[d]&&l.has(d)})};this.#_({listeners:r()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const n=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(n?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){sn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Y2(e,n){return In(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&In(n.retryOnMount,e)===!1)}function Cb(e,n){return Y2(e,n)||e.state.data!==void 0&&vm(e,n,n.refetchOnMount)}function vm(e,n,r){if(In(n.enabled,e)!==!1&&La(n.staleTime,e)!=="static"){const i=typeof r=="function"?r(e):r;return i==="always"||i!==!1&&sp(e,n)}return!1}function Eb(e,n,r,i){return(e!==n||In(i.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&sp(e,r)}function sp(e,n){return In(n.enabled,e)!==!1&&e.isStaleByTime(La(n.staleTime,e))}function Q2(e,n){return!dm(e.getCurrentResult(),n)}var X2=class extends Aw{constructor(e,n){super(e,n)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,n){const{state:r}=e,i=super.createResult(e,n),{isFetching:o,isRefetching:l,isError:u,isRefetchError:d}=i,p=r.fetchMeta?.fetchMore?.direction,m=u&&p==="forward",y=o&&p==="forward",v=u&&p==="backward",b=o&&p==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:G2(n,r.data),hasPreviousPage:Z2(n,r.data),isFetchNextPageError:m,isFetchingNextPage:y,isFetchPreviousPageError:v,isFetchingPreviousPage:b,isRefetchError:d&&!m&&!v,isRefetching:l&&!y&&!b}}},J2=class extends jw{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||W2(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(n=>n!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Rw({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(l,u)=>{this.#i({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#i({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",o=!this.#r.canStart();try{if(i)n();else{this.#i({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);const u=await this.options.onMutate?.(e,r);u!==this.state.context&&this.#i({type:"pending",context:u,variables:e,isPaused:o})}const l=await this.#r.start();return await this.#n.config.onSuccess?.(l,e,this.state.context,this,r),await this.options.onSuccess?.(l,e,this.state.context,r),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(l,null,e,this.state.context,r),this.#i({type:"success",data:l}),l}catch(l){try{await this.#n.config.onError?.(l,e,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onError?.(l,e,this.state.context,r)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,l,e,this.state.context,r)}catch(u){Promise.reject(u)}throw this.#i({type:"error",error:l}),l}finally{this.#n.runNext(this)}}#i(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),sn.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function W2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ej=class extends gl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,r){const i=new J2({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){this.#e.add(e);const n=Fc(e);if(typeof n=="string"){const r=this.#t.get(n);r?r.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=Fc(e);if(typeof n=="string"){const r=this.#t.get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Fc(e);if(typeof n=="string"){const i=this.#t.get(n)?.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){const n=Fc(e);return typeof n=="string"?this.#t.get(n)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){sn.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(r=>bb(n,r))}findAll(e={}){return this.getAll().filter(n=>bb(e,n))}notify(e){sn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return sn.batch(()=>Promise.all(e.map(n=>n.continue().catch(On))))}};function Fc(e){return e.options.scope?.id}var tj=class extends gl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,r){const i=n.queryKey,o=n.queryHash??ap(i,n);let l=this.get(o);return l||(l=new K2({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){sn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>yb(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>yb(e,r)):n}notify(e){sn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){sn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){sn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},nj=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new tj,this.#t=e.mutationCache||new ej,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=rp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=fu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),r=this.#e.build(this,n),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(La(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(e,n,r){const i=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(i.queryHash)?.state.data,u=k2(n,l);if(u!==void 0)return this.#e.build(this,i).setData(u,{...r,manual:!0})}setQueriesData(e,n,r){return sn.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;sn.batch(()=>{n.findAll(e).forEach(r=>{n.remove(r)})})}resetQueries(e,n){const r=this.#e;return sn.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const r={revert:!0,...n},i=sn.batch(()=>this.#e.findAll(e).map(o=>o.cancel(r)));return Promise.all(i).then(On).catch(On)}invalidateQueries(e,n={}){return sn.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},i=sn.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let l=o.fetch(void 0,r);return r.throwOnError||(l=l.catch(On)),o.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(On)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const r=this.#e.build(this,n);return r.isStaleByTime(La(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(On).catch(On)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(On).catch(On)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return fu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#r.set(nl(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#r.values()],r={};return n.forEach(i=>{rl(e,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(e,n){this.#i.set(nl(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#i.values()],r={};return n.forEach(i=>{rl(e,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=ap(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===ip&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Mw=S.createContext(void 0),Ai=e=>{const n=S.useContext(Mw);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},rj=({client:e,children:n})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(Mw.Provider,{value:e,children:n})),Nw=S.createContext(!1),aj=()=>S.useContext(Nw);Nw.Provider;function ij(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var sj=S.createContext(ij()),oj=()=>S.useContext(sj),lj=(e,n,r)=>{const i=r?.state.error&&typeof e.throwOnError=="function"?Cw(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(n.isReset()||(e.retryOnMount=!1))},cj=e=>{S.useEffect(()=>{e.clearReset()},[e])},uj=({result:e,errorResetBoundary:n,throwOnError:r,query:i,suspense:o})=>e.isError&&!n.isReset()&&!e.isFetching&&i&&(o&&e.data===void 0||Cw(r,[e.error,i])),dj=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...o)=>r(i(...o)):r(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},fj=(e,n)=>e.isLoading&&e.isFetching&&!n,hj=(e,n)=>e?.suspense&&n.isPending,Rb=(e,n,r)=>n.fetchOptimistic(e).catch(()=>{r.clearReset()});function Dw(e,n,r){const i=aj(),o=oj(),l=Ai(),u=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const d=l.getQueryCache().get(u.queryHash),p=e.subscribed!==!1;u._optimisticResults=i?"isRestoring":p?"optimistic":void 0,dj(u),lj(u,o,d),cj(o);const m=!l.getQueryCache().get(u.queryHash),[y]=S.useState(()=>new n(l,u)),v=y.getOptimisticResult(u),b=!i&&p;if(S.useSyncExternalStore(S.useCallback(x=>{const w=b?y.subscribe(sn.batchCalls(x)):On;return y.updateResult(),w},[y,b]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),S.useEffect(()=>{y.setOptions(u)},[u,y]),hj(u,v))throw Rb(u,y,o);if(uj({result:v,errorResetBoundary:o,throwOnError:u.throwOnError,query:d,suspense:u.suspense}))throw v.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(u,v),u.experimental_prefetchInRender&&!al.isServer()&&fj(v,i)&&(m?Rb(u,y,o):d?.promise)?.catch(On).finally(()=>{y.updateResult()}),u.notifyOnChangeProps?v:y.trackResult(v)}function Pt(e,n){return Dw(e,Aw)}function mj(e,n){return Dw(e,X2)}let jb=!1;function pj(e){const n=e.analytics;if(!n?.key||jb)return;jb=!0;const r=document.createElement("script");r.src=n.host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",r.async=!0,r.onload=()=>{const i=window.posthog;i&&(i.init(n.key,{api_host:n.host,defaults:"2026-05-30",capture_pageview:"history_change",session_recording:{maskAllInputs:!0,maskTextSelector:"*"}}),e.me&&i.identify(e.me.email,{email:e.me.email,name:e.me.name,...e.billing?{plan:e.billing.plan}:{}}))},document.head.appendChild(r)}function zw(e,n){window.posthog?.capture(e,n)}const gj=[[/^POST \/api\/projects$/,"project_created"],[/^DELETE \/api\/projects\//,"project_deleted"],[/^POST \/api\/p\/[^/]+\/restore$/,"file_restored"],[/^DELETE \/api\/shares\//,"share_revoked"],[/^PATCH \/api\/shares\//,"share_expiry_changed"],[/^POST \/api\/orgs\/[^/]+\/invites$/,"invite_created"],[/^DELETE \/api\/orgs\/[^/]+\/invites\//,"invite_revoked"],[/^POST \/api\/invites\//,"invite_accepted"],[/^PUT \/api\/p\/[^/]+\/permissions\/./,"project_access_granted"],[/^DELETE \/api\/p\/[^/]+\/permissions\/./,"project_access_revoked"]];function kw(e,n){const r=e+" "+n.split("?")[0],i=gj.find(([o])=>o.test(r));i&&zw(i[1])}function op(){throw location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),new Error("signing in…")}function vj(e,n){const r=n.trim();switch(e){case 403:return r.includes("seat")?"This plan is out of seats. Upgrade to add more people.":r.includes("owner")?"Only owners can do that.":"You don't have access to that.";case 409:return r?r[0].toUpperCase()+r.slice(1):"That is managed outside this hub.";case 404:return"That is gone — it may have been removed already.";case 413:return"This project is over its plan limit.";case 429:return"Too many requests. Give it a moment.";default:return e>=500?"The server had a problem. Try again.":r?r[0].toUpperCase()+r.slice(1):"Something went wrong."}}async function Mu(e){throw new Error(vj(e.status,await e.text()))}async function Bt(e){const n=await fetch(e,{headers:{Accept:"application/json"}});return n.status===401&&op(),n.ok||await Mu(n),n.json()}async function yj(e){const n=await fetch(e);return n.status===401&&op(),n.ok||await Mu(n),n}async function Wn(e,n,r){const i={method:e};r!==void 0&&(i.headers={"Content-Type":"application/json"},i.body=JSON.stringify(r));const o=await fetch(n,i);return o.ok||await Mu(o),kw(e,n),o.status===204?{}:o.json()}async function Si(e,n){const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n||{})});return r.status===401&&op(),r.ok||await Mu(r),kw("POST",e),r.json()}function bj(){return Pt({queryKey:["config"],queryFn:async()=>{const e=await Bt("/api/config");return e.auth.enabled&&!e.me&&(location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),await new Promise(()=>{})),pj(e),e},staleTime:1/0})}var Mi=xw();const xj=bw(Mi);function Tb(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Ps(...e){return n=>{let r=!1;const i=e.map(o=>{const l=Tb(o,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let o=0;o{let{children:o,...l}=r,u=null,d=!1;const p=[];Ob(o)&&typeof Vc=="function"&&(o=Vc(o._payload)),S.Children.forEach(o,b=>{if(Rj(b)){d=!0;const x=b;let w="child"in x.props?x.props.child:x.props.children;Ob(w)&&typeof Vc=="function"&&(w=Vc(w._payload)),u=_j(x,w),p.push(u?.props?.children)}else p.push(b)}),u?u=S.cloneElement(u,void 0,p):!d&&S.Children.count(o)===1&&S.isValidElement(o)&&(u=o);const m=u?Ej(u):void 0,y=nt(i,m);if(!u){if(o||o===0)throw new Error(d?Aj(e):Oj(e));return o}const v=Cj(l,u.props??{});return u.type!==S.Fragment&&(v.ref=i?y:m),S.cloneElement(u,v)});return n.displayName=`${e}.Slot`,n}var wj=_i("Slot"),Lw=Symbol.for("radix.slottable");function Sj(e){const n=r=>"child"in r?r.children(r.child):r.children;return n.displayName=`${e}.Slottable`,n.__radixId=Lw,n}var _j=(e,n)=>{if("child"in e.props){const r=e.props.child;return S.isValidElement(r)?S.cloneElement(r,void 0,e.props.children(r.props.children)):null}return S.isValidElement(n)?n:null};function Cj(e,n){const r={...n};for(const i in n){const o=e[i],l=n[i];/^on[A-Z]/.test(i)?o&&l?r[i]=(...d)=>{const p=l(...d);return o(...d),p}:o&&(r[i]=o):i==="style"?r[i]={...o,...l}:i==="className"&&(r[i]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}function Ej(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Rj(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Lw}var jj=Symbol.for("react.lazy");function Ob(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===jj&&"_payload"in e&&Tj(e._payload)}function Tj(e){return typeof e=="object"&&e!==null&&"then"in e}var Oj=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Aj=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Vc=Au[" use ".trim().toString()],Mj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$e=Mj.reduce((e,n)=>{const r=_i(`Primitive.${n}`),i=S.forwardRef((o,l)=>{const{asChild:u,...d}=o,p=u?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(p,{...d,ref:l})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function $w(e,n){e&&Mi.flushSync(()=>e.dispatchEvent(n))}var Iw=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Nj="VisuallyHidden",Pw=S.forwardRef((e,n)=>f.jsx($e.span,{...e,ref:n,style:{...Iw,...e.style}}));Pw.displayName=Nj;var Dj=Pw;function Ga(e,n=[]){let r=[];function i(l,u){const d=S.createContext(u);d.displayName=l+"Context";const p=r.length;r=[...r,u];const m=v=>{const{scope:b,children:x,...w}=v,_=b?.[e]?.[p]||d,E=S.useMemo(()=>w,Object.values(w));return f.jsx(_.Provider,{value:E,children:x})};m.displayName=l+"Provider";function y(v,b,x={}){const{optional:w=!1}=x,_=b?.[e]?.[p]||d,E=S.useContext(_);if(E)return E;if(u!==void 0)return u;if(!w)throw new Error(`\`${v}\` must be used within \`${l}\``)}return[m,y]}const o=()=>{const l=r.map(u=>S.createContext(u));return function(d){const p=d?.[e]||l;return S.useMemo(()=>({[`__scope${e}`]:{...d,[e]:p}}),[d,p])}};return o.scopeName=e,[i,zj(o,...n)]}function zj(...e){const n=e[0];if(e.length===1)return n;const r=()=>{const i=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const u=i.reduce((d,{useScope:p,scopeName:m})=>{const v=p(l)[`__scope${m}`];return{...d,...v}},{});return S.useMemo(()=>({[`__scope${n.scopeName}`]:u}),[u])}};return r.scopeName=n.scopeName,r}function lp(e){const n=e+"CollectionProvider",[r,i]=Ga(n),[o,l]=r(n,{collectionRef:{current:null},itemMap:new Map}),u=_=>{const{scope:E,children:R}=_,T=S.useRef(null),O=S.useRef(new Map).current;return f.jsx(o,{scope:E,itemMap:O,collectionRef:T,children:R})};u.displayName=n;const d=e+"CollectionSlot",p=_i(d),m=S.forwardRef((_,E)=>{const{scope:R,children:T}=_,O=l(d,R),M=nt(E,O.collectionRef);return f.jsx(p,{ref:M,children:T})});m.displayName=d;const y=e+"CollectionItemSlot",v="data-radix-collection-item",b=_i(y),x=S.forwardRef((_,E)=>{const{scope:R,children:T,...O}=_,M=S.useRef(null),D=nt(E,M),P=l(y,R);return S.useEffect(()=>(P.itemMap.set(M,{ref:M,...O}),()=>{P.itemMap.delete(M)})),f.jsx(b,{[v]:"",ref:D,children:T})});x.displayName=y;function w(_){const E=l(e+"CollectionConsumer",_);return S.useCallback(()=>{const T=E.collectionRef.current;if(!T)return[];const O=Array.from(T.querySelectorAll(`[${v}]`));return Array.from(E.itemMap.values()).sort((P,F)=>O.indexOf(P.ref.current)-O.indexOf(F.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:u,Slot:m,ItemSlot:x},w,i]}function je(e,n,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o||!o.defaultPrevented)return n?.(o)}}var Yt=globalThis?.document?S.useLayoutEffect:()=>{},kj=Au[" useInsertionEffect ".trim().toString()]||Yt;function Fs({prop:e,defaultProp:n,onChange:r=()=>{},caller:i}){const[o,l,u]=Lj({defaultProp:n,onChange:r}),d=e!==void 0,p=d?e:o;{const y=S.useRef(e!==void 0);S.useEffect(()=>{const v=y.current;v!==d&&console.warn(`${i} is changing from ${v?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=d},[d,i])}const m=S.useCallback(y=>{if(d){const v=$j(y)?y(e):y;v!==e&&u.current?.(v)}else l(y)},[d,e,l,u]);return[p,m]}function Lj({defaultProp:e,onChange:n}){const[r,i]=S.useState(e),o=S.useRef(r),l=S.useRef(n);return kj(()=>{l.current=n},[n]),S.useEffect(()=>{o.current!==r&&(l.current?.(r),o.current=r)},[r,o]),[r,i,l]}function $j(e){return typeof e=="function"}function Ij(e,n){return S.useReducer((r,i)=>n[r][i]??r,e)}var vr=e=>{const{present:n,children:r}=e,i=Pj(n),o=typeof r=="function"?r({present:i.isPresent}):S.Children.only(r),l=Fj(i.ref,Vj(o));return typeof r=="function"||i.isPresent?S.cloneElement(o,{ref:l}):null};vr.displayName="Presence";function Pj(e){const[n,r]=S.useState(),i=S.useRef(null),o=S.useRef(e),l=S.useRef("none"),u=S.useRef(void 0),d=e?"mounted":"unmounted",[p,m]=Ij(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{p==="mounted"?(l.current=u.current??Uo(i.current),u.current=void 0):l.current="none"},[p]),Yt(()=>{const y=i.current,v=o.current;if(v!==e){const x=l.current,w=Uo(y);e?(u.current=w,m("MOUNT")):w==="none"||y?.display==="none"?m("UNMOUNT"):m(v&&x!==w?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,m]),Yt(()=>{if(n){let y;const v=n.ownerDocument.defaultView??window,b=w=>{const E=Uo(i.current).includes(CSS.escape(w.animationName));if(w.target===n&&E&&(m("ANIMATION_END"),!o.current)){const R=n.style.animationFillMode;n.style.animationFillMode="forwards",y=v.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=R)})}},x=w=>{w.target===n&&(l.current=Uo(i.current))};return n.addEventListener("animationstart",x),n.addEventListener("animationcancel",b),n.addEventListener("animationend",b),()=>{v.clearTimeout(y),n.removeEventListener("animationstart",x),n.removeEventListener("animationcancel",b),n.removeEventListener("animationend",b)}}else m("ANIMATION_END")},[n,m]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:S.useCallback(y=>{if(y){const v=getComputedStyle(y);i.current=v,u.current=Uo(v)}else i.current=null;r(y)},[])}}function Ab(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Fj(...e){const n=S.useRef(e);return n.current=e,S.useCallback(r=>{const i=n.current;let o=!1;const l=i.map(u=>{const d=Ab(u,r);return!o&&typeof d=="function"&&(o=!0),d});if(o)return()=>{for(let u=0;u{}),Hj=0;function dn(e){const[n,r]=S.useState(Uj());return Yt(()=>{r(i=>i??String(Hj++))},[e]),n?`radix-${n}`:""}var Bj=S.createContext(void 0);function cp(e){const n=S.useContext(Bj);return e||n||"ltr"}function tr(e){const n=S.useRef(e);return S.useEffect(()=>{n.current=e}),S.useMemo(()=>((...r)=>n.current?.(...r)),[])}var qj="DismissableLayer",ym="dismissableLayer.update",Gj="dismissableLayer.pointerDownOutside",Zj="dismissableLayer.focusOutside",Mb,up=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),vl=S.forwardRef((e,n)=>{const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,onDismiss:p,...m}=e,y=S.useContext(up),[v,b]=S.useState(null),x=v?.ownerDocument??globalThis?.document,[,w]=S.useState({}),_=nt(n,b),E=Array.from(y.layers),[R]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),T=R?E.indexOf(R):-1,O=v?E.indexOf(v):-1,M=y.layersWithOutsidePointerEventsDisabled.size>0,D=O>=T,P=S.useRef(!1),F=Jj(he=>{l?.(he),d?.(he),he.defaultPrevented||p?.()},{ownerDocument:x,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:P,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:S.useCallback(he=>{if(!(he instanceof Node))return!1;const ue=[...y.branches].some(X=>X.contains(he));return D&&!ue},[y.branches,D])}),V=Wj(he=>{if(i&&P.current)return;const ue=he.target;[...y.branches].some(pe=>pe.contains(ue))||(u?.(he),d?.(he),he.defaultPrevented||p?.())},x),ve=v?O===E.length-1:!1,be=tr(he=>{he.key==="Escape"&&(o?.(he),!he.defaultPrevented&&p&&(he.preventDefault(),p()))});return S.useEffect(()=>{if(ve)return x.addEventListener("keydown",be,{capture:!0}),()=>x.removeEventListener("keydown",be,{capture:!0})},[x,ve,be]),S.useEffect(()=>{if(v)return r&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(Mb=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(v)),y.layers.add(v),Nb(),()=>{r&&(y.layersWithOutsidePointerEventsDisabled.delete(v),y.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=Mb))}},[v,x,r,y]),S.useEffect(()=>()=>{v&&(y.layers.delete(v),y.layersWithOutsidePointerEventsDisabled.delete(v),Nb())},[v,y]),S.useEffect(()=>{const he=()=>w({});return document.addEventListener(ym,he),()=>document.removeEventListener(ym,he)},[]),f.jsx($e.div,{...m,ref:_,style:{pointerEvents:M?D?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,V.onFocusCapture),onBlurCapture:je(e.onBlurCapture,V.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,F.onPointerDownCapture)})});vl.displayName=qj;var Kj="DismissableLayerBranch",Yj=S.forwardRef((e,n)=>{const r=S.useContext(up),i=S.useRef(null),o=nt(n,i);return S.useEffect(()=>{const l=i.current;if(l)return r.branches.add(l),()=>{r.branches.delete(l)}},[r.branches]),f.jsx($e.div,{...e,ref:o})});Yj.displayName=Kj;function Qj(){const e=S.useContext(up),[n,r]=S.useState(null);return S.useEffect(()=>{if(n)return e.dismissableSurfaces.add(n),()=>{e.dismissableSurfaces.delete(n)}},[n,e.dismissableSurfaces]),r}var Xj=()=>!0;function Jj(e,n){const{ownerDocument:r=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:l,shouldHandlePointerDownOutside:u=Xj}=n,d=tr(e),p=S.useRef(!1),m=S.useRef(!1),y=S.useRef(new Map),v=S.useRef(()=>{});return S.useEffect(()=>{function b(){m.current=!1,o.current=!1,y.current.clear()}function x(){return Array.from(y.current.values()).some(Boolean)}function w(O){if(!m.current)return;const M=O.target;M instanceof Node&&[...l].some(P=>P.contains(M))||y.current.set(O.type,!0),O.type==="click"&&window.setTimeout(()=>{m.current&&v.current()},0)}function _(O){m.current&&y.current.set(O.type,!1)}const E=O=>{if(O.target&&!p.current){let M=function(){r.removeEventListener("click",v.current);const P=x();b(),P||Fw(Gj,d,D,{discrete:!0})};if(!u(O.target)){r.removeEventListener("click",v.current),b(),p.current=!1;return}const D={originalEvent:O};m.current=!0,o.current=i&&O.button===0,y.current.clear(),!i||O.button!==0?M():(r.removeEventListener("click",v.current),v.current=M,r.addEventListener("click",v.current,{once:!0}))}else r.removeEventListener("click",v.current),b();p.current=!1},R=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const O of R)r.addEventListener(O,w,!0),r.addEventListener(O,_);const T=window.setTimeout(()=>{r.addEventListener("pointerdown",E)},0);return()=>{window.clearTimeout(T),r.removeEventListener("pointerdown",E),r.removeEventListener("click",v.current);for(const O of R)r.removeEventListener(O,w,!0),r.removeEventListener(O,_)}},[r,d,i,o,l,u]),{onPointerDownCapture:()=>p.current=!0}}function Wj(e,n=globalThis?.document){const r=tr(e),i=S.useRef(!1);return S.useEffect(()=>{const o=l=>{l.target&&!i.current&&Fw(Zj,r,{originalEvent:l},{discrete:!1})};return n.addEventListener("focusin",o),()=>n.removeEventListener("focusin",o)},[n,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Nb(){const e=new CustomEvent(ym);document.dispatchEvent(e)}function Fw(e,n,r,{discrete:i}){const o=r.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});n&&o.addEventListener(e,n,{once:!0}),i?$w(o,l):o.dispatchEvent(l)}var Nh="focusScope.autoFocusOnMount",Dh="focusScope.autoFocusOnUnmount",Db={bubbles:!1,cancelable:!0},eT="FocusScope",Nu=S.forwardRef((e,n)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=e,[d,p]=S.useState(null),m=tr(o),y=tr(l),v=S.useRef(null),b=nt(n,p),x=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(i){let _=function(O){if(x.paused||!d)return;const M=O.target;d.contains(M)?v.current=M:Na(v.current,{select:!0})},E=function(O){if(x.paused||!d)return;const M=O.relatedTarget;M!==null&&(d.contains(M)||Na(v.current,{select:!0}))},R=function(O){if(document.activeElement===document.body)for(const D of O)D.removedNodes.length>0&&Na(d)};document.addEventListener("focusin",_),document.addEventListener("focusout",E);const T=new MutationObserver(R);return d&&T.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",E),T.disconnect()}}},[i,d,x.paused]),S.useEffect(()=>{if(d){kb.add(x);const _=document.activeElement;if(!d.contains(_)){const R=new CustomEvent(Nh,Db);d.addEventListener(Nh,m),d.dispatchEvent(R),R.defaultPrevented||(tT(sT(Vw(d)),{select:!0}),document.activeElement===_&&Na(d))}return()=>{d.removeEventListener(Nh,m),setTimeout(()=>{const R=new CustomEvent(Dh,Db);d.addEventListener(Dh,y),d.dispatchEvent(R),R.defaultPrevented||Na(_??document.body,{select:!0}),d.removeEventListener(Dh,y),kb.remove(x)},0)}}},[d,m,y,x]);const w=S.useCallback(_=>{if(!r&&!i||x.paused)return;const E=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,R=document.activeElement;if(E&&R){const T=_.currentTarget,[O,M]=nT(T);O&&M?!_.shiftKey&&R===M?(_.preventDefault(),r&&Na(O,{select:!0})):_.shiftKey&&R===O&&(_.preventDefault(),r&&Na(M,{select:!0})):R===T&&_.preventDefault()}},[r,i,x.paused]);return f.jsx($e.div,{tabIndex:-1,...u,ref:b,onKeyDown:w})});Nu.displayName=eT;function tT(e,{select:n=!1}={}){const r=document.activeElement;for(const i of e)if(Na(i,{select:n}),document.activeElement!==r)return}function nT(e){const n=Vw(e),r=zb(n,e),i=zb(n.reverse(),e);return[r,i]}function Vw(e){const n=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const o=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||o?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)n.push(r.currentNode);return n}function zb(e,n){const r=typeof n.checkVisibility=="function"&&n.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(r?!i.checkVisibility({checkVisibilityCSS:!0}):rT(i,{upTo:n})))return i}function rT(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function aT(e){return e instanceof HTMLInputElement&&"select"in e}function Na(e,{select:n=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&aT(e)&&n&&e.select()}}var kb=iT();function iT(){let e=[];return{add(n){const r=e[0];n!==r&&r?.pause(),e=Lb(e,n),e.unshift(n)},remove(n){e=Lb(e,n),e[0]?.resume()}}}function Lb(e,n){const r=[...e],i=r.indexOf(n);return i!==-1&&r.splice(i,1),r}function sT(e){return e.filter(n=>n.tagName!=="A")}var oT="Portal",yl=S.forwardRef((e,n)=>{const{container:r,...i}=e,[o,l]=S.useState(!1);Yt(()=>l(!0),[]);const u=r||o&&globalThis?.document?.body;return u?Mi.createPortal(f.jsx($e.div,{...i,ref:n}),u):null});yl.displayName=oT;var Uc=0,Ss=null;function dp(){S.useEffect(()=>{Ss||(Ss={start:$b(),end:$b()});const{start:e,end:n}=Ss;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==n&&document.body.insertAdjacentElement("beforeend",n),Uc++,()=>{Uc===1&&(Ss?.start.remove(),Ss?.end.remove(),Ss=null),Uc=Math.max(0,Uc-1)}},[])}function $b(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ar=function(){return Ar=Object.assign||function(n){for(var r,i=1,o=arguments.length;i"u")return CT;var n=ET(e),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,i-r+n[2]-n[0])}},jT=qw(),zs="data-scroll-locked",TT=function(e,n,r,i){var o=e.left,l=e.top,u=e.right,d=e.gap;return r===void 0&&(r="margin"),` + .`.concat(cT,` { overflow: hidden `).concat(i,`; padding-right: `).concat(d,"px ").concat(i,`; } @@ -41,17 +41,17 @@ Error generating stack: `+c.message+` } body[`).concat(zs,`] { - `).concat(lT,": ").concat(d,`px; + `).concat(uT,": ").concat(d,`px; } -`)},Pb=function(){var e=parseInt(document.body.getAttribute(zs)||"0",10);return isFinite(e)?e:0},jT=function(){w.useEffect(function(){return document.body.setAttribute(zs,(Pb()+1).toString()),function(){var e=Pb()-1;e<=0?document.body.removeAttribute(zs):document.body.setAttribute(zs,e.toString())}},[])},TT=function(e){var n=e.noRelative,r=e.noImportant,i=e.gapMode,o=i===void 0?"margin":i;jT();var l=w.useMemo(function(){return CT(o)},[o]);return w.createElement(ET,{styles:RT(l,!n,o,r?"":"!important")})},bm=!1;if(typeof window<"u")try{var Hc=Object.defineProperty({},"passive",{get:function(){return bm=!0,!0}});window.addEventListener("test",Hc,Hc),window.removeEventListener("test",Hc,Hc)}catch{bm=!1}var _s=bm?{passive:!1}:!1,OT=function(e){return e.tagName==="TEXTAREA"},Gw=function(e,n){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[n]!=="hidden"&&!(r.overflowY===r.overflowX&&!OT(e)&&r[n]==="visible")},AT=function(e){return Gw(e,"overflowY")},MT=function(e){return Gw(e,"overflowX")},Fb=function(e,n){var r=n.ownerDocument,i=n;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var o=Zw(e,i);if(o){var l=Kw(e,i),u=l[1],d=l[2];if(u>d)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},NT=function(e){var n=e.scrollTop,r=e.scrollHeight,i=e.clientHeight;return[n,r,i]},DT=function(e){var n=e.scrollLeft,r=e.scrollWidth,i=e.clientWidth;return[n,r,i]},Zw=function(e,n){return e==="v"?AT(n):MT(n)},Kw=function(e,n){return e==="v"?NT(n):DT(n)},zT=function(e,n){return e==="h"&&n==="rtl"?-1:1},kT=function(e,n,r,i,o){var l=zT(e,window.getComputedStyle(n).direction),u=l*i,d=r.target,p=n.contains(d),m=!1,y=u>0,v=0,b=0;do{if(!d)break;var x=Kw(e,d),S=x[0],_=x[1],E=x[2],R=_-E-l*S;(S||R)&&Zw(e,d)&&(v+=R,b+=S);var T=d.parentNode;d=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!p&&d!==document.body||p&&(n.contains(d)||n===d));return(y&&Math.abs(v)<1||!y&&Math.abs(b)<1)&&(m=!0),m},Bc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Vb=function(e){return[e.deltaX,e.deltaY]},Ub=function(e){return e&&"current"in e?e.current:e},LT=function(e,n){return e[0]===n[0]&&e[1]===n[1]},$T=function(e){return` +`)},Pb=function(){var e=parseInt(document.body.getAttribute(zs)||"0",10);return isFinite(e)?e:0},OT=function(){S.useEffect(function(){return document.body.setAttribute(zs,(Pb()+1).toString()),function(){var e=Pb()-1;e<=0?document.body.removeAttribute(zs):document.body.setAttribute(zs,e.toString())}},[])},AT=function(e){var n=e.noRelative,r=e.noImportant,i=e.gapMode,o=i===void 0?"margin":i;OT();var l=S.useMemo(function(){return RT(o)},[o]);return S.createElement(jT,{styles:TT(l,!n,o,r?"":"!important")})},bm=!1;if(typeof window<"u")try{var Hc=Object.defineProperty({},"passive",{get:function(){return bm=!0,!0}});window.addEventListener("test",Hc,Hc),window.removeEventListener("test",Hc,Hc)}catch{bm=!1}var _s=bm?{passive:!1}:!1,MT=function(e){return e.tagName==="TEXTAREA"},Gw=function(e,n){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[n]!=="hidden"&&!(r.overflowY===r.overflowX&&!MT(e)&&r[n]==="visible")},NT=function(e){return Gw(e,"overflowY")},DT=function(e){return Gw(e,"overflowX")},Fb=function(e,n){var r=n.ownerDocument,i=n;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var o=Zw(e,i);if(o){var l=Kw(e,i),u=l[1],d=l[2];if(u>d)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},zT=function(e){var n=e.scrollTop,r=e.scrollHeight,i=e.clientHeight;return[n,r,i]},kT=function(e){var n=e.scrollLeft,r=e.scrollWidth,i=e.clientWidth;return[n,r,i]},Zw=function(e,n){return e==="v"?NT(n):DT(n)},Kw=function(e,n){return e==="v"?zT(n):kT(n)},LT=function(e,n){return e==="h"&&n==="rtl"?-1:1},$T=function(e,n,r,i,o){var l=LT(e,window.getComputedStyle(n).direction),u=l*i,d=r.target,p=n.contains(d),m=!1,y=u>0,v=0,b=0;do{if(!d)break;var x=Kw(e,d),w=x[0],_=x[1],E=x[2],R=_-E-l*w;(w||R)&&Zw(e,d)&&(v+=R,b+=w);var T=d.parentNode;d=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!p&&d!==document.body||p&&(n.contains(d)||n===d));return(y&&Math.abs(v)<1||!y&&Math.abs(b)<1)&&(m=!0),m},Bc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Vb=function(e){return[e.deltaX,e.deltaY]},Ub=function(e){return e&&"current"in e?e.current:e},IT=function(e,n){return e[0]===n[0]&&e[1]===n[1]},PT=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},IT=0,Cs=[];function PT(e){var n=w.useRef([]),r=w.useRef([0,0]),i=w.useRef(),o=w.useState(IT++)[0],l=w.useState(qw)[0],u=w.useRef(e);w.useEffect(function(){u.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var _=sT([e.lockRef.current],(e.shards||[]).map(Ub),!0).filter(Boolean);return _.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),_.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var d=w.useCallback(function(_,E){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!u.current.allowPinchZoom;var R=Bc(_),T=r.current,O="deltaX"in _?_.deltaX:T[0]-R[0],M="deltaY"in _?_.deltaY:T[1]-R[1],D,P=_.target,F=Math.abs(O)>Math.abs(M)?"h":"v";if("touches"in _&&F==="h"&&P.type==="range")return!1;var V=window.getSelection(),ve=V&&V.anchorNode,be=ve?ve===P||ve.contains(P):!1;if(be)return!1;var he=Fb(F,P);if(!he)return!0;if(he?D=F:(D=F==="v"?"h":"v",he=Fb(F,P)),!he)return!1;if(!i.current&&"changedTouches"in _&&(O||M)&&(i.current=D),!D)return!0;var ue=i.current||D;return kT(ue,E,_,ue==="h"?O:M)},[]),p=w.useCallback(function(_){var E=_;if(!(!Cs.length||Cs[Cs.length-1]!==l)){var R="deltaY"in E?Vb(E):Bc(E),T=n.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&<(D.delta,R)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var O=(u.current.shards||[]).map(Ub).filter(Boolean).filter(function(D){return D.contains(E.target)}),M=O.length>0?d(E,O[0]):!u.current.noIsolation;M&&E.cancelable&&E.preventDefault()}}},[]),m=w.useCallback(function(_,E,R,T){var O={name:_,delta:E,target:R,should:T,shadowParent:FT(R)};n.current.push(O),setTimeout(function(){n.current=n.current.filter(function(M){return M!==O})},1)},[]),y=w.useCallback(function(_){r.current=Bc(_),i.current=void 0},[]),v=w.useCallback(function(_){m(_.type,Vb(_),_.target,d(_,e.lockRef.current))},[]),b=w.useCallback(function(_){m(_.type,Bc(_),_.target,d(_,e.lockRef.current))},[]);w.useEffect(function(){return Cs.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:b}),document.addEventListener("wheel",p,_s),document.addEventListener("touchmove",p,_s),document.addEventListener("touchstart",y,_s),function(){Cs=Cs.filter(function(_){return _!==l}),document.removeEventListener("wheel",p,_s),document.removeEventListener("touchmove",p,_s),document.removeEventListener("touchstart",y,_s)}},[]);var x=e.removeScrollBar,S=e.inert;return w.createElement(w.Fragment,null,S?w.createElement(l,{styles:$T(o)}):null,x?w.createElement(TT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function FT(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const VT=pT(Bw,PT);var zu=w.forwardRef(function(e,n){return w.createElement(Du,Ar({},e,{ref:n,sideCar:VT}))});zu.classNames=Du.classNames;var UT=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Es=new WeakMap,qc=new WeakMap,Gc={},$h=0,Yw=function(e){return e&&(e.host||Yw(e.parentNode))},HT=function(e,n){return n.map(function(r){if(e.contains(r))return r;var i=Yw(r);return i&&e.contains(i)?i:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},BT=function(e,n,r,i){var o=HT(n,Array.isArray(e)?e:[e]);Gc[r]||(Gc[r]=new WeakMap);var l=Gc[r],u=[],d=new Set,p=new Set(o),m=function(v){!v||d.has(v)||(d.add(v),m(v.parentNode))};o.forEach(m);var y=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(b){if(d.has(b))y(b);else try{var x=b.getAttribute(i),S=x!==null&&x!=="false",_=(Es.get(b)||0)+1,E=(l.get(b)||0)+1;Es.set(b,_),l.set(b,E),u.push(b),_===1&&S&&qc.set(b,!0),E===1&&b.setAttribute(r,"true"),S||b.setAttribute(i,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return y(n),d.clear(),$h++,function(){u.forEach(function(v){var b=Es.get(v)-1,x=l.get(v)-1;Es.set(v,b),l.set(v,x),b||(qc.has(v)||v.removeAttribute(i),qc.delete(v)),x||v.removeAttribute(r)}),$h--,$h||(Es=new WeakMap,Es=new WeakMap,qc=new WeakMap,Gc={})}},fp=function(e,n,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),o=UT(e);return o?(i.push.apply(i,Array.from(o.querySelectorAll("[aria-live], script"))),BT(i,o,r,"aria-hidden")):function(){return null}},ku="Dialog",[Qw]=Ga(ku),[qT,yr]=Qw(ku),hp=e=>{const{__scopeDialog:n,children:r,open:i,defaultOpen:o,onOpenChange:l,modal:u=!0}=e,d=w.useRef(null),p=w.useRef(null),[m,y]=Fs({prop:i,defaultProp:o??!1,onChange:l,caller:ku});return f.jsx(qT,{scope:n,triggerRef:d,contentRef:p,contentId:dn(),titleId:dn(),descriptionId:dn(),open:m,onOpenChange:y,onOpenToggle:w.useCallback(()=>y(v=>!v),[y]),modal:u,children:r})};hp.displayName=ku;var Xw="DialogTrigger",GT=w.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,o=yr(Xw,r),l=nt(n,o.triggerRef);return f.jsx($e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":yp(o.open),...i,ref:l,onClick:je(e.onClick,o.onOpenToggle)})});GT.displayName=Xw;var mp="DialogPortal",[ZT,Jw]=Qw(mp,{forceMount:void 0}),pp=e=>{const{__scopeDialog:n,forceMount:r,children:i,container:o}=e,l=yr(mp,n);return f.jsx(ZT,{scope:n,forceMount:r,children:w.Children.map(i,u=>f.jsx(vr,{present:r||l.open,children:f.jsx(yl,{asChild:!0,container:o,children:u})}))})};pp.displayName=mp;var hu="DialogOverlay",gp=w.forwardRef((e,n)=>{const r=Jw(hu,e.__scopeDialog),{forceMount:i=r.forceMount,...o}=e,l=yr(hu,e.__scopeDialog);return l.modal?f.jsx(vr,{present:i||l.open,children:f.jsx(YT,{...o,ref:n})}):null});gp.displayName=hu;var KT=_i("DialogOverlay.RemoveScroll"),YT=w.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,o=yr(hu,r),l=Kj(),u=nt(n,l);return f.jsx(zu,{as:KT,allowPinchZoom:!0,shards:[o.contentRef],children:f.jsx($e.div,{"data-state":yp(o.open),...i,ref:u,style:{pointerEvents:"auto",...i.style}})})}),Vs="DialogContent",vp=w.forwardRef((e,n)=>{const r=Jw(Vs,e.__scopeDialog),{forceMount:i=r.forceMount,...o}=e,l=yr(Vs,e.__scopeDialog);return f.jsx(vr,{present:i||l.open,children:l.modal?f.jsx(QT,{...o,ref:n}):f.jsx(XT,{...o,ref:n})})});vp.displayName=Vs;var QT=w.forwardRef((e,n)=>{const r=yr(Vs,e.__scopeDialog),i=w.useRef(null),o=nt(n,r.contentRef,i);return w.useEffect(()=>{const l=i.current;if(l)return fp(l)},[]),f.jsx(Ww,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:je(e.onCloseAutoFocus,l=>{l.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:je(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0;(u.button===2||d)&&l.preventDefault()}),onFocusOutside:je(e.onFocusOutside,l=>l.preventDefault())})}),XT=w.forwardRef((e,n)=>{const r=yr(Vs,e.__scopeDialog),i=w.useRef(!1),o=w.useRef(!1);return f.jsx(Ww,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{e.onCloseAutoFocus?.(l),l.defaultPrevented||(i.current||r.triggerRef.current?.focus(),l.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:l=>{e.onInteractOutside?.(l),l.defaultPrevented||(i.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const u=l.target;r.triggerRef.current?.contains(u)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),Ww=w.forwardRef((e,n)=>{const{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:l,...u}=e,d=yr(Vs,r);return dp(),f.jsx(f.Fragment,{children:f.jsx(Nu,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:l,children:f.jsx(vl,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":yp(d.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1)})})})}),eS="DialogTitle",tS=w.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,o=yr(eS,r);return f.jsx($e.h2,{id:o.titleId,...i,ref:n})});tS.displayName=eS;var nS="DialogDescription",JT=w.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,o=yr(nS,r);return f.jsx($e.p,{id:o.descriptionId,...i,ref:n})});JT.displayName=nS;var rS="DialogClose",aS=w.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,o=yr(rS,r);return f.jsx($e.button,{type:"button",...i,ref:n,onClick:je(e.onClick,()=>o.onOpenChange(!1))})});aS.displayName=rS;function yp(e){return e?"open":"closed"}function WT(e){const n=w.useRef({value:e,previous:e});return w.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}function eO(e){const[n,r]=w.useState(void 0);return Yt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const l=o[0];let u,d;if("borderBoxSize"in l){const p=l.borderBoxSize,m=Array.isArray(p)?p[0]:p;u=m.inlineSize,d=m.blockSize}else u=e.offsetWidth,d=e.offsetHeight;r({width:u,height:d})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else r(void 0)},[e]),n}const tO=["top","right","bottom","left"],Va=Math.min,ra=Math.max,mu=Math.round,Zc=Math.floor,aa=e=>({x:e,y:e}),nO={left:"right",right:"left",bottom:"top",top:"bottom"};function iS(e,n,r){return ra(e,Va(n,r))}function ia(e,n){return typeof e=="function"?e(n):e}function Ua(e){return e.split("-")[0]}function Gs(e){return e.split("-")[1]}function bp(e){return e==="x"?"y":"x"}function xp(e){return e==="y"?"height":"width"}function Mr(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function wp(e){return bp(Mr(e))}function rO(e,n,r){r===void 0&&(r=!1);const i=Gs(e),o=wp(e),l=xp(o);let u=o==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return n.reference[l]>n.floating[l]&&(u=pu(u)),[u,pu(u)]}function aO(e){const n=pu(e);return[xm(e),n,xm(n)]}function xm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Hb=["left","right"],Bb=["right","left"],iO=["top","bottom"],sO=["bottom","top"];function oO(e,n,r){switch(e){case"top":case"bottom":return r?n?Bb:Hb:n?Hb:Bb;case"left":case"right":return n?iO:sO;default:return[]}}function lO(e,n,r,i){const o=Gs(e);let l=oO(Ua(e),r==="start",i);return o&&(l=l.map(u=>u+"-"+o),n&&(l=l.concat(l.map(xm)))),l}function pu(e){const n=Ua(e);return nO[n]+e.slice(n.length)}function cO(e){var n,r,i,o;return{top:(n=e.top)!=null?n:0,right:(r=e.right)!=null?r:0,bottom:(i=e.bottom)!=null?i:0,left:(o=e.left)!=null?o:0}}function sS(e){return typeof e!="number"?cO(e):{top:e,right:e,bottom:e,left:e}}function gu(e){const{x:n,y:r,width:i,height:o}=e;return{width:i,height:o,top:r,left:n,right:n+i,bottom:r+o,x:n,y:r}}function qb(e,n,r){let{reference:i,floating:o}=e;const l=Mr(n),u=wp(n),d=xp(u),p=Ua(n),m=l==="y",y=i.x+i.width/2-o.width/2,v=i.y+i.height/2-o.height/2,b=i[d]/2-o[d]/2;let x;switch(p){case"top":x={x:y,y:i.y-o.height};break;case"bottom":x={x:y,y:i.y+i.height};break;case"right":x={x:i.x+i.width,y:v};break;case"left":x={x:i.x-o.width,y:v};break;default:x={x:i.x,y:i.y}}const S=Gs(n);return S&&(x[u]+=b*(S==="end"?1:-1)*(r&&m?-1:1)),x}async function uO(e,n){var r;n===void 0&&(n={});const{x:i,y:o,platform:l,rects:u,elements:d,strategy:p}=e,{boundary:m="clippingAncestors",rootBoundary:y="viewport",elementContext:v="floating",altBoundary:b=!1,padding:x=0}=ia(n,e),S=sS(x),E=d[b?v==="floating"?"reference":"floating":v],R=gu(await l.getClippingRect({element:(r=await(l.isElement==null?void 0:l.isElement(E)))==null||r?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:m,rootBoundary:y,strategy:p})),T=v==="floating"?{x:i,y:o,width:u.floating.width,height:u.floating.height}:u.reference,O=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),M=await(l.isElement==null?void 0:l.isElement(O))&&await(l.getScale==null?void 0:l.getScale(O))||{x:1,y:1},D=gu(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:T,offsetParent:O,strategy:p}):T);return{top:(R.top-D.top+S.top)/M.y,bottom:(D.bottom-R.bottom+S.bottom)/M.y,left:(R.left-D.left+S.left)/M.x,right:(D.right-R.right+S.right)/M.x}}const dO=50,fO=async(e,n,r)=>{const{placement:i="bottom",strategy:o="absolute",middleware:l=[],platform:u}=r,d=u.detectOverflow?u:{...u,detectOverflow:uO},p=await(u.isRTL==null?void 0:u.isRTL(n));let m=await u.getElementRects({reference:e,floating:n,strategy:o}),{x:y,y:v}=qb(m,i,p),b=i,x=0;const S={};for(let _=0;_({name:"arrow",options:e,async fn(n){const{x:r,y:i,placement:o,rects:l,platform:u,elements:d,middlewareData:p}=n,{element:m,padding:y=0}=ia(e,n)||{};if(m==null)return{};const v=sS(y),b={x:r,y:i},x=wp(o),S=xp(x),_=await u.getDimensions(m),E=x==="y",R=E?"top":"left",T=E?"bottom":"right",O=E?"clientHeight":"clientWidth",M=l.reference[S]+l.reference[x]-b[x]-l.floating[S],D=b[x]-l.reference[x],P=await(u.getOffsetParent==null?void 0:u.getOffsetParent(m));let F=P?P[O]:0;(!F||!await(u.isElement==null?void 0:u.isElement(P)))&&(F=d.floating[O]||l.floating[S]);const V=M/2-D/2,ve=F/2-_[S]/2-1,be=Va(v[R],ve),he=Va(v[T],ve),ue=F-_[S]-he,X=F/2-_[S]/2+V,pe=iS(be,X,ue),ge=!p.arrow&&Gs(o)!=null&&X!==pe&&l.reference[S]/2-(Xpe<=0)){var he,ue;const pe=(((he=l.flip)==null?void 0:he.index)||0)+1,ge=F[pe];if(ge&&(!(v==="alignment"?T!==Mr(ge):!1)||be.every(re=>Mr(re.placement)===T?re.overflows[0]>0:!0)))return{data:{index:pe,overflows:be},reset:{placement:ge}};let L=(ue=be.filter(Z=>Z.overflows[0]<=0).sort((Z,re)=>Z.overflows[1]-re.overflows[1])[0])==null?void 0:ue.placement;if(!L)switch(x){case"bestFit":{var X;const Z=(X=be.filter(re=>{if(P){const ee=Mr(re.placement);return ee===T||ee==="y"}return!0}).map(re=>[re.placement,re.overflows.filter(ee=>ee>0).reduce((ee,ne)=>ee+ne,0)]).sort((re,ee)=>re[1]-ee[1])[0])==null?void 0:X[0];Z&&(L=Z);break}case"initialPlacement":L=d;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function Gb(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function Zb(e){return tO.some(n=>e[n]>=0)}const pO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:r,platform:i}=n,{strategy:o="referenceHidden",...l}=ia(e,n);switch(o){case"referenceHidden":{const u=await i.detectOverflow(n,{...l,elementContext:"reference"}),d=Gb(u,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Zb(d)}}}case"escaped":{const u=await i.detectOverflow(n,{...l,altBoundary:!0}),d=Gb(u,r.floating);return{data:{escapedOffsets:d,escaped:Zb(d)}}}default:return{}}}}},oS=new Set(["left","top"]);async function gO(e,n){const{placement:r,platform:i,elements:o}=e,l=await(i.isRTL==null?void 0:i.isRTL(o.floating)),u=Ua(r),d=Gs(r),p=Mr(r)==="y",m=oS.has(u)?-1:1,y=l&&p?-1:1,v=ia(n,e);let{mainAxis:b,crossAxis:x,alignmentAxis:S}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return d&&typeof S=="number"&&(x=d==="end"?S*-1:S),p?{x:x*y,y:b*m}:{x:b*m,y:x*y}}const vO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var r,i;const{x:o,y:l,placement:u,middlewareData:d}=n,p=await gO(n,e);return u===((r=d.offset)==null?void 0:r.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:o+p.x,y:l+p.y,data:{...p,placement:u}}}}},yO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:r,y:i,placement:o,platform:l}=n,{mainAxis:u=!0,crossAxis:d=!1,limiter:p={fn:T=>{let{x:O,y:M}=T;return{x:O,y:M}}},...m}=ia(e,n),y={x:r,y:i},v=await l.detectOverflow(n,m),b=Mr(o),x=bp(b);let S=y[x],_=y[b];const E=(T,O)=>iS(O+v[T==="y"?"top":"left"],O,O-v[T==="y"?"bottom":"right"]);u&&(S=E(x,S)),d&&(_=E(b,_));const R=p.fn({...n,[x]:S,[b]:_});return{...R,data:{x:R.x-r,y:R.y-i,enabled:{[x]:u,[b]:d}}}}}},bO=function(e){return e===void 0&&(e={}),{options:e,fn(n){var r,i;const{x:o,y:l,placement:u,rects:d,middlewareData:p}=n,{offset:m=0,mainAxis:y=!0,crossAxis:v=!0}=ia(e,n),b={x:o,y:l},x=Mr(u),S=bp(x);let _=b[S],E=b[x];const R=ia(m,n),T=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(r=R.mainAxis)!=null?r:0,crossAxis:(i=R.crossAxis)!=null?i:0};if(y){const D=S==="y"?"height":"width",P=d.reference[S]-d.floating[D]+T.mainAxis,F=d.reference[S]+d.reference[D]-T.mainAxis;_F&&(_=F)}if(v){var O,M;const D=S==="y"?"width":"height",P=oS.has(Ua(u)),F=d.reference[x]-d.floating[D]+(P&&((O=p.offset)==null?void 0:O[x])||0)+(P?0:T.crossAxis),V=d.reference[x]+d.reference[D]+(P?0:((M=p.offset)==null?void 0:M[x])||0)-(P?T.crossAxis:0);EV&&(E=V)}return{[S]:_,[x]:E}}}},xO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){const{placement:r,rects:i,platform:o,elements:l}=n,{apply:u=()=>{},...d}=ia(e,n),p=await o.detectOverflow(n,d),m=Ua(r),y=Gs(r),v=Mr(r)==="y",{width:b,height:x}=i.floating;let S,_;m==="top"||m==="bottom"?(S=m,_=y===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(_=m,S=y==="end"?"top":"bottom");const E=x-p.top-p.bottom,R=b-p.left-p.right,T=Va(x-p[S],E),O=Va(b-p[_],R),M=n.middlewareData.shift,D=!M;let P=T,F=O;M!=null&&M.enabled.x&&(F=R),M!=null&&M.enabled.y&&(P=E),D&&!y&&(v?F=b-2*ra(p.left,p.right):P=x-2*ra(p.top,p.bottom)),await u({...n,availableWidth:F,availableHeight:P});const V=await o.getDimensions(l.floating);return b!==V.width||x!==V.height?{reset:{rects:!0}}:{}}}};function Lu(){return typeof window<"u"}function Zs(e){return lS(e)?(e.nodeName||"").toLowerCase():"#document"}function An(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function sa(e){var n;return(n=(lS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function lS(e){return Lu()?e instanceof Node||e instanceof An(e).Node:!1}function Nr(e){return Lu()?e instanceof Element||e instanceof An(e).Element:!1}function Za(e){return Lu()?e instanceof HTMLElement||e instanceof An(e).HTMLElement:!1}function Kb(e){return!Lu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof An(e).ShadowRoot}function $u(e){const{overflow:n,overflowX:r,overflowY:i,display:o}=Dr(e);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&o!=="inline"&&o!=="contents"}function wO(e){return/^(table|td|th)$/.test(Zs(e))}function Iu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const SO=/transform|translate|scale|rotate|perspective|filter/,_O=/paint|layout|strict|content/,vi=e=>!!e&&e!=="none";let Ih;function Sp(e){const n=Nr(e)?Dr(e):e;return vi(n.transform)||vi(n.translate)||vi(n.scale)||vi(n.rotate)||vi(n.perspective)||!_p()&&(vi(n.backdropFilter)||vi(n.filter))||SO.test(n.willChange||"")||_O.test(n.contain||"")}function CO(e){let n=Ci(e);for(;Za(n)&&!il(n);){if(Sp(n))return n;if(Iu(n))return null;n=Ci(n)}return null}function _p(){return Ih==null&&(Ih=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ih}function il(e){return/^(html|body|#document)$/.test(Zs(e))}function Dr(e){return An(e).getComputedStyle(e)}function Pu(e){return Nr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ci(e){if(Zs(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Kb(e)&&e.host||sa(e);return Kb(n)?n.host:n}function cS(e){const n=Ci(e);return il(n)?(e.ownerDocument||e).body:Za(n)&&$u(n)?n:cS(n)}function sl(e,n,r){var i;n===void 0&&(n=[]),r===void 0&&(r=!0);const o=cS(e),l=o===((i=e.ownerDocument)==null?void 0:i.body),u=An(o);if(l){const d=wm(u);return n.concat(u,u.visualViewport||[],$u(o)?o:[],d&&r?sl(d):[])}else return n.concat(o,sl(o,[],r))}function wm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function uS(e){const n=Dr(e);let r=parseFloat(n.width)||0,i=parseFloat(n.height)||0;const o=Za(e),l=o?e.offsetWidth:r,u=o?e.offsetHeight:i,d=mu(r)!==l||mu(i)!==u;return d&&(r=l,i=u),{width:r,height:i,$:d}}function Cp(e){return Nr(e)?e:e.contextElement}function ks(e){const n=Cp(e);if(!Za(n))return aa(1);const r=n.getBoundingClientRect(),{width:i,height:o,$:l}=uS(n);let u=(l?mu(r.width):r.width)/i,d=(l?mu(r.height):r.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const EO=aa(0);function dS(e){const n=An(e);return!_p()||!n.visualViewport?EO:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function RO(e,n,r){return n===void 0&&(n=!1),!!r&&n&&r===An(e)}function Ei(e,n,r,i){n===void 0&&(n=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),l=Cp(e);let u=aa(1);n&&(i?Nr(i)&&(u=ks(i)):u=ks(e));const d=RO(l,r,i)?dS(l):aa(0);let p=(o.left+d.x)/u.x,m=(o.top+d.y)/u.y,y=o.width/u.x,v=o.height/u.y;if(l&&i){const b=An(l),x=Nr(i)?An(i):i;let S=b,_=wm(S);for(;_&&x!==S;){const E=ks(_),R=_.getBoundingClientRect(),T=Dr(_),O=R.left+(_.clientLeft+parseFloat(T.paddingLeft))*E.x,M=R.top+(_.clientTop+parseFloat(T.paddingTop))*E.y;p*=E.x,m*=E.y,y*=E.x,v*=E.y,p+=O,m+=M,S=An(_),_=wm(S)}}return gu({width:y,height:v,x:p,y:m})}function Fu(e,n){const r=Pu(e).scrollLeft;return n?n.left+r:Ei(sa(e)).left+r}function fS(e,n){const r=e.getBoundingClientRect(),i=r.left+n.scrollLeft-Fu(e,r),o=r.top+n.scrollTop;return{x:i,y:o}}function jO(e){let{elements:n,rect:r,offsetParent:i,strategy:o}=e;const l=o==="fixed",u=sa(i),d=n?Iu(n.floating):!1;if(i===u||d&&l)return r;let p={scrollLeft:0,scrollTop:0},m=aa(1);const y=aa(0),v=Za(i);if((v||!l)&&((Zs(i)!=="body"||$u(u))&&(p=Pu(i)),v)){const x=Ei(i);m=ks(i),y.x=x.x+i.clientLeft,y.y=x.y+i.clientTop}const b=u&&!v&&!l?fS(u,p):aa(0);return{width:r.width*m.x,height:r.height*m.y,x:r.x*m.x-p.scrollLeft*m.x+y.x+b.x,y:r.y*m.y-p.scrollTop*m.y+y.y+b.y}}function TO(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function OO(e){const n=Pu(e),r=e.ownerDocument.body,i=ra(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=ra(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Fu(e);const u=-n.scrollTop;return Dr(r).direction==="rtl"&&(l+=ra(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:u}}const AO=25;function MO(e,n,r){r===void 0&&(r="viewport");const i=r==="layoutViewport",o=An(e),l=sa(e),u=o.visualViewport;let d=l.clientWidth,p=l.clientHeight,m=0,y=0;if(u){const b=!_p()||n==="fixed";i?b||(m=-u.offsetLeft,y=-u.offsetTop):(d=u.width,p=u.height,b&&(m=u.offsetLeft,y=u.offsetTop))}if(Fu(l)<=0){const b=l.ownerDocument,x=b.body,S=getComputedStyle(x),_=b.compatMode==="CSS1Compat"&&parseFloat(S.marginLeft)+parseFloat(S.marginRight)||0,E=Math.abs(l.clientWidth-x.clientWidth-_),R=getComputedStyle(l).scrollbarGutter==="stable both-edges"?E/2:E;R<=AO&&(d-=R)}return{width:d,height:p,x:m,y}}function NO(e,n){const r=Ei(e,!0,n==="fixed"),i=r.top+e.clientTop,o=r.left+e.clientLeft,l=ks(e),u=e.clientWidth*l.x,d=e.clientHeight*l.y,p=o*l.x,m=i*l.y;return{width:u,height:d,x:p,y:m}}function Yb(e,n,r){let i;if(n==="viewport"||n==="layoutViewport")i=MO(e,r,n);else if(n==="document")i=OO(sa(e));else if(Nr(n))i=NO(n,r);else{const o=dS(e);i={x:n.x-o.x,y:n.y-o.y,width:n.width,height:n.height}}return gu(i)}function DO(e,n){const r=n.get(e);if(r)return r;let i=sl(e,[],!1).filter(d=>Nr(d)&&Zs(d)!=="body"),o=null;const l=Dr(e).position==="fixed";let u=l?Ci(e):e;for(;Nr(u)&&!il(u);){const d=Dr(u),p=Sp(u),m=o?o.position:l?"fixed":"";!p&&(m==="fixed"||m==="absolute"&&d.position==="static")?i=i.filter(v=>v!==u):o=d,u=Ci(u)}return n.set(e,i),i}function zO(e){let{element:n,boundary:r,rootBoundary:i,strategy:o}=e;const u=[...r==="clippingAncestors"?Iu(n)?[]:DO(n,this._c):[].concat(r),i],d=Yb(n,u[0],o);let p=d.top,m=d.right,y=d.bottom,v=d.left;for(let b=1;b{d(!1,1e-7)},1e3)}F=!1}try{i=new IntersectionObserver(V,{...P,root:l.ownerDocument})}catch{i=new IntersectionObserver(V,P)}i.observe(e)}const p=An(e),m=()=>d(r);return p.addEventListener("resize",m),d(!0),()=>{p.removeEventListener("resize",m),u()}}function VO(e,n,r,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:p=!1}=i,m=Cp(e),y=o||l?[...m?sl(m):[],...n?sl(n):[]]:[];y.forEach(R=>{o&&R.addEventListener("scroll",r),l&&R.addEventListener("resize",r)});const v=m&&d?FO(m,r,l):null;let b=-1,x=null;u&&(x=new ResizeObserver(R=>{let[T]=R;T&&T.target===m&&x&&n&&(x.unobserve(n),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var O;(O=x)==null||O.observe(n)})),r()}),m&&!p&&x.observe(m),n&&x.observe(n));let S,_=p?Ei(e):null;p&&E();function E(){const R=Ei(e);_&&!mS(_,R)&&r(),_=R,S=requestAnimationFrame(E)}return r(),()=>{var R;y.forEach(T=>{o&&T.removeEventListener("scroll",r),l&&T.removeEventListener("resize",r)}),v?.(),(R=x)==null||R.disconnect(),x=null,p&&cancelAnimationFrame(S)}}const UO=vO,HO=yO,BO=mO,qO=xO,GO=pO,Xb=hO,ZO=bO,KO=(e,n,r)=>{const i=new Map,o=r??{},l={...PO,...o.platform,_c:i};return fO(e,n,{...o,platform:l})};var YO=typeof document<"u",QO=function(){},su=YO?w.useLayoutEffect:QO;function vu(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let r,i,o;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==n.length)return!1;for(i=r;i--!==0;)if(!vu(e[i],n[i]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){const l=o[i];if(!(l==="_owner"&&e.$$typeof)&&!vu(e[l],n[l]))return!1}return!0}return e!==e&&n!==n}function pS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jb(e,n){const r=pS(e);return Math.round(n*r)/r}function Fh(e){const n=w.useRef(e);return su(()=>{n.current=e}),n}function XO(e){e===void 0&&(e={});const{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:o,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:p,open:m}=e,[y,v]=w.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[b,x]=w.useState(i);vu(b,i)||x(i);const[S,_]=w.useState(null),[E,R]=w.useState(null),T=w.useCallback(re=>{re!==P.current&&(P.current=re,_(re))},[]),O=w.useCallback(re=>{re!==F.current&&(F.current=re,R(re))},[]),M=l||S,D=u||E,P=w.useRef(null),F=w.useRef(null),V=w.useRef(y),ve=p!=null,be=Fh(p),he=Fh(o),ue=Fh(m),X=w.useCallback(()=>{if(!P.current||!F.current)return;const re={placement:n,strategy:r,middleware:b};he.current&&(re.platform=he.current),KO(P.current,F.current,re).then(ee=>{const ne={...ee,isPositioned:ue.current!==!1};pe.current&&!vu(V.current,ne)&&(V.current=ne,Mi.flushSync(()=>{v(ne)}))})},[b,n,r,he,ue]);su(()=>{m===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,v(re=>({...re,isPositioned:!1})))},[m]);const pe=w.useRef(!1);su(()=>(pe.current=!0,()=>{pe.current=!1}),[]),su(()=>{if(M&&(P.current=M),D&&(F.current=D),M&&D){if(be.current)return be.current(M,D,X);X()}},[M,D,X,be,ve]);const ge=w.useMemo(()=>({reference:P,floating:F,setReference:T,setFloating:O}),[T,O]),L=w.useMemo(()=>({reference:M,floating:D}),[M,D]),Z=w.useMemo(()=>{const re={position:r,left:0,top:0};if(!L.floating)return re;const ee=Jb(L.floating,y.x),ne=Jb(L.floating,y.y);return d?{...re,transform:"translate("+ee+"px, "+ne+"px)",...pS(L.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ee,top:ne}},[r,d,L.floating,y.x,y.y]);return w.useMemo(()=>({...y,update:X,refs:ge,elements:L,floatingStyles:Z}),[y,X,ge,L,Z])}const JO=e=>{function n(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:i,padding:o}=typeof e=="function"?e(r):e;return i&&n(i)?i.current!=null?Xb({element:i.current,padding:o}).fn(r):{}:i?Xb({element:i,padding:o}).fn(r):{}}}},WO=(e,n)=>{const r=UO(e);return{name:r.name,fn:r.fn,options:[e,n]}},eA=(e,n)=>{const r=HO(e);return{name:r.name,fn:r.fn,options:[e,n]}},tA=(e,n)=>({fn:ZO(e).fn,options:[e,n]}),nA=(e,n)=>{const r=BO(e);return{name:r.name,fn:r.fn,options:[e,n]}},rA=(e,n)=>{const r=qO(e);return{name:r.name,fn:r.fn,options:[e,n]}},aA=(e,n)=>{const r=GO(e);return{name:r.name,fn:r.fn,options:[e,n]}},iA=(e,n)=>{const r=JO(e);return{name:r.name,fn:r.fn,options:[e,n]}};var sA="Arrow",gS=w.forwardRef((e,n)=>{const{children:r,width:i=10,height:o=5,...l}=e;return f.jsx($e.svg,{...l,ref:n,width:i,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});gS.displayName=sA;var oA=gS,Ep="Popper",[vS,Ks]=Ga(Ep),[lA,yS]=vS(Ep),bS=e=>{const{__scopePopper:n,children:r}=e,[i,o]=w.useState(null),[l,u]=w.useState(void 0);return f.jsx(lA,{scope:n,anchor:i,onAnchorChange:o,placementState:l,setPlacementState:u,children:r})};bS.displayName=Ep;var xS="PopperAnchor",wS=w.forwardRef((e,n)=>{const{__scopePopper:r,virtualRef:i,...o}=e,l=yS(xS,r),u=w.useRef(null),d=l.onAnchorChange,p=w.useCallback(S=>{u.current=S,S&&d(S)},[d]),m=nt(n,p),y=w.useRef(null);w.useEffect(()=>{if(!i)return;const S=y.current;y.current=i.current,S!==y.current&&d(y.current)});const v=l.placementState&&jp(l.placementState),b=v?.[0],x=v?.[1];return i?null:f.jsx($e.div,{"data-radix-popper-side":b,"data-radix-popper-align":x,...o,ref:m})});wS.displayName=xS;var Rp="PopperContent",[cA,uA]=vS(Rp),SS=w.forwardRef((e,n)=>{const{__scopePopper:r,side:i="bottom",sideOffset:o=0,align:l="center",alignOffset:u=0,arrowPadding:d=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:y=0,sticky:v="partial",hideWhenDetached:b=!1,updatePositionStrategy:x="optimized",onPlaced:S,..._}=e,E=yS(Rp,r),[R,T]=w.useState(null),O=nt(n,T),[M,D]=w.useState(null),P=eO(M),F=P?.width??0,V=P?.height??0,ve=i+(l!=="center"?"-"+l:""),be=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},he=Array.isArray(m)?m:[m],ue=he.length>0,X={padding:be,boundary:he.filter(fA),altBoundary:ue},{refs:pe,floatingStyles:ge,placement:L,isPositioned:Z,middlewareData:re}=XO({strategy:"fixed",placement:ve,whileElementsMounted:(...ye)=>VO(...ye,{animationFrame:x==="always"}),elements:{reference:E.anchor},middleware:[WO({mainAxis:o+V,alignmentAxis:u}),p&&eA({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?tA():void 0,...X}),p&&nA({...X}),rA({...X,apply:({elements:ye,rects:xe,availableWidth:Oe,availableHeight:Ie})=>{const{width:Ve,height:it}=xe.reference,Qe=ye.floating.style;Qe.setProperty("--radix-popper-available-width",`${Oe}px`),Qe.setProperty("--radix-popper-available-height",`${Ie}px`),Qe.setProperty("--radix-popper-anchor-width",`${Ve}px`),Qe.setProperty("--radix-popper-anchor-height",`${it}px`)}}),M&&iA({element:M,padding:d}),hA({arrowWidth:F,arrowHeight:V}),b&&aA({strategy:"referenceHidden",...X,boundary:ue?X.boundary:void 0})]}),ee=E.setPlacementState;Yt(()=>(ee(L),()=>{ee(void 0)}),[L,ee]);const[ne,z]=jp(L),N=tr(S);Yt(()=>{Z&&N?.()},[Z,N]);const B=re.arrow?.x,J=re.arrow?.y,K=re.arrow?.centerOffset!==0,[le,ae]=w.useState();return Yt(()=>{R&&ae(window.getComputedStyle(R).zIndex)},[R]),f.jsx("div",{ref:pe.setFloating,"data-radix-popper-content-wrapper":"",style:{...ge,transform:Z?ge.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[re.transformOrigin?.x,re.transformOrigin?.y].join(" "),...re.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(cA,{scope:r,placedSide:ne,placedAlign:z,onArrowChange:D,arrowX:B,arrowY:J,shouldHideArrow:K,children:f.jsx($e.div,{"data-side":ne,"data-align":z,..._,ref:O,style:{..._.style,animation:Z?void 0:"none"}})})})});SS.displayName=Rp;var _S="PopperArrow",dA={top:"bottom",right:"left",bottom:"top",left:"right"},CS=w.forwardRef(function(n,r){const{__scopePopper:i,...o}=n,l=uA(_S,i),u=dA[l.placedSide];return f.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:f.jsx(oA,{...o,ref:r,style:{...o.style,display:"block"}})})});CS.displayName=_S;function fA(e){return e!==null}var hA=e=>({name:"transformOrigin",options:e,fn(n){const{placement:r,rects:i,middlewareData:o}=n,u=o.arrow?.centerOffset!==0,d=u?0:e.arrowWidth,p=u?0:e.arrowHeight,[m,y]=jp(r),v={start:"0%",center:"50%",end:"100%"}[y],b=(o.arrow?.x??0)+d/2,x=(o.arrow?.y??0)+p/2;let S="",_="";return m==="bottom"?(S=u?v:`${b}px`,_=`${-p}px`):m==="top"?(S=u?v:`${b}px`,_=`${i.floating.height+p}px`):m==="right"?(S=`${-p}px`,_=u?v:`${x}px`):m==="left"&&(S=`${i.floating.width+p}px`,_=u?v:`${x}px`),{data:{x:S,y:_}}}});function jp(e){const[n,r="center"]=e.split("-");return[n,r]}var Tp=bS,Op=wS,Ap=SS,Mp=CS,Vh=!1;function mA(){const[e,n]=w.useState(Vh);return w.useEffect(()=>{Vh||(Vh=!0,n(!0))},[]),e}var ES=Au[" useSyncExternalStore ".trim().toString()];function pA(){return()=>{}}function gA(){return ES(pA,()=>!0,()=>!1)}var vA=typeof ES=="function"?gA:mA,Uh="rovingFocusGroup.onEntryFocus",yA={bubbles:!1,cancelable:!0},bl="RovingFocusGroup",[Sm,RS,bA]=lp(bl),[xA,jS]=Ga(bl,[bA]),[wA,SA]=xA(bl),TS=w.forwardRef((e,n)=>f.jsx(Sm.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Sm.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(_A,{...e,ref:n})})}));TS.displayName=bl;var _A=w.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:r,orientation:i,loop:o=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:p,onEntryFocus:m,preventScrollOnEntryFocus:y=!1,...v}=e,b=w.useRef(null),x=nt(n,b),S=cp(l),[_,E]=Fs({prop:u,defaultProp:d??null,onChange:p,caller:bl}),[R,T]=w.useState(!1),O=tr(m),M=RS(r),D=w.useRef(!1),[P,F]=w.useState(0);return w.useEffect(()=>{const V=b.current;if(V)return V.addEventListener(Uh,O),()=>V.removeEventListener(Uh,O)},[O]),f.jsx(wA,{scope:r,orientation:i,dir:S,loop:o,currentTabStopId:_,onItemFocus:w.useCallback(V=>E(V),[E]),onItemShiftTab:w.useCallback(()=>T(!0),[]),onFocusableItemAdd:w.useCallback(()=>F(V=>V+1),[]),onFocusableItemRemove:w.useCallback(()=>F(V=>V-1),[]),children:f.jsx($e.div,{tabIndex:R||P===0?-1:0,"data-orientation":i,...v,ref:x,style:{outline:"none",...e.style},onMouseDown:je(e.onMouseDown,()=>{D.current=!0}),onFocus:je(e.onFocus,V=>{const ve=!D.current;if(V.target===V.currentTarget&&ve&&!R){const be=new CustomEvent(Uh,yA);if(V.currentTarget.dispatchEvent(be),!be.defaultPrevented){const he=M().filter(L=>L.focusable),ue=he.find(L=>L.active),X=he.find(L=>L.id===_),ge=[ue,X,...he].filter(Boolean).map(L=>L.ref.current);MS(ge,y)}}D.current=!1}),onBlur:je(e.onBlur,()=>T(!1))})})}),OS="RovingFocusGroupItem",AS=w.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:l,children:u,...d}=e,p=dn(),m=l||p,y=SA(OS,r),v=y.currentTabStopId===m,b=RS(r),{onFocusableItemAdd:x,onFocusableItemRemove:S,currentTabStopId:_}=y,E=vA();return Yt(()=>{if(!(!E||!i))return x(),()=>S()},[E,i,x,S]),w.useEffect(()=>{if(!(E||!i))return x(),()=>S()},[E,i,x,S]),f.jsx(Sm.ItemSlot,{scope:r,id:m,focusable:i,active:o,children:f.jsx($e.span,{tabIndex:v?0:-1,"data-orientation":y.orientation,...d,ref:n,onMouseDown:je(e.onMouseDown,R=>{i?y.onItemFocus(m):R.preventDefault()}),onFocus:je(e.onFocus,()=>y.onItemFocus(m)),onKeyDown:je(e.onKeyDown,R=>{if(R.key==="Tab"&&R.shiftKey){y.onItemShiftTab();return}if(R.target!==R.currentTarget)return;const T=RA(R,y.orientation,y.dir);if(T!==void 0){if(R.metaKey||R.ctrlKey||R.altKey||R.shiftKey)return;R.preventDefault();let M=b().filter(D=>D.focusable).map(D=>D.ref.current);if(T==="last")M.reverse();else if(T==="prev"||T==="next"){T==="prev"&&M.reverse();const D=M.indexOf(R.currentTarget);M=y.loop?jA(M,D+1):M.slice(D+1)}setTimeout(()=>MS(M))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:_!=null}):u})})});AS.displayName=OS;var CA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function EA(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function RA(e,n,r){const i=EA(e.key,r);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return CA[i]}function MS(e,n=!1){const r=document.activeElement;for(const i of e)if(i===r||(i.focus({preventScroll:n}),document.activeElement!==r))return}function jA(e,n){return e.map((r,i)=>e[(n+i)%e.length])}var TA=TS,OA=AS,_m=["Enter"," "],AA=["ArrowDown","PageUp","Home"],NS=["ArrowUp","PageDown","End"],MA=[...AA,...NS],NA={ltr:[..._m,"ArrowRight"],rtl:[..._m,"ArrowLeft"]},DA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xl="Menu",[ol,zA,kA]=lp(xl),[Ni,DS]=Ga(xl,[kA,Ks,jS]),Vu=Ks(),zS=jS(),[LA,Di]=Ni(xl),[$A,wl]=Ni(xl),kS=e=>{const{__scopeMenu:n,open:r=!1,children:i,dir:o,onOpenChange:l,modal:u=!0}=e,d=Vu(n),[p,m]=w.useState(null),y=w.useRef(!1),v=tr(l),b=cp(o);return w.useEffect(()=>{const x=()=>{y.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>y.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),w.useEffect(()=>{if(!r)return;const x=()=>v(!1);return window.addEventListener("blur",x),()=>window.removeEventListener("blur",x)},[r,v]),f.jsx(Tp,{...d,children:f.jsx(LA,{scope:n,open:r,onOpenChange:v,content:p,onContentChange:m,children:f.jsx($A,{scope:n,onClose:w.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:y,dir:b,modal:u,children:i})})})};kS.displayName=xl;var IA="MenuAnchor",Np=w.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e,o=Vu(r);return f.jsx(Op,{...o,...i,ref:n})});Np.displayName=IA;var Dp="MenuPortal",[PA,LS]=Ni(Dp,{forceMount:void 0}),$S=e=>{const{__scopeMenu:n,forceMount:r,children:i,container:o}=e,l=Di(Dp,n);return f.jsx(PA,{scope:n,forceMount:r,children:f.jsx(vr,{present:r||l.open,children:f.jsx(yl,{asChild:!0,container:o,children:i})})})};$S.displayName=Dp;var er="MenuContent",[FA,zp]=Ni(er),IS=w.forwardRef((e,n)=>{const r=LS(er,e.__scopeMenu),{forceMount:i=r.forceMount,...o}=e,l=Di(er,e.__scopeMenu),u=wl(er,e.__scopeMenu);return f.jsx(ol.Provider,{scope:e.__scopeMenu,children:f.jsx(vr,{present:i||l.open,children:f.jsx(ol.Slot,{scope:e.__scopeMenu,children:u.modal?f.jsx(VA,{...o,ref:n}):f.jsx(UA,{...o,ref:n})})})})}),VA=w.forwardRef((e,n)=>{const r=Di(er,e.__scopeMenu),i=w.useRef(null),o=nt(n,i);return w.useEffect(()=>{const l=i.current;if(l)return fp(l)},[]),f.jsx(kp,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:je(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),UA=w.forwardRef((e,n)=>{const r=Di(er,e.__scopeMenu);return f.jsx(kp,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),HA=_i("MenuContent.ScrollLock"),kp=w.forwardRef((e,n)=>{const{__scopeMenu:r,loop:i=!1,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:d,onEntryFocus:p,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:x,disableOutsideScroll:S,..._}=e,E=Di(er,r),R=wl(er,r),T=Vu(r),O=zS(r),M=zA(r),[D,P]=w.useState(null),F=w.useRef(null),V=nt(n,F,E.onContentChange),ve=w.useRef(0),be=w.useRef(""),he=w.useRef(0),ue=w.useRef(null),X=w.useRef("right"),pe=w.useRef(0),ge=S?zu:w.Fragment,L=S?{as:HA,allowPinchZoom:!0}:void 0,Z=ee=>{const ne=be.current+ee,z=M().filter(ae=>!ae.disabled),N=document.activeElement,B=z.find(ae=>ae.ref.current===N)?.textValue,J=z.map(ae=>ae.textValue),K=tM(J,ne,B),le=z.find(ae=>ae.textValue===K)?.ref.current;(function ae(ye){be.current=ye,window.clearTimeout(ve.current),ye!==""&&(ve.current=window.setTimeout(()=>ae(""),1e3))})(ne),le&&setTimeout(()=>le.focus())};w.useEffect(()=>()=>window.clearTimeout(ve.current),[]),dp();const re=w.useCallback(ee=>X.current===ue.current?.side&&rM(ee,ue.current?.area),[]);return f.jsx(FA,{scope:r,searchRef:be,onItemEnter:w.useCallback(ee=>{re(ee)&&ee.preventDefault()},[re]),onItemLeave:w.useCallback(ee=>{re(ee)||(F.current?.focus(),P(null))},[re]),onTriggerLeave:w.useCallback(ee=>{re(ee)&&ee.preventDefault()},[re]),pointerGraceTimerRef:he,onPointerGraceIntentChange:w.useCallback(ee=>{ue.current=ee},[]),children:f.jsx(ge,{...L,children:f.jsx(Nu,{asChild:!0,trapped:o,onMountAutoFocus:je(l,ee=>{ee.preventDefault(),F.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:f.jsx(vl,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:x,children:f.jsx(TA,{asChild:!0,...O,dir:R.dir,orientation:"vertical",loop:i,currentTabStopId:D,onCurrentTabStopIdChange:P,onEntryFocus:je(p,ee=>{R.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(Ap,{role:"menu","aria-orientation":"vertical","data-state":e1(E.open),"data-radix-menu-content":"",dir:R.dir,...T,..._,ref:V,style:{outline:"none",..._.style},onKeyDown:je(_.onKeyDown,ee=>{const z=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,N=ee.ctrlKey||ee.altKey||ee.metaKey,B=ee.key.length===1;z&&(ee.key==="Tab"&&ee.preventDefault(),!N&&B&&Z(ee.key));const J=F.current;if(ee.target!==J||!MA.includes(ee.key))return;ee.preventDefault();const le=M().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);NS.includes(ee.key)&&le.reverse(),WA(le)}),onBlur:je(e.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(ve.current),be.current="")}),onPointerMove:je(e.onPointerMove,ll(ee=>{const ne=ee.target,z=pe.current!==ee.clientX;if(ee.currentTarget.contains(ne)&&z){const N=ee.clientX>pe.current?"right":"left";X.current=N,pe.current=ee.clientX}}))})})})})})})});IS.displayName=er;var BA="MenuGroup",Lp=w.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e;return f.jsx($e.div,{role:"group",...i,ref:n})});Lp.displayName=BA;var qA="MenuLabel",PS=w.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e;return f.jsx($e.div,{...i,ref:n})});PS.displayName=qA;var yu="MenuItem",Wb="menu.itemSelect",Uu=w.forwardRef((e,n)=>{const{disabled:r=!1,onSelect:i,...o}=e,l=w.useRef(null),u=wl(yu,e.__scopeMenu),d=zp(yu,e.__scopeMenu),p=nt(n,l),m=w.useRef(!1),y=()=>{const v=l.current;if(!r&&v){const b=new CustomEvent(Wb,{bubbles:!0,cancelable:!0});v.addEventListener(Wb,x=>i?.(x),{once:!0}),$w(v,b),b.defaultPrevented?m.current=!1:u.onClose()}};return f.jsx(FS,{...o,ref:p,disabled:r,onClick:je(e.onClick,y),onPointerDown:v=>{e.onPointerDown?.(v),m.current=!0},onPointerUp:je(e.onPointerUp,v=>{m.current||v.currentTarget?.click()}),onKeyDown:je(e.onKeyDown,v=>{r||v.target!==v.currentTarget||d.searchRef.current!==""&&v.key===" "||_m.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});Uu.displayName=yu;var FS=w.forwardRef((e,n)=>{const{__scopeMenu:r,disabled:i=!1,textValue:o,...l}=e,u=zp(yu,r),d=zS(r),p=w.useRef(null),m=nt(n,p),[y,v]=w.useState(!1),[b,x]=w.useState("");return w.useEffect(()=>{const S=p.current;S&&x((S.textContent??"").trim())},[l.children]),f.jsx(ol.ItemSlot,{scope:r,disabled:i,textValue:o??b,children:f.jsx(OA,{asChild:!0,...d,focusable:!i,children:f.jsx($e.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...l,ref:m,onPointerMove:je(e.onPointerMove,ll(S=>{i?u.onItemLeave(S):(u.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(e.onPointerLeave,ll(S=>u.onItemLeave(S))),onFocus:je(e.onFocus,()=>v(!0)),onBlur:je(e.onBlur,()=>v(!1))})})})}),GA="MenuCheckboxItem",VS=w.forwardRef((e,n)=>{const{checked:r=!1,onCheckedChange:i,...o}=e;return f.jsx(GS,{scope:e.__scopeMenu,checked:r,children:f.jsx(Uu,{role:"menuitemcheckbox","aria-checked":bu(r)?"mixed":r,...o,ref:n,"data-state":Ip(r),onSelect:je(o.onSelect,()=>i?.(bu(r)?!0:!r),{checkForDefaultPrevented:!1})})})});VS.displayName=GA;var US="MenuRadioGroup",[ZA,KA]=Ni(US,{value:void 0,onValueChange:()=>{}}),HS=w.forwardRef((e,n)=>{const{value:r,onValueChange:i,...o}=e,l=tr(i);return f.jsx(ZA,{scope:e.__scopeMenu,value:r,onValueChange:l,children:f.jsx(Lp,{...o,ref:n})})});HS.displayName=US;var BS="MenuRadioItem",qS=w.forwardRef((e,n)=>{const{value:r,...i}=e,o=KA(BS,e.__scopeMenu),l=r===o.value;return f.jsx(GS,{scope:e.__scopeMenu,checked:l,children:f.jsx(Uu,{role:"menuitemradio","aria-checked":l,...i,ref:n,"data-state":Ip(l),onSelect:je(i.onSelect,()=>o.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});qS.displayName=BS;var $p="MenuItemIndicator",[GS,YA]=Ni($p,{checked:!1}),ZS=w.forwardRef((e,n)=>{const{__scopeMenu:r,forceMount:i,...o}=e,l=YA($p,r);return f.jsx(vr,{present:i||bu(l.checked)||l.checked===!0,children:f.jsx($e.span,{...o,ref:n,"data-state":Ip(l.checked)})})});ZS.displayName=$p;var QA="MenuSeparator",KS=w.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e;return f.jsx($e.div,{role:"separator","aria-orientation":"horizontal",...i,ref:n})});KS.displayName=QA;var XA="MenuArrow",YS=w.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e,o=Vu(r);return f.jsx(Mp,{...o,...i,ref:n})});YS.displayName=XA;var JA="MenuSub",[cF,QS]=Ni(JA),Ko="MenuSubTrigger",XS=w.forwardRef((e,n)=>{const r=Di(Ko,e.__scopeMenu),i=wl(Ko,e.__scopeMenu),o=QS(Ko,e.__scopeMenu),l=zp(Ko,e.__scopeMenu),u=w.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:p}=l,m={__scopeMenu:e.__scopeMenu},y=w.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);w.useEffect(()=>y,[y]),w.useEffect(()=>{const b=d.current;return()=>{window.clearTimeout(b),p(null)}},[d,p]);const v=nt(n,o.onTriggerChange);return f.jsx(Np,{asChild:!0,...m,children:f.jsx(FS,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":e1(r.open),...e,ref:v,onClick:b=>{e.onClick?.(b),!(e.disabled||b.defaultPrevented)&&(b.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:je(e.onPointerMove,ll(b=>{l.onItemEnter(b),!b.defaultPrevented&&!e.disabled&&!r.open&&!u.current&&(l.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),y()},100))})),onPointerLeave:je(e.onPointerLeave,ll(b=>{y();const x=r.content?.getBoundingClientRect();if(x){const S=r.content?.dataset.side,_=S==="right",E=_?-5:5,R=x[_?"left":"right"],T=x[_?"right":"left"];l.onPointerGraceIntentChange({area:[{x:b.clientX+E,y:b.clientY},{x:R,y:x.top},{x:T,y:x.top},{x:T,y:x.bottom},{x:R,y:x.bottom}],side:S}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(b),b.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:je(e.onKeyDown,b=>{e.disabled||b.target!==b.currentTarget||l.searchRef.current!==""&&b.key===" "||NA[i.dir].includes(b.key)&&(r.onOpenChange(!0),r.content?.focus(),b.preventDefault())})})})});XS.displayName=Ko;var JS="MenuSubContent",WS=w.forwardRef((e,n)=>{const r=LS(er,e.__scopeMenu),{forceMount:i=r.forceMount,align:o="start",...l}=e,u=Di(er,e.__scopeMenu),d=wl(er,e.__scopeMenu),p=QS(JS,e.__scopeMenu),m=w.useRef(null),y=nt(n,m);return f.jsx(ol.Provider,{scope:e.__scopeMenu,children:f.jsx(vr,{present:i||u.open,children:f.jsx(ol.Slot,{scope:e.__scopeMenu,children:f.jsx(kp,{id:p.contentId,"aria-labelledby":p.triggerId,...l,ref:y,align:o,side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{d.isUsingKeyboardRef.current&&m.current?.focus(),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:je(e.onFocusOutside,v=>{v.target!==p.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:je(e.onEscapeKeyDown,v=>{d.onClose(),v.preventDefault()}),onKeyDown:je(e.onKeyDown,v=>{const b=v.currentTarget.contains(v.target),x=DA[d.dir].includes(v.key);b&&x&&(u.onOpenChange(!1),p.trigger?.focus(),v.preventDefault())})})})})})});WS.displayName=JS;function e1(e){return e?"open":"closed"}function bu(e){return e==="indeterminate"}function Ip(e){return bu(e)?"indeterminate":e?"checked":"unchecked"}function WA(e){const n=document.activeElement;for(const r of e)if(r===n||(r.focus(),document.activeElement!==n))return}function eM(e,n){return e.map((r,i)=>e[(n+i)%e.length])}function tM(e,n,r){const o=n.length>1&&Array.from(n).every(m=>m===n[0])?n[0]:n,l=r?e.indexOf(r):-1;let u=eM(e,Math.max(l,0));o.length===1&&(u=u.filter(m=>m!==r));const p=u.find(m=>m.toLowerCase().startsWith(o.toLowerCase()));return p!==r?p:void 0}function nM(e,n){const{x:r,y:i}=e;let o=!1;for(let l=0,u=n.length-1;li!=b>i&&r<(v-m)*(i-y)/(b-y)+m&&(o=!o)}return o}function rM(e,n){if(!n)return!1;const r={x:e.clientX,y:e.clientY};return nM(r,n)}function ll(e){return n=>n.pointerType==="mouse"?e(n):void 0}var aM=kS,iM=Np,sM=$S,oM=IS,lM=Lp,cM=PS,uM=Uu,dM=VS,fM=HS,hM=qS,mM=ZS,pM=KS,gM=YS,vM=XS,yM=WS,Hu="DropdownMenu",[bM]=Ga(Hu,[DS]),vn=DS(),[xM,t1]=bM(Hu),n1=e=>{const{__scopeDropdownMenu:n,children:r,dir:i,open:o,defaultOpen:l,onOpenChange:u,modal:d=!0}=e,p=vn(n),m=w.useRef(null),[y,v]=Fs({prop:o,defaultProp:l??!1,onChange:u,caller:Hu});return f.jsx(xM,{scope:n,triggerId:dn(),triggerRef:m,contentId:dn(),open:y,onOpenChange:v,onOpenToggle:w.useCallback(()=>v(b=>!b),[v]),modal:d,children:f.jsx(aM,{...p,open:y,onOpenChange:v,dir:i,modal:d,children:r})})};n1.displayName=Hu;var r1="DropdownMenuTrigger",a1=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,disabled:i=!1,...o}=e,l=t1(r1,r),u=vn(r),d=nt(n,l.triggerRef);return f.jsx(iM,{asChild:!0,...u,children:f.jsx($e.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...o,ref:d,onPointerDown:je(e.onPointerDown,p=>{!i&&p.button===0&&p.ctrlKey===!1&&(l.onOpenToggle(),l.open||p.preventDefault())}),onKeyDown:je(e.onKeyDown,p=>{i||(["Enter"," "].includes(p.key)&&l.onOpenToggle(),p.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(p.key)&&p.preventDefault())})})})});a1.displayName=r1;var wM="DropdownMenuPortal",i1=e=>{const{__scopeDropdownMenu:n,...r}=e,i=vn(n);return f.jsx(sM,{...i,...r})};i1.displayName=wM;var s1="DropdownMenuContent",o1=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=t1(s1,r),l=vn(r),u=w.useRef(!1);return f.jsx(oM,{id:o.contentId,"aria-labelledby":o.triggerId,...l,...i,ref:n,onCloseAutoFocus:je(e.onCloseAutoFocus,d=>{u.current||o.triggerRef.current?.focus(),u.current=!1,d.preventDefault()}),onInteractOutside:je(e.onInteractOutside,d=>{const p=d.detail.originalEvent,m=p.button===0&&p.ctrlKey===!0,y=p.button===2||m;(!o.modal||y)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});o1.displayName=s1;var SM="DropdownMenuGroup",_M=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(lM,{...o,...i,ref:n})});_M.displayName=SM;var CM="DropdownMenuLabel",l1=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(cM,{...o,...i,ref:n})});l1.displayName=CM;var EM="DropdownMenuItem",c1=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(uM,{...o,...i,ref:n})});c1.displayName=EM;var RM="DropdownMenuCheckboxItem",jM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(dM,{...o,...i,ref:n})});jM.displayName=RM;var TM="DropdownMenuRadioGroup",OM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(fM,{...o,...i,ref:n})});OM.displayName=TM;var AM="DropdownMenuRadioItem",MM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(hM,{...o,...i,ref:n})});MM.displayName=AM;var NM="DropdownMenuItemIndicator",DM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(mM,{...o,...i,ref:n})});DM.displayName=NM;var zM="DropdownMenuSeparator",kM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(pM,{...o,...i,ref:n})});kM.displayName=zM;var LM="DropdownMenuArrow",$M=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(gM,{...o,...i,ref:n})});$M.displayName=LM;var IM="DropdownMenuSubTrigger",PM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(vM,{...o,...i,ref:n})});PM.displayName=IM;var FM="DropdownMenuSubContent",VM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(yM,{...o,...i,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});VM.displayName=FM;var UM=n1,HM=a1,BM=i1,qM=o1,GM=l1,ZM=c1,KM="Label",u1=w.forwardRef((e,n)=>f.jsx($e.label,{...e,ref:n,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));u1.displayName=KM;var YM=u1;function ex(e,[n,r]){return Math.min(r,Math.max(n,e))}var QM=[" ","Enter","ArrowUp","ArrowDown"],XM=[" ","Enter"],Ri="Select",[Bu,qu,JM]=lp(Ri),[zi]=Ga(Ri,[JM,Ks]),Gu=Ks(),[WM,Ka]=zi(Ri),[eN,tN]=zi(Ri),nN="SelectProvider";function d1(e){const{__scopeSelect:n,children:r,open:i,defaultOpen:o,onOpenChange:l,value:u,defaultValue:d,onValueChange:p,dir:m,name:y,autoComplete:v,disabled:b,required:x,form:S,internal_do_not_use_render:_}=e,E=Gu(n),[R,T]=w.useState(null),[O,M]=w.useState(null),[D,P]=w.useState(!1),F=cp(m),[V,ve]=Fs({prop:i,defaultProp:o??!1,onChange:l,caller:Ri}),[be,he]=Fs({prop:u,defaultProp:d,onChange:p,caller:Ri}),ue=w.useRef(null),X=w.useRef(be);w.useEffect(()=>{const N=S?R?.ownerDocument.getElementById(S):R?.form;if(N instanceof HTMLFormElement){const B=()=>he(X.current);return N.addEventListener("reset",B),()=>N.removeEventListener("reset",B)}},[S,R,he]);const pe=R?!!S||!!R.closest("form"):!0,[ge,L]=w.useState(new Set),Z=dn(),re=Array.from(ge).map(N=>N.props.value).join(";"),ee=w.useCallback(N=>{L(B=>new Set(B).add(N))},[]),ne=w.useCallback(N=>{L(B=>{const J=new Set(B);return J.delete(N),J})},[]),z={required:x,trigger:R,onTriggerChange:T,valueNode:O,onValueNodeChange:M,valueNodeHasChildren:D,onValueNodeHasChildrenChange:P,contentId:Z,value:be,onValueChange:he,open:V,onOpenChange:ve,dir:F,triggerPointerDownPosRef:ue,disabled:b,name:y,autoComplete:v,form:S,nativeOptions:ge,nativeSelectKey:re,isFormControl:pe};return f.jsx(Tp,{...E,children:f.jsx(WM,{scope:n,...z,children:f.jsx(Bu.Provider,{scope:n,children:f.jsx(eN,{scope:n,onNativeOptionAdd:ee,onNativeOptionRemove:ne,children:bN(_)?_(z):r})})})})}d1.displayName=nN;var f1=e=>{const{__scopeSelect:n,children:r,...i}=e;return f.jsx(d1,{__scopeSelect:n,...i,internal_do_not_use_render:({isFormControl:o})=>f.jsxs(f.Fragment,{children:[r,o?f.jsx(I1,{__scopeSelect:n}):null]})})};f1.displayName=Ri;var h1="SelectTrigger",m1=w.forwardRef((e,n)=>{const{__scopeSelect:r,disabled:i=!1,...o}=e,l=Gu(r),u=Ka(h1,r),d=u.disabled||i,p=nt(n,u.onTriggerChange),m=qu(r),y=w.useRef("touch"),[v,b,x]=P1(_=>{const E=m().filter(O=>!O.disabled),R=E.find(O=>O.value===u.value),T=F1(E,_,R);T!==void 0&&u.onValueChange(T.value)}),S=_=>{d||(u.onOpenChange(!0),x()),_&&(u.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return f.jsx(Op,{asChild:!0,...l,children:f.jsx($e.button,{type:"button",role:"combobox","aria-controls":u.open?u.contentId:void 0,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":Zu(u.value)?"":void 0,...o,ref:p,onClick:je(o.onClick,_=>{_.currentTarget.focus(),y.current!=="mouse"&&S(_)}),onPointerDown:je(o.onPointerDown,_=>{y.current=_.pointerType;const E=_.target;E.hasPointerCapture(_.pointerId)&&E.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(S(_),_.preventDefault())}),onKeyDown:je(o.onKeyDown,_=>{const E=v.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&b(_.key),!(E&&_.key===" ")&&QM.includes(_.key)&&(S(),_.preventDefault())})})})});m1.displayName=h1;var p1="SelectValue",g1=w.forwardRef((e,n)=>{const{__scopeSelect:r,className:i,style:o,children:l,placeholder:u="",...d}=e,p=Ka(p1,r),{onValueNodeHasChildrenChange:m}=p,y=l!==void 0,v=nt(n,p.onValueNodeChange);Yt(()=>{m(y)},[m,y]);const b=Zu(p.value);return f.jsx($e.span,{...d,asChild:b?!1:d.asChild,ref:v,style:{pointerEvents:"none"},children:f.jsx(w.Fragment,{children:b?u:l},b?"placeholder":"value")})});g1.displayName=p1;var rN="SelectIcon",v1=w.forwardRef((e,n)=>{const{__scopeSelect:r,children:i,...o}=e;return f.jsx($e.span,{"aria-hidden":!0,...o,ref:n,children:i||"▼"})});v1.displayName=rN;var y1="SelectPortal",[aN,iN]=zi(y1,{forceMount:void 0}),b1=e=>{const{__scopeSelect:n,forceMount:r,...i}=e;return f.jsx(aN,{scope:e.__scopeSelect,forceMount:r,children:f.jsx(yl,{asChild:!0,...i})})};b1.displayName=y1;var Ha="SelectContent",x1=w.forwardRef((e,n)=>{const r=iN(Ha,e.__scopeSelect),{forceMount:i=r.forceMount,...o}=e,l=Ka(Ha,e.__scopeSelect),[u,d]=w.useState();return Yt(()=>{d(new DocumentFragment)},[]),f.jsx(vr,{present:i||l.open,children:({present:p})=>p?f.jsx(_1,{...o,ref:n}):f.jsx(w1,{...o,fragment:u})})});x1.displayName=Ha;var w1=w.forwardRef((e,n)=>{const{__scopeSelect:r,children:i,fragment:o}=e;return o?Mi.createPortal(f.jsx(S1,{scope:r,children:f.jsx(Bu.Slot,{scope:r,children:f.jsx("div",{ref:n,children:i})})}),o):null});w1.displayName="SelectContentFragment";var fr=10,[S1,Ya]=zi(Ha),sN="SelectContentImpl",oN=_i("SelectContent.RemoveScroll"),_1=w.forwardRef((e,n)=>{const{__scopeSelect:r}=e,{position:i="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:u,side:d,sideOffset:p,align:m,alignOffset:y,arrowPadding:v,collisionBoundary:b,collisionPadding:x,sticky:S,hideWhenDetached:_,avoidCollisions:E,...R}=e,T=Ka(Ha,r),[O,M]=w.useState(null),[D,P]=w.useState(null),F=nt(n,M),[V,ve]=w.useState(null),[be,he]=w.useState(null),ue=qu(r),[X,pe]=w.useState(!1),ge=w.useRef(!1);w.useEffect(()=>{if(O)return fp(O)},[O]),dp();const L=w.useCallback(ae=>{const[ye,...xe]=ue().map(Ve=>Ve.ref.current),[Oe]=xe.slice(-1),Ie=document.activeElement;for(const Ve of ae)if(Ve===Ie||(Ve?.scrollIntoView({block:"nearest"}),Ve===ye&&D&&(D.scrollTop=0),Ve===Oe&&D&&(D.scrollTop=D.scrollHeight),Ve?.focus(),document.activeElement!==Ie))return},[ue,D]),Z=w.useCallback(()=>L([V,O]),[L,V,O]);w.useEffect(()=>{X&&Z()},[X,Z]);const{onOpenChange:re,triggerPointerDownPosRef:ee}=T;w.useEffect(()=>{if(O){let ae={x:0,y:0};const ye=Oe=>{ae={x:Math.abs(Math.round(Oe.pageX)-(ee.current?.x??0)),y:Math.abs(Math.round(Oe.pageY)-(ee.current?.y??0))}},xe=Oe=>{ae.x<=10&&ae.y<=10?Oe.preventDefault():Oe.composedPath().includes(O)||re(!1),document.removeEventListener("pointermove",ye),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",xe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",xe,{capture:!0})}}},[O,re,ee]),w.useEffect(()=>{const ae=()=>re(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[re]);const[ne,z]=P1(ae=>{const ye=ue().filter(Ie=>!Ie.disabled),xe=ye.find(Ie=>Ie.ref.current===document.activeElement),Oe=F1(ye,ae,xe);Oe&&setTimeout(()=>Oe.ref.current?.focus())}),N=w.useCallback((ae,ye,xe)=>{const Oe=!ge.current&&!xe;(T.value!==void 0&&T.value===ye||Oe)&&(ve(ae),Oe&&(ge.current=!0))},[T.value]),B=w.useCallback(()=>O?.focus(),[O]),J=w.useCallback((ae,ye,xe)=>{const Oe=!ge.current&&!xe;(T.value!==void 0&&T.value===ye||Oe)&&he(ae)},[T.value]),K=i==="popper"?Cm:C1,le=K===Cm?{side:d,sideOffset:p,align:m,alignOffset:y,arrowPadding:v,collisionBoundary:b,collisionPadding:x,sticky:S,hideWhenDetached:_,avoidCollisions:E}:{};return f.jsx(S1,{scope:r,content:O,viewport:D,onViewportChange:P,itemRefCallback:N,selectedItem:V,onItemLeave:B,itemTextRefCallback:J,focusSelectedItem:Z,selectedItemText:be,position:i,isPositioned:X,searchRef:ne,children:f.jsx(zu,{as:oN,allowPinchZoom:!0,children:f.jsx(Nu,{asChild:!0,trapped:T.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:je(o,ae=>{T.trigger?.focus({preventScroll:!0}),ae.preventDefault()}),children:f.jsx(vl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:f.jsx(K,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:ae=>ae.preventDefault(),...R,...le,onPlaced:()=>pe(!0),ref:F,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:je(R.onKeyDown,ae=>{const ye=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!ye&&ae.key.length===1&&z(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let Oe=ue().filter(Ie=>!Ie.disabled).map(Ie=>Ie.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(Oe=Oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const Ie=ae.target,Ve=Oe.indexOf(Ie);Oe=Oe.slice(Ve+1)}setTimeout(()=>L(Oe)),ae.preventDefault()}})})})})})})});_1.displayName=sN;var lN="SelectItemAlignedPosition",C1=w.forwardRef((e,n)=>{const{__scopeSelect:r,onPlaced:i,...o}=e,l=Ka(Ha,r),u=Ya(Ha,r),[d,p]=w.useState(null),[m,y]=w.useState(null),v=nt(n,y),b=qu(r),x=w.useRef(!1),S=w.useRef(!0),{viewport:_,selectedItem:E,selectedItemText:R,focusSelectedItem:T}=u,O=w.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&m&&_&&E&&R){const F=l.trigger.getBoundingClientRect(),V=m.getBoundingClientRect(),ve=l.valueNode.getBoundingClientRect(),be=R.getBoundingClientRect();if(l.dir!=="rtl"){const Ie=be.left-V.left,Ve=ve.left-Ie,it=F.left-Ve,Qe=F.width+it,fn=Math.max(Qe,V.width),hn=window.innerWidth-fr,Qt=ex(Ve,[fr,Math.max(fr,hn-fn)]);d.style.minWidth=Qe+"px",d.style.left=Qt+"px"}else{const Ie=V.right-be.right,Ve=window.innerWidth-ve.right-Ie,it=window.innerWidth-F.right-Ve,Qe=F.width+it,fn=Math.max(Qe,V.width),hn=window.innerWidth-fr,Qt=ex(Ve,[fr,Math.max(fr,hn-fn)]);d.style.minWidth=Qe+"px",d.style.right=Qt+"px"}const he=b(),ue=window.innerHeight-fr*2,X=_.scrollHeight,pe=window.getComputedStyle(m),ge=parseInt(pe.borderTopWidth,10),L=parseInt(pe.paddingTop,10),Z=parseInt(pe.borderBottomWidth,10),re=parseInt(pe.paddingBottom,10),ee=ge+L+X+re+Z,ne=Math.min(E.offsetHeight*5,ee),z=window.getComputedStyle(_),N=parseInt(z.paddingTop,10),B=parseInt(z.paddingBottom,10),J=F.top+F.height/2-fr,K=ue-J,le=E.offsetHeight/2,ae=E.offsetTop+le,ye=ge+L+ae,xe=ee-ye;if(ye<=J){const Ie=he.length>0&&E===he[he.length-1].ref.current;d.style.bottom="0px";const Ve=m.clientHeight-_.offsetTop-_.offsetHeight,it=Math.max(K,le+(Ie?B:0)+Ve+Z),Qe=ye+it;d.style.height=Qe+"px"}else{const Ie=he.length>0&&E===he[0].ref.current;d.style.top="0px";const it=Math.max(J,ge+_.offsetTop+(Ie?N:0)+le)+xe;d.style.height=it+"px",_.scrollTop=ye-J+_.offsetTop}d.style.margin=`${fr}px 0`,d.style.minHeight=ne+"px",d.style.maxHeight=ue+"px",i?.(),requestAnimationFrame(()=>x.current=!0)}},[b,l.trigger,l.valueNode,d,m,_,E,R,l.dir,i]);Yt(()=>O(),[O]);const[M,D]=w.useState();Yt(()=>{m&&D(window.getComputedStyle(m).zIndex)},[m]);const P=w.useCallback(F=>{F&&S.current===!0&&(O(),T?.(),S.current=!1)},[O,T]);return f.jsx(uN,{scope:r,contentWrapper:d,shouldExpandOnScrollRef:x,onScrollButtonChange:P,children:f.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:f.jsx($e.div,{...o,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});C1.displayName=lN;var cN="SelectPopperPosition",Cm=w.forwardRef((e,n)=>{const{__scopeSelect:r,align:i="start",collisionPadding:o=fr,...l}=e,u=Gu(r);return f.jsx(Ap,{...u,...l,ref:n,align:i,collisionPadding:o,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Cm.displayName=cN;var[uN,Pp]=zi(Ha,{}),Em="SelectViewport",E1=w.forwardRef((e,n)=>{const{__scopeSelect:r,nonce:i,...o}=e,l=Ya(Em,r),u=Pp(Em,r),d=nt(n,l.onViewportChange),p=w.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),f.jsx(Bu.Slot,{scope:r,children:f.jsx($e.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:je(o.onScroll,m=>{const y=m.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:b}=u;if(b?.current&&v){const x=Math.abs(p.current-y.scrollTop);if(x>0){const S=window.innerHeight-fr*2,_=parseFloat(v.style.minHeight),E=parseFloat(v.style.height),R=Math.max(_,E);if(R0?M:0,v.style.justifyContent="flex-end")}}}p.current=y.scrollTop})})})]})});E1.displayName=Em;var R1="SelectGroup",[dN,fN]=zi(R1),hN=w.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e,o=dn();return f.jsx(dN,{scope:r,id:o,children:f.jsx($e.div,{role:"group","aria-labelledby":o,...i,ref:n})})});hN.displayName=R1;var j1="SelectLabel",mN=w.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e,o=fN(j1,r);return f.jsx($e.div,{id:o.id,...i,ref:n})});mN.displayName=j1;var xu="SelectItem",[pN,T1]=zi(xu),O1=w.forwardRef((e,n)=>{const{__scopeSelect:r,value:i,disabled:o=!1,textValue:l,...u}=e,d=Ka(xu,r),p=Ya(xu,r),m=d.value===i,[y,v]=w.useState(l??""),[b,x]=w.useState(!1),S=tr(O=>p.itemRefCallback?.(O,i,o)),_=nt(n,S),E=dn(),R=w.useRef("touch"),T=()=>{o||(d.onValueChange(i),d.onOpenChange(!1))};return f.jsx(pN,{scope:r,value:i,disabled:o,textId:E,isSelected:m,onItemTextChange:w.useCallback(O=>{v(M=>M||(O?.textContent??"").trim())},[]),children:f.jsx(Bu.ItemSlot,{scope:r,value:i,disabled:o,textValue:y,children:f.jsx($e.div,{role:"option","aria-labelledby":E,"data-highlighted":b?"":void 0,"aria-selected":m&&b,"data-state":m?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...u,ref:_,onFocus:je(u.onFocus,()=>x(!0)),onBlur:je(u.onBlur,()=>x(!1)),onClick:je(u.onClick,()=>{R.current!=="mouse"&&T()}),onPointerUp:je(u.onPointerUp,()=>{R.current==="mouse"&&T()}),onPointerDown:je(u.onPointerDown,O=>{R.current=O.pointerType}),onPointerMove:je(u.onPointerMove,O=>{R.current=O.pointerType,o?p.onItemLeave?.():R.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(u.onPointerLeave,O=>{O.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:je(u.onKeyDown,O=>{o||O.target!==O.currentTarget||p.searchRef?.current!==""&&O.key===" "||(XM.includes(O.key)&&T(),O.key===" "&&O.preventDefault())})})})})});O1.displayName=xu;var Yo="SelectItemText",A1=w.forwardRef((e,n)=>{const{__scopeSelect:r,className:i,style:o,...l}=e,u=Ka(Yo,r),d=Ya(Yo,r),p=T1(Yo,r),m=tN(Yo,r),[y,v]=w.useState(null),b=tr(T=>d.itemTextRefCallback?.(T,p.value,p.disabled)),x=nt(n,v,p.onItemTextChange,b),S=y?.textContent,_=w.useMemo(()=>f.jsx("option",{value:p.value,disabled:p.disabled,children:S},p.value),[p.disabled,p.value,S]),{onNativeOptionAdd:E,onNativeOptionRemove:R}=m;return Yt(()=>(E(_),()=>R(_)),[E,R,_]),f.jsxs(f.Fragment,{children:[f.jsx($e.span,{id:p.textId,...l,ref:x}),p.isSelected&&u.valueNode&&!u.valueNodeHasChildren&&!Zu(u.value)?Mi.createPortal(l.children,u.valueNode):null]})});A1.displayName=Yo;var M1="SelectItemIndicator",N1=w.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e;return T1(M1,r).isSelected?f.jsx($e.span,{"aria-hidden":!0,...i,ref:n}):null});N1.displayName=M1;var Rm="SelectScrollUpButton",D1=w.forwardRef((e,n)=>{const r=Ya(Rm,e.__scopeSelect),i=Pp(Rm,e.__scopeSelect),[o,l]=w.useState(!1),u=nt(n,i.onScrollButtonChange);return Yt(()=>{if(r.viewport&&r.isPositioned){let d=function(){const m=p.scrollTop>0;l(m)};const p=r.viewport;return d(),p.addEventListener("scroll",d),()=>p.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),o?f.jsx(k1,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:p}=r;d&&p&&(d.scrollTop=d.scrollTop-p.offsetHeight)}}):null});D1.displayName=Rm;var jm="SelectScrollDownButton",z1=w.forwardRef((e,n)=>{const r=Ya(jm,e.__scopeSelect),i=Pp(jm,e.__scopeSelect),[o,l]=w.useState(!1),u=nt(n,i.onScrollButtonChange);return Yt(()=>{if(r.viewport&&r.isPositioned){let d=function(){const m=p.scrollHeight-p.clientHeight,y=Math.ceil(p.scrollTop)p.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),o?f.jsx(k1,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:p}=r;d&&p&&(d.scrollTop=d.scrollTop+p.offsetHeight)}}):null});z1.displayName=jm;var k1=w.forwardRef((e,n)=>{const{__scopeSelect:r,onAutoScroll:i,...o}=e,l=Ya("SelectScrollButton",r),u=w.useRef(null),d=qu(r),p=w.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return w.useEffect(()=>()=>p(),[p]),Yt(()=>{d().find(y=>y.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[d]),f.jsx($e.div,{"aria-hidden":!0,...o,ref:n,style:{flexShrink:0,...o.style},onPointerDown:je(o.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(i,50))}),onPointerMove:je(o.onPointerMove,()=>{l.onItemLeave?.(),u.current===null&&(u.current=window.setInterval(i,50))}),onPointerLeave:je(o.onPointerLeave,()=>{p()})})}),gN="SelectSeparator",vN=w.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e;return f.jsx($e.div,{"aria-hidden":!0,...i,ref:n})});vN.displayName=gN;var L1="SelectArrow",yN=w.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e,o=Gu(r);return Ya(L1,r).position==="popper"?f.jsx(Mp,{...o,...i,ref:n}):null});yN.displayName=L1;var $1="SelectBubbleInput",I1=w.forwardRef(({__scopeSelect:e,...n},r)=>{const i=Ka($1,e),{value:o,onValueChange:l,required:u,disabled:d,name:p,autoComplete:m,form:y}=i,{nativeOptions:v,nativeSelectKey:b}=i,x=w.useRef(null),S=nt(r,x),_=o??"",E=WT(_),R=Array.from(v).some(T=>(T.props.value??"")==="");return w.useEffect(()=>{const T=x.current;if(!T)return;const O=window.HTMLSelectElement.prototype,D=Object.getOwnPropertyDescriptor(O,"value").set;if(E!==_&&D){const P=new Event("change",{bubbles:!0});D.call(T,_),T.dispatchEvent(P)}},[E,_]),f.jsxs($e.select,{"aria-hidden":!0,required:u,tabIndex:-1,name:p,autoComplete:m,disabled:d,form:y,onChange:T=>l(T.target.value),...n,style:{...Iw,...n.style},ref:S,defaultValue:_,children:[Zu(o)&&!R?f.jsx("option",{value:""}):null,Array.from(v)]},b)});I1.displayName=$1;function bN(e){return typeof e=="function"}function Zu(e){return e===""||e===void 0}function P1(e){const n=tr(e),r=w.useRef(""),i=w.useRef(0),o=w.useCallback(u=>{const d=r.current+u;n(d),(function p(m){r.current=m,window.clearTimeout(i.current),m!==""&&(i.current=window.setTimeout(()=>p(""),1e3))})(d)},[n]),l=w.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,o,l]}function F1(e,n,r){const o=n.length>1&&Array.from(n).every(m=>m===n[0])?n[0]:n,l=r?e.indexOf(r):-1;let u=xN(e,Math.max(l,0));o.length===1&&(u=u.filter(m=>m!==r));const p=u.find(m=>m.textValue.toLowerCase().startsWith(o.toLowerCase()));return p!==r?p:void 0}function xN(e,n){return e.map((r,i)=>e[(n+i)%e.length])}var wN="Separator",tx="horizontal",SN=["horizontal","vertical"],V1=w.forwardRef((e,n)=>{const{decorative:r,orientation:i=tx,...o}=e,l=_N(i)?i:tx,d=r?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return f.jsx($e.div,{"data-orientation":l,...d,...o,ref:n})});V1.displayName=wN;function _N(e){return SN.includes(e)}var CN=V1,[Ku]=Ga("Tooltip",[Ks]),Yu=Ks(),U1="TooltipProvider",EN=700,Tm="tooltip.open",[RN,Fp]=Ku(U1),H1=e=>{const{__scopeTooltip:n,delayDuration:r=EN,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:l}=e,u=w.useRef(!0),d=w.useRef(!1),p=w.useRef(0);return w.useEffect(()=>{const m=p.current;return()=>window.clearTimeout(m)},[]),f.jsx(RN,{scope:n,isOpenDelayedRef:u,delayDuration:r,onOpen:w.useCallback(()=>{i<=0||(window.clearTimeout(p.current),u.current=!1)},[i]),onClose:w.useCallback(()=>{i<=0||(window.clearTimeout(p.current),p.current=window.setTimeout(()=>u.current=!0,i))},[i]),isPointerInTransitRef:d,onPointerInTransitChange:w.useCallback(m=>{d.current=m},[]),disableHoverableContent:o,children:l})};H1.displayName=U1;var cl="Tooltip",[jN,Sl]=Ku(cl),B1=e=>{const{__scopeTooltip:n,children:r,open:i,defaultOpen:o,onOpenChange:l,disableHoverableContent:u,delayDuration:d}=e,p=Fp(cl,e.__scopeTooltip),m=Yu(n),[y,v]=w.useState(null),b=dn(),x=w.useRef(0),S=u??p.disableHoverableContent,_=d??p.delayDuration,E=w.useRef(!1),[R,T]=Fs({prop:i,defaultProp:o??!1,onChange:F=>{F?(p.onOpen(),document.dispatchEvent(new CustomEvent(Tm))):p.onClose(),l?.(F)},caller:cl}),O=w.useMemo(()=>R?E.current?"delayed-open":"instant-open":"closed",[R]),M=w.useCallback(()=>{window.clearTimeout(x.current),x.current=0,E.current=!1,T(!0)},[T]),D=w.useCallback(()=>{window.clearTimeout(x.current),x.current=0,T(!1)},[T]),P=w.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{E.current=!0,T(!0),x.current=0},_)},[_,T]);return w.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),f.jsx(Tp,{...m,children:f.jsx(jN,{scope:n,contentId:b,open:R,stateAttribute:O,trigger:y,onTriggerChange:v,onTriggerEnter:w.useCallback(()=>{p.isOpenDelayedRef.current?P():M()},[p.isOpenDelayedRef,P,M]),onTriggerLeave:w.useCallback(()=>{S?D():(window.clearTimeout(x.current),x.current=0)},[D,S]),onOpen:M,onClose:D,disableHoverableContent:S,children:r})})};B1.displayName=cl;var Om="TooltipTrigger",q1=w.forwardRef((e,n)=>{const{__scopeTooltip:r,...i}=e,o=Sl(Om,r),l=Fp(Om,r),u=Yu(r),d=w.useRef(null),p=nt(n,d,o.onTriggerChange),m=w.useRef(!1),y=w.useRef(!1),v=w.useCallback(()=>m.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),f.jsx(Op,{asChild:!0,...u,children:f.jsx($e.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:p,onPointerMove:je(e.onPointerMove,b=>{b.pointerType!=="touch"&&!y.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),y.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{o.onTriggerLeave(),y.current=!1}),onPointerDown:je(e.onPointerDown,()=>{o.open&&o.onClose(),m.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:je(e.onFocus,()=>{m.current||o.onOpen()}),onBlur:je(e.onBlur,o.onClose),onClick:je(e.onClick,o.onClose)})})});q1.displayName=Om;var Vp="TooltipPortal",[TN,ON]=Ku(Vp,{forceMount:void 0}),G1=e=>{const{__scopeTooltip:n,forceMount:r,children:i,container:o}=e,l=Sl(Vp,n);return f.jsx(TN,{scope:n,forceMount:r,children:f.jsx(vr,{present:r||l.open,children:f.jsx(yl,{asChild:!0,container:o,children:i})})})};G1.displayName=Vp;var Us="TooltipContent",Z1=w.forwardRef((e,n)=>{const r=ON(Us,e.__scopeTooltip),{forceMount:i=r.forceMount,side:o="top",...l}=e,u=Sl(Us,e.__scopeTooltip);return f.jsx(vr,{present:i||u.open,children:u.disableHoverableContent?f.jsx(K1,{side:o,...l,ref:n}):f.jsx(AN,{side:o,...l,ref:n})})}),AN=w.forwardRef((e,n)=>{const r=Sl(Us,e.__scopeTooltip),i=Fp(Us,e.__scopeTooltip),o=w.useRef(null),l=nt(n,o),[u,d]=w.useState(null),{trigger:p,onClose:m}=r,y=o.current,{onPointerInTransitChange:v}=i,b=w.useCallback(()=>{d(null),v(!1)},[v]),x=w.useCallback((S,_)=>{const E=S.currentTarget,R={x:S.clientX,y:S.clientY},T=zN(R,E.getBoundingClientRect()),O=kN(R,T),M=LN(_.getBoundingClientRect()),D=IN([...O,...M]);d(D),v(!0)},[v]);return w.useEffect(()=>()=>b(),[b]),w.useEffect(()=>{if(p&&y){const S=E=>x(E,y),_=E=>x(E,p);return p.addEventListener("pointerleave",S),y.addEventListener("pointerleave",_),()=>{p.removeEventListener("pointerleave",S),y.removeEventListener("pointerleave",_)}}},[p,y,x,b]),w.useEffect(()=>{if(u){const S=_=>{const E=_.target,R={x:_.clientX,y:_.clientY},T=p?.contains(E)||y?.contains(E),O=!$N(R,u);T?b():O&&(b(),m())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[p,y,u,m,b]),f.jsx(K1,{...e,ref:l})}),[MN,NN]=Ku(cl,{isInside:!1}),DN=xj("TooltipContent"),K1=w.forwardRef((e,n)=>{const{__scopeTooltip:r,children:i,"aria-label":o,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,p=Sl(Us,r),m=Yu(r),{onClose:y}=p;return w.useEffect(()=>(document.addEventListener(Tm,y),()=>document.removeEventListener(Tm,y)),[y]),w.useEffect(()=>{if(p.trigger){const v=b=>{b.target instanceof Node&&b.target.contains(p.trigger)&&y()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[p.trigger,y]),f.jsx(vl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:v=>v.preventDefault(),onDismiss:y,children:f.jsxs(Ap,{"data-state":p.stateAttribute,...m,...d,ref:n,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(DN,{children:i}),f.jsx(MN,{scope:r,isInside:!0,children:f.jsx(Mj,{id:p.contentId,role:"tooltip",children:o||i})})]})})});Z1.displayName=Us;var Y1="TooltipArrow",Q1=w.forwardRef((e,n)=>{const{__scopeTooltip:r,...i}=e,o=Yu(r);return NN(Y1,r).isInside?null:f.jsx(Mp,{...o,...i,ref:n})});Q1.displayName=Y1;function zN(e,n){const r=Math.abs(n.top-e.y),i=Math.abs(n.bottom-e.y),o=Math.abs(n.right-e.x),l=Math.abs(n.left-e.x);switch(Math.min(r,i,o,l)){case l:return"left";case o:return"right";case r:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function kN(e,n,r=5){const i=[];switch(n){case"top":i.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":i.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":i.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":i.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return i}function LN(e){const{top:n,right:r,bottom:i,left:o}=e;return[{x:o,y:n},{x:r,y:n},{x:r,y:i},{x:o,y:i}]}function $N(e,n){const{x:r,y:i}=e;let o=!1;for(let l=0,u=n.length-1;li!=b>i&&r<(v-m)*(i-y)/(b-y)+m&&(o=!o)}return o}function IN(e){const n=e.slice();return n.sort((r,i)=>r.xi.x?1:r.yi.y?1:0),PN(n)}function PN(e){if(e.length<=1)return e.slice();const n=[];for(let i=0;i=2;){const l=n[n.length-1],u=n[n.length-2];if((l.x-u.x)*(o.y-u.y)>=(l.y-u.y)*(o.x-u.x))n.pop();else break}n.push(o)}n.pop();const r=[];for(let i=e.length-1;i>=0;i--){const o=e[i];for(;r.length>=2;){const l=r[r.length-1],u=r[r.length-2];if((l.x-u.x)*(o.y-u.y)>=(l.y-u.y)*(o.x-u.x))r.pop();else break}r.push(o)}return r.pop(),n.length===1&&r.length===1&&n[0].x===r[0].x&&n[0].y===r[0].y?n:n.concat(r)}var FN=H1,VN=B1,UN=q1,HN=G1,BN=Z1,qN=Q1;function X1(e){var n,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(n=0;n{const r=new Array(e.length+n.length);for(let i=0;i({classGroupId:e,validator:n}),W1=(e=new Map,n=null,r)=>({nextPart:e,validators:n,classGroupId:r}),wu="-",nx=[],KN="arbitrary..",YN=e=>{const n=XN(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return QN(u);const d=u.split(wu),p=d[0]===""&&d.length>1?1:0;return e_(d,p,n)},getConflictingClassGroupIds:(u,d)=>{if(d){const p=i[u],m=r[u];return p?m?GN(m,p):p:m||nx}return r[u]||nx}}},e_=(e,n,r)=>{if(e.length-n===0)return r.classGroupId;const o=e[n],l=r.nextPart.get(o);if(l){const m=e_(e,n+1,l);if(m)return m}const u=r.validators;if(u===null)return;const d=n===0?e.join(wu):e.slice(n).join(wu),p=u.length;for(let m=0;me.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),r=n.indexOf(":"),i=n.slice(0,r);return i?KN+i:void 0})(),XN=e=>{const{theme:n,classGroups:r}=e;return JN(r,n)},JN=(e,n)=>{const r=W1();for(const i in e){const o=e[i];Up(o,r,i,n)}return r},Up=(e,n,r,i)=>{const o=e.length;for(let l=0;l{if(typeof e=="string"){eD(e,n,r);return}if(typeof e=="function"){tD(e,n,r,i);return}nD(e,n,r,i)},eD=(e,n,r)=>{const i=e===""?n:t_(n,e);i.classGroupId=r},tD=(e,n,r,i)=>{if(rD(e)){Up(e(i),n,r,i);return}n.validators===null&&(n.validators=[]),n.validators.push(ZN(r,e))},nD=(e,n,r,i)=>{const o=Object.entries(e),l=o.length;for(let u=0;u{let r=e;const i=n.split(wu),o=i.length;for(let l=0;l"isThemeGetter"in e&&e.isThemeGetter===!0,aD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,r=Object.create(null),i=Object.create(null);const o=(l,u)=>{r[l]=u,n++,n>e&&(n=0,i=r,r=Object.create(null))};return{get(l){let u=r[l];if(u!==void 0)return u;if((u=i[l])!==void 0)return o(l,u),u},set(l,u){l in r?r[l]=u:o(l,u)}}},Am="!",rx=":",iD=[],ax=(e,n,r,i,o)=>({modifiers:e,hasImportantModifier:n,baseClassName:r,maybePostfixModifierPosition:i,isExternal:o}),sD=e=>{const{prefix:n,experimentalParseClassName:r}=e;let i=o=>{const l=[];let u=0,d=0,p=0,m;const y=o.length;for(let _=0;_p?m-p:void 0;return ax(l,x,b,S)};if(n){const o=n+rx,l=i;i=u=>u.startsWith(o)?l(u.slice(o.length)):ax(iD,!1,u,void 0,!0)}if(r){const o=i;i=l=>r({className:l,parseClassName:o})}return i},oD=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((r,i)=>{n.set(r,1e6+i)}),r=>{const i=[];let o=[];for(let l=0;l0&&(o.sort(),i.push(...o),o=[]),i.push(u)):o.push(u)}return o.length>0&&(o.sort(),i.push(...o)),i}},lD=e=>({cache:aD(e.cacheSize),parseClassName:sD(e),sortModifiers:oD(e),postfixLookupClassGroupIds:cD(e),...YN(e)}),cD=e=>{const n=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let i=0;i{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:l,postfixLookupClassGroupIds:u}=n,d=[],p=e.trim().split(uD);let m="";for(let y=p.length-1;y>=0;y-=1){const v=p[y],{isExternal:b,modifiers:x,hasImportantModifier:S,baseClassName:_,maybePostfixModifierPosition:E}=r(v);if(b){m=v+(m.length>0?" "+m:m);continue}let R=!!E,T;if(R){const F=_.substring(0,E);T=i(F);const V=T&&u[T]?i(_):void 0;V&&V!==T&&(T=V,R=!1)}else T=i(_);if(!T){if(!R){m=v+(m.length>0?" "+m:m);continue}if(T=i(_),!T){m=v+(m.length>0?" "+m:m);continue}R=!1}const O=x.length===0?"":x.length===1?x[0]:l(x).join(":"),M=S?O+Am:O,D=M+T;if(d.indexOf(D)>-1)continue;d.push(D);const P=o(T,R);for(let F=0;F0?" "+m:m)}return m},fD=(...e)=>{let n=0,r,i,o="";for(;n{if(typeof e=="string")return e;let n,r="";for(let i=0;i{let r,i,o,l;const u=p=>{const m=n.reduce((y,v)=>v(y),e());return r=lD(m),i=r.cache.get,o=r.cache.set,l=d,d(p)},d=p=>{const m=i(p);if(m)return m;const y=dD(p,r);return o(p,y),y};return l=u,(...p)=>l(fD(...p))},mD=[],Ht=e=>{const n=r=>r[e]||mD;return n.isThemeGetter=!0,n},r_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,a_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,pD=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,gD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,yD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ma=e=>pD.test(e),He=e=>!!e&&!Number.isNaN(Number(e)),Rr=e=>!!e&&Number.isInteger(Number(e)),Hh=e=>e.endsWith("%")&&He(e.slice(0,-1)),ea=e=>gD.test(e),i_=()=>!0,wD=e=>vD.test(e)&&!yD.test(e),Hp=()=>!1,SD=e=>bD.test(e),_D=e=>xD.test(e),CD=e=>!Ce(e)&&!Ee(e),ED=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),RD=e=>Qa(e,l_,Hp),Ce=e=>r_.test(e),yi=e=>Qa(e,c_,wD),ix=e=>Qa(e,zD,He),jD=e=>Qa(e,d_,i_),TD=e=>Qa(e,u_,Hp),sx=e=>Qa(e,s_,Hp),OD=e=>Qa(e,o_,_D),Kc=e=>Qa(e,f_,SD),Ee=e=>a_.test(e),Ho=e=>ki(e,c_),AD=e=>ki(e,u_),ox=e=>ki(e,s_),MD=e=>ki(e,l_),ND=e=>ki(e,o_),Yc=e=>ki(e,f_,!0),DD=e=>ki(e,d_,!0),Qa=(e,n,r)=>{const i=r_.exec(e);return i?i[1]?n(i[1]):r(i[2]):!1},ki=(e,n,r=!1)=>{const i=a_.exec(e);return i?i[1]?n(i[1]):r:!1},s_=e=>e==="position"||e==="percentage",o_=e=>e==="image"||e==="url",l_=e=>e==="length"||e==="size"||e==="bg-size",c_=e=>e==="length",zD=e=>e==="number",u_=e=>e==="family-name",d_=e=>e==="number"||e==="weight",f_=e=>e==="shadow",kD=()=>{const e=Ht("color"),n=Ht("font"),r=Ht("text"),i=Ht("font-weight"),o=Ht("tracking"),l=Ht("leading"),u=Ht("breakpoint"),d=Ht("container"),p=Ht("spacing"),m=Ht("radius"),y=Ht("shadow"),v=Ht("inset-shadow"),b=Ht("text-shadow"),x=Ht("drop-shadow"),S=Ht("blur"),_=Ht("perspective"),E=Ht("aspect"),R=Ht("ease"),T=Ht("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...M(),Ee,Ce],P=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],V=()=>[Ee,Ce,p],ve=()=>[Ma,"full","auto",...V()],be=()=>[Rr,"none","subgrid",Ee,Ce],he=()=>["auto",{span:["full",Rr,Ee,Ce]},Rr,Ee,Ce],ue=()=>[Rr,"auto",Ee,Ce],X=()=>["auto","min","max","fr",Ee,Ce],pe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ge=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...V()],Z=()=>[Ma,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],re=()=>[Ma,"screen","full","dvw","lvw","svw","min","max","fit",...V()],ee=()=>[Ma,"screen","full","lh","dvh","lvh","svh","min","max","fit",...V()],ne=()=>[e,Ee,Ce],z=()=>[...M(),ox,sx,{position:[Ee,Ce]}],N=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",MD,RD,{size:[Ee,Ce]}],J=()=>[Hh,Ho,yi],K=()=>["","none","full",m,Ee,Ce],le=()=>["",He,Ho,yi],ae=()=>["solid","dashed","dotted","double"],ye=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[He,Hh,ox,sx],Oe=()=>["","none",S,Ee,Ce],Ie=()=>["none",He,Ee,Ce],Ve=()=>["none",He,Ee,Ce],it=()=>[He,Ee,Ce],Qe=()=>[Ma,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ea],breakpoint:[ea],color:[i_],container:[ea],"drop-shadow":[ea],ease:["in","out","in-out"],font:[CD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ea],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ea],shadow:[ea],spacing:["px",He],text:[ea],"text-shadow":[ea],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ma,Ce,Ee,E]}],container:["container"],"container-type":[{"@container":["","normal","size",Ee,Ce]}],"container-named":[ED],columns:[{columns:[He,Ce,Ee,d]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ve()}],"inset-x":[{"inset-x":ve()}],"inset-y":[{"inset-y":ve()}],start:[{"inset-s":ve(),start:ve()}],end:[{"inset-e":ve(),end:ve()}],"inset-bs":[{"inset-bs":ve()}],"inset-be":[{"inset-be":ve()}],top:[{top:ve()}],right:[{right:ve()}],bottom:[{bottom:ve()}],left:[{left:ve()}],visibility:["visible","invisible","collapse"],z:[{z:[Rr,"auto",Ee,Ce]}],basis:[{basis:[Ma,"full","auto",d,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,Ma,"auto","initial","none",Ce]}],grow:[{grow:["",He,Ee,Ce]}],shrink:[{shrink:["",He,Ee,Ce]}],order:[{order:[Rr,"first","last","none",Ee,Ce]}],"grid-cols":[{"grid-cols":be()}],"col-start-end":[{col:he()}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":be()}],"row-start-end":[{row:he()}],"row-start":[{"row-start":ue()}],"row-end":[{"row-end":ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...pe(),"normal"]}],"justify-items":[{"justify-items":[...ge(),"normal"]}],"justify-self":[{"justify-self":["auto",...ge()]}],"align-content":[{content:["normal",...pe()]}],"align-items":[{items:[...ge(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ge(),{baseline:["","last"]}]}],"place-content":[{"place-content":pe()}],"place-items":[{"place-items":[...ge(),"baseline"]}],"place-self":[{"place-self":["auto",...ge()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pbs:[{pbs:V()}],pbe:[{pbe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...re()]}],"min-inline-size":[{"min-inline":["auto",...re()]}],"max-inline-size":[{"max-inline":["none",...re()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[d,"screen",...Z()]}],"min-w":[{"min-w":[d,"screen","none",...Z()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",r,Ho,yi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,DD,jD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Hh,Ce]}],"font-family":[{font:[AD,TD,n]}],"font-features":[{"font-features":[Ce]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Ee,Ce]}],"line-clamp":[{"line-clamp":[He,"none",Ee,ix]}],leading:[{leading:[l,...V()]}],"list-image":[{"list-image":["none",Ee,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ne()}],"text-color":[{text:ne()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",Ee,yi]}],"text-decoration-color":[{decoration:ne()}],"underline-offset":[{"underline-offset":[He,"auto",Ee,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"tab-size":[{tab:[Rr,Ee,Ce]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,Ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee,Ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:N()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Rr,Ee,Ce],radial:["",Ee,Ce],conic:[Rr,Ee,Ce]},ND,OD]}],"bg-color":[{bg:ne()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:ne()}],"gradient-via":[{via:ne()}],"gradient-to":[{to:ne()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":le()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:ne()}],"border-color-x":[{"border-x":ne()}],"border-color-y":[{"border-y":ne()}],"border-color-s":[{"border-s":ne()}],"border-color-e":[{"border-e":ne()}],"border-color-bs":[{"border-bs":ne()}],"border-color-be":[{"border-be":ne()}],"border-color-t":[{"border-t":ne()}],"border-color-r":[{"border-r":ne()}],"border-color-b":[{"border-b":ne()}],"border-color-l":[{"border-l":ne()}],"divide-color":[{divide:ne()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,Ee,Ce]}],"outline-w":[{outline:["",He,Ho,yi]}],"outline-color":[{outline:ne()}],shadow:[{shadow:["","none",y,Yc,Kc]}],"shadow-color":[{shadow:ne()}],"inset-shadow":[{"inset-shadow":["none",v,Yc,Kc]}],"inset-shadow-color":[{"inset-shadow":ne()}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ne()}],"ring-offset-w":[{"ring-offset":[He,yi]}],"ring-offset-color":[{"ring-offset":ne()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":ne()}],"text-shadow":[{"text-shadow":["none",b,Yc,Kc]}],"text-shadow-color":[{"text-shadow":ne()}],opacity:[{opacity:[He,Ee,Ce]}],"mix-blend":[{"mix-blend":[...ye(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ye()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":ne()}],"mask-image-linear-to-color":[{"mask-linear-to":ne()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":ne()}],"mask-image-t-to-color":[{"mask-t-to":ne()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":ne()}],"mask-image-r-to-color":[{"mask-r-to":ne()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":ne()}],"mask-image-b-to-color":[{"mask-b-to":ne()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":ne()}],"mask-image-l-to-color":[{"mask-l-to":ne()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":ne()}],"mask-image-x-to-color":[{"mask-x-to":ne()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":ne()}],"mask-image-y-to-color":[{"mask-y-to":ne()}],"mask-image-radial":[{"mask-radial":[Ee,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":ne()}],"mask-image-radial-to-color":[{"mask-radial-to":ne()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":ne()}],"mask-image-conic-to-color":[{"mask-conic-to":ne()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:N()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ce]}],filter:[{filter:["","none",Ee,Ce]}],blur:[{blur:Oe()}],brightness:[{brightness:[He,Ee,Ce]}],contrast:[{contrast:[He,Ee,Ce]}],"drop-shadow":[{"drop-shadow":["","none",x,Yc,Kc]}],"drop-shadow-color":[{"drop-shadow":ne()}],grayscale:[{grayscale:["",He,Ee,Ce]}],"hue-rotate":[{"hue-rotate":[He,Ee,Ce]}],invert:[{invert:["",He,Ee,Ce]}],saturate:[{saturate:[He,Ee,Ce]}],sepia:[{sepia:["",He,Ee,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ce]}],"backdrop-blur":[{"backdrop-blur":Oe()}],"backdrop-brightness":[{"backdrop-brightness":[He,Ee,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[He,Ee,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,Ee,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,Ee,Ce]}],"backdrop-invert":[{"backdrop-invert":["",He,Ee,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[He,Ee,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[He,Ee,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",He,Ee,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":V()}],"border-spacing-x":[{"border-spacing-x":V()}],"border-spacing-y":[{"border-spacing-y":V()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",Ee,Ce]}],ease:[{ease:["linear","initial",R,Ee,Ce]}],delay:[{delay:[He,Ee,Ce]}],animate:[{animate:["none",T,Ee,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Ee,Ce]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Ie()}],"rotate-x":[{"rotate-x":Ie()}],"rotate-y":[{"rotate-y":Ie()}],"rotate-z":[{"rotate-z":Ie()}],scale:[{scale:Ve()}],"scale-x":[{"scale-x":Ve()}],"scale-y":[{"scale-y":Ve()}],"scale-z":[{"scale-z":Ve()}],"scale-3d":["scale-3d"],skew:[{skew:it()}],"skew-x":[{"skew-x":it()}],"skew-y":[{"skew-y":it()}],transform:[{transform:[Ee,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Qe()}],"translate-x":[{"translate-x":Qe()}],"translate-y":[{"translate-y":Qe()}],"translate-z":[{"translate-z":Qe()}],"translate-none":["translate-none"],zoom:[{zoom:[Rr,Ee,Ce]}],accent:[{accent:ne()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ne()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ee,Ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":ne()}],"scrollbar-track-color":[{"scrollbar-track":ne()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mbs":[{"scroll-mbs":V()}],"scroll-mbe":[{"scroll-mbe":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pbs":[{"scroll-pbs":V()}],"scroll-pbe":[{"scroll-pbe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ee,Ce]}],fill:[{fill:["none",...ne()]}],"stroke-w":[{stroke:[He,Ho,yi,ix]}],stroke:[{stroke:["none",...ne()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},LD=hD(kD);function Je(...e){return LD(J1(e))}function $D({delayDuration:e=0,...n}){return f.jsx(FN,{"data-slot":"tooltip-provider",delayDuration:e,...n})}function ID({...e}){return f.jsx(VN,{"data-slot":"tooltip",...e})}function PD({...e}){return f.jsx(UN,{"data-slot":"tooltip-trigger",...e})}function FD({className:e,sideOffset:n=0,children:r,...i}){return f.jsx(HN,{children:f.jsxs(BN,{"data-slot":"tooltip-content",sideOffset:n,className:Je("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...i,children:[r,f.jsx(qN,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const Mm=new Set;function VD(e){return Mm.add(e),()=>Mm.delete(e)}function UD(){for(const e of Mm)e()}const h_=(...e)=>e.filter((n,r,i)=>!!n&&n.trim()!==""&&i.indexOf(n)===r).join(" ").trim();const HD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const BD=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,r,i)=>i?i.toUpperCase():r.toLowerCase());const lx=e=>{const n=BD(e);return n.charAt(0).toUpperCase()+n.slice(1)};var Bh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const qD=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},GD=w.createContext({}),ZD=()=>w.useContext(GD),KD=w.forwardRef(({color:e,size:n,strokeWidth:r,absoluteStrokeWidth:i,className:o="",children:l,iconNode:u,...d},p)=>{const{size:m=24,strokeWidth:y=2,absoluteStrokeWidth:v=!1,color:b="currentColor",className:x=""}=ZD()??{},S=i??v?Number(r??y)*24/Number(n??m):r??y;return w.createElement("svg",{ref:p,...Bh,width:n??m??Bh.width,height:n??m??Bh.height,stroke:e??b,strokeWidth:S,className:h_("lucide",x,o),...!l&&!qD(d)&&{"aria-hidden":"true"},...d},[...u.map(([_,E])=>w.createElement(_,E)),...Array.isArray(l)?l:[l]])});const Me=(e,n)=>{const r=w.forwardRef(({className:i,...o},l)=>w.createElement(KD,{ref:l,iconNode:n,className:h_(`lucide-${HD(lx(e))}`,`lucide-${e}`,i),...o}));return r.displayName=lx(e),r};const YD=[["path",{d:"M4.5 3h15",key:"c7n0jr"}],["path",{d:"M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3",key:"m1uhx7"}],["path",{d:"M6 14h12",key:"4cwo0f"}]],QD=Me("beaker",YD);const XD=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],JD=Me("book-open",XD);const WD=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],ez=Me("briefcase",WD);const tz=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],nz=Me("bug",tz);const rz=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],az=Me("calendar",rz);const iz=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],m_=Me("check",iz);const sz=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Bp=Me("chevron-down",sz);const oz=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],lz=Me("chevron-right",oz);const cz=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],uz=Me("chevron-up",cz);const dz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],fz=Me("circle-check",dz);const hz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],p_=Me("clock",hz);const mz=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],pz=Me("code",mz);const gz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],vz=Me("compass",gz);const yz=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],bz=Me("copy",yz);const xz=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],wz=Me("credit-card",xz);const Sz=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],_z=Me("database",Sz);const Cz=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Ez=Me("download",Cz);const Rz=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],jz=Me("ellipsis",Rz);const Tz=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],g_=Me("file-text",Tz);const Oz=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],Az=Me("flag",Oz);const Mz=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],qp=Me("folder",Mz);const Nz=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Dz=Me("gauge",Nz);const zz=[["path",{d:"m14 13-8.381 8.38a1 1 0 0 1-3.001-3l8.384-8.381",key:"pgg06f"}],["path",{d:"m16 16 6-6",key:"vzrcl6"}],["path",{d:"m21.5 10.5-8-8",key:"a17d9x"}],["path",{d:"m8 8 6-6",key:"18bi4p"}],["path",{d:"m8.5 7.5 8 8",key:"1oyaui"}]],kz=Me("gavel",zz);const Lz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],v_=Me("globe",Lz);const $z=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],Iz=Me("graduation-cap",$z);const Pz=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],Fz=Me("heart",Pz);const Vz=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Uz=Me("history",Vz);const Hz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Bz=Me("image",Hz);const qz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Gz=Me("info",qz);const Zz=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Kz=Me("layout-dashboard",Zz);const Yz=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Qz=Me("lightbulb",Yz);const Xz=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Jz=Me("link",Xz);const Wz=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ek=Me("loader-circle",Wz);const tk=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],y_=Me("lock",tk);const nk=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],rk=Me("log-out",nk);const ak=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],ik=Me("megaphone",ak);const sk=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],ok=Me("menu",sk);const lk=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],ck=Me("music",lk);const uk=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],dk=Me("octagon-x",uk);const fk=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],hk=Me("package",fk);const mk=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],pk=Me("pen-line",mk);const gk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],vk=Me("plus",gk);const yk=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],bk=Me("rocket",yk);const xk=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],b_=Me("search",xk);const wk=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Sk=Me("settings",wk);const _k=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],Ck=Me("share-2",_k);const Ek=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],x_=Me("shield",Ek);const Rk=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],w_=Me("square-terminal",Rk);const jk=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Tk=Me("star",jk);const Ok=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ak=Me("trash-2",Ok);const Mk=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],S_=Me("triangle-alert",Mk);const Nk=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Dk=Me("upload",Nk);const zk=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],__=Me("users",zk);const kk=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Lk=Me("wrench",kk);const $k=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],C_=Me("x",$k);function Ik(){const e=!document.body.classList.contains("sb-open");document.body.classList.toggle("sb-open"),Qu(),e?document.getElementById("sidebar")?.querySelector(Pk)?.focus():document.getElementById("menu-btn")?.focus()}const Pk='a[href], button:not(:disabled), select, input, [tabindex]:not([tabindex="-1"])';function mr(){const e=document.body.classList.contains("sb-open");document.body.classList.remove("sb-open"),Qu(),e&&window.innerWidth<=ou&&document.getElementById("menu-btn")?.focus()}const ou=900;function Qu(){const e=document.getElementById("sidebar");if(!e)return;const n=document.body.classList.contains("sb-open");window.innerWidth<=ou&&!n?e.setAttribute("inert",""):e.removeAttribute("inert");const i=document.getElementById("main");i&&(n&&window.innerWidth<=ou?i.setAttribute("inert",""):i.removeAttribute("inert")),e.setAttribute("aria-modal",String(n&&window.innerWidth<=ou)),document.getElementById("menu-btn")?.setAttribute("aria-expanded",String(n))}typeof window<"u"&&(window.addEventListener("resize",Qu),window.addEventListener("keydown",e=>{e.key==="Escape"&&document.body.classList.contains("sb-open")&&mr()}));const Fk={alert:S_,card:wz,check:m_,chev:lz,chevd:Bp,clock:p_,copy:bz,doc:g_,dots:jz,download:Ez,folder:qp,dashboard:Kz,gear:Sk,globe:v_,hist:Uz,link:Jz,lock:y_,menu:ok,plus:vk,power:rk,search:b_,share:Ck,shield:x_,terminal:w_,trash:Ak,upload:Dk,users:__,x:C_};function ut({name:e}){const n=Fk[e];return n?f.jsx(n,{className:"ico","aria-hidden":"true"}):null}const Nm={folder:qp,"book-open":JD,"file-text":g_,"pen-line":pk,users:__,briefcase:ez,megaphone:ik,rocket:bk,lightbulb:Qz,flag:Az,star:Tk,heart:Fz,code:pz,"square-terminal":w_,bug:nz,wrench:Lk,database:_z,package:hk,beaker:QD,gauge:Dz,shield:x_,lock:y_,gavel:kz,globe:v_,compass:vz,calendar:az,clock:p_,"graduation-cap":Iz,image:Bz,music:ck};function Ls({name:e,className:n}){const r=e??"",i=Object.hasOwn(Nm,r)?Nm[r]:qp;return f.jsx(i,{className:n,"aria-hidden":"true"})}function Vk({size:e=22}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 32 32",fill:"currentColor",role:"img","aria-label":"BearDrive",children:[f.jsx("rect",{x:"4",y:"4",width:"5.6",height:"24"}),f.jsx("rect",{x:"11.2",y:"4",width:"14.4",height:"11.2"}),f.jsx("rect",{x:"11.2",y:"16.8",width:"16.8",height:"11.2"})]})}function Su(e){const n=["page",e.width??"app",e.className].filter(Boolean).join(" ");return f.jsx("div",{className:n,children:e.children})}function Uk(e){e&&Qu()}function ul(e){return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"sb-backdrop",onClick:mr}),f.jsxs("aside",{id:"sidebar",ref:Uk,children:[e.vault,e.projectsNav,e.tree??f.jsx("nav",{id:"tree","aria-label":"Files"}),e.orgBar]}),f.jsxs("main",{id:"main",children:[e.topbar,f.jsx("article",{id:"content",ref:e.contentRef,onScroll:e.onContentScroll,children:e.children})]})]})}function Xu(e){const{name:n,onHome:r,showSignout:i,search:o}=e;return f.jsxs("header",{id:"vault",children:[f.jsx("span",{id:"vault-badge",children:f.jsx(Vk,{size:22})}),f.jsx("span",{id:"vault-name",className:r?"vault-link":void 0,onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,onKeyDown:l=>{r&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r())},children:n}),f.jsxs("div",{className:"vault-actions",children:[o&&f.jsxs(ID,{delayDuration:150,children:[f.jsx(PD,{asChild:!0,children:f.jsx("button",{id:"search-btn",className:"icon-btn2","aria-label":"Search",onClick:()=>{UD(),mr()},children:f.jsx(ut,{name:"search"})})}),f.jsxs(FD,{className:"tipcard",sideOffset:6,children:["Search ",f.jsx("kbd",{children:"⌘K"})]})]}),i&&f.jsx("a",{id:"signout",href:"/auth/logout",title:"Sign out","aria-label":"Sign out",children:f.jsx(ut,{name:"power"})})]})]})}function dl(e){return f.jsxs("header",{id:"topbar",children:[f.jsx("button",{id:"menu-btn",className:"icon-btn",title:"Menu","aria-label":"Menu","aria-controls":"sidebar","aria-expanded":"false",onClick:Ik,children:f.jsx(ut,{name:"menu"})}),f.jsx("span",{id:"crumb",children:e.crumb}),f.jsx("span",{id:"meta",children:e.meta}),e.actions]})}function Hk(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const Bk=e=>{switch(e){case"success":return Zk;case"info":return Yk;case"warning":return Kk;case"error":return Qk;default:return null}},qk=Array(12).fill(0),Gk=({visible:e,className:n})=>me.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},me.createElement("div",{className:"sonner-spinner"},qk.map((r,i)=>me.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),Zk=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Kk=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Yk=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Qk=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Xk=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},me.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),me.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Jk=()=>{const[e,n]=me.useState(document.hidden);return me.useEffect(()=>{const r=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Dm=1;class Wk{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const r=this.subscribers.indexOf(n);this.subscribers.splice(r,1)}),this.publish=n=>{this.subscribers.forEach(r=>r(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var r;const{message:i,...o}=n,l=typeof n?.id=="number"||((r=n.id)==null?void 0:r.length)>0?n.id:Dm++,u=this.toasts.find(p=>p.id===l),d=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),u?this.toasts=this.toasts.map(p=>p.id===l?(this.publish({...p,...n,id:l,title:i}),{...p,...n,id:l,dismissible:d,title:i}):p):this.addToast({title:i,...o,dismissible:d,id:l}),l},this.dismiss=n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:n,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(i=>i({id:r.id,dismiss:!0}))}),n),this.message=(n,r)=>this.create({...r,message:n}),this.error=(n,r)=>this.create({...r,message:n,type:"error"}),this.success=(n,r)=>this.create({...r,type:"success",message:n}),this.info=(n,r)=>this.create({...r,type:"info",message:n}),this.warning=(n,r)=>this.create({...r,type:"warning",message:n}),this.loading=(n,r)=>this.create({...r,type:"loading",message:n}),this.promise=(n,r)=>{if(!r)return;let i;r.loading!==void 0&&(i=this.create({...r,promise:n,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const o=Promise.resolve(n instanceof Function?n():n);let l=i!==void 0,u;const d=o.then(async m=>{if(u=["resolve",m],me.isValidElement(m))l=!1,this.create({id:i,type:"default",message:m});else if(t3(m)&&!m.ok){l=!1;const v=typeof r.error=="function"?await r.error(`HTTP error! status: ${m.status}`):r.error,b=typeof r.description=="function"?await r.description(`HTTP error! status: ${m.status}`):r.description,S=typeof v=="object"&&!me.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:b,...S})}else if(m instanceof Error){l=!1;const v=typeof r.error=="function"?await r.error(m):r.error,b=typeof r.description=="function"?await r.description(m):r.description,S=typeof v=="object"&&!me.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:b,...S})}else if(r.success!==void 0){l=!1;const v=typeof r.success=="function"?await r.success(m):r.success,b=typeof r.description=="function"?await r.description(m):r.description,S=typeof v=="object"&&!me.isValidElement(v)?v:{message:v};this.create({id:i,type:"success",description:b,...S})}}).catch(async m=>{if(u=["reject",m],r.error!==void 0){l=!1;const y=typeof r.error=="function"?await r.error(m):r.error,v=typeof r.description=="function"?await r.description(m):r.description,x=typeof y=="object"&&!me.isValidElement(y)?y:{message:y};this.create({id:i,type:"error",description:v,...x})}}).finally(()=>{l&&(this.dismiss(i),i=void 0),r.finally==null||r.finally.call(r)}),p=()=>new Promise((m,y)=>d.then(()=>u[0]==="reject"?y(u[1]):m(u[1])).catch(y));return typeof i!="string"&&typeof i!="number"?{unwrap:p}:Object.assign(i,{unwrap:p})},this.custom=(n,r)=>{const i=r?.id||Dm++;return this.create({jsx:n(i),id:i,...r}),i},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Tn=new Wk,e3=(e,n)=>{const r=n?.id||Dm++;return Tn.addToast({title:e,...n,id:r}),r},t3=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",n3=e3,r3=()=>Tn.toasts,a3=()=>Tn.getActiveToasts(),cx=Object.assign(n3,{success:Tn.success,info:Tn.info,warning:Tn.warning,error:Tn.error,custom:Tn.custom,message:Tn.message,promise:Tn.promise,dismiss:Tn.dismiss,loading:Tn.loading},{getHistory:r3,getToasts:a3});Hk("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Qc(e){return e.label!==void 0}const i3=3,s3="24px",o3="16px",ux=4e3,l3=356,c3=14,u3=45,d3=200;function jr(...e){return e.filter(Boolean).join(" ")}function f3(e){const[n,r]=e.split("-"),i=[];return n&&i.push(n),r&&i.push(r),i}const h3=e=>{var n,r,i,o,l,u,d,p,m;const{invert:y,toast:v,unstyled:b,interacting:x,setHeights:S,visibleToasts:_,heights:E,index:R,toasts:T,expanded:O,removeToast:M,defaultRichColors:D,closeButton:P,style:F,cancelButtonStyle:V,actionButtonStyle:ve,className:be="",descriptionClassName:he="",duration:ue,position:X,gap:pe,expandByDefault:ge,classNames:L,icons:Z,closeButtonAriaLabel:re="Close toast"}=e,[ee,ne]=me.useState(null),[z,N]=me.useState(null),[B,J]=me.useState(!1),[K,le]=me.useState(!1),[ae,ye]=me.useState(!1),[xe,Oe]=me.useState(!1),[Ie,Ve]=me.useState(!1),[it,Qe]=me.useState(0),[fn,hn]=me.useState(0),Qt=me.useRef(v.duration||ue||ux),br=me.useRef(null),jt=me.useRef(null),rr=R===0,xr=R+1<=_,Tt=v.type,Vn=v.dismissible!==!1,Dt=v.className||"",kr=v.descriptionClassName||"",ar=me.useMemo(()=>E.findIndex(Ne=>Ne.toastId===v.id)||0,[E,v.id]),ir=me.useMemo(()=>{var Ne;return(Ne=v.closeButton)!=null?Ne:P},[v.closeButton,P]),wr=me.useMemo(()=>v.duration||ue||ux,[v.duration,ue]),sr=me.useRef(0),mn=me.useRef(0),A=me.useRef(0),I=me.useRef(null),[U,ce]=X.split("-"),Y=me.useMemo(()=>E.reduce((Ne,ht,yt)=>yt>=ar?Ne:Ne+ht.height,0),[E,ar]),W=Jk(),de=v.invert||y,we=Tt==="loading";mn.current=me.useMemo(()=>ar*pe+Y,[ar,Y]),me.useEffect(()=>{Qt.current=wr},[wr]),me.useEffect(()=>{J(!0)},[]),me.useEffect(()=>{const Ne=jt.current;if(Ne){const ht=Ne.getBoundingClientRect().height;return hn(ht),S(yt=>[{toastId:v.id,height:ht,position:v.position},...yt]),()=>S(yt=>yt.filter(qt=>qt.toastId!==v.id))}},[S,v.id]),me.useLayoutEffect(()=>{if(!B)return;const Ne=jt.current,ht=Ne.style.height;Ne.style.height="auto";const yt=Ne.getBoundingClientRect().height;Ne.style.height=ht,hn(yt),S(qt=>qt.find(St=>St.toastId===v.id)?qt.map(St=>St.toastId===v.id?{...St,height:yt}:St):[{toastId:v.id,height:yt,position:v.position},...qt])},[B,v.title,v.description,S,v.id,v.jsx,v.action,v.cancel]);const _e=me.useCallback(()=>{le(!0),Qe(mn.current),S(Ne=>Ne.filter(ht=>ht.toastId!==v.id)),setTimeout(()=>{M(v)},d3)},[v,M,S,mn]);me.useEffect(()=>{if(v.promise&&Tt==="loading"||v.duration===1/0||v.type==="loading")return;let Ne;return O||x||W?(()=>{if(A.current{v.onAutoClose==null||v.onAutoClose.call(v,v),_e()},Qt.current)),()=>clearTimeout(Ne)},[O,x,v,Tt,W,_e]),me.useEffect(()=>{v.delete&&(_e(),v.onDismiss==null||v.onDismiss.call(v,v))},[_e,v.delete]);function Xe(){var Ne;if(Z?.loading){var ht;return me.createElement("div",{className:jr(L?.loader,v==null||(ht=v.classNames)==null?void 0:ht.loader,"sonner-loader"),"data-visible":Tt==="loading"},Z.loading)}return me.createElement(Gk,{className:jr(L?.loader,v==null||(Ne=v.classNames)==null?void 0:Ne.loader),visible:Tt==="loading"})}const wt=v.icon||Z?.[Tt]||Bk(Tt);var Xt,zt;return me.createElement("li",{tabIndex:0,ref:jt,className:jr(be,Dt,L?.toast,v==null||(n=v.classNames)==null?void 0:n.toast,L?.default,L?.[Tt],v==null||(r=v.classNames)==null?void 0:r[Tt]),"data-sonner-toast":"","data-rich-colors":(Xt=v.richColors)!=null?Xt:D,"data-styled":!(v.jsx||v.unstyled||b),"data-mounted":B,"data-promise":!!v.promise,"data-swiped":Ie,"data-removed":K,"data-visible":xr,"data-y-position":U,"data-x-position":ce,"data-index":R,"data-front":rr,"data-swiping":ae,"data-dismissible":Vn,"data-type":Tt,"data-invert":de,"data-swipe-out":xe,"data-swipe-direction":z,"data-expanded":!!(O||ge&&B),"data-testid":v.testId,style:{"--index":R,"--toasts-before":R,"--z-index":T.length-R,"--offset":`${K?it:mn.current}px`,"--initial-height":ge?"auto":`${fn}px`,...F,...v.style},onDragEnd:()=>{ye(!1),ne(null),I.current=null},onPointerDown:Ne=>{Ne.button!==2&&(we||!Vn||(br.current=new Date,Qe(mn.current),Ne.target.setPointerCapture(Ne.pointerId),Ne.target.tagName!=="BUTTON"&&(ye(!0),I.current={x:Ne.clientX,y:Ne.clientY})))},onPointerUp:()=>{var Ne,ht,yt;if(xe||!Vn)return;I.current=null;const qt=Number(((Ne=jt.current)==null?void 0:Ne.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),or=Number(((ht=jt.current)==null?void 0:ht.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),St=new Date().getTime()-((yt=br.current)==null?void 0:yt.getTime()),yn=ee==="x"?qt:or,Wa=Math.abs(yn)/St;if(Math.abs(yn)>=u3||Wa>.11){Qe(mn.current),v.onDismiss==null||v.onDismiss.call(v,v),N(ee==="x"?qt>0?"right":"left":or>0?"down":"up"),_e(),Oe(!0);return}else{var bn,xn;(bn=jt.current)==null||bn.style.setProperty("--swipe-amount-x","0px"),(xn=jt.current)==null||xn.style.setProperty("--swipe-amount-y","0px")}Ve(!1),ye(!1),ne(null)},onPointerMove:Ne=>{var ht,yt,qt;if(!I.current||!Vn||((ht=window.getSelection())==null?void 0:ht.toString().length)>0)return;const St=Ne.clientY-I.current.y,yn=Ne.clientX-I.current.x;var Wa;const bn=(Wa=e.swipeDirections)!=null?Wa:f3(X);!ee&&(Math.abs(yn)>1||Math.abs(St)>1)&&ne(Math.abs(yn)>Math.abs(St)?"x":"y");let xn={x:0,y:0};const $i=lr=>1/(1.5+Math.abs(lr)/20);if(ee==="y"){if(bn.includes("top")||bn.includes("bottom"))if(bn.includes("top")&&St<0||bn.includes("bottom")&&St>0)xn.y=St;else{const lr=St*$i(St);xn.y=Math.abs(lr)0)xn.x=yn;else{const lr=yn*$i(yn);xn.x=Math.abs(lr)0||Math.abs(xn.y)>0)&&Ve(!0),(yt=jt.current)==null||yt.style.setProperty("--swipe-amount-x",`${xn.x}px`),(qt=jt.current)==null||qt.style.setProperty("--swipe-amount-y",`${xn.y}px`)}},ir&&!v.jsx&&Tt!=="loading"?me.createElement("button",{"aria-label":re,"data-disabled":we,"data-close-button":!0,onClick:we||!Vn?()=>{}:()=>{_e(),v.onDismiss==null||v.onDismiss.call(v,v)},className:jr(L?.closeButton,v==null||(i=v.classNames)==null?void 0:i.closeButton)},(zt=Z?.close)!=null?zt:Xk):null,(Tt||v.icon||v.promise)&&v.icon!==null&&(Z?.[Tt]!==null||v.icon)?me.createElement("div",{"data-icon":"",className:jr(L?.icon,v==null||(o=v.classNames)==null?void 0:o.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||Xe():null,v.type!=="loading"?wt:null):null,me.createElement("div",{"data-content":"",className:jr(L?.content,v==null||(l=v.classNames)==null?void 0:l.content)},me.createElement("div",{"data-title":"",className:jr(L?.title,v==null||(u=v.classNames)==null?void 0:u.title)},v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title),v.description?me.createElement("div",{"data-description":"",className:jr(he,kr,L?.description,v==null||(d=v.classNames)==null?void 0:d.description)},typeof v.description=="function"?v.description():v.description):null),me.isValidElement(v.cancel)?v.cancel:v.cancel&&Qc(v.cancel)?me.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||V,onClick:Ne=>{Qc(v.cancel)&&Vn&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,Ne),_e())},className:jr(L?.cancelButton,v==null||(p=v.classNames)==null?void 0:p.cancelButton)},v.cancel.label):null,me.isValidElement(v.action)?v.action:v.action&&Qc(v.action)?me.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||ve,onClick:Ne=>{Qc(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,Ne),!Ne.defaultPrevented&&_e())},className:jr(L?.actionButton,v==null||(m=v.classNames)==null?void 0:m.actionButton)},v.action.label):null)};function dx(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function m3(e,n){const r={};return[e,n].forEach((i,o)=>{const l=o===1,u=l?"--mobile-offset":"--offset",d=l?o3:s3;function p(m){["top","right","bottom","left"].forEach(y=>{r[`${u}-${y}`]=typeof m=="number"?`${m}px`:m})}typeof i=="number"||typeof i=="string"?p(i):typeof i=="object"?["top","right","bottom","left"].forEach(m=>{i[m]===void 0?r[`${u}-${m}`]=d:r[`${u}-${m}`]=typeof i[m]=="number"?`${i[m]}px`:i[m]}):p(d)}),r}const p3=me.forwardRef(function(n,r){const{id:i,invert:o,position:l="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:p,className:m,offset:y,mobileOffset:v,theme:b="light",richColors:x,duration:S,style:_,visibleToasts:E=i3,toastOptions:R,dir:T=dx(),gap:O=c3,icons:M,containerAriaLabel:D="Notifications"}=n,[P,F]=me.useState([]),V=me.useMemo(()=>i?P.filter(B=>B.toasterId===i):P.filter(B=>!B.toasterId),[P,i]),ve=me.useMemo(()=>Array.from(new Set([l].concat(V.filter(B=>B.position).map(B=>B.position)))),[V,l]),[be,he]=me.useState([]),[ue,X]=me.useState(!1),[pe,ge]=me.useState(!1),[L,Z]=me.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),re=me.useRef(null),ee=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),ne=me.useRef(null),z=me.useRef(!1),N=me.useCallback(B=>{F(J=>{var K;return(K=J.find(le=>le.id===B.id))!=null&&K.delete||Tn.dismiss(B.id),J.filter(({id:le})=>le!==B.id)})},[]);return me.useEffect(()=>Tn.subscribe(B=>{if(B.dismiss){requestAnimationFrame(()=>{F(J=>J.map(K=>K.id===B.id?{...K,delete:!0}:K))});return}setTimeout(()=>{yj.flushSync(()=>{F(J=>{const K=J.findIndex(le=>le.id===B.id);return K!==-1?[...J.slice(0,K),{...J[K],...B},...J.slice(K+1)]:[B,...J]})})})}),[P]),me.useEffect(()=>{if(b!=="system"){Z(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;const B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:J})=>{Z(J?"dark":"light")})}catch{B.addListener(({matches:K})=>{try{Z(K?"dark":"light")}catch(le){console.error(le)}})}},[b]),me.useEffect(()=>{P.length<=1&&X(!1)},[P]),me.useEffect(()=>{const B=J=>{var K;if(u.every(ye=>J[ye]||J.code===ye)){var ae;X(!0),(ae=re.current)==null||ae.focus()}J.code==="Escape"&&(document.activeElement===re.current||(K=re.current)!=null&&K.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[u]),me.useEffect(()=>{if(re.current)return()=>{ne.current&&(ne.current.focus({preventScroll:!0}),ne.current=null,z.current=!1)}},[re.current]),me.createElement("section",{ref:r,"aria-label":`${D} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ve.map((B,J)=>{var K;const[le,ae]=B.split("-");return V.length?me.createElement("ol",{key:B,dir:T==="auto"?dx():T,tabIndex:-1,ref:re,className:m,"data-sonner-toaster":!0,"data-sonner-theme":L,"data-y-position":le,"data-x-position":ae,style:{"--front-toast-height":`${((K=be[0])==null?void 0:K.height)||0}px`,"--width":`${l3}px`,"--gap":`${O}px`,..._,...m3(y,v)},onBlur:ye=>{z.current&&!ye.currentTarget.contains(ye.relatedTarget)&&(z.current=!1,ne.current&&(ne.current.focus({preventScroll:!0}),ne.current=null))},onFocus:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||z.current||(z.current=!0,ne.current=ye.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{pe||X(!1)},onDragEnd:()=>X(!1),onPointerDown:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||ge(!0)},onPointerUp:()=>ge(!1)},V.filter(ye=>!ye.position&&J===0||ye.position===B).map((ye,xe)=>{var Oe,Ie;return me.createElement(h3,{key:ye.id,icons:M,index:xe,toast:ye,defaultRichColors:x,duration:(Oe=R?.duration)!=null?Oe:S,className:R?.className,descriptionClassName:R?.descriptionClassName,invert:o,visibleToasts:E,closeButton:(Ie=R?.closeButton)!=null?Ie:p,interacting:pe,position:B,style:R?.style,unstyled:R?.unstyled,classNames:R?.classNames,cancelButtonStyle:R?.cancelButtonStyle,actionButtonStyle:R?.actionButtonStyle,closeButtonAriaLabel:R?.closeButtonAriaLabel,removeToast:N,toasts:V.filter(Ve=>Ve.position==ye.position),heights:be.filter(Ve=>Ve.position==ye.position),setHeights:he,expandByDefault:d,gap:O,expanded:ue,swipeDirections:n.swipeDirections})})):null}))}),g3=({...e})=>f.jsx(p3,{theme:"dark",className:"toaster group",icons:{success:f.jsx(fz,{className:"size-4"}),info:f.jsx(Gz,{className:"size-4"}),warning:f.jsx(S_,{className:"size-4"}),error:f.jsx(dk,{className:"size-4"}),loading:f.jsx(ek,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius-ctl)"},...e});function Ke(e,n=!1){n?cx.error(e,{duration:1/0,closeButton:!0}):cx(e)}function v3(){return f.jsx(g3,{position:"bottom-center"})}const fx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,hx=J1,y3=(e,n)=>r=>{var i;if(n?.variants==null)return hx(e,r?.class,r?.className);const{variants:o,defaultVariants:l}=n,u=Object.keys(o).map(m=>{const y=r?.[m],v=l?.[m];if(y===null)return null;const b=fx(y)||fx(v);return o[m][b]}),d=r&&Object.entries(r).reduce((m,y)=>{let[v,b]=y;return b===void 0||(m[v]=b),m},{}),p=n==null||(i=n.compoundVariants)===null||i===void 0?void 0:i.reduce((m,y)=>{let{class:v,className:b,...x}=y;return Object.entries(x).every(S=>{let[_,E]=S;return Array.isArray(E)?E.includes({...l,...d}[_]):{...l,...d}[_]===E})?[...m,v,b]:m},[]);return hx(e,u,p,r?.class,r?.className)},b3=y3("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[background-color,border-color,color] disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",primary:"pbtn",danger:"danger-btn",subtle:"ai-btn",toolbar:"btn",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function vt({className:e,variant:n="default",size:r="default",asChild:i=!1,...o}){const l=i?bj:"button";return f.jsx(l,{"data-slot":"button","data-variant":n,"data-size":r,className:Je(b3({variant:n,size:r,className:e})),...o})}function Ju({...e}){return f.jsx(hp,{"data-slot":"dialog",...e})}function x3({...e}){return f.jsx(pp,{"data-slot":"dialog-portal",...e})}function w3({className:e,...n}){return f.jsx(gp,{"data-slot":"dialog-overlay",className:Je("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...n})}function Wu({className:e,children:n,showCloseButton:r=!0,...i}){return f.jsxs(x3,{"data-slot":"dialog-portal",children:[f.jsx(w3,{}),f.jsxs(vp,{"data-slot":"dialog-content",className:Je("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...i,children:[n,r&&f.jsxs(aS,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[f.jsx(C_,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function _l({className:e,...n}){return f.jsx(tS,{"data-slot":"dialog-title",className:Je("text-lg leading-none font-semibold",e),...n})}let E_=null,lu=[];function Cl(e){E_=e,lu.forEach(n=>n())}function R_(e,n,r="",i="OK",o={}){return new Promise(l=>Cl({kind:"prompt",title:e,label:n,value:r,okLabel:i,...o,resolve:l}))}function Hs(e,n,r="Confirm",i=!1){return new Promise(o=>Cl({kind:"confirm",title:e,message:n,confirmLabel:r,danger:i,resolve:o}))}function S3(){const e=w.useSyncExternalStore(r=>(lu.push(r),()=>{lu=lu.filter(i=>i!==r)}),()=>E_);if(!e)return null;const n=()=>{Cl(null),e.kind==="prompt"?e.resolve(null):e.resolve(!1)};return f.jsx(Ju,{open:!0,onOpenChange:r=>!r&&n(),children:f.jsx(Wu,{className:"modal",showCloseButton:!1,children:e.kind==="prompt"?f.jsx(_3,{m:e}):f.jsx(C3,{m:e})})})}function _3({m:e}){const n=w.useRef(null),r=m=>{Cl(null),e.resolve(m)},[i,o]=w.useState(""),[l,u]=w.useState(e.value),d=e.match===void 0||l.trim()===e.match,p=()=>{const m=l;if(d){if(!m.trim()){o("Give it a name."),n.current.focus();return}r(m)}};return f.jsxs(f.Fragment,{children:[f.jsx(_l,{asChild:!0,children:f.jsx("h3",{children:e.title})}),f.jsx("label",{className:"modal-label",htmlFor:"modal-input",children:e.label}),f.jsx("input",{className:"modal-input",type:"text",autoComplete:"off",value:l,ref:n,id:"modal-input",autoFocus:!0,onFocus:m=>m.currentTarget.select(),"aria-invalid":!!i,"aria-describedby":i?"modal-input-err":void 0,onChange:m=>{u(m.currentTarget.value),i&&o("")},onKeyDown:m=>m.key==="Enter"&&p()}),i&&f.jsx("span",{id:"modal-input-err",role:"alert",className:"field-err",children:i}),f.jsxs("div",{className:"modal-actions",children:[f.jsx(vt,{variant:"subtle",onClick:()=>r(null),children:"Cancel"}),f.jsx(vt,{variant:e.danger?"danger":"primary",onClick:p,disabled:!d,children:e.okLabel})]})]})}function C3({m:e}){const n=r=>{Cl(null),e.resolve(r)};return f.jsxs(f.Fragment,{children:[f.jsx(_l,{asChild:!0,children:f.jsx("h3",{children:e.title})}),f.jsx("p",{className:"modal-msg",children:e.message}),f.jsxs("div",{className:"modal-actions",children:[f.jsx(vt,{variant:"subtle",onClick:()=>n(!1),autoFocus:e.danger,children:"Cancel"}),f.jsx(vt,{variant:e.danger?"danger":"primary",onClick:()=>n(!0),autoFocus:!e.danger,children:e.confirmLabel})]})]})}function E3(e){return Pt({queryKey:["projects"],queryFn:()=>Bt("/api/projects"),enabled:e,refetchInterval:3e4,select:n=>n.projects||[]})}function R3(e){return Pt({queryKey:["orgs"],queryFn:()=>Bt("/api/orgs"),enabled:e,select:n=>n.orgs||[]})}function j3(e){return Pt({queryKey:["permissions",e],queryFn:()=>Bt(`/api/p/${e}/permissions`),enabled:!!e})}function j_(e,n=!0){return Pt({queryKey:["shares",e],queryFn:()=>Bt(`/api/p/${e}/shares`),enabled:!!e&&n,select:r=>r.shares||[]})}function T_(e){return Pt({queryKey:["admin","pending"],queryFn:()=>Bt("/api/admin/pending"),enabled:e,select:n=>n.pending||[]})}function O_(){const e=Ai();return()=>Promise.all([e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["orgs"]})]).then(()=>{})}function A_(e){return e.split("/").map(encodeURIComponent).join("/")}function T3(e){try{return decodeURIComponent(e)}catch{return e}}function M_(e){return e.split("/").map(T3).join("/")}const O3=new Set(["dashboard","history","install","settings"]),mx={insights:"dashboard"};function A3(e){return Object.hasOwn(mx,e)?mx[e]:void 0}const Gp=["q","user","since","until"];function Zp(e){return!!e&&Gp.some(n=>!!e[n])}function N_(e){const n=new URLSearchParams;for(const i of Gp)e?.[i]&&n.set(i,e[i]);const r=n.toString();return r?"?"+r:""}function D_(e,n){const r=e.indexOf("?"),i=r===-1?null:new URLSearchParams(e.slice(r)),o=i?.get("v")||"",l=i?.get("connect")||"",u=M3(r===-1?e:e.slice(0,r),n);o&&(u.version=o),l&&(u.connect=l);const d={};for(const p of Gp){const m=i?.get(p);m&&(d[p]=m)}if(Zp(d)&&(u.filters=d),u.view==="history"&&!u.viewTarget){const p=(i?.get("path")||i?.get("prefix")||"").replace(/^\/+|\/+$/g,"");p&&(u.viewTarget=M_(p),u.queryTarget=!0)}return u}function px(e,n){const r=n.replace(/\/+$/,"");return r!==n&&(e.trailingSlash=!0),e.path=r?M_(r):"",e}function M3(e,n){const r=e.replace(/^\/+/,"");if(n!=="hub")return px({path:""},r);if(r==="orgs"||r.startsWith("orgs/"))return{org:r.slice(5).replace(/\/+$/,""),path:""};if(r==="billing"||r.startsWith("billing/"))return{billing:!0,path:""};const i=r.indexOf("/");if(i===-1)return{project:r,path:""};const o=px({project:r.slice(0,i),path:""},r.slice(i+1)),l=o.path.indexOf("/"),u=l===-1?o.path:o.path.slice(0,l),d=A3(u);return(O3.has(u)||d)&&(o.view=d||u,d&&(o.legacyView=!0),o.viewTarget=l===-1?"":o.path.slice(l+1).replace(/\/+$/,""),o.path=""),o}function fl(e,n,r){const i=A_(e),o=r?"?v="+r:"";return n?"/"+n+(i?"/"+i:"")+o:"/"+i+o}function Pn(e,n,r,i){let o=(n?"/"+n:"")+"/"+e;return r&&(o+="/"+A_(r.replace(/\/+$/,""))),o+(e==="history"?N_(i):"")}let Kp="POP";const zm=new Set;function z_(){for(const e of zm)e()}window.addEventListener("popstate",()=>{Kp="POP",z_()});function Kt(e,n){const r=location.pathname+location.search;!n?.replace&&r===e||(history[n?.replace?"replaceState":"pushState"](null,"",e),Kp=n?.replace?"REPLACE":"PUSH",z_())}function Yp(){return w.useSyncExternalStore(e=>(zm.add(e),()=>{zm.delete(e)}),()=>location.pathname+location.search)}function N3(){return Kp}function Bs(e){return e.startsWith("/")&&!e.startsWith("//")?{href:e,onClick:r=>{r.defaultPrevented||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||r.button!==0||(r.preventDefault(),Kt(e),document.body.classList.remove("sb-open"))}}:{href:e,target:"_blank",rel:"noopener noreferrer"}}function Qo({to:e}){return w.useEffect(()=>{Kt(e,{replace:!0})},[e]),null}function k_(){return{accessor:(e,n)=>typeof e=="function"?{...n,accessorFn:e}:{...n,accessorKey:e},display:e=>e,group:e=>e}}function Da(e,n){return typeof e=="function"?e(n):e}function Fn(e,n){return r=>{n.setState(i=>({...i,[e]:Da(r,i[e])}))}}function ed(e){return e instanceof Function}function D3(e){return Array.isArray(e)&&e.every(n=>typeof n=="number")}function z3(e,n){const r=[],i=o=>{o.forEach(l=>{r.push(l);const u=n(l);u!=null&&u.length&&i(u)})};return i(e),r}function ze(e,n,r){let i=[],o;return l=>{let u;r.key&&r.debug&&(u=Date.now());const d=e(l);if(!(d.length!==i.length||d.some((y,v)=>i[v]!==y)))return o;i=d;let m;if(r.key&&r.debug&&(m=Date.now()),o=n(...d),r==null||r.onChange==null||r.onChange(o),r.key&&r.debug&&r!=null&&r.debug()){const y=Math.round((Date.now()-u)*100)/100,v=Math.round((Date.now()-m)*100)/100,b=v/16,x=(S,_)=>{for(S=String(S);S.length<_;)S=" "+S;return S};console.info(`%c⏱ ${x(v,5)} /${x(y,5)} ms`,` +`)},FT=0,Cs=[];function VT(e){var n=S.useRef([]),r=S.useRef([0,0]),i=S.useRef(),o=S.useState(FT++)[0],l=S.useState(qw)[0],u=S.useRef(e);S.useEffect(function(){u.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var _=lT([e.lockRef.current],(e.shards||[]).map(Ub),!0).filter(Boolean);return _.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),_.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var d=S.useCallback(function(_,E){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!u.current.allowPinchZoom;var R=Bc(_),T=r.current,O="deltaX"in _?_.deltaX:T[0]-R[0],M="deltaY"in _?_.deltaY:T[1]-R[1],D,P=_.target,F=Math.abs(O)>Math.abs(M)?"h":"v";if("touches"in _&&F==="h"&&P.type==="range")return!1;var V=window.getSelection(),ve=V&&V.anchorNode,be=ve?ve===P||ve.contains(P):!1;if(be)return!1;var he=Fb(F,P);if(!he)return!0;if(he?D=F:(D=F==="v"?"h":"v",he=Fb(F,P)),!he)return!1;if(!i.current&&"changedTouches"in _&&(O||M)&&(i.current=D),!D)return!0;var ue=i.current||D;return $T(ue,E,_,ue==="h"?O:M)},[]),p=S.useCallback(function(_){var E=_;if(!(!Cs.length||Cs[Cs.length-1]!==l)){var R="deltaY"in E?Vb(E):Bc(E),T=n.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&&IT(D.delta,R)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var O=(u.current.shards||[]).map(Ub).filter(Boolean).filter(function(D){return D.contains(E.target)}),M=O.length>0?d(E,O[0]):!u.current.noIsolation;M&&E.cancelable&&E.preventDefault()}}},[]),m=S.useCallback(function(_,E,R,T){var O={name:_,delta:E,target:R,should:T,shadowParent:UT(R)};n.current.push(O),setTimeout(function(){n.current=n.current.filter(function(M){return M!==O})},1)},[]),y=S.useCallback(function(_){r.current=Bc(_),i.current=void 0},[]),v=S.useCallback(function(_){m(_.type,Vb(_),_.target,d(_,e.lockRef.current))},[]),b=S.useCallback(function(_){m(_.type,Bc(_),_.target,d(_,e.lockRef.current))},[]);S.useEffect(function(){return Cs.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:b}),document.addEventListener("wheel",p,_s),document.addEventListener("touchmove",p,_s),document.addEventListener("touchstart",y,_s),function(){Cs=Cs.filter(function(_){return _!==l}),document.removeEventListener("wheel",p,_s),document.removeEventListener("touchmove",p,_s),document.removeEventListener("touchstart",y,_s)}},[]);var x=e.removeScrollBar,w=e.inert;return S.createElement(S.Fragment,null,w?S.createElement(l,{styles:PT(o)}):null,x?S.createElement(AT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function UT(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const HT=vT(Bw,VT);var zu=S.forwardRef(function(e,n){return S.createElement(Du,Ar({},e,{ref:n,sideCar:HT}))});zu.classNames=Du.classNames;var BT=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Es=new WeakMap,qc=new WeakMap,Gc={},$h=0,Yw=function(e){return e&&(e.host||Yw(e.parentNode))},qT=function(e,n){return n.map(function(r){if(e.contains(r))return r;var i=Yw(r);return i&&e.contains(i)?i:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},GT=function(e,n,r,i){var o=qT(n,Array.isArray(e)?e:[e]);Gc[r]||(Gc[r]=new WeakMap);var l=Gc[r],u=[],d=new Set,p=new Set(o),m=function(v){!v||d.has(v)||(d.add(v),m(v.parentNode))};o.forEach(m);var y=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(b){if(d.has(b))y(b);else try{var x=b.getAttribute(i),w=x!==null&&x!=="false",_=(Es.get(b)||0)+1,E=(l.get(b)||0)+1;Es.set(b,_),l.set(b,E),u.push(b),_===1&&w&&qc.set(b,!0),E===1&&b.setAttribute(r,"true"),w||b.setAttribute(i,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return y(n),d.clear(),$h++,function(){u.forEach(function(v){var b=Es.get(v)-1,x=l.get(v)-1;Es.set(v,b),l.set(v,x),b||(qc.has(v)||v.removeAttribute(i),qc.delete(v)),x||v.removeAttribute(r)}),$h--,$h||(Es=new WeakMap,Es=new WeakMap,qc=new WeakMap,Gc={})}},fp=function(e,n,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),o=BT(e);return o?(i.push.apply(i,Array.from(o.querySelectorAll("[aria-live], script"))),GT(i,o,r,"aria-hidden")):function(){return null}},ku="Dialog",[Qw]=Ga(ku),[ZT,yr]=Qw(ku),hp=e=>{const{__scopeDialog:n,children:r,open:i,defaultOpen:o,onOpenChange:l,modal:u=!0}=e,d=S.useRef(null),p=S.useRef(null),[m,y]=Fs({prop:i,defaultProp:o??!1,onChange:l,caller:ku});return f.jsx(ZT,{scope:n,triggerRef:d,contentRef:p,contentId:dn(),titleId:dn(),descriptionId:dn(),open:m,onOpenChange:y,onOpenToggle:S.useCallback(()=>y(v=>!v),[y]),modal:u,children:r})};hp.displayName=ku;var Xw="DialogTrigger",KT=S.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,o=yr(Xw,r),l=nt(n,o.triggerRef);return f.jsx($e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":yp(o.open),...i,ref:l,onClick:je(e.onClick,o.onOpenToggle)})});KT.displayName=Xw;var mp="DialogPortal",[YT,Jw]=Qw(mp,{forceMount:void 0}),pp=e=>{const{__scopeDialog:n,forceMount:r,children:i,container:o}=e,l=yr(mp,n);return f.jsx(YT,{scope:n,forceMount:r,children:S.Children.map(i,u=>f.jsx(vr,{present:r||l.open,children:f.jsx(yl,{asChild:!0,container:o,children:u})}))})};pp.displayName=mp;var hu="DialogOverlay",gp=S.forwardRef((e,n)=>{const r=Jw(hu,e.__scopeDialog),{forceMount:i=r.forceMount,...o}=e,l=yr(hu,e.__scopeDialog);return l.modal?f.jsx(vr,{present:i||l.open,children:f.jsx(XT,{...o,ref:n})}):null});gp.displayName=hu;var QT=_i("DialogOverlay.RemoveScroll"),XT=S.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,o=yr(hu,r),l=Qj(),u=nt(n,l);return f.jsx(zu,{as:QT,allowPinchZoom:!0,shards:[o.contentRef],children:f.jsx($e.div,{"data-state":yp(o.open),...i,ref:u,style:{pointerEvents:"auto",...i.style}})})}),Vs="DialogContent",vp=S.forwardRef((e,n)=>{const r=Jw(Vs,e.__scopeDialog),{forceMount:i=r.forceMount,...o}=e,l=yr(Vs,e.__scopeDialog);return f.jsx(vr,{present:i||l.open,children:l.modal?f.jsx(JT,{...o,ref:n}):f.jsx(WT,{...o,ref:n})})});vp.displayName=Vs;var JT=S.forwardRef((e,n)=>{const r=yr(Vs,e.__scopeDialog),i=S.useRef(null),o=nt(n,r.contentRef,i);return S.useEffect(()=>{const l=i.current;if(l)return fp(l)},[]),f.jsx(Ww,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:je(e.onCloseAutoFocus,l=>{l.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:je(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0;(u.button===2||d)&&l.preventDefault()}),onFocusOutside:je(e.onFocusOutside,l=>l.preventDefault())})}),WT=S.forwardRef((e,n)=>{const r=yr(Vs,e.__scopeDialog),i=S.useRef(!1),o=S.useRef(!1);return f.jsx(Ww,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{e.onCloseAutoFocus?.(l),l.defaultPrevented||(i.current||r.triggerRef.current?.focus(),l.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:l=>{e.onInteractOutside?.(l),l.defaultPrevented||(i.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const u=l.target;r.triggerRef.current?.contains(u)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),Ww=S.forwardRef((e,n)=>{const{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:l,...u}=e,d=yr(Vs,r);return dp(),f.jsx(f.Fragment,{children:f.jsx(Nu,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:l,children:f.jsx(vl,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":yp(d.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1)})})})}),eS="DialogTitle",tS=S.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,o=yr(eS,r);return f.jsx($e.h2,{id:o.titleId,...i,ref:n})});tS.displayName=eS;var nS="DialogDescription",eO=S.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,o=yr(nS,r);return f.jsx($e.p,{id:o.descriptionId,...i,ref:n})});eO.displayName=nS;var rS="DialogClose",aS=S.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,o=yr(rS,r);return f.jsx($e.button,{type:"button",...i,ref:n,onClick:je(e.onClick,()=>o.onOpenChange(!1))})});aS.displayName=rS;function yp(e){return e?"open":"closed"}function tO(e){const n=S.useRef({value:e,previous:e});return S.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}function nO(e){const[n,r]=S.useState(void 0);return Yt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const l=o[0];let u,d;if("borderBoxSize"in l){const p=l.borderBoxSize,m=Array.isArray(p)?p[0]:p;u=m.inlineSize,d=m.blockSize}else u=e.offsetWidth,d=e.offsetHeight;r({width:u,height:d})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else r(void 0)},[e]),n}const rO=["top","right","bottom","left"],Va=Math.min,ra=Math.max,mu=Math.round,Zc=Math.floor,aa=e=>({x:e,y:e}),aO={left:"right",right:"left",bottom:"top",top:"bottom"};function iS(e,n,r){return ra(e,Va(n,r))}function ia(e,n){return typeof e=="function"?e(n):e}function Ua(e){return e.split("-")[0]}function Gs(e){return e.split("-")[1]}function bp(e){return e==="x"?"y":"x"}function xp(e){return e==="y"?"height":"width"}function Mr(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function wp(e){return bp(Mr(e))}function iO(e,n,r){r===void 0&&(r=!1);const i=Gs(e),o=wp(e),l=xp(o);let u=o==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return n.reference[l]>n.floating[l]&&(u=pu(u)),[u,pu(u)]}function sO(e){const n=pu(e);return[xm(e),n,xm(n)]}function xm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Hb=["left","right"],Bb=["right","left"],oO=["top","bottom"],lO=["bottom","top"];function cO(e,n,r){switch(e){case"top":case"bottom":return r?n?Bb:Hb:n?Hb:Bb;case"left":case"right":return n?oO:lO;default:return[]}}function uO(e,n,r,i){const o=Gs(e);let l=cO(Ua(e),r==="start",i);return o&&(l=l.map(u=>u+"-"+o),n&&(l=l.concat(l.map(xm)))),l}function pu(e){const n=Ua(e);return aO[n]+e.slice(n.length)}function dO(e){var n,r,i,o;return{top:(n=e.top)!=null?n:0,right:(r=e.right)!=null?r:0,bottom:(i=e.bottom)!=null?i:0,left:(o=e.left)!=null?o:0}}function sS(e){return typeof e!="number"?dO(e):{top:e,right:e,bottom:e,left:e}}function gu(e){const{x:n,y:r,width:i,height:o}=e;return{width:i,height:o,top:r,left:n,right:n+i,bottom:r+o,x:n,y:r}}function qb(e,n,r){let{reference:i,floating:o}=e;const l=Mr(n),u=wp(n),d=xp(u),p=Ua(n),m=l==="y",y=i.x+i.width/2-o.width/2,v=i.y+i.height/2-o.height/2,b=i[d]/2-o[d]/2;let x;switch(p){case"top":x={x:y,y:i.y-o.height};break;case"bottom":x={x:y,y:i.y+i.height};break;case"right":x={x:i.x+i.width,y:v};break;case"left":x={x:i.x-o.width,y:v};break;default:x={x:i.x,y:i.y}}const w=Gs(n);return w&&(x[u]+=b*(w==="end"?1:-1)*(r&&m?-1:1)),x}async function fO(e,n){var r;n===void 0&&(n={});const{x:i,y:o,platform:l,rects:u,elements:d,strategy:p}=e,{boundary:m="clippingAncestors",rootBoundary:y="viewport",elementContext:v="floating",altBoundary:b=!1,padding:x=0}=ia(n,e),w=sS(x),E=d[b?v==="floating"?"reference":"floating":v],R=gu(await l.getClippingRect({element:(r=await(l.isElement==null?void 0:l.isElement(E)))==null||r?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:m,rootBoundary:y,strategy:p})),T=v==="floating"?{x:i,y:o,width:u.floating.width,height:u.floating.height}:u.reference,O=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),M=await(l.isElement==null?void 0:l.isElement(O))&&await(l.getScale==null?void 0:l.getScale(O))||{x:1,y:1},D=gu(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:T,offsetParent:O,strategy:p}):T);return{top:(R.top-D.top+w.top)/M.y,bottom:(D.bottom-R.bottom+w.bottom)/M.y,left:(R.left-D.left+w.left)/M.x,right:(D.right-R.right+w.right)/M.x}}const hO=50,mO=async(e,n,r)=>{const{placement:i="bottom",strategy:o="absolute",middleware:l=[],platform:u}=r,d=u.detectOverflow?u:{...u,detectOverflow:fO},p=await(u.isRTL==null?void 0:u.isRTL(n));let m=await u.getElementRects({reference:e,floating:n,strategy:o}),{x:y,y:v}=qb(m,i,p),b=i,x=0;const w={};for(let _=0;_({name:"arrow",options:e,async fn(n){const{x:r,y:i,placement:o,rects:l,platform:u,elements:d,middlewareData:p}=n,{element:m,padding:y=0}=ia(e,n)||{};if(m==null)return{};const v=sS(y),b={x:r,y:i},x=wp(o),w=xp(x),_=await u.getDimensions(m),E=x==="y",R=E?"top":"left",T=E?"bottom":"right",O=E?"clientHeight":"clientWidth",M=l.reference[w]+l.reference[x]-b[x]-l.floating[w],D=b[x]-l.reference[x],P=await(u.getOffsetParent==null?void 0:u.getOffsetParent(m));let F=P?P[O]:0;(!F||!await(u.isElement==null?void 0:u.isElement(P)))&&(F=d.floating[O]||l.floating[w]);const V=M/2-D/2,ve=F/2-_[w]/2-1,be=Va(v[R],ve),he=Va(v[T],ve),ue=F-_[w]-he,X=F/2-_[w]/2+V,pe=iS(be,X,ue),ge=!p.arrow&&Gs(o)!=null&&X!==pe&&l.reference[w]/2-(Xpe<=0)){var he,ue;const pe=(((he=l.flip)==null?void 0:he.index)||0)+1,ge=F[pe];if(ge&&(!(v==="alignment"?T!==Mr(ge):!1)||be.every(re=>Mr(re.placement)===T?re.overflows[0]>0:!0)))return{data:{index:pe,overflows:be},reset:{placement:ge}};let L=(ue=be.filter(Z=>Z.overflows[0]<=0).sort((Z,re)=>Z.overflows[1]-re.overflows[1])[0])==null?void 0:ue.placement;if(!L)switch(x){case"bestFit":{var X;const Z=(X=be.filter(re=>{if(P){const ee=Mr(re.placement);return ee===T||ee==="y"}return!0}).map(re=>[re.placement,re.overflows.filter(ee=>ee>0).reduce((ee,ne)=>ee+ne,0)]).sort((re,ee)=>re[1]-ee[1])[0])==null?void 0:X[0];Z&&(L=Z);break}case"initialPlacement":L=d;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function Gb(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function Zb(e){return rO.some(n=>e[n]>=0)}const vO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:r,platform:i}=n,{strategy:o="referenceHidden",...l}=ia(e,n);switch(o){case"referenceHidden":{const u=await i.detectOverflow(n,{...l,elementContext:"reference"}),d=Gb(u,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Zb(d)}}}case"escaped":{const u=await i.detectOverflow(n,{...l,altBoundary:!0}),d=Gb(u,r.floating);return{data:{escapedOffsets:d,escaped:Zb(d)}}}default:return{}}}}},oS=new Set(["left","top"]);async function yO(e,n){const{placement:r,platform:i,elements:o}=e,l=await(i.isRTL==null?void 0:i.isRTL(o.floating)),u=Ua(r),d=Gs(r),p=Mr(r)==="y",m=oS.has(u)?-1:1,y=l&&p?-1:1,v=ia(n,e);let{mainAxis:b,crossAxis:x,alignmentAxis:w}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return d&&typeof w=="number"&&(x=d==="end"?w*-1:w),p?{x:x*y,y:b*m}:{x:b*m,y:x*y}}const bO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var r,i;const{x:o,y:l,placement:u,middlewareData:d}=n,p=await yO(n,e);return u===((r=d.offset)==null?void 0:r.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:o+p.x,y:l+p.y,data:{...p,placement:u}}}}},xO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:r,y:i,placement:o,platform:l}=n,{mainAxis:u=!0,crossAxis:d=!1,limiter:p={fn:T=>{let{x:O,y:M}=T;return{x:O,y:M}}},...m}=ia(e,n),y={x:r,y:i},v=await l.detectOverflow(n,m),b=Mr(o),x=bp(b);let w=y[x],_=y[b];const E=(T,O)=>iS(O+v[T==="y"?"top":"left"],O,O-v[T==="y"?"bottom":"right"]);u&&(w=E(x,w)),d&&(_=E(b,_));const R=p.fn({...n,[x]:w,[b]:_});return{...R,data:{x:R.x-r,y:R.y-i,enabled:{[x]:u,[b]:d}}}}}},wO=function(e){return e===void 0&&(e={}),{options:e,fn(n){var r,i;const{x:o,y:l,placement:u,rects:d,middlewareData:p}=n,{offset:m=0,mainAxis:y=!0,crossAxis:v=!0}=ia(e,n),b={x:o,y:l},x=Mr(u),w=bp(x);let _=b[w],E=b[x];const R=ia(m,n),T=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(r=R.mainAxis)!=null?r:0,crossAxis:(i=R.crossAxis)!=null?i:0};if(y){const D=w==="y"?"height":"width",P=d.reference[w]-d.floating[D]+T.mainAxis,F=d.reference[w]+d.reference[D]-T.mainAxis;_F&&(_=F)}if(v){var O,M;const D=w==="y"?"width":"height",P=oS.has(Ua(u)),F=d.reference[x]-d.floating[D]+(P&&((O=p.offset)==null?void 0:O[x])||0)+(P?0:T.crossAxis),V=d.reference[x]+d.reference[D]+(P?0:((M=p.offset)==null?void 0:M[x])||0)-(P?T.crossAxis:0);EV&&(E=V)}return{[w]:_,[x]:E}}}},SO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){const{placement:r,rects:i,platform:o,elements:l}=n,{apply:u=()=>{},...d}=ia(e,n),p=await o.detectOverflow(n,d),m=Ua(r),y=Gs(r),v=Mr(r)==="y",{width:b,height:x}=i.floating;let w,_;m==="top"||m==="bottom"?(w=m,_=y===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(_=m,w=y==="end"?"top":"bottom");const E=x-p.top-p.bottom,R=b-p.left-p.right,T=Va(x-p[w],E),O=Va(b-p[_],R),M=n.middlewareData.shift,D=!M;let P=T,F=O;M!=null&&M.enabled.x&&(F=R),M!=null&&M.enabled.y&&(P=E),D&&!y&&(v?F=b-2*ra(p.left,p.right):P=x-2*ra(p.top,p.bottom)),await u({...n,availableWidth:F,availableHeight:P});const V=await o.getDimensions(l.floating);return b!==V.width||x!==V.height?{reset:{rects:!0}}:{}}}};function Lu(){return typeof window<"u"}function Zs(e){return lS(e)?(e.nodeName||"").toLowerCase():"#document"}function An(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function sa(e){var n;return(n=(lS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function lS(e){return Lu()?e instanceof Node||e instanceof An(e).Node:!1}function Nr(e){return Lu()?e instanceof Element||e instanceof An(e).Element:!1}function Za(e){return Lu()?e instanceof HTMLElement||e instanceof An(e).HTMLElement:!1}function Kb(e){return!Lu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof An(e).ShadowRoot}function $u(e){const{overflow:n,overflowX:r,overflowY:i,display:o}=Dr(e);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&o!=="inline"&&o!=="contents"}function _O(e){return/^(table|td|th)$/.test(Zs(e))}function Iu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const CO=/transform|translate|scale|rotate|perspective|filter/,EO=/paint|layout|strict|content/,vi=e=>!!e&&e!=="none";let Ih;function Sp(e){const n=Nr(e)?Dr(e):e;return vi(n.transform)||vi(n.translate)||vi(n.scale)||vi(n.rotate)||vi(n.perspective)||!_p()&&(vi(n.backdropFilter)||vi(n.filter))||CO.test(n.willChange||"")||EO.test(n.contain||"")}function RO(e){let n=Ci(e);for(;Za(n)&&!il(n);){if(Sp(n))return n;if(Iu(n))return null;n=Ci(n)}return null}function _p(){return Ih==null&&(Ih=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ih}function il(e){return/^(html|body|#document)$/.test(Zs(e))}function Dr(e){return An(e).getComputedStyle(e)}function Pu(e){return Nr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ci(e){if(Zs(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Kb(e)&&e.host||sa(e);return Kb(n)?n.host:n}function cS(e){const n=Ci(e);return il(n)?(e.ownerDocument||e).body:Za(n)&&$u(n)?n:cS(n)}function sl(e,n,r){var i;n===void 0&&(n=[]),r===void 0&&(r=!0);const o=cS(e),l=o===((i=e.ownerDocument)==null?void 0:i.body),u=An(o);if(l){const d=wm(u);return n.concat(u,u.visualViewport||[],$u(o)?o:[],d&&r?sl(d):[])}else return n.concat(o,sl(o,[],r))}function wm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function uS(e){const n=Dr(e);let r=parseFloat(n.width)||0,i=parseFloat(n.height)||0;const o=Za(e),l=o?e.offsetWidth:r,u=o?e.offsetHeight:i,d=mu(r)!==l||mu(i)!==u;return d&&(r=l,i=u),{width:r,height:i,$:d}}function Cp(e){return Nr(e)?e:e.contextElement}function ks(e){const n=Cp(e);if(!Za(n))return aa(1);const r=n.getBoundingClientRect(),{width:i,height:o,$:l}=uS(n);let u=(l?mu(r.width):r.width)/i,d=(l?mu(r.height):r.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const jO=aa(0);function dS(e){const n=An(e);return!_p()||!n.visualViewport?jO:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function TO(e,n,r){return n===void 0&&(n=!1),!!r&&n&&r===An(e)}function Ei(e,n,r,i){n===void 0&&(n=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),l=Cp(e);let u=aa(1);n&&(i?Nr(i)&&(u=ks(i)):u=ks(e));const d=TO(l,r,i)?dS(l):aa(0);let p=(o.left+d.x)/u.x,m=(o.top+d.y)/u.y,y=o.width/u.x,v=o.height/u.y;if(l&&i){const b=An(l),x=Nr(i)?An(i):i;let w=b,_=wm(w);for(;_&&x!==w;){const E=ks(_),R=_.getBoundingClientRect(),T=Dr(_),O=R.left+(_.clientLeft+parseFloat(T.paddingLeft))*E.x,M=R.top+(_.clientTop+parseFloat(T.paddingTop))*E.y;p*=E.x,m*=E.y,y*=E.x,v*=E.y,p+=O,m+=M,w=An(_),_=wm(w)}}return gu({width:y,height:v,x:p,y:m})}function Fu(e,n){const r=Pu(e).scrollLeft;return n?n.left+r:Ei(sa(e)).left+r}function fS(e,n){const r=e.getBoundingClientRect(),i=r.left+n.scrollLeft-Fu(e,r),o=r.top+n.scrollTop;return{x:i,y:o}}function OO(e){let{elements:n,rect:r,offsetParent:i,strategy:o}=e;const l=o==="fixed",u=sa(i),d=n?Iu(n.floating):!1;if(i===u||d&&l)return r;let p={scrollLeft:0,scrollTop:0},m=aa(1);const y=aa(0),v=Za(i);if((v||!l)&&((Zs(i)!=="body"||$u(u))&&(p=Pu(i)),v)){const x=Ei(i);m=ks(i),y.x=x.x+i.clientLeft,y.y=x.y+i.clientTop}const b=u&&!v&&!l?fS(u,p):aa(0);return{width:r.width*m.x,height:r.height*m.y,x:r.x*m.x-p.scrollLeft*m.x+y.x+b.x,y:r.y*m.y-p.scrollTop*m.y+y.y+b.y}}function AO(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function MO(e){const n=Pu(e),r=e.ownerDocument.body,i=ra(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=ra(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Fu(e);const u=-n.scrollTop;return Dr(r).direction==="rtl"&&(l+=ra(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:u}}const NO=25;function DO(e,n,r){r===void 0&&(r="viewport");const i=r==="layoutViewport",o=An(e),l=sa(e),u=o.visualViewport;let d=l.clientWidth,p=l.clientHeight,m=0,y=0;if(u){const b=!_p()||n==="fixed";i?b||(m=-u.offsetLeft,y=-u.offsetTop):(d=u.width,p=u.height,b&&(m=u.offsetLeft,y=u.offsetTop))}if(Fu(l)<=0){const b=l.ownerDocument,x=b.body,w=getComputedStyle(x),_=b.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,E=Math.abs(l.clientWidth-x.clientWidth-_),R=getComputedStyle(l).scrollbarGutter==="stable both-edges"?E/2:E;R<=NO&&(d-=R)}return{width:d,height:p,x:m,y}}function zO(e,n){const r=Ei(e,!0,n==="fixed"),i=r.top+e.clientTop,o=r.left+e.clientLeft,l=ks(e),u=e.clientWidth*l.x,d=e.clientHeight*l.y,p=o*l.x,m=i*l.y;return{width:u,height:d,x:p,y:m}}function Yb(e,n,r){let i;if(n==="viewport"||n==="layoutViewport")i=DO(e,r,n);else if(n==="document")i=MO(sa(e));else if(Nr(n))i=zO(n,r);else{const o=dS(e);i={x:n.x-o.x,y:n.y-o.y,width:n.width,height:n.height}}return gu(i)}function kO(e,n){const r=n.get(e);if(r)return r;let i=sl(e,[],!1).filter(d=>Nr(d)&&Zs(d)!=="body"),o=null;const l=Dr(e).position==="fixed";let u=l?Ci(e):e;for(;Nr(u)&&!il(u);){const d=Dr(u),p=Sp(u),m=o?o.position:l?"fixed":"";!p&&(m==="fixed"||m==="absolute"&&d.position==="static")?i=i.filter(v=>v!==u):o=d,u=Ci(u)}return n.set(e,i),i}function LO(e){let{element:n,boundary:r,rootBoundary:i,strategy:o}=e;const u=[...r==="clippingAncestors"?Iu(n)?[]:kO(n,this._c):[].concat(r),i],d=Yb(n,u[0],o);let p=d.top,m=d.right,y=d.bottom,v=d.left;for(let b=1;b{d(!1,1e-7)},1e3)}F=!1}try{i=new IntersectionObserver(V,{...P,root:l.ownerDocument})}catch{i=new IntersectionObserver(V,P)}i.observe(e)}const p=An(e),m=()=>d(r);return p.addEventListener("resize",m),d(!0),()=>{p.removeEventListener("resize",m),u()}}function HO(e,n,r,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:p=!1}=i,m=Cp(e),y=o||l?[...m?sl(m):[],...n?sl(n):[]]:[];y.forEach(R=>{o&&R.addEventListener("scroll",r),l&&R.addEventListener("resize",r)});const v=m&&d?UO(m,r,l):null;let b=-1,x=null;u&&(x=new ResizeObserver(R=>{let[T]=R;T&&T.target===m&&x&&n&&(x.unobserve(n),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var O;(O=x)==null||O.observe(n)})),r()}),m&&!p&&x.observe(m),n&&x.observe(n));let w,_=p?Ei(e):null;p&&E();function E(){const R=Ei(e);_&&!mS(_,R)&&r(),_=R,w=requestAnimationFrame(E)}return r(),()=>{var R;y.forEach(T=>{o&&T.removeEventListener("scroll",r),l&&T.removeEventListener("resize",r)}),v?.(),(R=x)==null||R.disconnect(),x=null,p&&cancelAnimationFrame(w)}}const BO=bO,qO=xO,GO=gO,ZO=SO,KO=vO,Xb=pO,YO=wO,QO=(e,n,r)=>{const i=new Map,o=r??{},l={...VO,...o.platform,_c:i};return mO(e,n,{...o,platform:l})};var XO=typeof document<"u",JO=function(){},su=XO?S.useLayoutEffect:JO;function vu(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let r,i,o;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==n.length)return!1;for(i=r;i--!==0;)if(!vu(e[i],n[i]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){const l=o[i];if(!(l==="_owner"&&e.$$typeof)&&!vu(e[l],n[l]))return!1}return!0}return e!==e&&n!==n}function pS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jb(e,n){const r=pS(e);return Math.round(n*r)/r}function Fh(e){const n=S.useRef(e);return su(()=>{n.current=e}),n}function WO(e){e===void 0&&(e={});const{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:o,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:p,open:m}=e,[y,v]=S.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[b,x]=S.useState(i);vu(b,i)||x(i);const[w,_]=S.useState(null),[E,R]=S.useState(null),T=S.useCallback(re=>{re!==P.current&&(P.current=re,_(re))},[]),O=S.useCallback(re=>{re!==F.current&&(F.current=re,R(re))},[]),M=l||w,D=u||E,P=S.useRef(null),F=S.useRef(null),V=S.useRef(y),ve=p!=null,be=Fh(p),he=Fh(o),ue=Fh(m),X=S.useCallback(()=>{if(!P.current||!F.current)return;const re={placement:n,strategy:r,middleware:b};he.current&&(re.platform=he.current),QO(P.current,F.current,re).then(ee=>{const ne={...ee,isPositioned:ue.current!==!1};pe.current&&!vu(V.current,ne)&&(V.current=ne,Mi.flushSync(()=>{v(ne)}))})},[b,n,r,he,ue]);su(()=>{m===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,v(re=>({...re,isPositioned:!1})))},[m]);const pe=S.useRef(!1);su(()=>(pe.current=!0,()=>{pe.current=!1}),[]),su(()=>{if(M&&(P.current=M),D&&(F.current=D),M&&D){if(be.current)return be.current(M,D,X);X()}},[M,D,X,be,ve]);const ge=S.useMemo(()=>({reference:P,floating:F,setReference:T,setFloating:O}),[T,O]),L=S.useMemo(()=>({reference:M,floating:D}),[M,D]),Z=S.useMemo(()=>{const re={position:r,left:0,top:0};if(!L.floating)return re;const ee=Jb(L.floating,y.x),ne=Jb(L.floating,y.y);return d?{...re,transform:"translate("+ee+"px, "+ne+"px)",...pS(L.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ee,top:ne}},[r,d,L.floating,y.x,y.y]);return S.useMemo(()=>({...y,update:X,refs:ge,elements:L,floatingStyles:Z}),[y,X,ge,L,Z])}const eA=e=>{function n(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:i,padding:o}=typeof e=="function"?e(r):e;return i&&n(i)?i.current!=null?Xb({element:i.current,padding:o}).fn(r):{}:i?Xb({element:i,padding:o}).fn(r):{}}}},tA=(e,n)=>{const r=BO(e);return{name:r.name,fn:r.fn,options:[e,n]}},nA=(e,n)=>{const r=qO(e);return{name:r.name,fn:r.fn,options:[e,n]}},rA=(e,n)=>({fn:YO(e).fn,options:[e,n]}),aA=(e,n)=>{const r=GO(e);return{name:r.name,fn:r.fn,options:[e,n]}},iA=(e,n)=>{const r=ZO(e);return{name:r.name,fn:r.fn,options:[e,n]}},sA=(e,n)=>{const r=KO(e);return{name:r.name,fn:r.fn,options:[e,n]}},oA=(e,n)=>{const r=eA(e);return{name:r.name,fn:r.fn,options:[e,n]}};var lA="Arrow",gS=S.forwardRef((e,n)=>{const{children:r,width:i=10,height:o=5,...l}=e;return f.jsx($e.svg,{...l,ref:n,width:i,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});gS.displayName=lA;var cA=gS,Ep="Popper",[vS,Ks]=Ga(Ep),[uA,yS]=vS(Ep),bS=e=>{const{__scopePopper:n,children:r}=e,[i,o]=S.useState(null),[l,u]=S.useState(void 0);return f.jsx(uA,{scope:n,anchor:i,onAnchorChange:o,placementState:l,setPlacementState:u,children:r})};bS.displayName=Ep;var xS="PopperAnchor",wS=S.forwardRef((e,n)=>{const{__scopePopper:r,virtualRef:i,...o}=e,l=yS(xS,r),u=S.useRef(null),d=l.onAnchorChange,p=S.useCallback(w=>{u.current=w,w&&d(w)},[d]),m=nt(n,p),y=S.useRef(null);S.useEffect(()=>{if(!i)return;const w=y.current;y.current=i.current,w!==y.current&&d(y.current)});const v=l.placementState&&jp(l.placementState),b=v?.[0],x=v?.[1];return i?null:f.jsx($e.div,{"data-radix-popper-side":b,"data-radix-popper-align":x,...o,ref:m})});wS.displayName=xS;var Rp="PopperContent",[dA,fA]=vS(Rp),SS=S.forwardRef((e,n)=>{const{__scopePopper:r,side:i="bottom",sideOffset:o=0,align:l="center",alignOffset:u=0,arrowPadding:d=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:y=0,sticky:v="partial",hideWhenDetached:b=!1,updatePositionStrategy:x="optimized",onPlaced:w,..._}=e,E=yS(Rp,r),[R,T]=S.useState(null),O=nt(n,T),[M,D]=S.useState(null),P=nO(M),F=P?.width??0,V=P?.height??0,ve=i+(l!=="center"?"-"+l:""),be=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},he=Array.isArray(m)?m:[m],ue=he.length>0,X={padding:be,boundary:he.filter(mA),altBoundary:ue},{refs:pe,floatingStyles:ge,placement:L,isPositioned:Z,middlewareData:re}=WO({strategy:"fixed",placement:ve,whileElementsMounted:(...ye)=>HO(...ye,{animationFrame:x==="always"}),elements:{reference:E.anchor},middleware:[tA({mainAxis:o+V,alignmentAxis:u}),p&&nA({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?rA():void 0,...X}),p&&aA({...X}),iA({...X,apply:({elements:ye,rects:xe,availableWidth:Oe,availableHeight:Ie})=>{const{width:Ve,height:it}=xe.reference,Qe=ye.floating.style;Qe.setProperty("--radix-popper-available-width",`${Oe}px`),Qe.setProperty("--radix-popper-available-height",`${Ie}px`),Qe.setProperty("--radix-popper-anchor-width",`${Ve}px`),Qe.setProperty("--radix-popper-anchor-height",`${it}px`)}}),M&&oA({element:M,padding:d}),pA({arrowWidth:F,arrowHeight:V}),b&&sA({strategy:"referenceHidden",...X,boundary:ue?X.boundary:void 0})]}),ee=E.setPlacementState;Yt(()=>(ee(L),()=>{ee(void 0)}),[L,ee]);const[ne,z]=jp(L),N=tr(w);Yt(()=>{Z&&N?.()},[Z,N]);const B=re.arrow?.x,J=re.arrow?.y,K=re.arrow?.centerOffset!==0,[le,ae]=S.useState();return Yt(()=>{R&&ae(window.getComputedStyle(R).zIndex)},[R]),f.jsx("div",{ref:pe.setFloating,"data-radix-popper-content-wrapper":"",style:{...ge,transform:Z?ge.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[re.transformOrigin?.x,re.transformOrigin?.y].join(" "),...re.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(dA,{scope:r,placedSide:ne,placedAlign:z,onArrowChange:D,arrowX:B,arrowY:J,shouldHideArrow:K,children:f.jsx($e.div,{"data-side":ne,"data-align":z,..._,ref:O,style:{..._.style,animation:Z?void 0:"none"}})})})});SS.displayName=Rp;var _S="PopperArrow",hA={top:"bottom",right:"left",bottom:"top",left:"right"},CS=S.forwardRef(function(n,r){const{__scopePopper:i,...o}=n,l=fA(_S,i),u=hA[l.placedSide];return f.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:f.jsx(cA,{...o,ref:r,style:{...o.style,display:"block"}})})});CS.displayName=_S;function mA(e){return e!==null}var pA=e=>({name:"transformOrigin",options:e,fn(n){const{placement:r,rects:i,middlewareData:o}=n,u=o.arrow?.centerOffset!==0,d=u?0:e.arrowWidth,p=u?0:e.arrowHeight,[m,y]=jp(r),v={start:"0%",center:"50%",end:"100%"}[y],b=(o.arrow?.x??0)+d/2,x=(o.arrow?.y??0)+p/2;let w="",_="";return m==="bottom"?(w=u?v:`${b}px`,_=`${-p}px`):m==="top"?(w=u?v:`${b}px`,_=`${i.floating.height+p}px`):m==="right"?(w=`${-p}px`,_=u?v:`${x}px`):m==="left"&&(w=`${i.floating.width+p}px`,_=u?v:`${x}px`),{data:{x:w,y:_}}}});function jp(e){const[n,r="center"]=e.split("-");return[n,r]}var Tp=bS,Op=wS,Ap=SS,Mp=CS,Vh=!1;function gA(){const[e,n]=S.useState(Vh);return S.useEffect(()=>{Vh||(Vh=!0,n(!0))},[]),e}var ES=Au[" useSyncExternalStore ".trim().toString()];function vA(){return()=>{}}function yA(){return ES(vA,()=>!0,()=>!1)}var bA=typeof ES=="function"?yA:gA,Uh="rovingFocusGroup.onEntryFocus",xA={bubbles:!1,cancelable:!0},bl="RovingFocusGroup",[Sm,RS,wA]=lp(bl),[SA,jS]=Ga(bl,[wA]),[_A,CA]=SA(bl),TS=S.forwardRef((e,n)=>f.jsx(Sm.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Sm.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(EA,{...e,ref:n})})}));TS.displayName=bl;var EA=S.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:r,orientation:i,loop:o=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:p,onEntryFocus:m,preventScrollOnEntryFocus:y=!1,...v}=e,b=S.useRef(null),x=nt(n,b),w=cp(l),[_,E]=Fs({prop:u,defaultProp:d??null,onChange:p,caller:bl}),[R,T]=S.useState(!1),O=tr(m),M=RS(r),D=S.useRef(!1),[P,F]=S.useState(0);return S.useEffect(()=>{const V=b.current;if(V)return V.addEventListener(Uh,O),()=>V.removeEventListener(Uh,O)},[O]),f.jsx(_A,{scope:r,orientation:i,dir:w,loop:o,currentTabStopId:_,onItemFocus:S.useCallback(V=>E(V),[E]),onItemShiftTab:S.useCallback(()=>T(!0),[]),onFocusableItemAdd:S.useCallback(()=>F(V=>V+1),[]),onFocusableItemRemove:S.useCallback(()=>F(V=>V-1),[]),children:f.jsx($e.div,{tabIndex:R||P===0?-1:0,"data-orientation":i,...v,ref:x,style:{outline:"none",...e.style},onMouseDown:je(e.onMouseDown,()=>{D.current=!0}),onFocus:je(e.onFocus,V=>{const ve=!D.current;if(V.target===V.currentTarget&&ve&&!R){const be=new CustomEvent(Uh,xA);if(V.currentTarget.dispatchEvent(be),!be.defaultPrevented){const he=M().filter(L=>L.focusable),ue=he.find(L=>L.active),X=he.find(L=>L.id===_),ge=[ue,X,...he].filter(Boolean).map(L=>L.ref.current);MS(ge,y)}}D.current=!1}),onBlur:je(e.onBlur,()=>T(!1))})})}),OS="RovingFocusGroupItem",AS=S.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:l,children:u,...d}=e,p=dn(),m=l||p,y=CA(OS,r),v=y.currentTabStopId===m,b=RS(r),{onFocusableItemAdd:x,onFocusableItemRemove:w,currentTabStopId:_}=y,E=bA();return Yt(()=>{if(!(!E||!i))return x(),()=>w()},[E,i,x,w]),S.useEffect(()=>{if(!(E||!i))return x(),()=>w()},[E,i,x,w]),f.jsx(Sm.ItemSlot,{scope:r,id:m,focusable:i,active:o,children:f.jsx($e.span,{tabIndex:v?0:-1,"data-orientation":y.orientation,...d,ref:n,onMouseDown:je(e.onMouseDown,R=>{i?y.onItemFocus(m):R.preventDefault()}),onFocus:je(e.onFocus,()=>y.onItemFocus(m)),onKeyDown:je(e.onKeyDown,R=>{if(R.key==="Tab"&&R.shiftKey){y.onItemShiftTab();return}if(R.target!==R.currentTarget)return;const T=TA(R,y.orientation,y.dir);if(T!==void 0){if(R.metaKey||R.ctrlKey||R.altKey||R.shiftKey)return;R.preventDefault();let M=b().filter(D=>D.focusable).map(D=>D.ref.current);if(T==="last")M.reverse();else if(T==="prev"||T==="next"){T==="prev"&&M.reverse();const D=M.indexOf(R.currentTarget);M=y.loop?OA(M,D+1):M.slice(D+1)}setTimeout(()=>MS(M))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:_!=null}):u})})});AS.displayName=OS;var RA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jA(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function TA(e,n,r){const i=jA(e.key,r);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return RA[i]}function MS(e,n=!1){const r=document.activeElement;for(const i of e)if(i===r||(i.focus({preventScroll:n}),document.activeElement!==r))return}function OA(e,n){return e.map((r,i)=>e[(n+i)%e.length])}var AA=TS,MA=AS,_m=["Enter"," "],NA=["ArrowDown","PageUp","Home"],NS=["ArrowUp","PageDown","End"],DA=[...NA,...NS],zA={ltr:[..._m,"ArrowRight"],rtl:[..._m,"ArrowLeft"]},kA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xl="Menu",[ol,LA,$A]=lp(xl),[Ni,DS]=Ga(xl,[$A,Ks,jS]),Vu=Ks(),zS=jS(),[IA,Di]=Ni(xl),[PA,wl]=Ni(xl),kS=e=>{const{__scopeMenu:n,open:r=!1,children:i,dir:o,onOpenChange:l,modal:u=!0}=e,d=Vu(n),[p,m]=S.useState(null),y=S.useRef(!1),v=tr(l),b=cp(o);return S.useEffect(()=>{const x=()=>{y.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>y.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),S.useEffect(()=>{if(!r)return;const x=()=>v(!1);return window.addEventListener("blur",x),()=>window.removeEventListener("blur",x)},[r,v]),f.jsx(Tp,{...d,children:f.jsx(IA,{scope:n,open:r,onOpenChange:v,content:p,onContentChange:m,children:f.jsx(PA,{scope:n,onClose:S.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:y,dir:b,modal:u,children:i})})})};kS.displayName=xl;var FA="MenuAnchor",Np=S.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e,o=Vu(r);return f.jsx(Op,{...o,...i,ref:n})});Np.displayName=FA;var Dp="MenuPortal",[VA,LS]=Ni(Dp,{forceMount:void 0}),$S=e=>{const{__scopeMenu:n,forceMount:r,children:i,container:o}=e,l=Di(Dp,n);return f.jsx(VA,{scope:n,forceMount:r,children:f.jsx(vr,{present:r||l.open,children:f.jsx(yl,{asChild:!0,container:o,children:i})})})};$S.displayName=Dp;var er="MenuContent",[UA,zp]=Ni(er),IS=S.forwardRef((e,n)=>{const r=LS(er,e.__scopeMenu),{forceMount:i=r.forceMount,...o}=e,l=Di(er,e.__scopeMenu),u=wl(er,e.__scopeMenu);return f.jsx(ol.Provider,{scope:e.__scopeMenu,children:f.jsx(vr,{present:i||l.open,children:f.jsx(ol.Slot,{scope:e.__scopeMenu,children:u.modal?f.jsx(HA,{...o,ref:n}):f.jsx(BA,{...o,ref:n})})})})}),HA=S.forwardRef((e,n)=>{const r=Di(er,e.__scopeMenu),i=S.useRef(null),o=nt(n,i);return S.useEffect(()=>{const l=i.current;if(l)return fp(l)},[]),f.jsx(kp,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:je(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),BA=S.forwardRef((e,n)=>{const r=Di(er,e.__scopeMenu);return f.jsx(kp,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),qA=_i("MenuContent.ScrollLock"),kp=S.forwardRef((e,n)=>{const{__scopeMenu:r,loop:i=!1,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:d,onEntryFocus:p,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:x,disableOutsideScroll:w,..._}=e,E=Di(er,r),R=wl(er,r),T=Vu(r),O=zS(r),M=LA(r),[D,P]=S.useState(null),F=S.useRef(null),V=nt(n,F,E.onContentChange),ve=S.useRef(0),be=S.useRef(""),he=S.useRef(0),ue=S.useRef(null),X=S.useRef("right"),pe=S.useRef(0),ge=w?zu:S.Fragment,L=w?{as:qA,allowPinchZoom:!0}:void 0,Z=ee=>{const ne=be.current+ee,z=M().filter(ae=>!ae.disabled),N=document.activeElement,B=z.find(ae=>ae.ref.current===N)?.textValue,J=z.map(ae=>ae.textValue),K=rM(J,ne,B),le=z.find(ae=>ae.textValue===K)?.ref.current;(function ae(ye){be.current=ye,window.clearTimeout(ve.current),ye!==""&&(ve.current=window.setTimeout(()=>ae(""),1e3))})(ne),le&&setTimeout(()=>le.focus())};S.useEffect(()=>()=>window.clearTimeout(ve.current),[]),dp();const re=S.useCallback(ee=>X.current===ue.current?.side&&iM(ee,ue.current?.area),[]);return f.jsx(UA,{scope:r,searchRef:be,onItemEnter:S.useCallback(ee=>{re(ee)&&ee.preventDefault()},[re]),onItemLeave:S.useCallback(ee=>{re(ee)||(F.current?.focus(),P(null))},[re]),onTriggerLeave:S.useCallback(ee=>{re(ee)&&ee.preventDefault()},[re]),pointerGraceTimerRef:he,onPointerGraceIntentChange:S.useCallback(ee=>{ue.current=ee},[]),children:f.jsx(ge,{...L,children:f.jsx(Nu,{asChild:!0,trapped:o,onMountAutoFocus:je(l,ee=>{ee.preventDefault(),F.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:f.jsx(vl,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:x,children:f.jsx(AA,{asChild:!0,...O,dir:R.dir,orientation:"vertical",loop:i,currentTabStopId:D,onCurrentTabStopIdChange:P,onEntryFocus:je(p,ee=>{R.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(Ap,{role:"menu","aria-orientation":"vertical","data-state":e1(E.open),"data-radix-menu-content":"",dir:R.dir,...T,..._,ref:V,style:{outline:"none",..._.style},onKeyDown:je(_.onKeyDown,ee=>{const z=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,N=ee.ctrlKey||ee.altKey||ee.metaKey,B=ee.key.length===1;z&&(ee.key==="Tab"&&ee.preventDefault(),!N&&B&&Z(ee.key));const J=F.current;if(ee.target!==J||!DA.includes(ee.key))return;ee.preventDefault();const le=M().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);NS.includes(ee.key)&&le.reverse(),tM(le)}),onBlur:je(e.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(ve.current),be.current="")}),onPointerMove:je(e.onPointerMove,ll(ee=>{const ne=ee.target,z=pe.current!==ee.clientX;if(ee.currentTarget.contains(ne)&&z){const N=ee.clientX>pe.current?"right":"left";X.current=N,pe.current=ee.clientX}}))})})})})})})});IS.displayName=er;var GA="MenuGroup",Lp=S.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e;return f.jsx($e.div,{role:"group",...i,ref:n})});Lp.displayName=GA;var ZA="MenuLabel",PS=S.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e;return f.jsx($e.div,{...i,ref:n})});PS.displayName=ZA;var yu="MenuItem",Wb="menu.itemSelect",Uu=S.forwardRef((e,n)=>{const{disabled:r=!1,onSelect:i,...o}=e,l=S.useRef(null),u=wl(yu,e.__scopeMenu),d=zp(yu,e.__scopeMenu),p=nt(n,l),m=S.useRef(!1),y=()=>{const v=l.current;if(!r&&v){const b=new CustomEvent(Wb,{bubbles:!0,cancelable:!0});v.addEventListener(Wb,x=>i?.(x),{once:!0}),$w(v,b),b.defaultPrevented?m.current=!1:u.onClose()}};return f.jsx(FS,{...o,ref:p,disabled:r,onClick:je(e.onClick,y),onPointerDown:v=>{e.onPointerDown?.(v),m.current=!0},onPointerUp:je(e.onPointerUp,v=>{m.current||v.currentTarget?.click()}),onKeyDown:je(e.onKeyDown,v=>{r||v.target!==v.currentTarget||d.searchRef.current!==""&&v.key===" "||_m.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});Uu.displayName=yu;var FS=S.forwardRef((e,n)=>{const{__scopeMenu:r,disabled:i=!1,textValue:o,...l}=e,u=zp(yu,r),d=zS(r),p=S.useRef(null),m=nt(n,p),[y,v]=S.useState(!1),[b,x]=S.useState("");return S.useEffect(()=>{const w=p.current;w&&x((w.textContent??"").trim())},[l.children]),f.jsx(ol.ItemSlot,{scope:r,disabled:i,textValue:o??b,children:f.jsx(MA,{asChild:!0,...d,focusable:!i,children:f.jsx($e.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...l,ref:m,onPointerMove:je(e.onPointerMove,ll(w=>{i?u.onItemLeave(w):(u.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(e.onPointerLeave,ll(w=>u.onItemLeave(w))),onFocus:je(e.onFocus,()=>v(!0)),onBlur:je(e.onBlur,()=>v(!1))})})})}),KA="MenuCheckboxItem",VS=S.forwardRef((e,n)=>{const{checked:r=!1,onCheckedChange:i,...o}=e;return f.jsx(GS,{scope:e.__scopeMenu,checked:r,children:f.jsx(Uu,{role:"menuitemcheckbox","aria-checked":bu(r)?"mixed":r,...o,ref:n,"data-state":Ip(r),onSelect:je(o.onSelect,()=>i?.(bu(r)?!0:!r),{checkForDefaultPrevented:!1})})})});VS.displayName=KA;var US="MenuRadioGroup",[YA,QA]=Ni(US,{value:void 0,onValueChange:()=>{}}),HS=S.forwardRef((e,n)=>{const{value:r,onValueChange:i,...o}=e,l=tr(i);return f.jsx(YA,{scope:e.__scopeMenu,value:r,onValueChange:l,children:f.jsx(Lp,{...o,ref:n})})});HS.displayName=US;var BS="MenuRadioItem",qS=S.forwardRef((e,n)=>{const{value:r,...i}=e,o=QA(BS,e.__scopeMenu),l=r===o.value;return f.jsx(GS,{scope:e.__scopeMenu,checked:l,children:f.jsx(Uu,{role:"menuitemradio","aria-checked":l,...i,ref:n,"data-state":Ip(l),onSelect:je(i.onSelect,()=>o.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});qS.displayName=BS;var $p="MenuItemIndicator",[GS,XA]=Ni($p,{checked:!1}),ZS=S.forwardRef((e,n)=>{const{__scopeMenu:r,forceMount:i,...o}=e,l=XA($p,r);return f.jsx(vr,{present:i||bu(l.checked)||l.checked===!0,children:f.jsx($e.span,{...o,ref:n,"data-state":Ip(l.checked)})})});ZS.displayName=$p;var JA="MenuSeparator",KS=S.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e;return f.jsx($e.div,{role:"separator","aria-orientation":"horizontal",...i,ref:n})});KS.displayName=JA;var WA="MenuArrow",YS=S.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e,o=Vu(r);return f.jsx(Mp,{...o,...i,ref:n})});YS.displayName=WA;var eM="MenuSub",[hF,QS]=Ni(eM),Ko="MenuSubTrigger",XS=S.forwardRef((e,n)=>{const r=Di(Ko,e.__scopeMenu),i=wl(Ko,e.__scopeMenu),o=QS(Ko,e.__scopeMenu),l=zp(Ko,e.__scopeMenu),u=S.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:p}=l,m={__scopeMenu:e.__scopeMenu},y=S.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);S.useEffect(()=>y,[y]),S.useEffect(()=>{const b=d.current;return()=>{window.clearTimeout(b),p(null)}},[d,p]);const v=nt(n,o.onTriggerChange);return f.jsx(Np,{asChild:!0,...m,children:f.jsx(FS,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":e1(r.open),...e,ref:v,onClick:b=>{e.onClick?.(b),!(e.disabled||b.defaultPrevented)&&(b.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:je(e.onPointerMove,ll(b=>{l.onItemEnter(b),!b.defaultPrevented&&!e.disabled&&!r.open&&!u.current&&(l.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),y()},100))})),onPointerLeave:je(e.onPointerLeave,ll(b=>{y();const x=r.content?.getBoundingClientRect();if(x){const w=r.content?.dataset.side,_=w==="right",E=_?-5:5,R=x[_?"left":"right"],T=x[_?"right":"left"];l.onPointerGraceIntentChange({area:[{x:b.clientX+E,y:b.clientY},{x:R,y:x.top},{x:T,y:x.top},{x:T,y:x.bottom},{x:R,y:x.bottom}],side:w}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(b),b.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:je(e.onKeyDown,b=>{e.disabled||b.target!==b.currentTarget||l.searchRef.current!==""&&b.key===" "||zA[i.dir].includes(b.key)&&(r.onOpenChange(!0),r.content?.focus(),b.preventDefault())})})})});XS.displayName=Ko;var JS="MenuSubContent",WS=S.forwardRef((e,n)=>{const r=LS(er,e.__scopeMenu),{forceMount:i=r.forceMount,align:o="start",...l}=e,u=Di(er,e.__scopeMenu),d=wl(er,e.__scopeMenu),p=QS(JS,e.__scopeMenu),m=S.useRef(null),y=nt(n,m);return f.jsx(ol.Provider,{scope:e.__scopeMenu,children:f.jsx(vr,{present:i||u.open,children:f.jsx(ol.Slot,{scope:e.__scopeMenu,children:f.jsx(kp,{id:p.contentId,"aria-labelledby":p.triggerId,...l,ref:y,align:o,side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{d.isUsingKeyboardRef.current&&m.current?.focus(),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:je(e.onFocusOutside,v=>{v.target!==p.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:je(e.onEscapeKeyDown,v=>{d.onClose(),v.preventDefault()}),onKeyDown:je(e.onKeyDown,v=>{const b=v.currentTarget.contains(v.target),x=kA[d.dir].includes(v.key);b&&x&&(u.onOpenChange(!1),p.trigger?.focus(),v.preventDefault())})})})})})});WS.displayName=JS;function e1(e){return e?"open":"closed"}function bu(e){return e==="indeterminate"}function Ip(e){return bu(e)?"indeterminate":e?"checked":"unchecked"}function tM(e){const n=document.activeElement;for(const r of e)if(r===n||(r.focus(),document.activeElement!==n))return}function nM(e,n){return e.map((r,i)=>e[(n+i)%e.length])}function rM(e,n,r){const o=n.length>1&&Array.from(n).every(m=>m===n[0])?n[0]:n,l=r?e.indexOf(r):-1;let u=nM(e,Math.max(l,0));o.length===1&&(u=u.filter(m=>m!==r));const p=u.find(m=>m.toLowerCase().startsWith(o.toLowerCase()));return p!==r?p:void 0}function aM(e,n){const{x:r,y:i}=e;let o=!1;for(let l=0,u=n.length-1;li!=b>i&&r<(v-m)*(i-y)/(b-y)+m&&(o=!o)}return o}function iM(e,n){if(!n)return!1;const r={x:e.clientX,y:e.clientY};return aM(r,n)}function ll(e){return n=>n.pointerType==="mouse"?e(n):void 0}var sM=kS,oM=Np,lM=$S,cM=IS,uM=Lp,dM=PS,fM=Uu,hM=VS,mM=HS,pM=qS,gM=ZS,vM=KS,yM=YS,bM=XS,xM=WS,Hu="DropdownMenu",[wM]=Ga(Hu,[DS]),vn=DS(),[SM,t1]=wM(Hu),n1=e=>{const{__scopeDropdownMenu:n,children:r,dir:i,open:o,defaultOpen:l,onOpenChange:u,modal:d=!0}=e,p=vn(n),m=S.useRef(null),[y,v]=Fs({prop:o,defaultProp:l??!1,onChange:u,caller:Hu});return f.jsx(SM,{scope:n,triggerId:dn(),triggerRef:m,contentId:dn(),open:y,onOpenChange:v,onOpenToggle:S.useCallback(()=>v(b=>!b),[v]),modal:d,children:f.jsx(sM,{...p,open:y,onOpenChange:v,dir:i,modal:d,children:r})})};n1.displayName=Hu;var r1="DropdownMenuTrigger",a1=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,disabled:i=!1,...o}=e,l=t1(r1,r),u=vn(r),d=nt(n,l.triggerRef);return f.jsx(oM,{asChild:!0,...u,children:f.jsx($e.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...o,ref:d,onPointerDown:je(e.onPointerDown,p=>{!i&&p.button===0&&p.ctrlKey===!1&&(l.onOpenToggle(),l.open||p.preventDefault())}),onKeyDown:je(e.onKeyDown,p=>{i||(["Enter"," "].includes(p.key)&&l.onOpenToggle(),p.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(p.key)&&p.preventDefault())})})})});a1.displayName=r1;var _M="DropdownMenuPortal",i1=e=>{const{__scopeDropdownMenu:n,...r}=e,i=vn(n);return f.jsx(lM,{...i,...r})};i1.displayName=_M;var s1="DropdownMenuContent",o1=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=t1(s1,r),l=vn(r),u=S.useRef(!1);return f.jsx(cM,{id:o.contentId,"aria-labelledby":o.triggerId,...l,...i,ref:n,onCloseAutoFocus:je(e.onCloseAutoFocus,d=>{u.current||o.triggerRef.current?.focus(),u.current=!1,d.preventDefault()}),onInteractOutside:je(e.onInteractOutside,d=>{const p=d.detail.originalEvent,m=p.button===0&&p.ctrlKey===!0,y=p.button===2||m;(!o.modal||y)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});o1.displayName=s1;var CM="DropdownMenuGroup",EM=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(uM,{...o,...i,ref:n})});EM.displayName=CM;var RM="DropdownMenuLabel",l1=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(dM,{...o,...i,ref:n})});l1.displayName=RM;var jM="DropdownMenuItem",c1=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(fM,{...o,...i,ref:n})});c1.displayName=jM;var TM="DropdownMenuCheckboxItem",OM=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(hM,{...o,...i,ref:n})});OM.displayName=TM;var AM="DropdownMenuRadioGroup",MM=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(mM,{...o,...i,ref:n})});MM.displayName=AM;var NM="DropdownMenuRadioItem",DM=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(pM,{...o,...i,ref:n})});DM.displayName=NM;var zM="DropdownMenuItemIndicator",kM=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(gM,{...o,...i,ref:n})});kM.displayName=zM;var LM="DropdownMenuSeparator",$M=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(vM,{...o,...i,ref:n})});$M.displayName=LM;var IM="DropdownMenuArrow",PM=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(yM,{...o,...i,ref:n})});PM.displayName=IM;var FM="DropdownMenuSubTrigger",VM=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(bM,{...o,...i,ref:n})});VM.displayName=FM;var UM="DropdownMenuSubContent",HM=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(xM,{...o,...i,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});HM.displayName=UM;var BM=n1,qM=a1,GM=i1,ZM=o1,KM=l1,YM=c1,QM="Label",u1=S.forwardRef((e,n)=>f.jsx($e.label,{...e,ref:n,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));u1.displayName=QM;var XM=u1;function ex(e,[n,r]){return Math.min(r,Math.max(n,e))}var JM=[" ","Enter","ArrowUp","ArrowDown"],WM=[" ","Enter"],Ri="Select",[Bu,qu,eN]=lp(Ri),[zi]=Ga(Ri,[eN,Ks]),Gu=Ks(),[tN,Ka]=zi(Ri),[nN,rN]=zi(Ri),aN="SelectProvider";function d1(e){const{__scopeSelect:n,children:r,open:i,defaultOpen:o,onOpenChange:l,value:u,defaultValue:d,onValueChange:p,dir:m,name:y,autoComplete:v,disabled:b,required:x,form:w,internal_do_not_use_render:_}=e,E=Gu(n),[R,T]=S.useState(null),[O,M]=S.useState(null),[D,P]=S.useState(!1),F=cp(m),[V,ve]=Fs({prop:i,defaultProp:o??!1,onChange:l,caller:Ri}),[be,he]=Fs({prop:u,defaultProp:d,onChange:p,caller:Ri}),ue=S.useRef(null),X=S.useRef(be);S.useEffect(()=>{const N=w?R?.ownerDocument.getElementById(w):R?.form;if(N instanceof HTMLFormElement){const B=()=>he(X.current);return N.addEventListener("reset",B),()=>N.removeEventListener("reset",B)}},[w,R,he]);const pe=R?!!w||!!R.closest("form"):!0,[ge,L]=S.useState(new Set),Z=dn(),re=Array.from(ge).map(N=>N.props.value).join(";"),ee=S.useCallback(N=>{L(B=>new Set(B).add(N))},[]),ne=S.useCallback(N=>{L(B=>{const J=new Set(B);return J.delete(N),J})},[]),z={required:x,trigger:R,onTriggerChange:T,valueNode:O,onValueNodeChange:M,valueNodeHasChildren:D,onValueNodeHasChildrenChange:P,contentId:Z,value:be,onValueChange:he,open:V,onOpenChange:ve,dir:F,triggerPointerDownPosRef:ue,disabled:b,name:y,autoComplete:v,form:w,nativeOptions:ge,nativeSelectKey:re,isFormControl:pe};return f.jsx(Tp,{...E,children:f.jsx(tN,{scope:n,...z,children:f.jsx(Bu.Provider,{scope:n,children:f.jsx(nN,{scope:n,onNativeOptionAdd:ee,onNativeOptionRemove:ne,children:wN(_)?_(z):r})})})})}d1.displayName=aN;var f1=e=>{const{__scopeSelect:n,children:r,...i}=e;return f.jsx(d1,{__scopeSelect:n,...i,internal_do_not_use_render:({isFormControl:o})=>f.jsxs(f.Fragment,{children:[r,o?f.jsx(I1,{__scopeSelect:n}):null]})})};f1.displayName=Ri;var h1="SelectTrigger",m1=S.forwardRef((e,n)=>{const{__scopeSelect:r,disabled:i=!1,...o}=e,l=Gu(r),u=Ka(h1,r),d=u.disabled||i,p=nt(n,u.onTriggerChange),m=qu(r),y=S.useRef("touch"),[v,b,x]=P1(_=>{const E=m().filter(O=>!O.disabled),R=E.find(O=>O.value===u.value),T=F1(E,_,R);T!==void 0&&u.onValueChange(T.value)}),w=_=>{d||(u.onOpenChange(!0),x()),_&&(u.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return f.jsx(Op,{asChild:!0,...l,children:f.jsx($e.button,{type:"button",role:"combobox","aria-controls":u.open?u.contentId:void 0,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":Zu(u.value)?"":void 0,...o,ref:p,onClick:je(o.onClick,_=>{_.currentTarget.focus(),y.current!=="mouse"&&w(_)}),onPointerDown:je(o.onPointerDown,_=>{y.current=_.pointerType;const E=_.target;E.hasPointerCapture(_.pointerId)&&E.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(w(_),_.preventDefault())}),onKeyDown:je(o.onKeyDown,_=>{const E=v.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&b(_.key),!(E&&_.key===" ")&&JM.includes(_.key)&&(w(),_.preventDefault())})})})});m1.displayName=h1;var p1="SelectValue",g1=S.forwardRef((e,n)=>{const{__scopeSelect:r,className:i,style:o,children:l,placeholder:u="",...d}=e,p=Ka(p1,r),{onValueNodeHasChildrenChange:m}=p,y=l!==void 0,v=nt(n,p.onValueNodeChange);Yt(()=>{m(y)},[m,y]);const b=Zu(p.value);return f.jsx($e.span,{...d,asChild:b?!1:d.asChild,ref:v,style:{pointerEvents:"none"},children:f.jsx(S.Fragment,{children:b?u:l},b?"placeholder":"value")})});g1.displayName=p1;var iN="SelectIcon",v1=S.forwardRef((e,n)=>{const{__scopeSelect:r,children:i,...o}=e;return f.jsx($e.span,{"aria-hidden":!0,...o,ref:n,children:i||"▼"})});v1.displayName=iN;var y1="SelectPortal",[sN,oN]=zi(y1,{forceMount:void 0}),b1=e=>{const{__scopeSelect:n,forceMount:r,...i}=e;return f.jsx(sN,{scope:e.__scopeSelect,forceMount:r,children:f.jsx(yl,{asChild:!0,...i})})};b1.displayName=y1;var Ha="SelectContent",x1=S.forwardRef((e,n)=>{const r=oN(Ha,e.__scopeSelect),{forceMount:i=r.forceMount,...o}=e,l=Ka(Ha,e.__scopeSelect),[u,d]=S.useState();return Yt(()=>{d(new DocumentFragment)},[]),f.jsx(vr,{present:i||l.open,children:({present:p})=>p?f.jsx(_1,{...o,ref:n}):f.jsx(w1,{...o,fragment:u})})});x1.displayName=Ha;var w1=S.forwardRef((e,n)=>{const{__scopeSelect:r,children:i,fragment:o}=e;return o?Mi.createPortal(f.jsx(S1,{scope:r,children:f.jsx(Bu.Slot,{scope:r,children:f.jsx("div",{ref:n,children:i})})}),o):null});w1.displayName="SelectContentFragment";var fr=10,[S1,Ya]=zi(Ha),lN="SelectContentImpl",cN=_i("SelectContent.RemoveScroll"),_1=S.forwardRef((e,n)=>{const{__scopeSelect:r}=e,{position:i="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:u,side:d,sideOffset:p,align:m,alignOffset:y,arrowPadding:v,collisionBoundary:b,collisionPadding:x,sticky:w,hideWhenDetached:_,avoidCollisions:E,...R}=e,T=Ka(Ha,r),[O,M]=S.useState(null),[D,P]=S.useState(null),F=nt(n,M),[V,ve]=S.useState(null),[be,he]=S.useState(null),ue=qu(r),[X,pe]=S.useState(!1),ge=S.useRef(!1);S.useEffect(()=>{if(O)return fp(O)},[O]),dp();const L=S.useCallback(ae=>{const[ye,...xe]=ue().map(Ve=>Ve.ref.current),[Oe]=xe.slice(-1),Ie=document.activeElement;for(const Ve of ae)if(Ve===Ie||(Ve?.scrollIntoView({block:"nearest"}),Ve===ye&&D&&(D.scrollTop=0),Ve===Oe&&D&&(D.scrollTop=D.scrollHeight),Ve?.focus(),document.activeElement!==Ie))return},[ue,D]),Z=S.useCallback(()=>L([V,O]),[L,V,O]);S.useEffect(()=>{X&&Z()},[X,Z]);const{onOpenChange:re,triggerPointerDownPosRef:ee}=T;S.useEffect(()=>{if(O){let ae={x:0,y:0};const ye=Oe=>{ae={x:Math.abs(Math.round(Oe.pageX)-(ee.current?.x??0)),y:Math.abs(Math.round(Oe.pageY)-(ee.current?.y??0))}},xe=Oe=>{ae.x<=10&&ae.y<=10?Oe.preventDefault():Oe.composedPath().includes(O)||re(!1),document.removeEventListener("pointermove",ye),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",xe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",xe,{capture:!0})}}},[O,re,ee]),S.useEffect(()=>{const ae=()=>re(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[re]);const[ne,z]=P1(ae=>{const ye=ue().filter(Ie=>!Ie.disabled),xe=ye.find(Ie=>Ie.ref.current===document.activeElement),Oe=F1(ye,ae,xe);Oe&&setTimeout(()=>Oe.ref.current?.focus())}),N=S.useCallback((ae,ye,xe)=>{const Oe=!ge.current&&!xe;(T.value!==void 0&&T.value===ye||Oe)&&(ve(ae),Oe&&(ge.current=!0))},[T.value]),B=S.useCallback(()=>O?.focus(),[O]),J=S.useCallback((ae,ye,xe)=>{const Oe=!ge.current&&!xe;(T.value!==void 0&&T.value===ye||Oe)&&he(ae)},[T.value]),K=i==="popper"?Cm:C1,le=K===Cm?{side:d,sideOffset:p,align:m,alignOffset:y,arrowPadding:v,collisionBoundary:b,collisionPadding:x,sticky:w,hideWhenDetached:_,avoidCollisions:E}:{};return f.jsx(S1,{scope:r,content:O,viewport:D,onViewportChange:P,itemRefCallback:N,selectedItem:V,onItemLeave:B,itemTextRefCallback:J,focusSelectedItem:Z,selectedItemText:be,position:i,isPositioned:X,searchRef:ne,children:f.jsx(zu,{as:cN,allowPinchZoom:!0,children:f.jsx(Nu,{asChild:!0,trapped:T.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:je(o,ae=>{T.trigger?.focus({preventScroll:!0}),ae.preventDefault()}),children:f.jsx(vl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:f.jsx(K,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:ae=>ae.preventDefault(),...R,...le,onPlaced:()=>pe(!0),ref:F,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:je(R.onKeyDown,ae=>{const ye=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!ye&&ae.key.length===1&&z(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let Oe=ue().filter(Ie=>!Ie.disabled).map(Ie=>Ie.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(Oe=Oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const Ie=ae.target,Ve=Oe.indexOf(Ie);Oe=Oe.slice(Ve+1)}setTimeout(()=>L(Oe)),ae.preventDefault()}})})})})})})});_1.displayName=lN;var uN="SelectItemAlignedPosition",C1=S.forwardRef((e,n)=>{const{__scopeSelect:r,onPlaced:i,...o}=e,l=Ka(Ha,r),u=Ya(Ha,r),[d,p]=S.useState(null),[m,y]=S.useState(null),v=nt(n,y),b=qu(r),x=S.useRef(!1),w=S.useRef(!0),{viewport:_,selectedItem:E,selectedItemText:R,focusSelectedItem:T}=u,O=S.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&m&&_&&E&&R){const F=l.trigger.getBoundingClientRect(),V=m.getBoundingClientRect(),ve=l.valueNode.getBoundingClientRect(),be=R.getBoundingClientRect();if(l.dir!=="rtl"){const Ie=be.left-V.left,Ve=ve.left-Ie,it=F.left-Ve,Qe=F.width+it,fn=Math.max(Qe,V.width),hn=window.innerWidth-fr,Qt=ex(Ve,[fr,Math.max(fr,hn-fn)]);d.style.minWidth=Qe+"px",d.style.left=Qt+"px"}else{const Ie=V.right-be.right,Ve=window.innerWidth-ve.right-Ie,it=window.innerWidth-F.right-Ve,Qe=F.width+it,fn=Math.max(Qe,V.width),hn=window.innerWidth-fr,Qt=ex(Ve,[fr,Math.max(fr,hn-fn)]);d.style.minWidth=Qe+"px",d.style.right=Qt+"px"}const he=b(),ue=window.innerHeight-fr*2,X=_.scrollHeight,pe=window.getComputedStyle(m),ge=parseInt(pe.borderTopWidth,10),L=parseInt(pe.paddingTop,10),Z=parseInt(pe.borderBottomWidth,10),re=parseInt(pe.paddingBottom,10),ee=ge+L+X+re+Z,ne=Math.min(E.offsetHeight*5,ee),z=window.getComputedStyle(_),N=parseInt(z.paddingTop,10),B=parseInt(z.paddingBottom,10),J=F.top+F.height/2-fr,K=ue-J,le=E.offsetHeight/2,ae=E.offsetTop+le,ye=ge+L+ae,xe=ee-ye;if(ye<=J){const Ie=he.length>0&&E===he[he.length-1].ref.current;d.style.bottom="0px";const Ve=m.clientHeight-_.offsetTop-_.offsetHeight,it=Math.max(K,le+(Ie?B:0)+Ve+Z),Qe=ye+it;d.style.height=Qe+"px"}else{const Ie=he.length>0&&E===he[0].ref.current;d.style.top="0px";const it=Math.max(J,ge+_.offsetTop+(Ie?N:0)+le)+xe;d.style.height=it+"px",_.scrollTop=ye-J+_.offsetTop}d.style.margin=`${fr}px 0`,d.style.minHeight=ne+"px",d.style.maxHeight=ue+"px",i?.(),requestAnimationFrame(()=>x.current=!0)}},[b,l.trigger,l.valueNode,d,m,_,E,R,l.dir,i]);Yt(()=>O(),[O]);const[M,D]=S.useState();Yt(()=>{m&&D(window.getComputedStyle(m).zIndex)},[m]);const P=S.useCallback(F=>{F&&w.current===!0&&(O(),T?.(),w.current=!1)},[O,T]);return f.jsx(fN,{scope:r,contentWrapper:d,shouldExpandOnScrollRef:x,onScrollButtonChange:P,children:f.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:f.jsx($e.div,{...o,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});C1.displayName=uN;var dN="SelectPopperPosition",Cm=S.forwardRef((e,n)=>{const{__scopeSelect:r,align:i="start",collisionPadding:o=fr,...l}=e,u=Gu(r);return f.jsx(Ap,{...u,...l,ref:n,align:i,collisionPadding:o,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Cm.displayName=dN;var[fN,Pp]=zi(Ha,{}),Em="SelectViewport",E1=S.forwardRef((e,n)=>{const{__scopeSelect:r,nonce:i,...o}=e,l=Ya(Em,r),u=Pp(Em,r),d=nt(n,l.onViewportChange),p=S.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),f.jsx(Bu.Slot,{scope:r,children:f.jsx($e.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:je(o.onScroll,m=>{const y=m.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:b}=u;if(b?.current&&v){const x=Math.abs(p.current-y.scrollTop);if(x>0){const w=window.innerHeight-fr*2,_=parseFloat(v.style.minHeight),E=parseFloat(v.style.height),R=Math.max(_,E);if(R0?M:0,v.style.justifyContent="flex-end")}}}p.current=y.scrollTop})})})]})});E1.displayName=Em;var R1="SelectGroup",[hN,mN]=zi(R1),pN=S.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e,o=dn();return f.jsx(hN,{scope:r,id:o,children:f.jsx($e.div,{role:"group","aria-labelledby":o,...i,ref:n})})});pN.displayName=R1;var j1="SelectLabel",gN=S.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e,o=mN(j1,r);return f.jsx($e.div,{id:o.id,...i,ref:n})});gN.displayName=j1;var xu="SelectItem",[vN,T1]=zi(xu),O1=S.forwardRef((e,n)=>{const{__scopeSelect:r,value:i,disabled:o=!1,textValue:l,...u}=e,d=Ka(xu,r),p=Ya(xu,r),m=d.value===i,[y,v]=S.useState(l??""),[b,x]=S.useState(!1),w=tr(O=>p.itemRefCallback?.(O,i,o)),_=nt(n,w),E=dn(),R=S.useRef("touch"),T=()=>{o||(d.onValueChange(i),d.onOpenChange(!1))};return f.jsx(vN,{scope:r,value:i,disabled:o,textId:E,isSelected:m,onItemTextChange:S.useCallback(O=>{v(M=>M||(O?.textContent??"").trim())},[]),children:f.jsx(Bu.ItemSlot,{scope:r,value:i,disabled:o,textValue:y,children:f.jsx($e.div,{role:"option","aria-labelledby":E,"data-highlighted":b?"":void 0,"aria-selected":m&&b,"data-state":m?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...u,ref:_,onFocus:je(u.onFocus,()=>x(!0)),onBlur:je(u.onBlur,()=>x(!1)),onClick:je(u.onClick,()=>{R.current!=="mouse"&&T()}),onPointerUp:je(u.onPointerUp,()=>{R.current==="mouse"&&T()}),onPointerDown:je(u.onPointerDown,O=>{R.current=O.pointerType}),onPointerMove:je(u.onPointerMove,O=>{R.current=O.pointerType,o?p.onItemLeave?.():R.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(u.onPointerLeave,O=>{O.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:je(u.onKeyDown,O=>{o||O.target!==O.currentTarget||p.searchRef?.current!==""&&O.key===" "||(WM.includes(O.key)&&T(),O.key===" "&&O.preventDefault())})})})})});O1.displayName=xu;var Yo="SelectItemText",A1=S.forwardRef((e,n)=>{const{__scopeSelect:r,className:i,style:o,...l}=e,u=Ka(Yo,r),d=Ya(Yo,r),p=T1(Yo,r),m=rN(Yo,r),[y,v]=S.useState(null),b=tr(T=>d.itemTextRefCallback?.(T,p.value,p.disabled)),x=nt(n,v,p.onItemTextChange,b),w=y?.textContent,_=S.useMemo(()=>f.jsx("option",{value:p.value,disabled:p.disabled,children:w},p.value),[p.disabled,p.value,w]),{onNativeOptionAdd:E,onNativeOptionRemove:R}=m;return Yt(()=>(E(_),()=>R(_)),[E,R,_]),f.jsxs(f.Fragment,{children:[f.jsx($e.span,{id:p.textId,...l,ref:x}),p.isSelected&&u.valueNode&&!u.valueNodeHasChildren&&!Zu(u.value)?Mi.createPortal(l.children,u.valueNode):null]})});A1.displayName=Yo;var M1="SelectItemIndicator",N1=S.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e;return T1(M1,r).isSelected?f.jsx($e.span,{"aria-hidden":!0,...i,ref:n}):null});N1.displayName=M1;var Rm="SelectScrollUpButton",D1=S.forwardRef((e,n)=>{const r=Ya(Rm,e.__scopeSelect),i=Pp(Rm,e.__scopeSelect),[o,l]=S.useState(!1),u=nt(n,i.onScrollButtonChange);return Yt(()=>{if(r.viewport&&r.isPositioned){let d=function(){const m=p.scrollTop>0;l(m)};const p=r.viewport;return d(),p.addEventListener("scroll",d),()=>p.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),o?f.jsx(k1,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:p}=r;d&&p&&(d.scrollTop=d.scrollTop-p.offsetHeight)}}):null});D1.displayName=Rm;var jm="SelectScrollDownButton",z1=S.forwardRef((e,n)=>{const r=Ya(jm,e.__scopeSelect),i=Pp(jm,e.__scopeSelect),[o,l]=S.useState(!1),u=nt(n,i.onScrollButtonChange);return Yt(()=>{if(r.viewport&&r.isPositioned){let d=function(){const m=p.scrollHeight-p.clientHeight,y=Math.ceil(p.scrollTop)p.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),o?f.jsx(k1,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:p}=r;d&&p&&(d.scrollTop=d.scrollTop+p.offsetHeight)}}):null});z1.displayName=jm;var k1=S.forwardRef((e,n)=>{const{__scopeSelect:r,onAutoScroll:i,...o}=e,l=Ya("SelectScrollButton",r),u=S.useRef(null),d=qu(r),p=S.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return S.useEffect(()=>()=>p(),[p]),Yt(()=>{d().find(y=>y.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[d]),f.jsx($e.div,{"aria-hidden":!0,...o,ref:n,style:{flexShrink:0,...o.style},onPointerDown:je(o.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(i,50))}),onPointerMove:je(o.onPointerMove,()=>{l.onItemLeave?.(),u.current===null&&(u.current=window.setInterval(i,50))}),onPointerLeave:je(o.onPointerLeave,()=>{p()})})}),yN="SelectSeparator",bN=S.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e;return f.jsx($e.div,{"aria-hidden":!0,...i,ref:n})});bN.displayName=yN;var L1="SelectArrow",xN=S.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e,o=Gu(r);return Ya(L1,r).position==="popper"?f.jsx(Mp,{...o,...i,ref:n}):null});xN.displayName=L1;var $1="SelectBubbleInput",I1=S.forwardRef(({__scopeSelect:e,...n},r)=>{const i=Ka($1,e),{value:o,onValueChange:l,required:u,disabled:d,name:p,autoComplete:m,form:y}=i,{nativeOptions:v,nativeSelectKey:b}=i,x=S.useRef(null),w=nt(r,x),_=o??"",E=tO(_),R=Array.from(v).some(T=>(T.props.value??"")==="");return S.useEffect(()=>{const T=x.current;if(!T)return;const O=window.HTMLSelectElement.prototype,D=Object.getOwnPropertyDescriptor(O,"value").set;if(E!==_&&D){const P=new Event("change",{bubbles:!0});D.call(T,_),T.dispatchEvent(P)}},[E,_]),f.jsxs($e.select,{"aria-hidden":!0,required:u,tabIndex:-1,name:p,autoComplete:m,disabled:d,form:y,onChange:T=>l(T.target.value),...n,style:{...Iw,...n.style},ref:w,defaultValue:_,children:[Zu(o)&&!R?f.jsx("option",{value:""}):null,Array.from(v)]},b)});I1.displayName=$1;function wN(e){return typeof e=="function"}function Zu(e){return e===""||e===void 0}function P1(e){const n=tr(e),r=S.useRef(""),i=S.useRef(0),o=S.useCallback(u=>{const d=r.current+u;n(d),(function p(m){r.current=m,window.clearTimeout(i.current),m!==""&&(i.current=window.setTimeout(()=>p(""),1e3))})(d)},[n]),l=S.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,o,l]}function F1(e,n,r){const o=n.length>1&&Array.from(n).every(m=>m===n[0])?n[0]:n,l=r?e.indexOf(r):-1;let u=SN(e,Math.max(l,0));o.length===1&&(u=u.filter(m=>m!==r));const p=u.find(m=>m.textValue.toLowerCase().startsWith(o.toLowerCase()));return p!==r?p:void 0}function SN(e,n){return e.map((r,i)=>e[(n+i)%e.length])}var _N="Separator",tx="horizontal",CN=["horizontal","vertical"],V1=S.forwardRef((e,n)=>{const{decorative:r,orientation:i=tx,...o}=e,l=EN(i)?i:tx,d=r?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return f.jsx($e.div,{"data-orientation":l,...d,...o,ref:n})});V1.displayName=_N;function EN(e){return CN.includes(e)}var RN=V1,[Ku]=Ga("Tooltip",[Ks]),Yu=Ks(),U1="TooltipProvider",jN=700,Tm="tooltip.open",[TN,Fp]=Ku(U1),H1=e=>{const{__scopeTooltip:n,delayDuration:r=jN,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:l}=e,u=S.useRef(!0),d=S.useRef(!1),p=S.useRef(0);return S.useEffect(()=>{const m=p.current;return()=>window.clearTimeout(m)},[]),f.jsx(TN,{scope:n,isOpenDelayedRef:u,delayDuration:r,onOpen:S.useCallback(()=>{i<=0||(window.clearTimeout(p.current),u.current=!1)},[i]),onClose:S.useCallback(()=>{i<=0||(window.clearTimeout(p.current),p.current=window.setTimeout(()=>u.current=!0,i))},[i]),isPointerInTransitRef:d,onPointerInTransitChange:S.useCallback(m=>{d.current=m},[]),disableHoverableContent:o,children:l})};H1.displayName=U1;var cl="Tooltip",[ON,Sl]=Ku(cl),B1=e=>{const{__scopeTooltip:n,children:r,open:i,defaultOpen:o,onOpenChange:l,disableHoverableContent:u,delayDuration:d}=e,p=Fp(cl,e.__scopeTooltip),m=Yu(n),[y,v]=S.useState(null),b=dn(),x=S.useRef(0),w=u??p.disableHoverableContent,_=d??p.delayDuration,E=S.useRef(!1),[R,T]=Fs({prop:i,defaultProp:o??!1,onChange:F=>{F?(p.onOpen(),document.dispatchEvent(new CustomEvent(Tm))):p.onClose(),l?.(F)},caller:cl}),O=S.useMemo(()=>R?E.current?"delayed-open":"instant-open":"closed",[R]),M=S.useCallback(()=>{window.clearTimeout(x.current),x.current=0,E.current=!1,T(!0)},[T]),D=S.useCallback(()=>{window.clearTimeout(x.current),x.current=0,T(!1)},[T]),P=S.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{E.current=!0,T(!0),x.current=0},_)},[_,T]);return S.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),f.jsx(Tp,{...m,children:f.jsx(ON,{scope:n,contentId:b,open:R,stateAttribute:O,trigger:y,onTriggerChange:v,onTriggerEnter:S.useCallback(()=>{p.isOpenDelayedRef.current?P():M()},[p.isOpenDelayedRef,P,M]),onTriggerLeave:S.useCallback(()=>{w?D():(window.clearTimeout(x.current),x.current=0)},[D,w]),onOpen:M,onClose:D,disableHoverableContent:w,children:r})})};B1.displayName=cl;var Om="TooltipTrigger",q1=S.forwardRef((e,n)=>{const{__scopeTooltip:r,...i}=e,o=Sl(Om,r),l=Fp(Om,r),u=Yu(r),d=S.useRef(null),p=nt(n,d,o.onTriggerChange),m=S.useRef(!1),y=S.useRef(!1),v=S.useCallback(()=>m.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),f.jsx(Op,{asChild:!0,...u,children:f.jsx($e.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:p,onPointerMove:je(e.onPointerMove,b=>{b.pointerType!=="touch"&&!y.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),y.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{o.onTriggerLeave(),y.current=!1}),onPointerDown:je(e.onPointerDown,()=>{o.open&&o.onClose(),m.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:je(e.onFocus,()=>{m.current||o.onOpen()}),onBlur:je(e.onBlur,o.onClose),onClick:je(e.onClick,o.onClose)})})});q1.displayName=Om;var Vp="TooltipPortal",[AN,MN]=Ku(Vp,{forceMount:void 0}),G1=e=>{const{__scopeTooltip:n,forceMount:r,children:i,container:o}=e,l=Sl(Vp,n);return f.jsx(AN,{scope:n,forceMount:r,children:f.jsx(vr,{present:r||l.open,children:f.jsx(yl,{asChild:!0,container:o,children:i})})})};G1.displayName=Vp;var Us="TooltipContent",Z1=S.forwardRef((e,n)=>{const r=MN(Us,e.__scopeTooltip),{forceMount:i=r.forceMount,side:o="top",...l}=e,u=Sl(Us,e.__scopeTooltip);return f.jsx(vr,{present:i||u.open,children:u.disableHoverableContent?f.jsx(K1,{side:o,...l,ref:n}):f.jsx(NN,{side:o,...l,ref:n})})}),NN=S.forwardRef((e,n)=>{const r=Sl(Us,e.__scopeTooltip),i=Fp(Us,e.__scopeTooltip),o=S.useRef(null),l=nt(n,o),[u,d]=S.useState(null),{trigger:p,onClose:m}=r,y=o.current,{onPointerInTransitChange:v}=i,b=S.useCallback(()=>{d(null),v(!1)},[v]),x=S.useCallback((w,_)=>{const E=w.currentTarget,R={x:w.clientX,y:w.clientY},T=LN(R,E.getBoundingClientRect()),O=$N(R,T),M=IN(_.getBoundingClientRect()),D=FN([...O,...M]);d(D),v(!0)},[v]);return S.useEffect(()=>()=>b(),[b]),S.useEffect(()=>{if(p&&y){const w=E=>x(E,y),_=E=>x(E,p);return p.addEventListener("pointerleave",w),y.addEventListener("pointerleave",_),()=>{p.removeEventListener("pointerleave",w),y.removeEventListener("pointerleave",_)}}},[p,y,x,b]),S.useEffect(()=>{if(u){const w=_=>{const E=_.target,R={x:_.clientX,y:_.clientY},T=p?.contains(E)||y?.contains(E),O=!PN(R,u);T?b():O&&(b(),m())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[p,y,u,m,b]),f.jsx(K1,{...e,ref:l})}),[DN,zN]=Ku(cl,{isInside:!1}),kN=Sj("TooltipContent"),K1=S.forwardRef((e,n)=>{const{__scopeTooltip:r,children:i,"aria-label":o,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,p=Sl(Us,r),m=Yu(r),{onClose:y}=p;return S.useEffect(()=>(document.addEventListener(Tm,y),()=>document.removeEventListener(Tm,y)),[y]),S.useEffect(()=>{if(p.trigger){const v=b=>{b.target instanceof Node&&b.target.contains(p.trigger)&&y()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[p.trigger,y]),f.jsx(vl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:v=>v.preventDefault(),onDismiss:y,children:f.jsxs(Ap,{"data-state":p.stateAttribute,...m,...d,ref:n,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(kN,{children:i}),f.jsx(DN,{scope:r,isInside:!0,children:f.jsx(Dj,{id:p.contentId,role:"tooltip",children:o||i})})]})})});Z1.displayName=Us;var Y1="TooltipArrow",Q1=S.forwardRef((e,n)=>{const{__scopeTooltip:r,...i}=e,o=Yu(r);return zN(Y1,r).isInside?null:f.jsx(Mp,{...o,...i,ref:n})});Q1.displayName=Y1;function LN(e,n){const r=Math.abs(n.top-e.y),i=Math.abs(n.bottom-e.y),o=Math.abs(n.right-e.x),l=Math.abs(n.left-e.x);switch(Math.min(r,i,o,l)){case l:return"left";case o:return"right";case r:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function $N(e,n,r=5){const i=[];switch(n){case"top":i.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":i.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":i.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":i.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return i}function IN(e){const{top:n,right:r,bottom:i,left:o}=e;return[{x:o,y:n},{x:r,y:n},{x:r,y:i},{x:o,y:i}]}function PN(e,n){const{x:r,y:i}=e;let o=!1;for(let l=0,u=n.length-1;li!=b>i&&r<(v-m)*(i-y)/(b-y)+m&&(o=!o)}return o}function FN(e){const n=e.slice();return n.sort((r,i)=>r.xi.x?1:r.yi.y?1:0),VN(n)}function VN(e){if(e.length<=1)return e.slice();const n=[];for(let i=0;i=2;){const l=n[n.length-1],u=n[n.length-2];if((l.x-u.x)*(o.y-u.y)>=(l.y-u.y)*(o.x-u.x))n.pop();else break}n.push(o)}n.pop();const r=[];for(let i=e.length-1;i>=0;i--){const o=e[i];for(;r.length>=2;){const l=r[r.length-1],u=r[r.length-2];if((l.x-u.x)*(o.y-u.y)>=(l.y-u.y)*(o.x-u.x))r.pop();else break}r.push(o)}return r.pop(),n.length===1&&r.length===1&&n[0].x===r[0].x&&n[0].y===r[0].y?n:n.concat(r)}var UN=H1,HN=B1,BN=q1,qN=G1,GN=Z1,ZN=Q1;function X1(e){var n,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(n=0;n{const r=new Array(e.length+n.length);for(let i=0;i({classGroupId:e,validator:n}),W1=(e=new Map,n=null,r)=>({nextPart:e,validators:n,classGroupId:r}),wu="-",nx=[],QN="arbitrary..",XN=e=>{const n=WN(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return JN(u);const d=u.split(wu),p=d[0]===""&&d.length>1?1:0;return e_(d,p,n)},getConflictingClassGroupIds:(u,d)=>{if(d){const p=i[u],m=r[u];return p?m?KN(m,p):p:m||nx}return r[u]||nx}}},e_=(e,n,r)=>{if(e.length-n===0)return r.classGroupId;const o=e[n],l=r.nextPart.get(o);if(l){const m=e_(e,n+1,l);if(m)return m}const u=r.validators;if(u===null)return;const d=n===0?e.join(wu):e.slice(n).join(wu),p=u.length;for(let m=0;me.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),r=n.indexOf(":"),i=n.slice(0,r);return i?QN+i:void 0})(),WN=e=>{const{theme:n,classGroups:r}=e;return eD(r,n)},eD=(e,n)=>{const r=W1();for(const i in e){const o=e[i];Up(o,r,i,n)}return r},Up=(e,n,r,i)=>{const o=e.length;for(let l=0;l{if(typeof e=="string"){nD(e,n,r);return}if(typeof e=="function"){rD(e,n,r,i);return}aD(e,n,r,i)},nD=(e,n,r)=>{const i=e===""?n:t_(n,e);i.classGroupId=r},rD=(e,n,r,i)=>{if(iD(e)){Up(e(i),n,r,i);return}n.validators===null&&(n.validators=[]),n.validators.push(YN(r,e))},aD=(e,n,r,i)=>{const o=Object.entries(e),l=o.length;for(let u=0;u{let r=e;const i=n.split(wu),o=i.length;for(let l=0;l"isThemeGetter"in e&&e.isThemeGetter===!0,sD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,r=Object.create(null),i=Object.create(null);const o=(l,u)=>{r[l]=u,n++,n>e&&(n=0,i=r,r=Object.create(null))};return{get(l){let u=r[l];if(u!==void 0)return u;if((u=i[l])!==void 0)return o(l,u),u},set(l,u){l in r?r[l]=u:o(l,u)}}},Am="!",rx=":",oD=[],ax=(e,n,r,i,o)=>({modifiers:e,hasImportantModifier:n,baseClassName:r,maybePostfixModifierPosition:i,isExternal:o}),lD=e=>{const{prefix:n,experimentalParseClassName:r}=e;let i=o=>{const l=[];let u=0,d=0,p=0,m;const y=o.length;for(let _=0;_p?m-p:void 0;return ax(l,x,b,w)};if(n){const o=n+rx,l=i;i=u=>u.startsWith(o)?l(u.slice(o.length)):ax(oD,!1,u,void 0,!0)}if(r){const o=i;i=l=>r({className:l,parseClassName:o})}return i},cD=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((r,i)=>{n.set(r,1e6+i)}),r=>{const i=[];let o=[];for(let l=0;l0&&(o.sort(),i.push(...o),o=[]),i.push(u)):o.push(u)}return o.length>0&&(o.sort(),i.push(...o)),i}},uD=e=>({cache:sD(e.cacheSize),parseClassName:lD(e),sortModifiers:cD(e),postfixLookupClassGroupIds:dD(e),...XN(e)}),dD=e=>{const n=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let i=0;i{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:l,postfixLookupClassGroupIds:u}=n,d=[],p=e.trim().split(fD);let m="";for(let y=p.length-1;y>=0;y-=1){const v=p[y],{isExternal:b,modifiers:x,hasImportantModifier:w,baseClassName:_,maybePostfixModifierPosition:E}=r(v);if(b){m=v+(m.length>0?" "+m:m);continue}let R=!!E,T;if(R){const F=_.substring(0,E);T=i(F);const V=T&&u[T]?i(_):void 0;V&&V!==T&&(T=V,R=!1)}else T=i(_);if(!T){if(!R){m=v+(m.length>0?" "+m:m);continue}if(T=i(_),!T){m=v+(m.length>0?" "+m:m);continue}R=!1}const O=x.length===0?"":x.length===1?x[0]:l(x).join(":"),M=w?O+Am:O,D=M+T;if(d.indexOf(D)>-1)continue;d.push(D);const P=o(T,R);for(let F=0;F0?" "+m:m)}return m},mD=(...e)=>{let n=0,r,i,o="";for(;n{if(typeof e=="string")return e;let n,r="";for(let i=0;i{let r,i,o,l;const u=p=>{const m=n.reduce((y,v)=>v(y),e());return r=uD(m),i=r.cache.get,o=r.cache.set,l=d,d(p)},d=p=>{const m=i(p);if(m)return m;const y=hD(p,r);return o(p,y),y};return l=u,(...p)=>l(mD(...p))},gD=[],Ht=e=>{const n=r=>r[e]||gD;return n.isThemeGetter=!0,n},r_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,a_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,vD=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,yD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,xD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ma=e=>vD.test(e),He=e=>!!e&&!Number.isNaN(Number(e)),Rr=e=>!!e&&Number.isInteger(Number(e)),Hh=e=>e.endsWith("%")&&He(e.slice(0,-1)),ea=e=>yD.test(e),i_=()=>!0,_D=e=>bD.test(e)&&!xD.test(e),Hp=()=>!1,CD=e=>wD.test(e),ED=e=>SD.test(e),RD=e=>!Ce(e)&&!Ee(e),jD=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),TD=e=>Qa(e,l_,Hp),Ce=e=>r_.test(e),yi=e=>Qa(e,c_,_D),ix=e=>Qa(e,LD,He),OD=e=>Qa(e,d_,i_),AD=e=>Qa(e,u_,Hp),sx=e=>Qa(e,s_,Hp),MD=e=>Qa(e,o_,ED),Kc=e=>Qa(e,f_,CD),Ee=e=>a_.test(e),Ho=e=>ki(e,c_),ND=e=>ki(e,u_),ox=e=>ki(e,s_),DD=e=>ki(e,l_),zD=e=>ki(e,o_),Yc=e=>ki(e,f_,!0),kD=e=>ki(e,d_,!0),Qa=(e,n,r)=>{const i=r_.exec(e);return i?i[1]?n(i[1]):r(i[2]):!1},ki=(e,n,r=!1)=>{const i=a_.exec(e);return i?i[1]?n(i[1]):r:!1},s_=e=>e==="position"||e==="percentage",o_=e=>e==="image"||e==="url",l_=e=>e==="length"||e==="size"||e==="bg-size",c_=e=>e==="length",LD=e=>e==="number",u_=e=>e==="family-name",d_=e=>e==="number"||e==="weight",f_=e=>e==="shadow",$D=()=>{const e=Ht("color"),n=Ht("font"),r=Ht("text"),i=Ht("font-weight"),o=Ht("tracking"),l=Ht("leading"),u=Ht("breakpoint"),d=Ht("container"),p=Ht("spacing"),m=Ht("radius"),y=Ht("shadow"),v=Ht("inset-shadow"),b=Ht("text-shadow"),x=Ht("drop-shadow"),w=Ht("blur"),_=Ht("perspective"),E=Ht("aspect"),R=Ht("ease"),T=Ht("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...M(),Ee,Ce],P=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],V=()=>[Ee,Ce,p],ve=()=>[Ma,"full","auto",...V()],be=()=>[Rr,"none","subgrid",Ee,Ce],he=()=>["auto",{span:["full",Rr,Ee,Ce]},Rr,Ee,Ce],ue=()=>[Rr,"auto",Ee,Ce],X=()=>["auto","min","max","fr",Ee,Ce],pe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ge=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...V()],Z=()=>[Ma,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],re=()=>[Ma,"screen","full","dvw","lvw","svw","min","max","fit",...V()],ee=()=>[Ma,"screen","full","lh","dvh","lvh","svh","min","max","fit",...V()],ne=()=>[e,Ee,Ce],z=()=>[...M(),ox,sx,{position:[Ee,Ce]}],N=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",DD,TD,{size:[Ee,Ce]}],J=()=>[Hh,Ho,yi],K=()=>["","none","full",m,Ee,Ce],le=()=>["",He,Ho,yi],ae=()=>["solid","dashed","dotted","double"],ye=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[He,Hh,ox,sx],Oe=()=>["","none",w,Ee,Ce],Ie=()=>["none",He,Ee,Ce],Ve=()=>["none",He,Ee,Ce],it=()=>[He,Ee,Ce],Qe=()=>[Ma,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ea],breakpoint:[ea],color:[i_],container:[ea],"drop-shadow":[ea],ease:["in","out","in-out"],font:[RD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ea],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ea],shadow:[ea],spacing:["px",He],text:[ea],"text-shadow":[ea],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ma,Ce,Ee,E]}],container:["container"],"container-type":[{"@container":["","normal","size",Ee,Ce]}],"container-named":[jD],columns:[{columns:[He,Ce,Ee,d]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ve()}],"inset-x":[{"inset-x":ve()}],"inset-y":[{"inset-y":ve()}],start:[{"inset-s":ve(),start:ve()}],end:[{"inset-e":ve(),end:ve()}],"inset-bs":[{"inset-bs":ve()}],"inset-be":[{"inset-be":ve()}],top:[{top:ve()}],right:[{right:ve()}],bottom:[{bottom:ve()}],left:[{left:ve()}],visibility:["visible","invisible","collapse"],z:[{z:[Rr,"auto",Ee,Ce]}],basis:[{basis:[Ma,"full","auto",d,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,Ma,"auto","initial","none",Ce]}],grow:[{grow:["",He,Ee,Ce]}],shrink:[{shrink:["",He,Ee,Ce]}],order:[{order:[Rr,"first","last","none",Ee,Ce]}],"grid-cols":[{"grid-cols":be()}],"col-start-end":[{col:he()}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":be()}],"row-start-end":[{row:he()}],"row-start":[{"row-start":ue()}],"row-end":[{"row-end":ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...pe(),"normal"]}],"justify-items":[{"justify-items":[...ge(),"normal"]}],"justify-self":[{"justify-self":["auto",...ge()]}],"align-content":[{content:["normal",...pe()]}],"align-items":[{items:[...ge(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ge(),{baseline:["","last"]}]}],"place-content":[{"place-content":pe()}],"place-items":[{"place-items":[...ge(),"baseline"]}],"place-self":[{"place-self":["auto",...ge()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pbs:[{pbs:V()}],pbe:[{pbe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...re()]}],"min-inline-size":[{"min-inline":["auto",...re()]}],"max-inline-size":[{"max-inline":["none",...re()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[d,"screen",...Z()]}],"min-w":[{"min-w":[d,"screen","none",...Z()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",r,Ho,yi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,kD,OD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Hh,Ce]}],"font-family":[{font:[ND,AD,n]}],"font-features":[{"font-features":[Ce]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Ee,Ce]}],"line-clamp":[{"line-clamp":[He,"none",Ee,ix]}],leading:[{leading:[l,...V()]}],"list-image":[{"list-image":["none",Ee,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ne()}],"text-color":[{text:ne()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",Ee,yi]}],"text-decoration-color":[{decoration:ne()}],"underline-offset":[{"underline-offset":[He,"auto",Ee,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"tab-size":[{tab:[Rr,Ee,Ce]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,Ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee,Ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:N()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Rr,Ee,Ce],radial:["",Ee,Ce],conic:[Rr,Ee,Ce]},zD,MD]}],"bg-color":[{bg:ne()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:ne()}],"gradient-via":[{via:ne()}],"gradient-to":[{to:ne()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":le()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:ne()}],"border-color-x":[{"border-x":ne()}],"border-color-y":[{"border-y":ne()}],"border-color-s":[{"border-s":ne()}],"border-color-e":[{"border-e":ne()}],"border-color-bs":[{"border-bs":ne()}],"border-color-be":[{"border-be":ne()}],"border-color-t":[{"border-t":ne()}],"border-color-r":[{"border-r":ne()}],"border-color-b":[{"border-b":ne()}],"border-color-l":[{"border-l":ne()}],"divide-color":[{divide:ne()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,Ee,Ce]}],"outline-w":[{outline:["",He,Ho,yi]}],"outline-color":[{outline:ne()}],shadow:[{shadow:["","none",y,Yc,Kc]}],"shadow-color":[{shadow:ne()}],"inset-shadow":[{"inset-shadow":["none",v,Yc,Kc]}],"inset-shadow-color":[{"inset-shadow":ne()}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ne()}],"ring-offset-w":[{"ring-offset":[He,yi]}],"ring-offset-color":[{"ring-offset":ne()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":ne()}],"text-shadow":[{"text-shadow":["none",b,Yc,Kc]}],"text-shadow-color":[{"text-shadow":ne()}],opacity:[{opacity:[He,Ee,Ce]}],"mix-blend":[{"mix-blend":[...ye(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ye()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":ne()}],"mask-image-linear-to-color":[{"mask-linear-to":ne()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":ne()}],"mask-image-t-to-color":[{"mask-t-to":ne()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":ne()}],"mask-image-r-to-color":[{"mask-r-to":ne()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":ne()}],"mask-image-b-to-color":[{"mask-b-to":ne()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":ne()}],"mask-image-l-to-color":[{"mask-l-to":ne()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":ne()}],"mask-image-x-to-color":[{"mask-x-to":ne()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":ne()}],"mask-image-y-to-color":[{"mask-y-to":ne()}],"mask-image-radial":[{"mask-radial":[Ee,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":ne()}],"mask-image-radial-to-color":[{"mask-radial-to":ne()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":ne()}],"mask-image-conic-to-color":[{"mask-conic-to":ne()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:N()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ce]}],filter:[{filter:["","none",Ee,Ce]}],blur:[{blur:Oe()}],brightness:[{brightness:[He,Ee,Ce]}],contrast:[{contrast:[He,Ee,Ce]}],"drop-shadow":[{"drop-shadow":["","none",x,Yc,Kc]}],"drop-shadow-color":[{"drop-shadow":ne()}],grayscale:[{grayscale:["",He,Ee,Ce]}],"hue-rotate":[{"hue-rotate":[He,Ee,Ce]}],invert:[{invert:["",He,Ee,Ce]}],saturate:[{saturate:[He,Ee,Ce]}],sepia:[{sepia:["",He,Ee,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ce]}],"backdrop-blur":[{"backdrop-blur":Oe()}],"backdrop-brightness":[{"backdrop-brightness":[He,Ee,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[He,Ee,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,Ee,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,Ee,Ce]}],"backdrop-invert":[{"backdrop-invert":["",He,Ee,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[He,Ee,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[He,Ee,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",He,Ee,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":V()}],"border-spacing-x":[{"border-spacing-x":V()}],"border-spacing-y":[{"border-spacing-y":V()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",Ee,Ce]}],ease:[{ease:["linear","initial",R,Ee,Ce]}],delay:[{delay:[He,Ee,Ce]}],animate:[{animate:["none",T,Ee,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Ee,Ce]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Ie()}],"rotate-x":[{"rotate-x":Ie()}],"rotate-y":[{"rotate-y":Ie()}],"rotate-z":[{"rotate-z":Ie()}],scale:[{scale:Ve()}],"scale-x":[{"scale-x":Ve()}],"scale-y":[{"scale-y":Ve()}],"scale-z":[{"scale-z":Ve()}],"scale-3d":["scale-3d"],skew:[{skew:it()}],"skew-x":[{"skew-x":it()}],"skew-y":[{"skew-y":it()}],transform:[{transform:[Ee,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Qe()}],"translate-x":[{"translate-x":Qe()}],"translate-y":[{"translate-y":Qe()}],"translate-z":[{"translate-z":Qe()}],"translate-none":["translate-none"],zoom:[{zoom:[Rr,Ee,Ce]}],accent:[{accent:ne()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ne()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ee,Ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":ne()}],"scrollbar-track-color":[{"scrollbar-track":ne()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mbs":[{"scroll-mbs":V()}],"scroll-mbe":[{"scroll-mbe":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pbs":[{"scroll-pbs":V()}],"scroll-pbe":[{"scroll-pbe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ee,Ce]}],fill:[{fill:["none",...ne()]}],"stroke-w":[{stroke:[He,Ho,yi,ix]}],stroke:[{stroke:["none",...ne()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ID=pD($D);function Je(...e){return ID(J1(e))}function PD({delayDuration:e=0,...n}){return f.jsx(UN,{"data-slot":"tooltip-provider",delayDuration:e,...n})}function FD({...e}){return f.jsx(HN,{"data-slot":"tooltip",...e})}function VD({...e}){return f.jsx(BN,{"data-slot":"tooltip-trigger",...e})}function UD({className:e,sideOffset:n=0,children:r,...i}){return f.jsx(qN,{children:f.jsxs(GN,{"data-slot":"tooltip-content",sideOffset:n,className:Je("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...i,children:[r,f.jsx(ZN,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const Mm=new Set;function HD(e){return Mm.add(e),()=>Mm.delete(e)}function BD(){for(const e of Mm)e()}const h_=(...e)=>e.filter((n,r,i)=>!!n&&n.trim()!==""&&i.indexOf(n)===r).join(" ").trim();const qD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const GD=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,r,i)=>i?i.toUpperCase():r.toLowerCase());const lx=e=>{const n=GD(e);return n.charAt(0).toUpperCase()+n.slice(1)};var Bh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ZD=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},KD=S.createContext({}),YD=()=>S.useContext(KD),QD=S.forwardRef(({color:e,size:n,strokeWidth:r,absoluteStrokeWidth:i,className:o="",children:l,iconNode:u,...d},p)=>{const{size:m=24,strokeWidth:y=2,absoluteStrokeWidth:v=!1,color:b="currentColor",className:x=""}=YD()??{},w=i??v?Number(r??y)*24/Number(n??m):r??y;return S.createElement("svg",{ref:p,...Bh,width:n??m??Bh.width,height:n??m??Bh.height,stroke:e??b,strokeWidth:w,className:h_("lucide",x,o),...!l&&!ZD(d)&&{"aria-hidden":"true"},...d},[...u.map(([_,E])=>S.createElement(_,E)),...Array.isArray(l)?l:[l]])});const Me=(e,n)=>{const r=S.forwardRef(({className:i,...o},l)=>S.createElement(QD,{ref:l,iconNode:n,className:h_(`lucide-${qD(lx(e))}`,`lucide-${e}`,i),...o}));return r.displayName=lx(e),r};const XD=[["path",{d:"M4.5 3h15",key:"c7n0jr"}],["path",{d:"M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3",key:"m1uhx7"}],["path",{d:"M6 14h12",key:"4cwo0f"}]],JD=Me("beaker",XD);const WD=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],ez=Me("book-open",WD);const tz=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],nz=Me("briefcase",tz);const rz=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],az=Me("bug",rz);const iz=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],sz=Me("calendar",iz);const oz=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],m_=Me("check",oz);const lz=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Bp=Me("chevron-down",lz);const cz=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],uz=Me("chevron-right",cz);const dz=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],fz=Me("chevron-up",dz);const hz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],mz=Me("circle-check",hz);const pz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],p_=Me("clock",pz);const gz=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],vz=Me("code",gz);const yz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],bz=Me("compass",yz);const xz=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],wz=Me("copy",xz);const Sz=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],_z=Me("credit-card",Sz);const Cz=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Ez=Me("database",Cz);const Rz=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],jz=Me("download",Rz);const Tz=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Oz=Me("ellipsis",Tz);const Az=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],g_=Me("file-text",Az);const Mz=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],Nz=Me("flag",Mz);const Dz=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],qp=Me("folder",Dz);const zz=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],kz=Me("gauge",zz);const Lz=[["path",{d:"m14 13-8.381 8.38a1 1 0 0 1-3.001-3l8.384-8.381",key:"pgg06f"}],["path",{d:"m16 16 6-6",key:"vzrcl6"}],["path",{d:"m21.5 10.5-8-8",key:"a17d9x"}],["path",{d:"m8 8 6-6",key:"18bi4p"}],["path",{d:"m8.5 7.5 8 8",key:"1oyaui"}]],$z=Me("gavel",Lz);const Iz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],v_=Me("globe",Iz);const Pz=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],Fz=Me("graduation-cap",Pz);const Vz=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],Uz=Me("heart",Vz);const Hz=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Bz=Me("history",Hz);const qz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Gz=Me("image",qz);const Zz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Kz=Me("info",Zz);const Yz=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Qz=Me("layout-dashboard",Yz);const Xz=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Jz=Me("lightbulb",Xz);const Wz=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],ek=Me("link",Wz);const tk=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],nk=Me("loader-circle",tk);const rk=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],y_=Me("lock",rk);const ak=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],ik=Me("log-out",ak);const sk=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],ok=Me("megaphone",sk);const lk=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],ck=Me("menu",lk);const uk=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],dk=Me("music",uk);const fk=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],hk=Me("octagon-x",fk);const mk=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],pk=Me("package",mk);const gk=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],vk=Me("pen-line",gk);const yk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],bk=Me("plus",yk);const xk=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],wk=Me("rocket",xk);const Sk=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],b_=Me("search",Sk);const _k=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ck=Me("settings",_k);const Ek=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],Rk=Me("share-2",Ek);const jk=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],x_=Me("shield",jk);const Tk=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],w_=Me("square-terminal",Tk);const Ok=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Ak=Me("star",Ok);const Mk=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Nk=Me("trash-2",Mk);const Dk=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],S_=Me("triangle-alert",Dk);const zk=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],kk=Me("upload",zk);const Lk=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],__=Me("users",Lk);const $k=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Ik=Me("wrench",$k);const Pk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],C_=Me("x",Pk);function Fk(){const e=!document.body.classList.contains("sb-open");document.body.classList.toggle("sb-open"),Qu(),e?document.getElementById("sidebar")?.querySelector(Vk)?.focus():document.getElementById("menu-btn")?.focus()}const Vk='a[href], button:not(:disabled), select, input, [tabindex]:not([tabindex="-1"])';function mr(){const e=document.body.classList.contains("sb-open");document.body.classList.remove("sb-open"),Qu(),e&&window.innerWidth<=ou&&document.getElementById("menu-btn")?.focus()}const ou=900;function Qu(){const e=document.getElementById("sidebar");if(!e)return;const n=document.body.classList.contains("sb-open");window.innerWidth<=ou&&!n?e.setAttribute("inert",""):e.removeAttribute("inert");const i=document.getElementById("main");i&&(n&&window.innerWidth<=ou?i.setAttribute("inert",""):i.removeAttribute("inert")),e.setAttribute("aria-modal",String(n&&window.innerWidth<=ou)),document.getElementById("menu-btn")?.setAttribute("aria-expanded",String(n))}typeof window<"u"&&(window.addEventListener("resize",Qu),window.addEventListener("keydown",e=>{e.key==="Escape"&&document.body.classList.contains("sb-open")&&mr()}));const Uk={alert:S_,card:_z,check:m_,chev:uz,chevd:Bp,clock:p_,copy:wz,doc:g_,dots:Oz,download:jz,folder:qp,dashboard:Qz,gear:Ck,globe:v_,hist:Bz,link:ek,lock:y_,menu:ck,plus:bk,power:ik,search:b_,share:Rk,shield:x_,terminal:w_,trash:Nk,upload:kk,users:__,x:C_};function ut({name:e}){const n=Uk[e];return n?f.jsx(n,{className:"ico","aria-hidden":"true"}):null}const Nm={folder:qp,"book-open":ez,"file-text":g_,"pen-line":vk,users:__,briefcase:nz,megaphone:ok,rocket:wk,lightbulb:Jz,flag:Nz,star:Ak,heart:Uz,code:vz,"square-terminal":w_,bug:az,wrench:Ik,database:Ez,package:pk,beaker:JD,gauge:kz,shield:x_,lock:y_,gavel:$z,globe:v_,compass:bz,calendar:sz,clock:p_,"graduation-cap":Fz,image:Gz,music:dk};function Ls({name:e,className:n}){const r=e??"",i=Object.hasOwn(Nm,r)?Nm[r]:qp;return f.jsx(i,{className:n,"aria-hidden":"true"})}function Hk({size:e=22}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 32 32",fill:"currentColor",role:"img","aria-label":"BearDrive",children:[f.jsx("rect",{x:"4",y:"4",width:"5.6",height:"24"}),f.jsx("rect",{x:"11.2",y:"4",width:"14.4",height:"11.2"}),f.jsx("rect",{x:"11.2",y:"16.8",width:"16.8",height:"11.2"})]})}function Su(e){const n=["page",e.width??"app",e.className].filter(Boolean).join(" ");return f.jsx("div",{className:n,children:e.children})}function Bk(e){e&&Qu()}function ul(e){return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"sb-backdrop",onClick:mr}),f.jsxs("aside",{id:"sidebar",ref:Bk,children:[e.vault,e.projectsNav,e.tree??f.jsx("nav",{id:"tree","aria-label":"Files"}),e.orgBar]}),f.jsxs("main",{id:"main",children:[e.topbar,f.jsx("article",{id:"content",ref:e.contentRef,onScroll:e.onContentScroll,children:e.children})]})]})}function Xu(e){const{name:n,onHome:r,showSignout:i,search:o}=e;return f.jsxs("header",{id:"vault",children:[f.jsx("span",{id:"vault-badge",children:f.jsx(Hk,{size:22})}),f.jsx("span",{id:"vault-name",className:r?"vault-link":void 0,onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,onKeyDown:l=>{r&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r())},children:n}),f.jsxs("div",{className:"vault-actions",children:[o&&f.jsxs(FD,{delayDuration:150,children:[f.jsx(VD,{asChild:!0,children:f.jsx("button",{id:"search-btn",className:"icon-btn2","aria-label":"Search",onClick:()=>{BD(),mr()},children:f.jsx(ut,{name:"search"})})}),f.jsxs(UD,{className:"tipcard",sideOffset:6,children:["Search ",f.jsx("kbd",{children:"⌘K"})]})]}),i&&f.jsx("a",{id:"signout",href:"/auth/logout",title:"Sign out","aria-label":"Sign out",children:f.jsx(ut,{name:"power"})})]})]})}function dl(e){return f.jsxs("header",{id:"topbar",children:[f.jsx("button",{id:"menu-btn",className:"icon-btn",title:"Menu","aria-label":"Menu","aria-controls":"sidebar","aria-expanded":"false",onClick:Fk,children:f.jsx(ut,{name:"menu"})}),f.jsx("span",{id:"crumb",children:e.crumb}),f.jsx("span",{id:"meta",children:e.meta}),e.actions]})}function qk(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const Gk=e=>{switch(e){case"success":return Yk;case"info":return Xk;case"warning":return Qk;case"error":return Jk;default:return null}},Zk=Array(12).fill(0),Kk=({visible:e,className:n})=>me.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},me.createElement("div",{className:"sonner-spinner"},Zk.map((r,i)=>me.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),Yk=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Qk=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Xk=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Jk=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Wk=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},me.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),me.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),e3=()=>{const[e,n]=me.useState(document.hidden);return me.useEffect(()=>{const r=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Dm=1;class t3{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const r=this.subscribers.indexOf(n);this.subscribers.splice(r,1)}),this.publish=n=>{this.subscribers.forEach(r=>r(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var r;const{message:i,...o}=n,l=typeof n?.id=="number"||((r=n.id)==null?void 0:r.length)>0?n.id:Dm++,u=this.toasts.find(p=>p.id===l),d=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),u?this.toasts=this.toasts.map(p=>p.id===l?(this.publish({...p,...n,id:l,title:i}),{...p,...n,id:l,dismissible:d,title:i}):p):this.addToast({title:i,...o,dismissible:d,id:l}),l},this.dismiss=n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:n,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(i=>i({id:r.id,dismiss:!0}))}),n),this.message=(n,r)=>this.create({...r,message:n}),this.error=(n,r)=>this.create({...r,message:n,type:"error"}),this.success=(n,r)=>this.create({...r,type:"success",message:n}),this.info=(n,r)=>this.create({...r,type:"info",message:n}),this.warning=(n,r)=>this.create({...r,type:"warning",message:n}),this.loading=(n,r)=>this.create({...r,type:"loading",message:n}),this.promise=(n,r)=>{if(!r)return;let i;r.loading!==void 0&&(i=this.create({...r,promise:n,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const o=Promise.resolve(n instanceof Function?n():n);let l=i!==void 0,u;const d=o.then(async m=>{if(u=["resolve",m],me.isValidElement(m))l=!1,this.create({id:i,type:"default",message:m});else if(r3(m)&&!m.ok){l=!1;const v=typeof r.error=="function"?await r.error(`HTTP error! status: ${m.status}`):r.error,b=typeof r.description=="function"?await r.description(`HTTP error! status: ${m.status}`):r.description,w=typeof v=="object"&&!me.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:b,...w})}else if(m instanceof Error){l=!1;const v=typeof r.error=="function"?await r.error(m):r.error,b=typeof r.description=="function"?await r.description(m):r.description,w=typeof v=="object"&&!me.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:b,...w})}else if(r.success!==void 0){l=!1;const v=typeof r.success=="function"?await r.success(m):r.success,b=typeof r.description=="function"?await r.description(m):r.description,w=typeof v=="object"&&!me.isValidElement(v)?v:{message:v};this.create({id:i,type:"success",description:b,...w})}}).catch(async m=>{if(u=["reject",m],r.error!==void 0){l=!1;const y=typeof r.error=="function"?await r.error(m):r.error,v=typeof r.description=="function"?await r.description(m):r.description,x=typeof y=="object"&&!me.isValidElement(y)?y:{message:y};this.create({id:i,type:"error",description:v,...x})}}).finally(()=>{l&&(this.dismiss(i),i=void 0),r.finally==null||r.finally.call(r)}),p=()=>new Promise((m,y)=>d.then(()=>u[0]==="reject"?y(u[1]):m(u[1])).catch(y));return typeof i!="string"&&typeof i!="number"?{unwrap:p}:Object.assign(i,{unwrap:p})},this.custom=(n,r)=>{const i=r?.id||Dm++;return this.create({jsx:n(i),id:i,...r}),i},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Tn=new t3,n3=(e,n)=>{const r=n?.id||Dm++;return Tn.addToast({title:e,...n,id:r}),r},r3=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",a3=n3,i3=()=>Tn.toasts,s3=()=>Tn.getActiveToasts(),cx=Object.assign(a3,{success:Tn.success,info:Tn.info,warning:Tn.warning,error:Tn.error,custom:Tn.custom,message:Tn.message,promise:Tn.promise,dismiss:Tn.dismiss,loading:Tn.loading},{getHistory:i3,getToasts:s3});qk("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Qc(e){return e.label!==void 0}const o3=3,l3="24px",c3="16px",ux=4e3,u3=356,d3=14,f3=45,h3=200;function jr(...e){return e.filter(Boolean).join(" ")}function m3(e){const[n,r]=e.split("-"),i=[];return n&&i.push(n),r&&i.push(r),i}const p3=e=>{var n,r,i,o,l,u,d,p,m;const{invert:y,toast:v,unstyled:b,interacting:x,setHeights:w,visibleToasts:_,heights:E,index:R,toasts:T,expanded:O,removeToast:M,defaultRichColors:D,closeButton:P,style:F,cancelButtonStyle:V,actionButtonStyle:ve,className:be="",descriptionClassName:he="",duration:ue,position:X,gap:pe,expandByDefault:ge,classNames:L,icons:Z,closeButtonAriaLabel:re="Close toast"}=e,[ee,ne]=me.useState(null),[z,N]=me.useState(null),[B,J]=me.useState(!1),[K,le]=me.useState(!1),[ae,ye]=me.useState(!1),[xe,Oe]=me.useState(!1),[Ie,Ve]=me.useState(!1),[it,Qe]=me.useState(0),[fn,hn]=me.useState(0),Qt=me.useRef(v.duration||ue||ux),br=me.useRef(null),jt=me.useRef(null),rr=R===0,xr=R+1<=_,Tt=v.type,Vn=v.dismissible!==!1,Dt=v.className||"",kr=v.descriptionClassName||"",ar=me.useMemo(()=>E.findIndex(Ne=>Ne.toastId===v.id)||0,[E,v.id]),ir=me.useMemo(()=>{var Ne;return(Ne=v.closeButton)!=null?Ne:P},[v.closeButton,P]),wr=me.useMemo(()=>v.duration||ue||ux,[v.duration,ue]),sr=me.useRef(0),mn=me.useRef(0),A=me.useRef(0),I=me.useRef(null),[U,ce]=X.split("-"),Y=me.useMemo(()=>E.reduce((Ne,ht,yt)=>yt>=ar?Ne:Ne+ht.height,0),[E,ar]),W=e3(),de=v.invert||y,we=Tt==="loading";mn.current=me.useMemo(()=>ar*pe+Y,[ar,Y]),me.useEffect(()=>{Qt.current=wr},[wr]),me.useEffect(()=>{J(!0)},[]),me.useEffect(()=>{const Ne=jt.current;if(Ne){const ht=Ne.getBoundingClientRect().height;return hn(ht),w(yt=>[{toastId:v.id,height:ht,position:v.position},...yt]),()=>w(yt=>yt.filter(qt=>qt.toastId!==v.id))}},[w,v.id]),me.useLayoutEffect(()=>{if(!B)return;const Ne=jt.current,ht=Ne.style.height;Ne.style.height="auto";const yt=Ne.getBoundingClientRect().height;Ne.style.height=ht,hn(yt),w(qt=>qt.find(St=>St.toastId===v.id)?qt.map(St=>St.toastId===v.id?{...St,height:yt}:St):[{toastId:v.id,height:yt,position:v.position},...qt])},[B,v.title,v.description,w,v.id,v.jsx,v.action,v.cancel]);const _e=me.useCallback(()=>{le(!0),Qe(mn.current),w(Ne=>Ne.filter(ht=>ht.toastId!==v.id)),setTimeout(()=>{M(v)},h3)},[v,M,w,mn]);me.useEffect(()=>{if(v.promise&&Tt==="loading"||v.duration===1/0||v.type==="loading")return;let Ne;return O||x||W?(()=>{if(A.current{v.onAutoClose==null||v.onAutoClose.call(v,v),_e()},Qt.current)),()=>clearTimeout(Ne)},[O,x,v,Tt,W,_e]),me.useEffect(()=>{v.delete&&(_e(),v.onDismiss==null||v.onDismiss.call(v,v))},[_e,v.delete]);function Xe(){var Ne;if(Z?.loading){var ht;return me.createElement("div",{className:jr(L?.loader,v==null||(ht=v.classNames)==null?void 0:ht.loader,"sonner-loader"),"data-visible":Tt==="loading"},Z.loading)}return me.createElement(Kk,{className:jr(L?.loader,v==null||(Ne=v.classNames)==null?void 0:Ne.loader),visible:Tt==="loading"})}const wt=v.icon||Z?.[Tt]||Gk(Tt);var Xt,zt;return me.createElement("li",{tabIndex:0,ref:jt,className:jr(be,Dt,L?.toast,v==null||(n=v.classNames)==null?void 0:n.toast,L?.default,L?.[Tt],v==null||(r=v.classNames)==null?void 0:r[Tt]),"data-sonner-toast":"","data-rich-colors":(Xt=v.richColors)!=null?Xt:D,"data-styled":!(v.jsx||v.unstyled||b),"data-mounted":B,"data-promise":!!v.promise,"data-swiped":Ie,"data-removed":K,"data-visible":xr,"data-y-position":U,"data-x-position":ce,"data-index":R,"data-front":rr,"data-swiping":ae,"data-dismissible":Vn,"data-type":Tt,"data-invert":de,"data-swipe-out":xe,"data-swipe-direction":z,"data-expanded":!!(O||ge&&B),"data-testid":v.testId,style:{"--index":R,"--toasts-before":R,"--z-index":T.length-R,"--offset":`${K?it:mn.current}px`,"--initial-height":ge?"auto":`${fn}px`,...F,...v.style},onDragEnd:()=>{ye(!1),ne(null),I.current=null},onPointerDown:Ne=>{Ne.button!==2&&(we||!Vn||(br.current=new Date,Qe(mn.current),Ne.target.setPointerCapture(Ne.pointerId),Ne.target.tagName!=="BUTTON"&&(ye(!0),I.current={x:Ne.clientX,y:Ne.clientY})))},onPointerUp:()=>{var Ne,ht,yt;if(xe||!Vn)return;I.current=null;const qt=Number(((Ne=jt.current)==null?void 0:Ne.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),or=Number(((ht=jt.current)==null?void 0:ht.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),St=new Date().getTime()-((yt=br.current)==null?void 0:yt.getTime()),yn=ee==="x"?qt:or,Wa=Math.abs(yn)/St;if(Math.abs(yn)>=f3||Wa>.11){Qe(mn.current),v.onDismiss==null||v.onDismiss.call(v,v),N(ee==="x"?qt>0?"right":"left":or>0?"down":"up"),_e(),Oe(!0);return}else{var bn,xn;(bn=jt.current)==null||bn.style.setProperty("--swipe-amount-x","0px"),(xn=jt.current)==null||xn.style.setProperty("--swipe-amount-y","0px")}Ve(!1),ye(!1),ne(null)},onPointerMove:Ne=>{var ht,yt,qt;if(!I.current||!Vn||((ht=window.getSelection())==null?void 0:ht.toString().length)>0)return;const St=Ne.clientY-I.current.y,yn=Ne.clientX-I.current.x;var Wa;const bn=(Wa=e.swipeDirections)!=null?Wa:m3(X);!ee&&(Math.abs(yn)>1||Math.abs(St)>1)&&ne(Math.abs(yn)>Math.abs(St)?"x":"y");let xn={x:0,y:0};const $i=lr=>1/(1.5+Math.abs(lr)/20);if(ee==="y"){if(bn.includes("top")||bn.includes("bottom"))if(bn.includes("top")&&St<0||bn.includes("bottom")&&St>0)xn.y=St;else{const lr=St*$i(St);xn.y=Math.abs(lr)0)xn.x=yn;else{const lr=yn*$i(yn);xn.x=Math.abs(lr)0||Math.abs(xn.y)>0)&&Ve(!0),(yt=jt.current)==null||yt.style.setProperty("--swipe-amount-x",`${xn.x}px`),(qt=jt.current)==null||qt.style.setProperty("--swipe-amount-y",`${xn.y}px`)}},ir&&!v.jsx&&Tt!=="loading"?me.createElement("button",{"aria-label":re,"data-disabled":we,"data-close-button":!0,onClick:we||!Vn?()=>{}:()=>{_e(),v.onDismiss==null||v.onDismiss.call(v,v)},className:jr(L?.closeButton,v==null||(i=v.classNames)==null?void 0:i.closeButton)},(zt=Z?.close)!=null?zt:Wk):null,(Tt||v.icon||v.promise)&&v.icon!==null&&(Z?.[Tt]!==null||v.icon)?me.createElement("div",{"data-icon":"",className:jr(L?.icon,v==null||(o=v.classNames)==null?void 0:o.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||Xe():null,v.type!=="loading"?wt:null):null,me.createElement("div",{"data-content":"",className:jr(L?.content,v==null||(l=v.classNames)==null?void 0:l.content)},me.createElement("div",{"data-title":"",className:jr(L?.title,v==null||(u=v.classNames)==null?void 0:u.title)},v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title),v.description?me.createElement("div",{"data-description":"",className:jr(he,kr,L?.description,v==null||(d=v.classNames)==null?void 0:d.description)},typeof v.description=="function"?v.description():v.description):null),me.isValidElement(v.cancel)?v.cancel:v.cancel&&Qc(v.cancel)?me.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||V,onClick:Ne=>{Qc(v.cancel)&&Vn&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,Ne),_e())},className:jr(L?.cancelButton,v==null||(p=v.classNames)==null?void 0:p.cancelButton)},v.cancel.label):null,me.isValidElement(v.action)?v.action:v.action&&Qc(v.action)?me.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||ve,onClick:Ne=>{Qc(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,Ne),!Ne.defaultPrevented&&_e())},className:jr(L?.actionButton,v==null||(m=v.classNames)==null?void 0:m.actionButton)},v.action.label):null)};function dx(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function g3(e,n){const r={};return[e,n].forEach((i,o)=>{const l=o===1,u=l?"--mobile-offset":"--offset",d=l?c3:l3;function p(m){["top","right","bottom","left"].forEach(y=>{r[`${u}-${y}`]=typeof m=="number"?`${m}px`:m})}typeof i=="number"||typeof i=="string"?p(i):typeof i=="object"?["top","right","bottom","left"].forEach(m=>{i[m]===void 0?r[`${u}-${m}`]=d:r[`${u}-${m}`]=typeof i[m]=="number"?`${i[m]}px`:i[m]}):p(d)}),r}const v3=me.forwardRef(function(n,r){const{id:i,invert:o,position:l="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:p,className:m,offset:y,mobileOffset:v,theme:b="light",richColors:x,duration:w,style:_,visibleToasts:E=o3,toastOptions:R,dir:T=dx(),gap:O=d3,icons:M,containerAriaLabel:D="Notifications"}=n,[P,F]=me.useState([]),V=me.useMemo(()=>i?P.filter(B=>B.toasterId===i):P.filter(B=>!B.toasterId),[P,i]),ve=me.useMemo(()=>Array.from(new Set([l].concat(V.filter(B=>B.position).map(B=>B.position)))),[V,l]),[be,he]=me.useState([]),[ue,X]=me.useState(!1),[pe,ge]=me.useState(!1),[L,Z]=me.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),re=me.useRef(null),ee=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),ne=me.useRef(null),z=me.useRef(!1),N=me.useCallback(B=>{F(J=>{var K;return(K=J.find(le=>le.id===B.id))!=null&&K.delete||Tn.dismiss(B.id),J.filter(({id:le})=>le!==B.id)})},[]);return me.useEffect(()=>Tn.subscribe(B=>{if(B.dismiss){requestAnimationFrame(()=>{F(J=>J.map(K=>K.id===B.id?{...K,delete:!0}:K))});return}setTimeout(()=>{xj.flushSync(()=>{F(J=>{const K=J.findIndex(le=>le.id===B.id);return K!==-1?[...J.slice(0,K),{...J[K],...B},...J.slice(K+1)]:[B,...J]})})})}),[P]),me.useEffect(()=>{if(b!=="system"){Z(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;const B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:J})=>{Z(J?"dark":"light")})}catch{B.addListener(({matches:K})=>{try{Z(K?"dark":"light")}catch(le){console.error(le)}})}},[b]),me.useEffect(()=>{P.length<=1&&X(!1)},[P]),me.useEffect(()=>{const B=J=>{var K;if(u.every(ye=>J[ye]||J.code===ye)){var ae;X(!0),(ae=re.current)==null||ae.focus()}J.code==="Escape"&&(document.activeElement===re.current||(K=re.current)!=null&&K.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[u]),me.useEffect(()=>{if(re.current)return()=>{ne.current&&(ne.current.focus({preventScroll:!0}),ne.current=null,z.current=!1)}},[re.current]),me.createElement("section",{ref:r,"aria-label":`${D} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ve.map((B,J)=>{var K;const[le,ae]=B.split("-");return V.length?me.createElement("ol",{key:B,dir:T==="auto"?dx():T,tabIndex:-1,ref:re,className:m,"data-sonner-toaster":!0,"data-sonner-theme":L,"data-y-position":le,"data-x-position":ae,style:{"--front-toast-height":`${((K=be[0])==null?void 0:K.height)||0}px`,"--width":`${u3}px`,"--gap":`${O}px`,..._,...g3(y,v)},onBlur:ye=>{z.current&&!ye.currentTarget.contains(ye.relatedTarget)&&(z.current=!1,ne.current&&(ne.current.focus({preventScroll:!0}),ne.current=null))},onFocus:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||z.current||(z.current=!0,ne.current=ye.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{pe||X(!1)},onDragEnd:()=>X(!1),onPointerDown:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||ge(!0)},onPointerUp:()=>ge(!1)},V.filter(ye=>!ye.position&&J===0||ye.position===B).map((ye,xe)=>{var Oe,Ie;return me.createElement(p3,{key:ye.id,icons:M,index:xe,toast:ye,defaultRichColors:x,duration:(Oe=R?.duration)!=null?Oe:w,className:R?.className,descriptionClassName:R?.descriptionClassName,invert:o,visibleToasts:E,closeButton:(Ie=R?.closeButton)!=null?Ie:p,interacting:pe,position:B,style:R?.style,unstyled:R?.unstyled,classNames:R?.classNames,cancelButtonStyle:R?.cancelButtonStyle,actionButtonStyle:R?.actionButtonStyle,closeButtonAriaLabel:R?.closeButtonAriaLabel,removeToast:N,toasts:V.filter(Ve=>Ve.position==ye.position),heights:be.filter(Ve=>Ve.position==ye.position),setHeights:he,expandByDefault:d,gap:O,expanded:ue,swipeDirections:n.swipeDirections})})):null}))}),y3=({...e})=>f.jsx(v3,{theme:"dark",className:"toaster group",icons:{success:f.jsx(mz,{className:"size-4"}),info:f.jsx(Kz,{className:"size-4"}),warning:f.jsx(S_,{className:"size-4"}),error:f.jsx(hk,{className:"size-4"}),loading:f.jsx(nk,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius-ctl)"},...e});function Ke(e,n=!1){n?cx.error(e,{duration:1/0,closeButton:!0}):cx(e)}function b3(){return f.jsx(y3,{position:"bottom-center"})}const fx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,hx=J1,x3=(e,n)=>r=>{var i;if(n?.variants==null)return hx(e,r?.class,r?.className);const{variants:o,defaultVariants:l}=n,u=Object.keys(o).map(m=>{const y=r?.[m],v=l?.[m];if(y===null)return null;const b=fx(y)||fx(v);return o[m][b]}),d=r&&Object.entries(r).reduce((m,y)=>{let[v,b]=y;return b===void 0||(m[v]=b),m},{}),p=n==null||(i=n.compoundVariants)===null||i===void 0?void 0:i.reduce((m,y)=>{let{class:v,className:b,...x}=y;return Object.entries(x).every(w=>{let[_,E]=w;return Array.isArray(E)?E.includes({...l,...d}[_]):{...l,...d}[_]===E})?[...m,v,b]:m},[]);return hx(e,u,p,r?.class,r?.className)},w3=x3("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[background-color,border-color,color] disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",primary:"pbtn",danger:"danger-btn",subtle:"ai-btn",toolbar:"btn",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function vt({className:e,variant:n="default",size:r="default",asChild:i=!1,...o}){const l=i?wj:"button";return f.jsx(l,{"data-slot":"button","data-variant":n,"data-size":r,className:Je(w3({variant:n,size:r,className:e})),...o})}function Ju({...e}){return f.jsx(hp,{"data-slot":"dialog",...e})}function S3({...e}){return f.jsx(pp,{"data-slot":"dialog-portal",...e})}function _3({className:e,...n}){return f.jsx(gp,{"data-slot":"dialog-overlay",className:Je("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...n})}function Wu({className:e,children:n,showCloseButton:r=!0,...i}){return f.jsxs(S3,{"data-slot":"dialog-portal",children:[f.jsx(_3,{}),f.jsxs(vp,{"data-slot":"dialog-content",className:Je("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...i,children:[n,r&&f.jsxs(aS,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[f.jsx(C_,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function _l({className:e,...n}){return f.jsx(tS,{"data-slot":"dialog-title",className:Je("text-lg leading-none font-semibold",e),...n})}let E_=null,lu=[];function Cl(e){E_=e,lu.forEach(n=>n())}function R_(e,n,r="",i="OK",o={}){return new Promise(l=>Cl({kind:"prompt",title:e,label:n,value:r,okLabel:i,...o,resolve:l}))}function Hs(e,n,r="Confirm",i=!1){return new Promise(o=>Cl({kind:"confirm",title:e,message:n,confirmLabel:r,danger:i,resolve:o}))}function C3(){const e=S.useSyncExternalStore(r=>(lu.push(r),()=>{lu=lu.filter(i=>i!==r)}),()=>E_);if(!e)return null;const n=()=>{Cl(null),e.kind==="prompt"?e.resolve(null):e.resolve(!1)};return f.jsx(Ju,{open:!0,onOpenChange:r=>!r&&n(),children:f.jsx(Wu,{className:"modal",showCloseButton:!1,children:e.kind==="prompt"?f.jsx(E3,{m:e}):f.jsx(R3,{m:e})})})}function E3({m:e}){const n=S.useRef(null),r=m=>{Cl(null),e.resolve(m)},[i,o]=S.useState(""),[l,u]=S.useState(e.value),d=e.match===void 0||l.trim()===e.match,p=()=>{const m=l;if(d){if(!m.trim()){o("Give it a name."),n.current.focus();return}r(m)}};return f.jsxs(f.Fragment,{children:[f.jsx(_l,{asChild:!0,children:f.jsx("h3",{children:e.title})}),f.jsx("label",{className:"modal-label",htmlFor:"modal-input",children:e.label}),f.jsx("input",{className:"modal-input",type:"text",autoComplete:"off",value:l,ref:n,id:"modal-input",autoFocus:!0,onFocus:m=>m.currentTarget.select(),"aria-invalid":!!i,"aria-describedby":i?"modal-input-err":void 0,onChange:m=>{u(m.currentTarget.value),i&&o("")},onKeyDown:m=>m.key==="Enter"&&p()}),i&&f.jsx("span",{id:"modal-input-err",role:"alert",className:"field-err",children:i}),f.jsxs("div",{className:"modal-actions",children:[f.jsx(vt,{variant:"subtle",onClick:()=>r(null),children:"Cancel"}),f.jsx(vt,{variant:e.danger?"danger":"primary",onClick:p,disabled:!d,children:e.okLabel})]})]})}function R3({m:e}){const n=r=>{Cl(null),e.resolve(r)};return f.jsxs(f.Fragment,{children:[f.jsx(_l,{asChild:!0,children:f.jsx("h3",{children:e.title})}),f.jsx("p",{className:"modal-msg",children:e.message}),f.jsxs("div",{className:"modal-actions",children:[f.jsx(vt,{variant:"subtle",onClick:()=>n(!1),autoFocus:e.danger,children:"Cancel"}),f.jsx(vt,{variant:e.danger?"danger":"primary",onClick:()=>n(!0),autoFocus:!e.danger,children:e.confirmLabel})]})]})}function j3(e){return Pt({queryKey:["projects"],queryFn:()=>Bt("/api/projects"),enabled:e,refetchInterval:3e4,select:n=>n.projects||[]})}function T3(e){return Pt({queryKey:["orgs"],queryFn:()=>Bt("/api/orgs"),enabled:e,select:n=>n.orgs||[]})}function O3(e){return Pt({queryKey:["permissions",e],queryFn:()=>Bt(`/api/p/${e}/permissions`),enabled:!!e})}function j_(e,n=!0){return Pt({queryKey:["shares",e],queryFn:()=>Bt(`/api/p/${e}/shares`),enabled:!!e&&n,select:r=>r.shares||[]})}function T_(e){return Pt({queryKey:["admin","pending"],queryFn:()=>Bt("/api/admin/pending"),enabled:e,select:n=>n.pending||[]})}function O_(){const e=Ai();return()=>Promise.all([e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["orgs"]})]).then(()=>{})}function A_(e){return e.split("/").map(encodeURIComponent).join("/")}function A3(e){try{return decodeURIComponent(e)}catch{return e}}function M_(e){return e.split("/").map(A3).join("/")}const M3=new Set(["dashboard","history","install","settings"]),mx={insights:"dashboard"};function N3(e){return Object.hasOwn(mx,e)?mx[e]:void 0}const Gp=["q","user","since","until"];function Zp(e){return!!e&&Gp.some(n=>!!e[n])}function N_(e){const n=new URLSearchParams;for(const i of Gp)e?.[i]&&n.set(i,e[i]);const r=n.toString();return r?"?"+r:""}function D_(e,n){const r=e.indexOf("?"),i=r===-1?null:new URLSearchParams(e.slice(r)),o=i?.get("v")||"",l=i?.get("connect")||"",u=D3(r===-1?e:e.slice(0,r),n);o&&(u.version=o),l&&(u.connect=l);const d={};for(const p of Gp){const m=i?.get(p);m&&(d[p]=m)}if(Zp(d)&&(u.filters=d),u.view==="history"&&!u.viewTarget){const p=(i?.get("path")||i?.get("prefix")||"").replace(/^\/+|\/+$/g,"");p&&(u.viewTarget=M_(p),u.queryTarget=!0)}return u}function px(e,n){const r=n.replace(/\/+$/,"");return r!==n&&(e.trailingSlash=!0),e.path=r?M_(r):"",e}function D3(e,n){const r=e.replace(/^\/+/,"");if(n!=="hub")return px({path:""},r);if(r==="orgs"||r.startsWith("orgs/"))return{org:r.slice(5).replace(/\/+$/,""),path:""};if(r==="billing"||r.startsWith("billing/"))return{billing:!0,path:""};const i=r.indexOf("/");if(i===-1)return{project:r,path:""};const o=px({project:r.slice(0,i),path:""},r.slice(i+1)),l=o.path.indexOf("/"),u=l===-1?o.path:o.path.slice(0,l),d=N3(u);return(M3.has(u)||d)&&(o.view=d||u,d&&(o.legacyView=!0),o.viewTarget=l===-1?"":o.path.slice(l+1).replace(/\/+$/,""),o.path=""),o}function fl(e,n,r){const i=A_(e),o=r?"?v="+r:"";return n?"/"+n+(i?"/"+i:"")+o:"/"+i+o}function Pn(e,n,r,i){let o=(n?"/"+n:"")+"/"+e;return r&&(o+="/"+A_(r.replace(/\/+$/,""))),o+(e==="history"?N_(i):"")}let Kp="POP";const zm=new Set;function z_(){for(const e of zm)e()}window.addEventListener("popstate",()=>{Kp="POP",z_()});function Kt(e,n){const r=location.pathname+location.search;!n?.replace&&r===e||(history[n?.replace?"replaceState":"pushState"](null,"",e),Kp=n?.replace?"REPLACE":"PUSH",z_())}function Yp(){return S.useSyncExternalStore(e=>(zm.add(e),()=>{zm.delete(e)}),()=>location.pathname+location.search)}function z3(){return Kp}function Bs(e){return e.startsWith("/")&&!e.startsWith("//")?{href:e,onClick:r=>{r.defaultPrevented||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||r.button!==0||(r.preventDefault(),Kt(e),document.body.classList.remove("sb-open"))}}:{href:e,target:"_blank",rel:"noopener noreferrer"}}function Qo({to:e}){return S.useEffect(()=>{Kt(e,{replace:!0})},[e]),null}function k_(){return{accessor:(e,n)=>typeof e=="function"?{...n,accessorFn:e}:{...n,accessorKey:e},display:e=>e,group:e=>e}}function Da(e,n){return typeof e=="function"?e(n):e}function Fn(e,n){return r=>{n.setState(i=>({...i,[e]:Da(r,i[e])}))}}function ed(e){return e instanceof Function}function k3(e){return Array.isArray(e)&&e.every(n=>typeof n=="number")}function L3(e,n){const r=[],i=o=>{o.forEach(l=>{r.push(l);const u=n(l);u!=null&&u.length&&i(u)})};return i(e),r}function ze(e,n,r){let i=[],o;return l=>{let u;r.key&&r.debug&&(u=Date.now());const d=e(l);if(!(d.length!==i.length||d.some((y,v)=>i[v]!==y)))return o;i=d;let m;if(r.key&&r.debug&&(m=Date.now()),o=n(...d),r==null||r.onChange==null||r.onChange(o),r.key&&r.debug&&r!=null&&r.debug()){const y=Math.round((Date.now()-u)*100)/100,v=Math.round((Date.now()-m)*100)/100,b=v/16,x=(w,_)=>{for(w=String(w);w.length<_;)w=" "+w;return w};console.info(`%c⏱ ${x(v,5)} /${x(y,5)} ms`,` font-size: .6rem; font-weight: bold; - color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,r?.key)}return o}}function ke(e,n,r,i){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[n]},key:!1,onChange:i}}function k3(e,n,r,i){const o=()=>{var u;return(u=l.getValue())!=null?u:e.options.renderFallbackValue},l={id:`${n.id}_${r.id}`,row:n,column:r,getValue:()=>n.getValue(i),renderValue:o,getContext:ze(()=>[e,r,n,l],(u,d,p,m)=>({table:u,column:d,row:p,cell:m,getValue:m.getValue,renderValue:m.renderValue}),ke(e.options,"debugCells"))};return e._features.forEach(u=>{u.createCell==null||u.createCell(l,r,n,e)},{}),l}function L3(e,n,r,i){var o,l;const d={...e._getDefaultColumnDef(),...n},p=d.accessorKey;let m=(o=(l=d.id)!=null?l:p?typeof String.prototype.replaceAll=="function"?p.replaceAll(".","_"):p.replace(/\./g,"_"):void 0)!=null?o:typeof d.header=="string"?d.header:void 0,y;if(d.accessorFn?y=d.accessorFn:p&&(p.includes(".")?y=b=>{let x=b;for(const _ of p.split(".")){var S;x=(S=x)==null?void 0:S[_]}return x}:y=b=>b[d.accessorKey]),!m)throw new Error;let v={id:`${String(m)}`,accessorFn:y,parent:i,depth:r,columnDef:d,columns:[],getFlatColumns:ze(()=>[!0],()=>{var b;return[v,...(b=v.columns)==null?void 0:b.flatMap(x=>x.getFlatColumns())]},ke(e.options,"debugColumns")),getLeafColumns:ze(()=>[e._getOrderColumnsFn()],b=>{var x;if((x=v.columns)!=null&&x.length){let S=v.columns.flatMap(_=>_.getLeafColumns());return b(S)}return[v]},ke(e.options,"debugColumns"))};for(const b of e._features)b.createColumn==null||b.createColumn(v,e);return v}const un="debugHeaders";function gx(e,n,r){var i;let l={id:(i=r.id)!=null?i:n.id,column:n,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const u=[],d=p=>{p.subHeaders&&p.subHeaders.length&&p.subHeaders.map(d),u.push(p)};return d(l),u},getContext:()=>({table:e,header:l,column:n})};return e._features.forEach(u=>{u.createHeader==null||u.createHeader(l,e)}),l}const $3={createTable:e=>{e.getHeaderGroups=ze(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i,o)=>{var l,u;const d=(l=i?.map(v=>r.find(b=>b.id===v)).filter(Boolean))!=null?l:[],p=(u=o?.map(v=>r.find(b=>b.id===v)).filter(Boolean))!=null?u:[],m=r.filter(v=>!(i!=null&&i.includes(v.id))&&!(o!=null&&o.includes(v.id)));return Xc(n,[...d,...m,...p],e)},ke(e.options,un)),e.getCenterHeaderGroups=ze(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i,o)=>(r=r.filter(l=>!(i!=null&&i.includes(l.id))&&!(o!=null&&o.includes(l.id))),Xc(n,r,e,"center")),ke(e.options,un)),e.getLeftHeaderGroups=ze(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,r,i)=>{var o;const l=(o=i?.map(u=>r.find(d=>d.id===u)).filter(Boolean))!=null?o:[];return Xc(n,l,e,"left")},ke(e.options,un)),e.getRightHeaderGroups=ze(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,r,i)=>{var o;const l=(o=i?.map(u=>r.find(d=>d.id===u)).filter(Boolean))!=null?o:[];return Xc(n,l,e,"right")},ke(e.options,un)),e.getFooterGroups=ze(()=>[e.getHeaderGroups()],n=>[...n].reverse(),ke(e.options,un)),e.getLeftFooterGroups=ze(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),ke(e.options,un)),e.getCenterFooterGroups=ze(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),ke(e.options,un)),e.getRightFooterGroups=ze(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),ke(e.options,un)),e.getFlatHeaders=ze(()=>[e.getHeaderGroups()],n=>n.map(r=>r.headers).flat(),ke(e.options,un)),e.getLeftFlatHeaders=ze(()=>[e.getLeftHeaderGroups()],n=>n.map(r=>r.headers).flat(),ke(e.options,un)),e.getCenterFlatHeaders=ze(()=>[e.getCenterHeaderGroups()],n=>n.map(r=>r.headers).flat(),ke(e.options,un)),e.getRightFlatHeaders=ze(()=>[e.getRightHeaderGroups()],n=>n.map(r=>r.headers).flat(),ke(e.options,un)),e.getCenterLeafHeaders=ze(()=>[e.getCenterFlatHeaders()],n=>n.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),ke(e.options,un)),e.getLeftLeafHeaders=ze(()=>[e.getLeftFlatHeaders()],n=>n.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),ke(e.options,un)),e.getRightLeafHeaders=ze(()=>[e.getRightFlatHeaders()],n=>n.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),ke(e.options,un)),e.getLeafHeaders=ze(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,r,i)=>{var o,l,u,d,p,m;return[...(o=(l=n[0])==null?void 0:l.headers)!=null?o:[],...(u=(d=r[0])==null?void 0:d.headers)!=null?u:[],...(p=(m=i[0])==null?void 0:m.headers)!=null?p:[]].map(y=>y.getLeafHeaders()).flat()},ke(e.options,un))}};function Xc(e,n,r,i){var o,l;let u=0;const d=function(b,x){x===void 0&&(x=1),u=Math.max(u,x),b.filter(S=>S.getIsVisible()).forEach(S=>{var _;(_=S.columns)!=null&&_.length&&d(S.columns,x+1)},0)};d(e);let p=[];const m=(b,x)=>{const S={depth:x,id:[i,`${x}`].filter(Boolean).join("_"),headers:[]},_=[];b.forEach(E=>{const R=[..._].reverse()[0],T=E.column.depth===S.depth;let O,M=!1;if(T&&E.column.parent?O=E.column.parent:(O=E.column,M=!0),R&&R?.column===O)R.subHeaders.push(E);else{const D=gx(r,O,{id:[i,x,O.id,E?.id].filter(Boolean).join("_"),isPlaceholder:M,placeholderId:M?`${_.filter(P=>P.column===O).length}`:void 0,depth:x,index:_.length});D.subHeaders.push(E),_.push(D)}S.headers.push(E),E.headerGroup=S}),p.push(S),x>0&&m(_,x-1)},y=n.map((b,x)=>gx(r,b,{depth:u,index:x}));m(y,u-1),p.reverse();const v=b=>b.filter(S=>S.column.getIsVisible()).map(S=>{let _=0,E=0,R=[0];S.subHeaders&&S.subHeaders.length?(R=[],v(S.subHeaders).forEach(O=>{let{colSpan:M,rowSpan:D}=O;_+=M,R.push(D)})):_=1;const T=Math.min(...R);return E=E+T,S.colSpan=_,S.rowSpan=E,{colSpan:_,rowSpan:E}});return v((o=(l=p[0])==null?void 0:l.headers)!=null?o:[]),p}const I3=(e,n,r,i,o,l,u)=>{let d={id:n,index:i,original:r,depth:o,parentId:u,_valuesCache:{},_uniqueValuesCache:{},getValue:p=>{if(d._valuesCache.hasOwnProperty(p))return d._valuesCache[p];const m=e.getColumn(p);if(m!=null&&m.accessorFn)return d._valuesCache[p]=m.accessorFn(d.original,i),d._valuesCache[p]},getUniqueValues:p=>{if(d._uniqueValuesCache.hasOwnProperty(p))return d._uniqueValuesCache[p];const m=e.getColumn(p);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(d._uniqueValuesCache[p]=m.columnDef.getUniqueValues(d.original,i),d._uniqueValuesCache[p]):(d._uniqueValuesCache[p]=[d.getValue(p)],d._uniqueValuesCache[p])},renderValue:p=>{var m;return(m=d.getValue(p))!=null?m:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>z3(d.subRows,p=>p.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let p=[],m=d;for(;;){const y=m.getParentRow();if(!y)break;p.push(y),m=y}return p.reverse()},getAllCells:ze(()=>[e.getAllLeafColumns()],p=>p.map(m=>k3(e,d,m,m.id)),ke(e.options,"debugRows")),_getAllCellsByColumnId:ze(()=>[d.getAllCells()],p=>p.reduce((m,y)=>(m[y.column.id]=y,m),{}),ke(e.options,"debugRows"))};for(let p=0;p{e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},L_=(e,n,r)=>{var i,o;const l=r==null||(i=r.toString())==null?void 0:i.toLowerCase();return!!(!((o=e.getValue(n))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(l))};L_.autoRemove=e=>gr(e);const $_=(e,n,r)=>{var i;return!!(!((i=e.getValue(n))==null||(i=i.toString())==null)&&i.includes(r))};$_.autoRemove=e=>gr(e);const I_=(e,n,r)=>{var i;return((i=e.getValue(n))==null||(i=i.toString())==null?void 0:i.toLowerCase())===r?.toLowerCase()};I_.autoRemove=e=>gr(e);const P_=(e,n,r)=>{var i;return(i=e.getValue(n))==null?void 0:i.includes(r)};P_.autoRemove=e=>gr(e);const F_=(e,n,r)=>!r.some(i=>{var o;return!((o=e.getValue(n))!=null&&o.includes(i))});F_.autoRemove=e=>gr(e)||!(e!=null&&e.length);const V_=(e,n,r)=>r.some(i=>{var o;return(o=e.getValue(n))==null?void 0:o.includes(i)});V_.autoRemove=e=>gr(e)||!(e!=null&&e.length);const U_=(e,n,r)=>e.getValue(n)===r;U_.autoRemove=e=>gr(e);const H_=(e,n,r)=>e.getValue(n)==r;H_.autoRemove=e=>gr(e);const Qp=(e,n,r)=>{let[i,o]=r;const l=e.getValue(n);return l>=i&&l<=o};Qp.resolveFilterValue=e=>{let[n,r]=e,i=typeof n!="number"?parseFloat(n):n,o=typeof r!="number"?parseFloat(r):r,l=n===null||Number.isNaN(i)?-1/0:i,u=r===null||Number.isNaN(o)?1/0:o;if(l>u){const d=l;l=u,u=d}return[l,u]};Qp.autoRemove=e=>gr(e)||gr(e[0])&&gr(e[1]);const ta={includesString:L_,includesStringSensitive:$_,equalsString:I_,arrIncludes:P_,arrIncludesAll:F_,arrIncludesSome:V_,equals:U_,weakEquals:H_,inNumberRange:Qp};function gr(e){return e==null||e===""}const F3={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Fn("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const r=n.getCoreRowModel().flatRows[0],i=r?.getValue(e.id);return typeof i=="string"?ta.includesString:typeof i=="number"?ta.inNumberRange:typeof i=="boolean"||i!==null&&typeof i=="object"?ta.equals:Array.isArray(i)?ta.arrIncludes:ta.weakEquals},e.getFilterFn=()=>{var r,i;return ed(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(r=(i=n.options.filterFns)==null?void 0:i[e.columnDef.filterFn])!=null?r:ta[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,i,o;return((r=e.columnDef.enableColumnFilter)!=null?r:!0)&&((i=n.options.enableColumnFilters)!=null?i:!0)&&((o=n.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return(r=n.getState().columnFilters)==null||(r=r.find(i=>i.id===e.id))==null?void 0:r.value},e.getFilterIndex=()=>{var r,i;return(r=(i=n.getState().columnFilters)==null?void 0:i.findIndex(o=>o.id===e.id))!=null?r:-1},e.setFilterValue=r=>{n.setColumnFilters(i=>{const o=e.getFilterFn(),l=i?.find(y=>y.id===e.id),u=Da(r,l?l.value:void 0);if(vx(o,u,e)){var d;return(d=i?.filter(y=>y.id!==e.id))!=null?d:[]}const p={id:e.id,value:u};if(l){var m;return(m=i?.map(y=>y.id===e.id?p:y))!=null?m:[]}return i!=null&&i.length?[...i,p]:[p]})}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const r=e.getAllLeafColumns(),i=o=>{var l;return(l=Da(n,o))==null?void 0:l.filter(u=>{const d=r.find(p=>p.id===u.id);if(d){const p=d.getFilterFn();if(vx(p,u.value,d))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(i)},e.resetColumnFilters=n=>{var r,i;e.setColumnFilters(n?[]:(r=(i=e.initialState)==null?void 0:i.columnFilters)!=null?r:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function vx(e,n,r){return(e&&e.autoRemove?e.autoRemove(n,r):!1)||typeof n>"u"||typeof n=="string"&&!n}const V3=(e,n,r)=>r.reduce((i,o)=>{const l=o.getValue(e);return i+(typeof l=="number"?l:0)},0),U3=(e,n,r)=>{let i;return r.forEach(o=>{const l=o.getValue(e);l!=null&&(i>l||i===void 0&&l>=l)&&(i=l)}),i},H3=(e,n,r)=>{let i;return r.forEach(o=>{const l=o.getValue(e);l!=null&&(i=l)&&(i=l)}),i},B3=(e,n,r)=>{let i,o;return r.forEach(l=>{const u=l.getValue(e);u!=null&&(i===void 0?u>=u&&(i=o=u):(i>u&&(i=u),o{let r=0,i=0;if(n.forEach(o=>{let l=o.getValue(e);l!=null&&(l=+l)>=l&&(++r,i+=l)}),r)return i/r},G3=(e,n)=>{if(!n.length)return;const r=n.map(l=>l.getValue(e));if(!D3(r))return;if(r.length===1)return r[0];const i=Math.floor(r.length/2),o=r.sort((l,u)=>l-u);return r.length%2!==0?o[i]:(o[i-1]+o[i])/2},Z3=(e,n)=>Array.from(new Set(n.map(r=>r.getValue(e))).values()),K3=(e,n)=>new Set(n.map(r=>r.getValue(e))).size,Y3=(e,n)=>n.length,qh={sum:V3,min:U3,max:H3,extent:B3,mean:q3,median:G3,unique:Z3,uniqueCount:K3,count:Y3},Q3={getDefaultColumnDef:()=>({aggregatedCell:e=>{var n,r;return(n=(r=e.getValue())==null||r.toString==null?void 0:r.toString())!=null?n:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Fn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,n)=>{e.toggleGrouping=()=>{n.setGrouping(r=>r!=null&&r.includes(e.id)?r.filter(i=>i!==e.id):[...r??[],e.id])},e.getCanGroup=()=>{var r,i;return((r=e.columnDef.enableGrouping)!=null?r:!0)&&((i=n.options.enableGrouping)!=null?i:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return(r=n.getState().grouping)==null?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return(r=n.getState().grouping)==null?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const r=e.getCanGroup();return()=>{r&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=n.getCoreRowModel().flatRows[0],i=r?.getValue(e.id);if(typeof i=="number")return qh.sum;if(Object.prototype.toString.call(i)==="[object Date]")return qh.extent},e.getAggregationFn=()=>{var r,i;if(!e)throw new Error;return ed(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(r=(i=n.options.aggregationFns)==null?void 0:i[e.columnDef.aggregationFn])!=null?r:qh[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=n=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(n),e.resetGrouping=n=>{var r,i;e.setGrouping(n?[]:(r=(i=e.initialState)==null?void 0:i.grouping)!=null?r:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,n)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const i=n.getColumn(r);return i!=null&&i.columnDef.getGroupingValue?(e._groupingValuesCache[r]=i.columnDef.getGroupingValue(e.original),e._groupingValuesCache[r]):e.getValue(r)},e._groupingValuesCache={}},createCell:(e,n,r,i)=>{e.getIsGrouped=()=>n.getIsGrouped()&&n.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&n.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=r.subRows)!=null&&o.length)}}};function X3(e,n,r){if(!(n!=null&&n.length)||!r)return e;const i=e.filter(l=>!n.includes(l.id));return r==="remove"?i:[...n.map(l=>e.find(u=>u.id===l)).filter(Boolean),...i]}const J3={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Fn("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=ze(r=>[el(n,r)],r=>r.findIndex(i=>i.id===e.id),ke(n.options,"debugColumns")),e.getIsFirstColumn=r=>{var i;return((i=el(n,r)[0])==null?void 0:i.id)===e.id},e.getIsLastColumn=r=>{var i;const o=el(n,r);return((i=o[o.length-1])==null?void 0:i.id)===e.id}},createTable:e=>{e.setColumnOrder=n=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(n),e.resetColumnOrder=n=>{var r;e.setColumnOrder(n?[]:(r=e.initialState.columnOrder)!=null?r:[])},e._getOrderColumnsFn=ze(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,r,i)=>o=>{let l=[];if(!(n!=null&&n.length))l=o;else{const u=[...n],d=[...o];for(;d.length&&u.length;){const p=u.shift(),m=d.findIndex(y=>y.id===p);m>-1&&l.push(d.splice(m,1)[0])}l=[...l,...d]}return X3(l,r,i)},ke(e.options,"debugTable"))}},Gh=()=>({left:[],right:[]}),W3={getInitialState:e=>({columnPinning:Gh(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Fn("columnPinning",e)}),createColumn:(e,n)=>{e.pin=r=>{const i=e.getLeafColumns().map(o=>o.id).filter(Boolean);n.setColumnPinning(o=>{var l,u;if(r==="right"){var d,p;return{left:((d=o?.left)!=null?d:[]).filter(v=>!(i!=null&&i.includes(v))),right:[...((p=o?.right)!=null?p:[]).filter(v=>!(i!=null&&i.includes(v))),...i]}}if(r==="left"){var m,y;return{left:[...((m=o?.left)!=null?m:[]).filter(v=>!(i!=null&&i.includes(v))),...i],right:((y=o?.right)!=null?y:[]).filter(v=>!(i!=null&&i.includes(v)))}}return{left:((l=o?.left)!=null?l:[]).filter(v=>!(i!=null&&i.includes(v))),right:((u=o?.right)!=null?u:[]).filter(v=>!(i!=null&&i.includes(v)))}})},e.getCanPin=()=>e.getLeafColumns().some(i=>{var o,l,u;return((o=i.columnDef.enablePinning)!=null?o:!0)&&((l=(u=n.options.enableColumnPinning)!=null?u:n.options.enablePinning)!=null?l:!0)}),e.getIsPinned=()=>{const r=e.getLeafColumns().map(d=>d.id),{left:i,right:o}=n.getState().columnPinning,l=r.some(d=>i?.includes(d)),u=r.some(d=>o?.includes(d));return l?"left":u?"right":!1},e.getPinnedIndex=()=>{var r,i;const o=e.getIsPinned();return o?(r=(i=n.getState().columnPinning)==null||(i=i[o])==null?void 0:i.indexOf(e.id))!=null?r:-1:0}},createRow:(e,n)=>{e.getCenterVisibleCells=ze(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(r,i,o)=>{const l=[...i??[],...o??[]];return r.filter(u=>!l.includes(u.column.id))},ke(n.options,"debugRows")),e.getLeftVisibleCells=ze(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left],(r,i)=>(i??[]).map(l=>r.find(u=>u.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),ke(n.options,"debugRows")),e.getRightVisibleCells=ze(()=>[e._getAllVisibleCells(),n.getState().columnPinning.right],(r,i)=>(i??[]).map(l=>r.find(u=>u.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),ke(n.options,"debugRows"))},createTable:e=>{e.setColumnPinning=n=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(n),e.resetColumnPinning=n=>{var r,i;return e.setColumnPinning(n?Gh():(r=(i=e.initialState)==null?void 0:i.columnPinning)!=null?r:Gh())},e.getIsSomeColumnsPinned=n=>{var r;const i=e.getState().columnPinning;if(!n){var o,l;return!!((o=i.left)!=null&&o.length||(l=i.right)!=null&&l.length)}return!!((r=i[n])!=null&&r.length)},e.getLeftLeafColumns=ze(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(o=>o.id===i)).filter(Boolean),ke(e.options,"debugColumns")),e.getRightLeafColumns=ze(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(o=>o.id===i)).filter(Boolean),ke(e.options,"debugColumns")),e.getCenterLeafColumns=ze(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(l=>!o.includes(l.id))},ke(e.options,"debugColumns"))}};function e4(e){return e||(typeof document<"u"?document:null)}const Jc={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Zh=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),t4={getDefaultColumnDef:()=>Jc,getInitialState:e=>({columnSizing:{},columnSizingInfo:Zh(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Fn("columnSizing",e),onColumnSizingInfoChange:Fn("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var r,i,o;const l=n.getState().columnSizing[e.id];return Math.min(Math.max((r=e.columnDef.minSize)!=null?r:Jc.minSize,(i=l??e.columnDef.size)!=null?i:Jc.size),(o=e.columnDef.maxSize)!=null?o:Jc.maxSize)},e.getStart=ze(r=>[r,el(n,r),n.getState().columnSizing],(r,i)=>i.slice(0,e.getIndex(r)).reduce((o,l)=>o+l.getSize(),0),ke(n.options,"debugColumns")),e.getAfter=ze(r=>[r,el(n,r),n.getState().columnSizing],(r,i)=>i.slice(e.getIndex(r)+1).reduce((o,l)=>o+l.getSize(),0),ke(n.options,"debugColumns")),e.resetSize=()=>{n.setColumnSizing(r=>{let{[e.id]:i,...o}=r;return o})},e.getCanResize=()=>{var r,i;return((r=e.columnDef.enableResizing)!=null?r:!0)&&((i=n.options.enableColumnResizing)!=null?i:!0)},e.getIsResizing=()=>n.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,n)=>{e.getSize=()=>{let r=0;const i=o=>{if(o.subHeaders.length)o.subHeaders.forEach(i);else{var l;r+=(l=o.column.getSize())!=null?l:0}};return i(e),r},e.getStart=()=>{if(e.index>0){const r=e.headerGroup.headers[e.index-1];return r.getStart()+r.getSize()}return 0},e.getResizeHandler=r=>{const i=n.getColumn(e.column.id),o=i?.getCanResize();return l=>{if(!i||!o||(l.persist==null||l.persist(),Kh(l)&&l.touches&&l.touches.length>1))return;const u=e.getSize(),d=e?e.getLeafHeaders().map(R=>[R.column.id,R.column.getSize()]):[[i.id,i.getSize()]],p=Kh(l)?Math.round(l.touches[0].clientX):l.clientX,m={},y=(R,T)=>{typeof T=="number"&&(n.setColumnSizingInfo(O=>{var M,D;const P=n.options.columnResizeDirection==="rtl"?-1:1,F=(T-((M=O?.startOffset)!=null?M:0))*P,V=Math.max(F/((D=O?.startSize)!=null?D:0),-.999999);return O.columnSizingStart.forEach(ve=>{let[be,he]=ve;m[be]=Math.round(Math.max(he+he*V,0)*100)/100}),{...O,deltaOffset:F,deltaPercentage:V}}),(n.options.columnResizeMode==="onChange"||R==="end")&&n.setColumnSizing(O=>({...O,...m})))},v=R=>y("move",R),b=R=>{y("end",R),n.setColumnSizingInfo(T=>({...T,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},x=e4(r),S={moveHandler:R=>v(R.clientX),upHandler:R=>{x?.removeEventListener("mousemove",S.moveHandler),x?.removeEventListener("mouseup",S.upHandler),b(R.clientX)}},_={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),v(R.touches[0].clientX),!1),upHandler:R=>{var T;x?.removeEventListener("touchmove",_.moveHandler),x?.removeEventListener("touchend",_.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),b((T=R.touches[0])==null?void 0:T.clientX)}},E=n4()?{passive:!1}:!1;Kh(l)?(x?.addEventListener("touchmove",_.moveHandler,E),x?.addEventListener("touchend",_.upHandler,E)):(x?.addEventListener("mousemove",S.moveHandler,E),x?.addEventListener("mouseup",S.upHandler,E)),n.setColumnSizingInfo(R=>({...R,startOffset:p,startSize:u,deltaOffset:0,deltaPercentage:0,columnSizingStart:d,isResizingColumn:i.id}))}}},createTable:e=>{e.setColumnSizing=n=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(n),e.setColumnSizingInfo=n=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(n),e.resetColumnSizing=n=>{var r;e.setColumnSizing(n?{}:(r=e.initialState.columnSizing)!=null?r:{})},e.resetHeaderSizeInfo=n=>{var r;e.setColumnSizingInfo(n?Zh():(r=e.initialState.columnSizingInfo)!=null?r:Zh())},e.getTotalSize=()=>{var n,r;return(n=(r=e.getHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,r;return(n=(r=e.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,r;return(n=(r=e.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,r;return(n=(r=e.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?n:0}}};let Wc=null;function n4(){if(typeof Wc=="boolean")return Wc;let e=!1;try{const n={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,n),window.removeEventListener("test",r)}catch{e=!1}return Wc=e,Wc}function Kh(e){return e.type==="touchstart"}const r4={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Fn("columnVisibility",e)}),createColumn:(e,n)=>{e.toggleVisibility=r=>{e.getCanHide()&&n.setColumnVisibility(i=>({...i,[e.id]:r??!e.getIsVisible()}))},e.getIsVisible=()=>{var r,i;const o=e.columns;return(r=o.length?o.some(l=>l.getIsVisible()):(i=n.getState().columnVisibility)==null?void 0:i[e.id])!=null?r:!0},e.getCanHide=()=>{var r,i;return((r=e.columnDef.enableHiding)!=null?r:!0)&&((i=n.options.enableHiding)!=null?i:!0)},e.getToggleVisibilityHandler=()=>r=>{e.toggleVisibility==null||e.toggleVisibility(r.target.checked)}},createRow:(e,n)=>{e._getAllVisibleCells=ze(()=>[e.getAllCells(),n.getState().columnVisibility],r=>r.filter(i=>i.column.getIsVisible()),ke(n.options,"debugRows")),e.getVisibleCells=ze(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(r,i,o)=>[...r,...i,...o],ke(n.options,"debugRows"))},createTable:e=>{const n=(r,i)=>ze(()=>[i(),i().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),ke(e.options,"debugColumns"));e.getVisibleFlatColumns=n("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=n("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=n("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=n("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=n("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=r=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(r),e.resetColumnVisibility=r=>{var i;e.setColumnVisibility(r?{}:(i=e.initialState.columnVisibility)!=null?i:{})},e.toggleAllColumnsVisible=r=>{var i;r=(i=r)!=null?i:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,l)=>({...o,[l.id]:r||!(l.getCanHide!=null&&l.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>r=>{var i;e.toggleAllColumnsVisible((i=r.target)==null?void 0:i.checked)}}};function el(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const a4={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},i4={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Fn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:n=>{var r;const i=(r=e.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[n.id])==null?void 0:r.getValue();return typeof i=="string"||typeof i=="number"}}),createColumn:(e,n)=>{e.getCanGlobalFilter=()=>{var r,i,o,l;return((r=e.columnDef.enableGlobalFilter)!=null?r:!0)&&((i=n.options.enableGlobalFilter)!=null?i:!0)&&((o=n.options.enableFilters)!=null?o:!0)&&((l=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ta.includesString,e.getGlobalFilterFn=()=>{var n,r;const{globalFilterFn:i}=e.options;return ed(i)?i:i==="auto"?e.getGlobalAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[i])!=null?n:ta[i]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},s4={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Fn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,r=!1;e._autoResetExpanded=()=>{var i,o;if(!n){e._queue(()=>{n=!0});return}if((i=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?i:!e.options.manualExpanding){if(r)return;r=!0,e._queue(()=>{e.resetExpanded(),r=!1})}},e.setExpanded=i=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(i),e.toggleAllRowsExpanded=i=>{i??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=i=>{var o,l;e.setExpanded(i?{}:(o=(l=e.initialState)==null?void 0:l.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(i=>i.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>i=>{i.persist==null||i.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const i=e.getState().expanded;return i===!0||Object.values(i).some(Boolean)},e.getIsAllRowsExpanded=()=>{const i=e.getState().expanded;return typeof i=="boolean"?i===!0:!(!Object.keys(i).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let i=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(l=>{const u=l.split(".");i=Math.max(i,u.length)}),i},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,n)=>{e.toggleExpanded=r=>{n.setExpanded(i=>{var o;const l=i===!0?!0:!!(i!=null&&i[e.id]);let u={};if(i===!0?Object.keys(n.getRowModel().rowsById).forEach(d=>{u[d]=!0}):u=i,r=(o=r)!=null?o:!l,!l&&r)return{...u,[e.id]:!0};if(l&&!r){const{[e.id]:d,...p}=u;return p}return i})},e.getIsExpanded=()=>{var r;const i=n.getState().expanded;return!!((r=n.options.getIsRowExpanded==null?void 0:n.options.getIsRowExpanded(e))!=null?r:i===!0||i?.[e.id])},e.getCanExpand=()=>{var r,i,o;return(r=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?r:((i=n.options.enableExpanding)!=null?i:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let r=!0,i=e;for(;r&&i.parentId;)i=n.getRow(i.parentId,!0),r=i.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const r=e.getCanExpand();return()=>{r&&e.toggleExpanded()}}}},km=0,Lm=10,Yh=()=>({pageIndex:km,pageSize:Lm}),o4={getInitialState:e=>({...e,pagination:{...Yh(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Fn("pagination",e)}),createTable:e=>{let n=!1,r=!1;e._autoResetPageIndex=()=>{var i,o;if(!n){e._queue(()=>{n=!0});return}if((i=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?i:!e.options.manualPagination){if(r)return;r=!0,e._queue(()=>{e.resetPageIndex(),r=!1})}},e.setPagination=i=>{const o=l=>Da(i,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=i=>{var o;e.setPagination(i?Yh():(o=e.initialState.pagination)!=null?o:Yh())},e.setPageIndex=i=>{e.setPagination(o=>{let l=Da(i,o.pageIndex);const u=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.max(0,Math.min(l,u)),{...o,pageIndex:l}})},e.resetPageIndex=i=>{var o,l;e.setPageIndex(i?km:(o=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?o:km)},e.resetPageSize=i=>{var o,l;e.setPageSize(i?Lm:(o=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?o:Lm)},e.setPageSize=i=>{e.setPagination(o=>{const l=Math.max(1,Da(i,o.pageSize)),u=o.pageSize*o.pageIndex,d=Math.floor(u/l);return{...o,pageIndex:d,pageSize:l}})},e.setPageCount=i=>e.setPagination(o=>{var l;let u=Da(i,(l=e.options.pageCount)!=null?l:-1);return typeof u=="number"&&(u=Math.max(-1,u)),{...o,pageCount:u}}),e.getPageOptions=ze(()=>[e.getPageCount()],i=>{let o=[];return i&&i>0&&(o=[...new Array(i)].fill(null).map((l,u)=>u)),o},ke(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:i}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:ie.setPageIndex(i=>i-1),e.nextPage=()=>e.setPageIndex(i=>i+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var i;return(i=e.options.pageCount)!=null?i:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var i;return(i=e.options.rowCount)!=null?i:e.getPrePaginationRowModel().rows.length}}},Qh=()=>({top:[],bottom:[]}),l4={getInitialState:e=>({rowPinning:Qh(),...e}),getDefaultOptions:e=>({onRowPinningChange:Fn("rowPinning",e)}),createRow:(e,n)=>{e.pin=(r,i,o)=>{const l=i?e.getLeafRows().map(p=>{let{id:m}=p;return m}):[],u=o?e.getParentRows().map(p=>{let{id:m}=p;return m}):[],d=new Set([...u,e.id,...l]);n.setRowPinning(p=>{var m,y;if(r==="bottom"){var v,b;return{top:((v=p?.top)!=null?v:[]).filter(_=>!(d!=null&&d.has(_))),bottom:[...((b=p?.bottom)!=null?b:[]).filter(_=>!(d!=null&&d.has(_))),...Array.from(d)]}}if(r==="top"){var x,S;return{top:[...((x=p?.top)!=null?x:[]).filter(_=>!(d!=null&&d.has(_))),...Array.from(d)],bottom:((S=p?.bottom)!=null?S:[]).filter(_=>!(d!=null&&d.has(_)))}}return{top:((m=p?.top)!=null?m:[]).filter(_=>!(d!=null&&d.has(_))),bottom:((y=p?.bottom)!=null?y:[]).filter(_=>!(d!=null&&d.has(_)))}})},e.getCanPin=()=>{var r;const{enableRowPinning:i,enablePinning:o}=n.options;return typeof i=="function"?i(e):(r=i??o)!=null?r:!0},e.getIsPinned=()=>{const r=[e.id],{top:i,bottom:o}=n.getState().rowPinning,l=r.some(d=>i?.includes(d)),u=r.some(d=>o?.includes(d));return l?"top":u?"bottom":!1},e.getPinnedIndex=()=>{var r,i;const o=e.getIsPinned();if(!o)return-1;const l=(r=o==="top"?n.getTopRows():n.getBottomRows())==null?void 0:r.map(u=>{let{id:d}=u;return d});return(i=l?.indexOf(e.id))!=null?i:-1}},createTable:e=>{e.setRowPinning=n=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(n),e.resetRowPinning=n=>{var r,i;return e.setRowPinning(n?Qh():(r=(i=e.initialState)==null?void 0:i.rowPinning)!=null?r:Qh())},e.getIsSomeRowsPinned=n=>{var r;const i=e.getState().rowPinning;if(!n){var o,l;return!!((o=i.top)!=null&&o.length||(l=i.bottom)!=null&&l.length)}return!!((r=i[n])!=null&&r.length)},e._getPinnedRows=(n,r,i)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(r??[]).map(u=>{const d=e.getRow(u,!0);return d.getIsAllParentsExpanded()?d:null}):(r??[]).map(u=>n.find(d=>d.id===u))).filter(Boolean).map(u=>({...u,position:i}))},e.getTopRows=ze(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,r)=>e._getPinnedRows(n,r,"top"),ke(e.options,"debugRows")),e.getBottomRows=ze(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,r)=>e._getPinnedRows(n,r,"bottom"),ke(e.options,"debugRows")),e.getCenterRows=ze(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,r,i)=>{const o=new Set([...r??[],...i??[]]);return n.filter(l=>!o.has(l.id))},ke(e.options,"debugRows"))}},c4={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Fn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=n=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(n),e.resetRowSelection=n=>{var r;return e.setRowSelection(n?{}:(r=e.initialState.rowSelection)!=null?r:{})},e.toggleAllRowsSelected=n=>{e.setRowSelection(r=>{n=typeof n<"u"?n:!e.getIsAllRowsSelected();const i={...r},o=e.getPreGroupedRowModel().flatRows;return n?o.forEach(l=>{l.getCanSelect()&&(i[l.id]=!0)}):o.forEach(l=>{delete i[l.id]}),i})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(r=>{const i=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),o={...r};return e.getRowModel().rows.forEach(l=>{$m(o,l.id,i,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ze(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,r)=>Object.keys(n).length?Xh(e,r):{rows:[],flatRows:[],rowsById:{}},ke(e.options,"debugTable")),e.getFilteredSelectedRowModel=ze(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,r)=>Object.keys(n).length?Xh(e,r):{rows:[],flatRows:[],rowsById:{}},ke(e.options,"debugTable")),e.getGroupedSelectedRowModel=ze(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,r)=>Object.keys(n).length?Xh(e,r):{rows:[],flatRows:[],rowsById:{}},ke(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const n=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let i=!!(n.length&&Object.keys(r).length);return i&&n.some(o=>o.getCanSelect()&&!r[o.id])&&(i=!1),i},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:r}=e.getState();let i=!!n.length;return i&&n.some(o=>!r[o.id])&&(i=!1),i},e.getIsSomeRowsSelected=()=>{var n;const r=Object.keys((n=e.getState().rowSelection)!=null?n:{}).length;return r>0&&r{const n=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:n.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>n=>{e.toggleAllRowsSelected(n.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>n=>{e.toggleAllPageRowsSelected(n.target.checked)}},createRow:(e,n)=>{e.toggleSelected=(r,i)=>{const o=e.getIsSelected();n.setRowSelection(l=>{var u;if(r=typeof r<"u"?r:!o,e.getCanSelect()&&o===r)return l;const d={...l};return $m(d,e.id,r,(u=i?.selectChildren)!=null?u:!0,n),d})},e.getIsSelected=()=>{const{rowSelection:r}=n.getState();return Xp(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=n.getState();return Im(e,r)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=n.getState();return Im(e,r)==="all"},e.getCanSelect=()=>{var r;return typeof n.options.enableRowSelection=="function"?n.options.enableRowSelection(e):(r=n.options.enableRowSelection)!=null?r:!0},e.getCanSelectSubRows=()=>{var r;return typeof n.options.enableSubRowSelection=="function"?n.options.enableSubRowSelection(e):(r=n.options.enableSubRowSelection)!=null?r:!0},e.getCanMultiSelect=()=>{var r;return typeof n.options.enableMultiRowSelection=="function"?n.options.enableMultiRowSelection(e):(r=n.options.enableMultiRowSelection)!=null?r:!0},e.getToggleSelectedHandler=()=>{const r=e.getCanSelect();return i=>{var o;r&&e.toggleSelected((o=i.target)==null?void 0:o.checked)}}}},$m=(e,n,r,i,o)=>{var l;const u=o.getRow(n,!0);r?(u.getCanMultiSelect()||Object.keys(e).forEach(d=>delete e[d]),u.getCanSelect()&&(e[n]=!0)):delete e[n],i&&(l=u.subRows)!=null&&l.length&&u.getCanSelectSubRows()&&u.subRows.forEach(d=>$m(e,d.id,r,i,o))};function Xh(e,n){const r=e.getState().rowSelection,i=[],o={},l=function(u,d){return u.map(p=>{var m;const y=Xp(p,r);if(y&&(i.push(p),o[p.id]=p),(m=p.subRows)!=null&&m.length&&(p={...p,subRows:l(p.subRows)}),y)return p}).filter(Boolean)};return{rows:l(n.rows),flatRows:i,rowsById:o}}function Xp(e,n){var r;return(r=n[e.id])!=null?r:!1}function Im(e,n,r){var i;if(!((i=e.subRows)!=null&&i.length))return!1;let o=!0,l=!1;return e.subRows.forEach(u=>{if(!(l&&!o)&&(u.getCanSelect()&&(Xp(u,n)?l=!0:o=!1),u.subRows&&u.subRows.length)){const d=Im(u,n);d==="all"?l=!0:(d==="some"&&(l=!0),o=!1)}}),o?"all":l?"some":!1}const Pm=/([0-9]+)/gm,u4=(e,n,r)=>B_(Ba(e.getValue(r)).toLowerCase(),Ba(n.getValue(r)).toLowerCase()),d4=(e,n,r)=>B_(Ba(e.getValue(r)),Ba(n.getValue(r))),f4=(e,n,r)=>Jp(Ba(e.getValue(r)).toLowerCase(),Ba(n.getValue(r)).toLowerCase()),h4=(e,n,r)=>Jp(Ba(e.getValue(r)),Ba(n.getValue(r))),m4=(e,n,r)=>{const i=e.getValue(r),o=n.getValue(r);return i>o?1:iJp(e.getValue(r),n.getValue(r));function Jp(e,n){return e===n?0:e>n?1:-1}function Ba(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function B_(e,n){const r=e.split(Pm).filter(Boolean),i=n.split(Pm).filter(Boolean);for(;r.length&&i.length;){const o=r.shift(),l=i.shift(),u=parseInt(o,10),d=parseInt(l,10),p=[u,d].sort();if(isNaN(p[0])){if(o>l)return 1;if(l>o)return-1;continue}if(isNaN(p[1]))return isNaN(u)?-1:1;if(u>d)return 1;if(d>u)return-1}return r.length-i.length}const Bo={alphanumeric:u4,alphanumericCaseSensitive:d4,text:f4,textCaseSensitive:h4,datetime:m4,basic:p4},g4={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Fn("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const r=n.getFilteredRowModel().flatRows.slice(10);let i=!1;for(const o of r){const l=o?.getValue(e.id);if(Object.prototype.toString.call(l)==="[object Date]")return Bo.datetime;if(typeof l=="string"&&(i=!0,l.split(Pm).length>1))return Bo.alphanumeric}return i?Bo.text:Bo.basic},e.getAutoSortDir=()=>{const r=n.getFilteredRowModel().flatRows[0];return typeof r?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var r,i;if(!e)throw new Error;return ed(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(r=(i=n.options.sortingFns)==null?void 0:i[e.columnDef.sortingFn])!=null?r:Bo[e.columnDef.sortingFn]},e.toggleSorting=(r,i)=>{const o=e.getNextSortingOrder(),l=typeof r<"u"&&r!==null;n.setSorting(u=>{const d=u?.find(x=>x.id===e.id),p=u?.findIndex(x=>x.id===e.id);let m=[],y,v=l?r:o==="desc";if(u!=null&&u.length&&e.getCanMultiSort()&&i?d?y="toggle":y="add":u!=null&&u.length&&p!==u.length-1?y="replace":d?y="toggle":y="replace",y==="toggle"&&(l||o||(y="remove")),y==="add"){var b;m=[...u,{id:e.id,desc:v}],m.splice(0,m.length-((b=n.options.maxMultiSortColCount)!=null?b:Number.MAX_SAFE_INTEGER))}else y==="toggle"?m=u.map(x=>x.id===e.id?{...x,desc:v}:x):y==="remove"?m=u.filter(x=>x.id!==e.id):m=[{id:e.id,desc:v}];return m})},e.getFirstSortDir=()=>{var r,i;return((r=(i=e.columnDef.sortDescFirst)!=null?i:n.options.sortDescFirst)!=null?r:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=r=>{var i,o;const l=e.getFirstSortDir(),u=e.getIsSorted();return u?u!==l&&((i=n.options.enableSortingRemoval)==null||i)&&(!(r&&(o=n.options.enableMultiRemove)!=null)||o)?!1:u==="desc"?"asc":"desc":l},e.getCanSort=()=>{var r,i;return((r=e.columnDef.enableSorting)!=null?r:!0)&&((i=n.options.enableSorting)!=null?i:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,i;return(r=(i=e.columnDef.enableMultiSort)!=null?i:n.options.enableMultiSort)!=null?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const i=(r=n.getState().sorting)==null?void 0:r.find(o=>o.id===e.id);return i?i.desc?"desc":"asc":!1},e.getSortIndex=()=>{var r,i;return(r=(i=n.getState().sorting)==null?void 0:i.findIndex(o=>o.id===e.id))!=null?r:-1},e.clearSorting=()=>{n.setSorting(r=>r!=null&&r.length?r.filter(i=>i.id!==e.id):[])},e.getToggleSortingHandler=()=>{const r=e.getCanSort();return i=>{r&&(i.persist==null||i.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?n.options.isMultiSortEvent==null?void 0:n.options.isMultiSortEvent(i):!1))}}},createTable:e=>{e.setSorting=n=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(n),e.resetSorting=n=>{var r,i;e.setSorting(n?[]:(r=(i=e.initialState)==null?void 0:i.sorting)!=null?r:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},v4=[$3,r4,J3,W3,P3,F3,a4,i4,g4,Q3,s4,o4,l4,c4,t4];function y4(e){var n,r;const i=[...v4,...(n=e._features)!=null?n:[]];let o={_features:i};const l=o._features.reduce((b,x)=>Object.assign(b,x.getDefaultOptions==null?void 0:x.getDefaultOptions(o)),{}),u=b=>o.options.mergeOptions?o.options.mergeOptions(l,b):{...l,...b};let p={...{},...(r=e.initialState)!=null?r:{}};o._features.forEach(b=>{var x;p=(x=b.getInitialState==null?void 0:b.getInitialState(p))!=null?x:p});const m=[];let y=!1;const v={_features:i,options:{...l,...e},initialState:p,_queue:b=>{m.push(b),y||(y=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();y=!1}).catch(x=>setTimeout(()=>{throw x})))},reset:()=>{o.setState(o.initialState)},setOptions:b=>{const x=Da(b,o.options);o.options=u(x)},getState:()=>o.options.state,setState:b=>{o.options.onStateChange==null||o.options.onStateChange(b)},_getRowId:(b,x,S)=>{var _;return(_=o.options.getRowId==null?void 0:o.options.getRowId(b,x,S))!=null?_:`${S?[S.id,x].join("."):x}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(b,x)=>{let S=(x?o.getPrePaginationRowModel():o.getRowModel()).rowsById[b];if(!S&&(S=o.getCoreRowModel().rowsById[b],!S))throw new Error;return S},_getDefaultColumnDef:ze(()=>[o.options.defaultColumn],b=>{var x;return b=(x=b)!=null?x:{},{header:S=>{const _=S.header.column.columnDef;return _.accessorKey?_.accessorKey:_.accessorFn?_.id:null},cell:S=>{var _,E;return(_=(E=S.renderValue())==null||E.toString==null?void 0:E.toString())!=null?_:null},...o._features.reduce((S,_)=>Object.assign(S,_.getDefaultColumnDef==null?void 0:_.getDefaultColumnDef()),{}),...b}},ke(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:ze(()=>[o._getColumnDefs()],b=>{const x=function(S,_,E){return E===void 0&&(E=0),S.map(R=>{const T=L3(o,R,E,_),O=R;return T.columns=O.columns?x(O.columns,T,E+1):[],T})};return x(b)},ke(e,"debugColumns")),getAllFlatColumns:ze(()=>[o.getAllColumns()],b=>b.flatMap(x=>x.getFlatColumns()),ke(e,"debugColumns")),_getAllFlatColumnsById:ze(()=>[o.getAllFlatColumns()],b=>b.reduce((x,S)=>(x[S.id]=S,x),{}),ke(e,"debugColumns")),getAllLeafColumns:ze(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(b,x)=>{let S=b.flatMap(_=>_.getLeafColumns());return x(S)},ke(e,"debugColumns")),getColumn:b=>o._getAllFlatColumnsById()[b]};Object.assign(o,v);for(let b=0;bze(()=>[e.options.data],n=>{const r={rows:[],flatRows:[],rowsById:{}},i=function(o,l,u){l===void 0&&(l=0);const d=[];for(let m=0;me._autoResetPageIndex()))}function G_(){return e=>ze(()=>[e.getState().sorting,e.getPreSortedRowModel()],(n,r)=>{if(!r.rows.length||!(n!=null&&n.length))return r;const i=e.getState().sorting,o=[],l=i.filter(p=>{var m;return(m=e.getColumn(p.id))==null?void 0:m.getCanSort()}),u={};l.forEach(p=>{const m=e.getColumn(p.id);m&&(u[p.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const d=p=>{const m=p.map(y=>({...y}));return m.sort((y,v)=>{for(let x=0;x{var v;o.push(y),(v=y.subRows)!=null&&v.length&&(y.subRows=d(y.subRows))}),m};return{rows:d(r.rows),flatRows:o,rowsById:r.rowsById}},ke(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Fm(e,n){return e?b4(e)?w.createElement(e,n):e:null}function b4(e){return x4(e)||typeof e=="function"||w4(e)}function x4(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function w4(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Z_(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=w.useState(()=>({current:y4(n)})),[i,o]=w.useState(()=>r.current.initialState);return r.current.setOptions(l=>({...l,...e,state:{...i,...e.state},onStateChange:u=>{o(u),e.onStateChange==null||e.onStateChange(u)}})),r.current}var El=e=>e.type==="checkbox",za=e=>e instanceof Date,an=e=>e==null;const Wp=e=>typeof e=="object";var Rt=e=>!an(e)&&!Array.isArray(e)&&Wp(e)&&!za(e),S4=e=>Rt(e)&&e.target?El(e.target)?e.target.checked:e.target.value:e,_4=(e,n)=>n.split(".").some((r,i,o)=>!isNaN(Number(r))&&e.has(o.slice(0,i).join("."))),K_=e=>{const n=e.constructor&&e.constructor.prototype;return Rt(n)&&n.hasOwnProperty("isPrototypeOf")},td=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Mt(e){if(e instanceof Date)return new Date(e);const n=typeof FileList<"u"&&e instanceof FileList;if(td&&(e instanceof Blob||n))return e;const r=Array.isArray(e);if(!r&&!(Rt(e)&&K_(e)))return e;const i=r?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=Mt(e[o]));return i}const Rs={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},pr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},hr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Y_="root",eg=["__proto__","constructor","prototype"],C4=/^\w*$/;var Rl=e=>C4.test(e),gt=e=>e===void 0;const E4=/[.[\]'"]/;var nd=e=>e.split(E4).filter(Boolean),Se=(e,n,r)=>{if(!n||!Rt(e))return r;const i=Rl(n)?[n]:nd(n);if(i.some(l=>eg.includes(l)))return r;const o=i.reduce((l,u)=>an(l)?void 0:l[u],e);return gt(o)||o===e?gt(e[n])?r:e[n]:o},Tr=e=>typeof e=="boolean",Jn=e=>typeof e=="function",ct=(e,n,r)=>{let i=-1;const o=Rl(n)?[n]:nd(n),l=o.length,u=l-1;for(;++i{const o={};for(const l in e)Object.defineProperty(o,l,{get:()=>{const u=l;return n._proxyFormState[u]!==pr.all&&(n._proxyFormState[u]=!i||pr.all),e[u]}});return o};const T4=td?me.useLayoutEffect:me.useEffect;var on=e=>typeof e=="string",O4=(e,n,r,i,o)=>on(e)?(i&&n.watch.add(e),Se(r,e,o)):Array.isArray(e)?e.map(l=>(i&&n.watch.add(l),Se(r,l))):(i&&(n.watchAll=!0),r),Vm=e=>an(e)||!Wp(e);const yx=(e,n)=>n.length===0&&!Array.isArray(e)&&!K_(e);function Or(e,n,r=new WeakMap){if(e===n)return!0;if(Vm(e)||Vm(n))return Object.is(e,n);if(za(e)&&za(n))return Object.is(e.getTime(),n.getTime());const i=Object.keys(e),o=Object.keys(n);if(i.length!==o.length)return!1;if(yx(e,i)||yx(n,o))return Object.is(e,n);if(!i.length&&Array.isArray(e)!==Array.isArray(n))return!1;const l=r.get(e);if(l&&l.has(n))return!0;if(l)l.add(n);else{const u=new WeakSet;u.add(n),r.set(e,u)}for(const u of i){const d=e[u];if(!(u in n))return!1;if(u!=="ref"){const p=n[u];if(za(d)&&za(p)||(Rt(d)||Array.isArray(d))&&(Rt(p)||Array.isArray(p))?!Or(d,p,r):!Object.is(d,p))return!1}}return!0}var eu=e=>({isOnSubmit:!e||e===pr.onSubmit,isOnBlur:e===pr.onBlur,isOnChange:e===pr.onChange,isOnAll:e===pr.all,isOnTouch:e===pr.onTouched}),Jh=(e,n,r)=>{if(r)return!1;if(n.watchAll||n.watch.has(e))return!0;for(const i of n.watch)if(e.startsWith(i)&&e.charAt(i.length)===".")return!0;return!1};const tl=(e,n,r,i)=>{for(const o of r||Object.keys(e)){const l=Se(e,o);if(l){const{_f:u,...d}=l;if(u){if(u.refs&&u.refs[0]&&n(u.refs[0],o)&&!i)return!0;if(u.ref&&n(u.ref,u.name)&&!i)return!0;if(tl(d,n))break}else if(Rt(d)&&tl(d,n))break}}};var bx=(e,n,r)=>{const i=Se(e,r),o=Array.isArray(i)?i:[];return ct(o,Y_,n[r]),ct(e,r,o),e},rn=e=>Rt(e)&&!Object.keys(e).length,tg=e=>e.type==="file",_u=e=>{if(!td)return!1;const n=e?e.ownerDocument:0;return e instanceof(n&&n.defaultView?n.defaultView.HTMLElement:HTMLElement)},ng=e=>e.type==="radio",Cu=e=>e instanceof RegExp,rg=(e,n,r,i,o)=>n?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[i]:o||!0}}:{};const xx={value:!1,isValid:!1},wx={value:!0,isValid:!0};var Q_=e=>{if(Array.isArray(e)){if(e.length>1){const n=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:n,isValid:!!n.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!gt(e[0].attributes.value)?gt(e[0].value)||e[0].value===""?wx:{value:e[0].value,isValid:!0}:wx:xx}return xx};const Sx={isValid:!1,value:null};var X_=e=>Array.isArray(e)?e.reduce((n,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:n,Sx):Sx;function _x(e,n,r="validate"){if(on(e)||Array.isArray(e)&&e.every(on)||Tr(e)&&!e)return{type:r,message:on(e)?e:"",ref:n}}var js=e=>Rt(e)&&!Cu(e)?e:{value:e,message:""},Cx=async(e,n,r,i,o,l)=>{const{ref:u,refs:d,required:p,maxLength:m,minLength:y,min:v,max:b,pattern:x,validate:S,name:_,valueAsNumber:E,mount:R}=e._f,T=Se(r,_);if(!R||n.has(_))return{};const O=d?d[0]:u,M=ue=>{if(o&&O.reportValidity){const X=Tr(ue)?"":ue||"";d?d.forEach(pe=>pe.setCustomValidity(X)):O.setCustomValidity(X),O.reportValidity()}},D={},P=ng(u),F=El(u),V=P||F,ve=(E||tg(u))&>(u.value)&>(T)||_u(u)&&u.value===""||T===""||Array.isArray(T)&&!T.length,be=rg.bind(null,_,i,D),he=(ue,X,pe,ge=hr.maxLength,L=hr.minLength)=>{const Z=ue?X:pe;D[_]={type:ue?ge:L,message:Z,ref:u,...be(ue?ge:L,Z)}};if(l?!Array.isArray(T)||!T.length:p&&(!V&&(ve||an(T))||Tr(T)&&!T||F&&!Q_(d).isValid||P&&!X_(d).isValid)){const{value:ue,message:X}=on(p)?{value:!!p,message:p}:js(p);if(ue&&(D[_]={type:hr.required,message:X,ref:O,...be(hr.required,X)},!i))return M(X),D}if(!ve&&(!an(v)||!an(b))){let ue,X;const pe=js(b),ge=js(v);if(!an(T)&&!isNaN(T)){const L=u.valueAsNumber||T&&+T;an(pe.value)||(ue=L>pe.value),an(ge.value)||(X=Lnew Date(new Date().toDateString()+" "+ne),re=u.type=="time",ee=u.type=="week";on(pe.value)&&T&&(ue=re?Z(T)>Z(pe.value):ee?T>pe.value:L>new Date(pe.value)),on(ge.value)&&T&&(X=re?Z(T)+ue.value,ge=!an(X.value)&&T.length<+X.value;if((pe||ge)&&(he(pe,ue.message,X.message),!i))return M(D[_].message),D}if(x&&!ve&&on(T)){const{value:ue,message:X}=js(x);if(Cu(ue)&&!T.match(ue)&&(D[_]={type:hr.pattern,message:X,ref:u,...be(hr.pattern,X)},!i))return M(X),D}if(S){if(Jn(S)){const ue=await S(T,r),X=_x(ue,O);if(X&&(D[_]={...X,...be(hr.validate,X.message)},!i))return M(X.message),D}else if(Rt(S)){let ue={};for(const X in S){if(!rn(ue)&&!i)break;const pe=_x(await S[X](T,r),O,X);pe&&(ue={...pe,...be(X,pe.message)},M(pe.message),i&&(D[_]=ue))}if(!rn(ue)&&(D[_]={ref:O,...ue},!i))return D}}return M(!0),D},cu=e=>Array.isArray(e)?e:[e],J_=e=>Array.isArray(e)?e.filter(Boolean):[];function A4(e,n){const r=n.slice(0,-1).length;let i=0;for(;ieg.includes(String(u))))return e;const i=r.length===1?e:A4(e,r),o=r.length-1,l=r[o];return i&&delete i[l],o!==0&&(Rt(i)&&rn(i)||Array.isArray(i)&&M4(i))&&Nt(e,r.slice(0,-1)),e}const W_=e=>{const n={};for(const r of Object.keys(e))if(Wp(e[r])&&e[r]!==null&&!za(e[r])){const i=W_(e[r]);for(const o of Object.keys(i))n[`${r}.${o}`]=i[o]}else n[r]=e[r];return n},N4=me.createContext(null);N4.displayName="HookFormContext";var Ex=()=>{let e=[];return{get observers(){return e},next:o=>{for(const l of e)l.next&&l.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(l=>l!==o)}}),unsubscribe:()=>{e=[]}}};function eC(e,n){const r={};for(const i in e)if(e.hasOwnProperty(i)){const o=e[i],l=n[i];if(o&&Rt(o)&&l){const u=eC(o,l);Rt(u)&&(r[i]=u)}else e[i]&&(r[i]=l)}return r}var tC=e=>e.type==="select-multiple",D4=e=>ng(e)||El(e),Wh=e=>_u(e)&&e.isConnected,z4=e=>{for(const n in e)if(Jn(e[n]))return!0;return!1};function nC(e){return Array.isArray(e)||Rt(e)&&!z4(e)}function rC(e){return!!(e&&"_f"in e)}function aC(e){return Array.isArray(e)?!e.some(n=>!gt(n)):!Object.keys(e).length}function Um(e,n){Array.isArray(e)?e[n]=void 0:delete e[n]}function Hm(e,n={},r){for(const i in e){const o=e[i],l=r&&r[i];nC(o)&&(!Array.isArray(o)||!rC(l))?(n[i]=Array.isArray(o)?[]:{},Hm(o,n[i],l),aC(n[i])&&Um(n,i)):gt(o)||(n[i]=!0)}return n}function bi(e,n,r,i){r||(r=Hm(n,{},i));for(const o in e){const l=e[o],u=i&&i[o];nC(l)&&(!Array.isArray(l)||!rC(u))?(gt(n)||Vm(r[o])?r[o]=Hm(l,Array.isArray(l)?[]:{},u):bi(l,an(n)?{}:n[o],r[o],u),aC(r[o])&&Um(r,o)):Or(l,n[o])?Um(r,o):r[o]=!0}return r}var iC=(e,{valueAsNumber:n,valueAsDate:r,setValueAs:i})=>gt(e)?e:n?e===""?NaN:e&&+e:r&&on(e)?new Date(e):i?i(e):e;function Rx(e){const n=e.ref;return tg(n)?n.files:ng(n)?X_(e.refs).value:tC(n)?[...n.selectedOptions].map(({value:r})=>r):El(n)?Q_(e.refs).value:iC(gt(n.value)?e.ref.value:n.value,e)}var k4=(e,n,r,i)=>{const o={};for(const l of e){const u=Se(n,l);u&&ct(o,l,u._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:i}},qo=e=>gt(e)?e:Cu(e)?e.source:Rt(e)?Cu(e.value)?e.value.source:e.value:e;const jx="AsyncFunction";var L4=e=>{if(!e||!e.validate)return!1;if(Jn(e.validate))return e.validate.constructor.name===jx;if(Rt(e.validate)){for(const n in e.validate)if(e.validate[n].constructor.name===jx)return!0}return!1},$4=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Tx(e,n,r){const i=Se(e,r);if(i||Rl(r))return{error:i,name:r};const o=r.split(".");for(;o.length;){const l=o.join("."),u=Se(n,l),d=Se(e,l);if(u&&!Array.isArray(u)&&r!==l)return{name:r};if(d&&d.type)return{name:l,error:d};if(d&&d.root&&d.root.type)return{name:`${l}.root`,error:d.root};o.pop()}return{name:r}}var I4=(e,n,r,i)=>{r(e);const{name:o,...l}=e,u=Object.keys(l);return!u.length||i&&u.length>=Object.keys(n).length||u.find(d=>n[d]===(!i||pr.all))},P4=(e,n,r)=>!e||!n||e===n||cu(e).some(i=>i&&(r?i===n||i.startsWith(n+"."):i.startsWith(n)||n.startsWith(i))),F4=(e,n,r,i,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(n||e):(r?i.isOnBlur:o.isOnBlur)?!e:(r?i.isOnChange:o.isOnChange)?e:!0,V4=(e,n)=>!J_(Se(e,n)).length&&Nt(e,n);const U4={mode:pr.onSubmit,reValidateMode:pr.onChange,shouldFocusError:!0},em="form",sC={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function H4(e={}){let n={...U4,...e},r={...Mt(sC),isLoading:Jn(n.defaultValues),errors:n.errors||{},disabled:n.disabled||!1},i={},o=Rt(n.defaultValues)||Rt(n.values)?Mt(n.defaultValues||n.values)||{}:{},l=n.shouldUnregister?{}:Mt(o),u={action:!1,mount:!1,watch:!1,keepIsValid:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const p={},m={};let y=0,v=eu(n.mode),b=eu(n.reValidateMode);const x={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},S={...x};let _={...S};const E={array:Ex(),state:Ex()};let R=0;const T=n.criteriaMode===pr.all,O=(A,I)=>U=>{clearTimeout(m[A]),m[A]=setTimeout(I,U)},M=async A=>{if(!u.keepIsValid&&!n.disabled&&(S.isValid||_.isValid||A)){const I=++R;let U;n.resolver?(U=rn((await pe()).errors),I===R&&D()):U=await Z({fields:i,onlyCheckValid:!0,eventType:Rs.VALID}),I===R&&U!==r.isValid&&E.state.next({isValid:U})}},D=(A,I)=>{!n.disabled&&(S.isValidating||S.validatingFields||_.isValidating||_.validatingFields)&&((A||Array.from(d.mount)).forEach(U=>{U&&(I?ct(r.validatingFields,U,I):Nt(r.validatingFields,U))}),E.state.next({validatingFields:r.validatingFields,isValidating:!rn(r.validatingFields)}))},P=()=>{r.dirtyFields=bi(o,l,void 0,i)},F=(A,I=[],U,ce,Y=!0,W=!0)=>{if(ce&&U&&!n.disabled){if(u.action=!0,W&&Array.isArray(Se(i,A))){const de=U(Se(i,A),ce.argA,ce.argB);Y&&ct(i,A,de)}if(W&&Array.isArray(Se(r.errors,A))){const de=U(Se(r.errors,A),ce.argA,ce.argB);Y&&ct(r.errors,A,de),V4(r.errors,A)}if((S.touchedFields||_.touchedFields)&&W&&Array.isArray(Se(r.touchedFields,A))){const de=U(Se(r.touchedFields,A),ce.argA,ce.argB);Y&&ct(r.touchedFields,A,de)}(S.dirtyFields||_.dirtyFields)&&P(),E.state.next({name:A,isDirty:ee(A,I),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ct(l,A,I)},V=(A,I)=>{ct(r.errors,A,I),r.errors={...r.errors},E.state.next({errors:r.errors})},ve=A=>{r.errors=A,E.state.next({errors:r.errors,isValid:!1})},be=A=>{const I=Rl(A)?[A]:nd(A);let U=l,ce=o;for(let Y=0;Y{const Y=Se(i,A);if(Y){if(be(A))return;const W=gt(Se(l,A)),de=Se(l,A,gt(U)?Se(o,A):U);gt(de)||ce&&ce.defaultChecked||I?ct(l,A,I?de:Rx(Y._f)):N(A,de),u.mount&&!u.action&&(M(),W&&r.isDirty&&(S.isDirty||_.isDirty)&&(ee()||(r.isDirty=!1,E.state.next({...r}))),e.shouldUnregister&&W&&!gt(Se(l,A))&&Jh(A,d)&&(u.watch=!0))}},ue=(A,I,U,ce,Y)=>{let W=!1,de=!1;const we={name:A};if(!n.disabled||ce===!0){if(!U||ce){const _e=Or(Se(o,A),I);(S.isDirty||_.isDirty)&&(de=r.isDirty,r.isDirty=we.isDirty=!_e||ee(),W=de!==we.isDirty),de=!!Se(r.dirtyFields,A),_e!==r.isDirty?r.dirtyFields=bi(o,l,void 0,i):_e?Nt(r.dirtyFields,A):ct(r.dirtyFields,A,!0),we.dirtyFields=r.dirtyFields,W=W||(S.dirtyFields||_.dirtyFields)&&de!==!_e}if(U){const _e=Se(r.touchedFields,A);_e||(ct(r.touchedFields,A,U),we.touchedFields=r.touchedFields,W=W||(S.touchedFields||_.touchedFields)&&_e!==U)}W&&Y&&E.state.next(we)}return W?we:{}},X=(A,I,U,ce)=>{const Y=Se(r.errors,A),W=(S.isValid||_.isValid)&&Tr(I)&&r.isValid!==I;if(n.delayError&&U?(p[A]=O(A,()=>V(A,U)),p[A](n.delayError)):(clearTimeout(m[A]),delete p[A],U?ct(r.errors,A,U):Nt(r.errors,A),r.errors={...r.errors}),(U?!Or(Y,U):Y)||!rn(ce)||W){const de={...ce,...W&&Tr(I)?{isValid:I}:{},errors:r.errors,name:A};r={...r,...de},E.state.next(de)}},pe=async A=>(D(A,!0),await n.resolver(l,n.context,k4(A||d.mount,i,n.criteriaMode,n.shouldUseNativeValidation))),ge=async A=>{const{errors:I}=await pe(A);if(D(A),A){for(const U of A){const ce=Se(I,U);ce?d.array.has(U)&&Rt(ce)&&!Object.keys(ce).some(Y=>!Number.isNaN(Number(Y)))?bx(r.errors,{[U]:ce},U):ct(r.errors,U,ce):Nt(r.errors,U)}r.errors={...r.errors}}else r.errors=I;return I},L=async({name:A,eventType:I})=>{if(e.validate){const U=await e.validate({formValues:l,formState:r,name:A,eventType:I});if(Rt(U))for(const ce in U){const Y=U[ce];Y&&it(`${em}.${ce}`,{message:on(Y.message)?Y.message:"",type:Y.type||hr.validate})}else on(U)||!U?it(em,{message:U||"",type:hr.validate}):Ve(em);return U}return!0},Z=async({fields:A,onlyCheckValid:I,name:U,eventType:ce,context:Y={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(Y.runRootValidation=!0,!await L({name:U,eventType:ce})&&(Y.valid=!1,I)))return Y.valid;for(const W in A){const de=A[W];if(de){const{_f:we,..._e}=de;if(we){const Xe=d.array.has(we.name),wt=de._f&&L4(de._f),Xt=S.validatingFields||S.isValidating||_.validatingFields||_.isValidating;wt&&Xt&&D([we.name],!0);const zt=await Cx(de,d.disabled,l,T,n.shouldUseNativeValidation&&!I,Xe);if(wt&&Xt&&D([we.name]),zt[we.name]&&(Y.valid=!1,I)||(!I&&(Se(zt,we.name)?Xe?bx(r.errors,zt,we.name):ct(r.errors,we.name,zt[we.name]):Nt(r.errors,we.name)),e.shouldUseNativeValidation&&zt[we.name]))break}!rn(_e)&&await Z({context:Y,onlyCheckValid:I,fields:_e,name:W,eventType:ce})}}return Y.valid},re=()=>{for(const A of d.unMount){const I=Se(i,A);I&&(I._f.refs?I._f.refs.every(U=>!Wh(U)):!Wh(I._f.ref))&&Qt(A)}d.unMount=new Set},ee=(A,I)=>(A&&I&&ct(l,A,I),!Or(u.mount?l:o,o)),ne=(A,I,U)=>O4(A,d,{...u.mount?l:gt(I)?o:on(A)?{[A]:I}:I},U,I),z=A=>J_(Se(u.mount?l:o,A,n.shouldUnregister?Se(o,A,[]):[])),N=(A,I,U={},ce=!1,Y=!1)=>{const W=Se(i,A);let de=I;if(W){const we=W._f;we&&(!we.disabled&&ct(l,A,iC(I,we)),de=_u(we.ref)&&an(I)?"":I,tC(we.ref)?[...we.ref.options].forEach(_e=>_e.selected=de.includes(_e.value)):we.refs?El(we.ref)?we.refs.forEach(_e=>{(!_e.defaultChecked||!_e.disabled)&&(Array.isArray(de)?_e.checked=!!de.find(Xe=>Xe===_e.value):_e.checked=de===_e.value||!!de)}):we.refs.forEach(_e=>_e.checked=_e.value===de):tg(we.ref)?we.ref.value="":(we.ref.value=de,!we.ref.type&&!Y&&E.state.next({name:A,values:ce?l:Mt(l)})))}(U.shouldDirty||U.shouldTouch)&&ue(A,de,U.shouldTouch,U.shouldDirty,!Y),U.shouldValidate&&xe(A,{delayError:U.delayError})},B=(A,I,U,ce=!1,Y=!1)=>{for(const W in I){if(!I.hasOwnProperty(W))return;const de=I[W],we=A+"."+W,_e=Se(i,we);(d.array.has(A)||Rt(de)||_e&&!_e._f)&&!za(de)?B(we,de,U,ce,Y):N(we,de,U,ce,Y)}},J=(A,I,U,ce,Y=!1)=>{const W=Se(i,A),de=d.array.has(A),we=ce?I:Mt(I),_e=Se(l,A),Xe=Or(_e,we);if(Xe||ct(l,A,we),de)E.array.next({name:A,values:ce?l:Mt(l)}),(S.isDirty||S.dirtyFields||_.isDirty||_.dirtyFields)&&U.shouldDirty&&(P(),Y||E.state.next({name:A,dirtyFields:r.dirtyFields,isDirty:ee(A,we)}));else{const wt=Array.isArray(we)&&!we.length||rn(we);!W||W._f||an(we)||wt?N(A,we,U,ce,Y):B(A,we,U,ce,Y)}if(!Xe&&!Y){const wt=Jh(A,d),Xt=ce?l:Mt(l);E.state.next({...wt&&r,name:u.mount||wt?A:void 0,values:Xt})}},K=(A,I,U={})=>J(A,I,U,!1),le=(A,I={})=>{const U=Jn(A)?A(l):A;if(!Or(l,U)){l={...l,...U};const ce=W_(U);for(const Y of d.mount)Y in ce&&J(Y,ce[Y],I,!0,!0);E.state.next({...r,name:void 0,type:void 0,...y?{values:l}:{}}),I.shouldValidate&&M()}},ae=async A=>{u.mount=!0;const I=A.target;let U=I.name,ce=!0;const Y=Se(i,U),W=de=>{ce=Number.isNaN(de)||za(de)&&isNaN(de.getTime())||Or(de,Se(l,U,de))};if(Y){let de,we;const _e=I.type?Rx(Y._f):S4(A),Xe=A.type===Rs.BLUR||A.type===Rs.FOCUS_OUT,wt=!$4(Y._f)&&!e.validate&&!n.resolver&&!Se(r.errors,U)&&!Y._f.deps,Xt=wt||F4(Xe,Se(r.touchedFields,U),r.isSubmitted,b,v),zt=Jh(U,d,Xe);if(ct(l,U,_e),Xe){if(!I||!I.readOnly){Y._f.onBlur&&Y._f.onBlur(A);const yt=p[U];yt&&yt(0)}}else Y._f.onChange&&Y._f.onChange(A);const Ne=ue(U,_e,Xe),ht=!rn(Ne)||zt;if(!Xe&&E.state.next({name:U,type:A.type,...y?{values:Mt(l)}:{}}),Xt)return(!wt||!r.isValid)&&(S.isValid||_.isValid)&&(n.mode==="onBlur"?Xe&&M():Xe||M()),ht&&E.state.next({name:U,...zt?{}:Ne});if(!n.resolver&&e.validate&&await L({name:U,eventType:A.type}),!Xe&&zt&&E.state.next({...r}),n.resolver){const{errors:yt}=await pe([U]);if(D([U]),W(_e),!ce){!rn(Ne)&&E.state.next(Ne);return}const qt=Tx(r.errors,i,U),or=Tx(yt,i,qt.name||U);de=or.error,U=or.name,we=rn(yt)}else D([U],!0),de=(await Cx(Y,d.disabled,l,T,n.shouldUseNativeValidation))[U],D([U]),W(_e),ce&&(de?we=!1:(S.isValid||_.isValid)&&(we=await Z({fields:i,onlyCheckValid:!0,name:U,eventType:A.type})));ce&&(Y._f.deps&&(!Array.isArray(Y._f.deps)||Y._f.deps.length>0)&&xe(Y._f.deps),X(U,we,de,Ne))}},ye=(A,I)=>{if(Se(r.errors,I)&&A.focus)return A.focus(),1},xe=async(A,I={})=>{let U,ce;const Y=cu(A);if(n.resolver){const W=await ge(gt(A)?A:Y);U=rn(W),ce=A?!Y.some(de=>Se(W,de)):U}else A?(ce=(await Promise.all(Y.map(async W=>{const de=Se(i,W);return await Z({fields:de&&de._f?{[W]:de}:de,eventType:Rs.TRIGGER})}))).every(Boolean),!(!ce&&!r.isValid)&&M()):ce=U=await Z({fields:i,name:A,eventType:Rs.TRIGGER});if(I.delayError&&n.delayError&&on(A)){const W=Se(r.errors,A);W?(Nt(r.errors,A),p[A]=O(A,()=>V(A,W)),p[A](n.delayError)):(clearTimeout(m[A]),delete p[A])}return E.state.next({...!on(A)||(S.isValid||_.isValid)&&U!==r.isValid?{}:{name:A},...n.resolver||!A?{isValid:U}:{},errors:r.errors}),I.shouldFocus&&!ce&&tl(i,ye,A?Y:d.mount),ce},Oe=(A,I)=>{let U={...u.mount?l:o};return I&&(U=eC(I.dirtyFields?r.dirtyFields:r.touchedFields,U)),gt(A)?U:on(A)?Se(U,A):A.map(ce=>Se(U,ce))},Ie=(A,I)=>({invalid:!!Se((I||r).errors,A),isDirty:!!Se((I||r).dirtyFields,A),error:Se((I||r).errors,A),isValidating:!!Se(r.validatingFields,A),isTouched:!!Se((I||r).touchedFields,A)}),Ve=A=>{const I=A?cu(A):void 0;I?.forEach(U=>Nt(r.errors,U)),I?I.forEach(U=>{E.state.next({name:U,errors:r.errors})}):E.state.next({errors:{}})},it=(A,I,U)=>{const ce=(Se(i,A,{_f:{}})._f||{}).ref,Y=Se(r.errors,A)||{},{ref:W,message:de,type:we,..._e}=Y;ct(r.errors,A,{..._e,...I,ref:ce}),E.state.next({name:A,errors:r.errors,isValid:!1}),U&&U.shouldFocus&&ce&&ce.focus&&ce.focus()},Qe=(A,I)=>{if(Jn(A)){y++;const{unsubscribe:U}=E.state.subscribe({next:Y=>"values"in Y&&A(Y.values||ne(void 0,I),Y)});let ce=!1;return{unsubscribe:()=>{ce||(ce=!0,y--,U())}}}return ne(A,I,!0)},fn=A=>{var I;const U=!!(!((I=A.formState)===null||I===void 0)&&I.values);U&&y++;const{unsubscribe:ce}=E.state.subscribe({next:W=>{if(P4(A.name,W.name,A.exact)&&I4(W,A.formState||S,ir,A.reRenderRoot)){const de={...l};A.callback({values:de,...r,...W,defaultValues:o})}}});if(!U)return ce;let Y=!1;return()=>{Y||(Y=!0,y--,ce())}},hn=A=>(u.mount=!0,_={..._,...A.formState},fn({...A,formState:{...x,...A.formState}})),Qt=(A,I={})=>{for(const U of A?cu(A):d.mount)d.mount.delete(U),d.array.delete(U),I.keepValue||(Nt(i,U),Nt(l,U)),!I.keepError&&Nt(r.errors,U),!I.keepDirty&&Nt(r.dirtyFields,U),!I.keepTouched&&Nt(r.touchedFields,U),!I.keepIsValidating&&Nt(r.validatingFields,U),!n.shouldUnregister&&!I.keepDefaultValue&&Nt(o,U);E.state.next({values:Mt(l)}),E.state.next({...r,...I.keepDirty?{isDirty:ee()}:{}}),!I.keepIsValid&&M()},br=({disabled:A,name:I})=>{if(Tr(A)&&u.mount||A||d.disabled.has(I)){const Y=d.disabled.has(I)!==!!A;A?d.disabled.add(I):d.disabled.delete(I),Y&&u.mount&&!u.action&&M()}},jt=(A,I={})=>{let U=Se(i,A);const ce=Tr(I.disabled)||Tr(n.disabled),Y=!d.registerName.has(A)&&U&&U._f&&!U._f.mount;return ct(i,A,{...U||{},_f:{...U&&U._f?U._f:{ref:{name:A}},name:A,mount:!0,...I}}),d.mount.add(A),U&&!Y?br({disabled:Tr(I.disabled)?I.disabled:n.disabled,name:A}):he(A,!0,I.value),{...ce?{disabled:I.disabled||n.disabled}:{},...n.progressive?{required:!!I.required,min:qo(I.min),max:qo(I.max),minLength:qo(I.minLength),maxLength:qo(I.maxLength),pattern:qo(I.pattern)}:{},name:A,onChange:ae,onBlur:ae,ref:W=>{if(W){d.registerName.add(A),jt(A,I),d.registerName.delete(A),U=Se(i,A);const de=gt(W.value)&&W.querySelectorAll&&W.querySelectorAll("input,select,textarea")[0]||W,we=D4(de),_e=U._f.refs||[];if(we?_e.find(Xe=>Xe===de):de===U._f.ref)return;ct(i,A,{_f:{...U._f,...we?{refs:[..._e.filter(Wh),de,...Array.isArray(Se(o,A))?[{}]:[]],ref:{type:de.type,name:A}}:{ref:de}}}),he(A,!1,void 0,de)}else U=Se(i,A,{}),U._f&&(U._f.mount=!1),(n.shouldUnregister||I.shouldUnregister)&&!(_4(d.array,A)&&u.action)&&d.unMount.add(A)}}},rr=()=>n.shouldFocusError&&!n.shouldUseNativeValidation&&tl(i,ye,d.mount),xr=A=>{Tr(A)&&(E.state.next({disabled:A}),tl(i,(I,U)=>{const ce=Se(i,U);ce&&(I.disabled=ce._f.disabled||A,Array.isArray(ce._f.refs)&&ce._f.refs.forEach(Y=>{Y.disabled=ce._f.disabled||A}))},0,!1))},Tt=(A,I)=>async U=>{let ce;U&&(U.preventDefault&&U.preventDefault(),U.persist&&U.persist());let Y=Mt(l);if(E.state.next({isSubmitting:!0}),n.resolver){const{errors:W,values:de}=await pe();D(),r.errors=W,Y=Mt(de)}else await Z({fields:i,eventType:Rs.SUBMIT});if(d.disabled.size)for(const W of d.disabled)Nt(Y,W);if(Nt(r.errors,Y_),rn(r.errors)){E.state.next({errors:{}});try{await A(Y,U)}catch(W){ce=W}}else I&&await I({...r.errors},U),rr(),setTimeout(rr);if(E.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:rn(r.errors)&&!ce,submitCount:r.submitCount+1,errors:r.errors}),ce)throw ce},Vn=(A,I={})=>{Se(i,A)&&(gt(I.defaultValue)?K(A,Mt(Se(o,A))):(K(A,I.defaultValue),ct(o,A,Mt(I.defaultValue))),I.keepTouched||Nt(r.touchedFields,A),I.keepDirty||(Nt(r.dirtyFields,A),r.isDirty=I.defaultValue?ee(A,Mt(Se(o,A))):ee()),I.keepError||(Nt(r.errors,A),S.isValid&&M()),E.state.next({...r}))},Dt=(A,I={})=>{const U=A?Mt(A):o,ce=Mt(U),Y=rn(A),W=ce,de=i;if(I.keepDefaultValues||(o=U),!I.keepValues){if(I.keepDirtyValues){const we=new Set([...d.mount,...Object.keys(bi(o,l,void 0,de))]);for(const _e of Array.from(we)){const Xe=Se(r.dirtyFields,_e),wt=Se(l,_e),Xt=Se(W,_e);Xe&&!gt(wt)?ct(W,_e,wt):!Xe&&!gt(Xt)&&K(_e,Xt)}}else{if(td&>(A))for(const we of d.mount){const _e=Se(i,we);if(_e&&_e._f){const Xe=Array.isArray(_e._f.refs)?_e._f.refs[0]:_e._f.ref;if(_u(Xe)){const wt=Xe.closest("form");if(wt){wt.reset();break}}}}if(I.keepFieldsRef)for(const we of d.mount)K(we,Se(W,we));else i={}}if(n.shouldUnregister){if(l=I.keepDefaultValues?Mt(o):{},I.keepFieldsRef)for(const we of d.mount)ct(l,we,Se(W,we))}else l=Mt(W);E.array.next({values:{...W}}),E.state.next({name:void 0,type:void 0,values:{...W}})}d={mount:I.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},u.mount=!S.isValid||!!I.keepIsValid||!!I.keepDirtyValues||!n.shouldUnregister&&!rn(W),u.watch=!!n.shouldUnregister,u.keepIsValid=!!I.keepIsValid,u.action=!1,I.keepErrors||(r.errors={}),E.state.next({submitCount:I.keepSubmitCount?r.submitCount:0,isDirty:Y?!1:I.keepDirty?r.isDirty:I.keepValues?ee():!!(I.keepDefaultValues&&!Or(A,o)),isSubmitted:I.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:Y?{}:I.keepDirtyValues?I.keepDefaultValues&&l?bi(o,l,void 0,de):r.dirtyFields:I.keepDefaultValues&&A?bi(o,A,void 0,de):I.keepDirty?r.dirtyFields:{},touchedFields:I.keepTouched?r.touchedFields:{},errors:I.keepErrors?r.errors:{},isSubmitSuccessful:I.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},kr=(A,I)=>Dt(Jn(A)?A(l):A,{...n.resetOptions,...I}),ar=(A,I={})=>{const U=Se(i,A),ce=U&&U._f;if(ce){const Y=ce.refs?ce.refs[0]:ce.ref;Y.focus&&setTimeout(()=>{Y.focus(),I.shouldSelect&&Jn(Y.select)&&Y.select()})}},ir=A=>{const{name:I,type:U,values:ce,...Y}=A;r={...r,...Y}},mn={control:{register:jt,unregister:Qt,getFieldState:Ie,handleSubmit:Tt,setError:it,_subscribe:fn,_runSchema:pe,_updateIsValidating:D,_focusError:rr,_getWatch:ne,_getDirty:ee,_setValid:M,_setFieldArray:F,_setDisabledField:br,_setErrors:ve,_getFieldArray:z,_reset:Dt,_resetDefaultValues:()=>Jn(n.defaultValues)&&n.defaultValues().then(A=>{kr(A,n.resetOptions),E.state.next({isLoading:!1})}),_removeUnmounted:re,_disableForm:xr,_subjects:E,_proxyFormState:S,get _fields(){return i},get _formValues(){return l},get _state(){return u},set _state(A){u=A},get _defaultValues(){return o},get _names(){return d},set _names(A){d=A},get _formState(){return r},get _options(){return n},set _options(A){n={...n,...A},v=eu(n.mode),b=eu(n.reValidateMode)}},subscribe:hn,trigger:xe,register:jt,handleSubmit:Tt,watch:Qe,setValue:K,setValues:le,getValues:Oe,reset:kr,resetField:Vn,resetDefaultValues:(A,I={})=>{if(o=Mt(A),!I.keepDirty){const U=bi(o,l,void 0,i);r.dirtyFields=U,r.isDirty=!rn(U)}I.keepIsValid||M(),E.state.next({...r,defaultValues:o})},clearErrors:Ve,unregister:Qt,setError:it,setFocus:ar,getFieldState:Ie};return{...mn,formControl:mn}}function ag(e={}){const n=me.useRef(void 0),r=me.useRef(void 0),i=me.useRef(e.formControl),[o,l]=me.useState(()=>({...Mt(sC),isLoading:Jn(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Jn(e.defaultValues)?void 0:e.defaultValues}));if(!n.current||e.formControl&&i.current!==e.formControl)if(i.current=e.formControl,e.formControl)n.current={...e.formControl,formState:o},e.defaultValues&&!Jn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:d,...p}=H4(e);n.current={...p,formState:o}}const u=n.current.control;return u._options=e,T4(()=>{const d=u._subscribe({formState:u._proxyFormState,callback:()=>l({...u._formState,defaultValues:u._defaultValues}),reRenderRoot:!0});return l(p=>({...p,isReady:!0})),u._formState.isReady=!0,d},[u]),me.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),me.useEffect(()=>{e.mode&&(u._options.mode=e.mode),e.reValidateMode&&(u._options.reValidateMode=e.reValidateMode)},[u,e.mode,e.reValidateMode]),me.useEffect(()=>{e.errors&&(u._setErrors(e.errors),u._focusError())},[u,e.errors]),me.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,e.shouldUnregister]),me.useEffect(()=>{if(u._proxyFormState.isDirty){const d=u._getDirty();d!==o.isDirty&&u._subjects.state.next({isDirty:d})}},[u,o.isDirty]),me.useEffect(()=>{var d;e.values&&!Or(e.values,r.current)?(u._reset(e.values,{keepFieldsRef:!0,...u._options.resetOptions}),!((d=u._options.resetOptions)===null||d===void 0)&&d.keepIsValid||u._setValid(),r.current=e.values,l(p=>({...p}))):u._resetDefaultValues()},[u,e.values]),me.useEffect(()=>{u._state.mount||(u._setValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),n.current.formState=me.useMemo(()=>j4(o,u),[u,o]),n.current}const Ox=(e,n,r)=>{if(e&&"reportValidity"in e){const i=Se(r,n);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},Bm=(e,n)=>{for(const r in n.fields){const i=n.fields[r];i&&i.ref&&"reportValidity"in i.ref?Ox(i.ref,r,e):i&&i.refs&&i.refs.forEach(o=>Ox(o,r,e))}},Ax=(e,n)=>{n.shouldUseNativeValidation&&Bm(e,n);const r={};for(const i in e){const o=Se(n.fields,i),l=Object.assign(e[i]||{},{ref:o&&o.ref});if(B4(n.names||Object.keys(e),i)){const u=Object.assign({},Se(r,i));ct(u,"root",l),ct(r,i,u)}else ct(r,i,l)}return r},B4=(e,n)=>{const r=Mx(n).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(i=>Mx(i).match(`^${r}\\.\\d+`))};function Mx(e){return e.replace(/[\[\]]/g,"")}var Nx;function fe(e,n,r){function i(d,p){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:p,constr:u,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),n(d,p);const m=u.prototype,y=Object.keys(m);for(let v=0;vr?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class $s extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class oC extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}(Nx=globalThis).__zod_globalConfig??(Nx.__zod_globalConfig={});const ig=globalThis.__zod_globalConfig;function ji(e){return ig}function lC(e){const n=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>n.indexOf(+i)===-1).map(([i,o])=>o)}function qm(e,n){return typeof n=="bigint"?n.toString():n}function sg(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function og(e){return e==null}function lg(e){const n=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(n,r)}const Dx=Symbol("evaluating");function dt(e,n,r){let i;Object.defineProperty(e,n,{get(){if(i!==Dx)return i===void 0&&(i=Dx,i=r()),i},set(o){Object.defineProperty(e,n,{value:o})},configurable:!0})}function Li(e,n,r){Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Xa(...e){const n={};for(const r of e){const i=Object.getOwnPropertyDescriptors(r);Object.assign(n,i)}return Object.defineProperties({},n)}function zx(e){return JSON.stringify(e)}function q4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const cC="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Eu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const G4=sg(()=>{if(ig.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function hl(e){if(Eu(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const r=n.prototype;return!(Eu(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function uC(e){return hl(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Z4=new Set(["string","number","symbol"]);function rd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ja(e,n,r){const i=new e._zod.constr(n??e._zod.def);return(!n||r?.parent)&&(i._zod.parent=e),i}function Le(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function K4(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}function Y4(e,n){const r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const l=Xa(e._zod.def,{get shape(){const u={};for(const d in n){if(!(d in r.shape))throw new Error(`Unrecognized key: "${d}"`);n[d]&&(u[d]=r.shape[d])}return Li(this,"shape",u),u},checks:[]});return Ja(e,l)}function Q4(e,n){const r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const l=Xa(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const d in n){if(!(d in r.shape))throw new Error(`Unrecognized key: "${d}"`);n[d]&&delete u[d]}return Li(this,"shape",u),u},checks:[]});return Ja(e,l)}function X4(e,n){if(!hl(n))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const l=e._zod.def.shape;for(const u in n)if(Object.getOwnPropertyDescriptor(l,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Xa(e._zod.def,{get shape(){const l={...e._zod.def.shape,...n};return Li(this,"shape",l),l}});return Ja(e,o)}function J4(e,n){if(!hl(n))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Xa(e._zod.def,{get shape(){const i={...e._zod.def.shape,...n};return Li(this,"shape",i),i}});return Ja(e,r)}function W4(e,n){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=Xa(e._zod.def,{get shape(){const i={...e._zod.def.shape,...n._zod.def.shape};return Li(this,"shape",i),i},get catchall(){return n._zod.def.catchall},checks:n._zod.def.checks??[]});return Ja(e,r)}function e5(e,n,r){const o=n._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Xa(n._zod.def,{get shape(){const d=n._zod.def.shape,p={...d};if(r)for(const m in r){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);r[m]&&(p[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)p[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Li(this,"shape",p),p},checks:[]});return Ja(n,u)}function t5(e,n,r){const i=Xa(n._zod.def,{get shape(){const o=n._zod.def.shape,l={...o};if(r)for(const u in r){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=new e({type:"nonoptional",innerType:o[u]}))}else for(const u in o)l[u]=new e({type:"nonoptional",innerType:o[u]});return Li(this,"shape",l),l}});return Ja(n,i)}function Ns(e,n=0){if(e.aborted===!0)return!0;for(let r=n;r{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function tu(e){return typeof e=="string"?e:e?.message}function Ti(e,n,r){const i=e.message?e.message:tu(e.inst?._zod.def?.error?.(e))??tu(n?.error?.(e))??tu(r.customError?.(e))??tu(r.localeError?.(e))??"Invalid input",{inst:o,continue:l,input:u,...d}=e;return d.path??(d.path=[]),d.message=i,n?.reportInput&&(d.input=u),d}function cg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ml(...e){const[n,r,i]=e;return typeof n=="string"?{message:n,code:"custom",input:r,inst:i}:{...n}}const fC=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,qm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ug=fe("$ZodError",fC),ad=fe("$ZodError",fC,{Parent:Error});function r5(e,n=r=>r.message){const r={},i=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(n(o))):i.push(n(o));return{formErrors:i,fieldErrors:r}}function a5(e,n=r=>r.message){const r={_errors:[]},i=(o,l=[])=>{for(const u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>i({issues:d},[...l,...u.path]));else if(u.code==="invalid_key")i({issues:u.issues},[...l,...u.path]);else if(u.code==="invalid_element")i({issues:u.issues},[...l,...u.path]);else{const d=[...l,...u.path];if(d.length===0)r._errors.push(n(u));else{let p=r,m=0;for(;m(n,r,i,o)=>{const l=i?{...i,async:!1}:{async:!1},u=n._zod.run({value:r,issues:[]},l);if(u instanceof Promise)throw new $s;if(u.issues.length){const d=new(o?.Err??e)(u.issues.map(p=>Ti(p,l,ji())));throw cC(d,o?.callee),d}return u.value},i5=id(ad),sd=e=>async(n,r,i,o)=>{const l=i?{...i,async:!0}:{async:!0};let u=n._zod.run({value:r,issues:[]},l);if(u instanceof Promise&&(u=await u),u.issues.length){const d=new(o?.Err??e)(u.issues.map(p=>Ti(p,l,ji())));throw cC(d,o?.callee),d}return u.value},s5=sd(ad),od=e=>(n,r,i)=>{const o=i?{...i,async:!1}:{async:!1},l=n._zod.run({value:r,issues:[]},o);if(l instanceof Promise)throw new $s;return l.issues.length?{success:!1,error:new(e??ug)(l.issues.map(u=>Ti(u,o,ji())))}:{success:!0,data:l.value}},o5=od(ad),ld=e=>async(n,r,i)=>{const o=i?{...i,async:!0}:{async:!0};let l=n._zod.run({value:r,issues:[]},o);return l instanceof Promise&&(l=await l),l.issues.length?{success:!1,error:new e(l.issues.map(u=>Ti(u,o,ji())))}:{success:!0,data:l.value}},l5=ld(ad),c5=e=>(n,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return id(e)(n,r,o)},u5=e=>(n,r,i)=>id(e)(n,r,i),d5=e=>async(n,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return sd(e)(n,r,o)},f5=e=>async(n,r,i)=>sd(e)(n,r,i),h5=e=>(n,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return od(e)(n,r,o)},m5=e=>(n,r,i)=>od(e)(n,r,i),p5=e=>async(n,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return ld(e)(n,r,o)},g5=e=>async(n,r,i)=>ld(e)(n,r,i),v5=/^[cC][0-9a-z]{6,}$/,y5=/^[0-9a-z]+$/,b5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,x5=/^[0-9a-vA-V]{20}$/,w5=/^[A-Za-z0-9]{27}$/,S5=/^[a-zA-Z0-9_-]{21}$/,_5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,C5=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,kx=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,E5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,R5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function j5(){return new RegExp(R5,"u")}const T5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,O5=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,A5=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,M5=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,N5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,hC=/^[A-Za-z0-9_-]*$/,D5=/^https?$/,z5=/^\+[1-9]\d{6,14}$/,mC="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",k5=new RegExp(`^${mC}$`);function pC(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function L5(e){return new RegExp(`^${pC(e)}$`)}function $5(e){const n=pC({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${n}(?:${r.join("|")})`;return new RegExp(`^${mC}T(?:${i})$`)}const I5=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},P5=/^(?:true|false)$/i,F5=/^[^A-Z]*$/,V5=/^[^a-z]*$/,zr=fe("$ZodCheck",(e,n)=>{var r;e._zod??(e._zod={}),e._zod.def=n,(r=e._zod).onattach??(r.onattach=[])}),U5=fe("$ZodCheckMaxLength",(e,n)=>{var r;zr.init(e,n),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!og(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum{const o=i.value;if(o.length<=n.maximum)return;const u=cg(o);i.issues.push({origin:u,code:"too_big",maximum:n.maximum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),H5=fe("$ZodCheckMinLength",(e,n)=>{var r;zr.init(e,n),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!og(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>o&&(i._zod.bag.minimum=n.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=n.minimum)return;const u=cg(o);i.issues.push({origin:u,code:"too_small",minimum:n.minimum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),B5=fe("$ZodCheckLengthEquals",(e,n)=>{var r;zr.init(e,n),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!og(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=n.length,o.maximum=n.length,o.length=n.length}),e._zod.check=i=>{const o=i.value,l=o.length;if(l===n.length)return;const u=cg(o),d=l>n.length;i.issues.push({origin:u,...d?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!n.abort})}}),cd=fe("$ZodCheckStringFormat",(e,n)=>{var r,i;zr.init(e,n),e._zod.onattach.push(o=>{const l=o._zod.bag;l.format=n.format,n.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(n.pattern))}),n.pattern?(r=e._zod).check??(r.check=o=>{n.pattern.lastIndex=0,!n.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:n.format,input:o.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(i=e._zod).check??(i.check=()=>{})}),q5=fe("$ZodCheckRegex",(e,n)=>{cd.init(e,n),e._zod.check=r=>{n.pattern.lastIndex=0,!n.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),G5=fe("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=F5),cd.init(e,n)}),Z5=fe("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=V5),cd.init(e,n)}),K5=fe("$ZodCheckIncludes",(e,n)=>{zr.init(e,n);const r=rd(n.includes),i=new RegExp(typeof n.position=="number"?`^.{${n.position}}${r}`:r);n.pattern=i,e._zod.onattach.push(o=>{const l=o._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(i)}),e._zod.check=o=>{o.value.includes(n.includes,n.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:o.value,inst:e,continue:!n.abort})}}),Y5=fe("$ZodCheckStartsWith",(e,n)=>{zr.init(e,n);const r=new RegExp(`^${rd(n.prefix)}.*`);n.pattern??(n.pattern=r),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(n.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:i.value,inst:e,continue:!n.abort})}}),Q5=fe("$ZodCheckEndsWith",(e,n)=>{zr.init(e,n);const r=new RegExp(`.*${rd(n.suffix)}$`);n.pattern??(n.pattern=r),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(n.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:i.value,inst:e,continue:!n.abort})}}),X5=fe("$ZodCheckOverwrite",(e,n)=>{zr.init(e,n),e._zod.check=r=>{r.value=n.tx(r.value)}});class J5{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const i=n.split(` + color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,r?.key)}return o}}function ke(e,n,r,i){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[n]},key:!1,onChange:i}}function $3(e,n,r,i){const o=()=>{var u;return(u=l.getValue())!=null?u:e.options.renderFallbackValue},l={id:`${n.id}_${r.id}`,row:n,column:r,getValue:()=>n.getValue(i),renderValue:o,getContext:ze(()=>[e,r,n,l],(u,d,p,m)=>({table:u,column:d,row:p,cell:m,getValue:m.getValue,renderValue:m.renderValue}),ke(e.options,"debugCells"))};return e._features.forEach(u=>{u.createCell==null||u.createCell(l,r,n,e)},{}),l}function I3(e,n,r,i){var o,l;const d={...e._getDefaultColumnDef(),...n},p=d.accessorKey;let m=(o=(l=d.id)!=null?l:p?typeof String.prototype.replaceAll=="function"?p.replaceAll(".","_"):p.replace(/\./g,"_"):void 0)!=null?o:typeof d.header=="string"?d.header:void 0,y;if(d.accessorFn?y=d.accessorFn:p&&(p.includes(".")?y=b=>{let x=b;for(const _ of p.split(".")){var w;x=(w=x)==null?void 0:w[_]}return x}:y=b=>b[d.accessorKey]),!m)throw new Error;let v={id:`${String(m)}`,accessorFn:y,parent:i,depth:r,columnDef:d,columns:[],getFlatColumns:ze(()=>[!0],()=>{var b;return[v,...(b=v.columns)==null?void 0:b.flatMap(x=>x.getFlatColumns())]},ke(e.options,"debugColumns")),getLeafColumns:ze(()=>[e._getOrderColumnsFn()],b=>{var x;if((x=v.columns)!=null&&x.length){let w=v.columns.flatMap(_=>_.getLeafColumns());return b(w)}return[v]},ke(e.options,"debugColumns"))};for(const b of e._features)b.createColumn==null||b.createColumn(v,e);return v}const un="debugHeaders";function gx(e,n,r){var i;let l={id:(i=r.id)!=null?i:n.id,column:n,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const u=[],d=p=>{p.subHeaders&&p.subHeaders.length&&p.subHeaders.map(d),u.push(p)};return d(l),u},getContext:()=>({table:e,header:l,column:n})};return e._features.forEach(u=>{u.createHeader==null||u.createHeader(l,e)}),l}const P3={createTable:e=>{e.getHeaderGroups=ze(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i,o)=>{var l,u;const d=(l=i?.map(v=>r.find(b=>b.id===v)).filter(Boolean))!=null?l:[],p=(u=o?.map(v=>r.find(b=>b.id===v)).filter(Boolean))!=null?u:[],m=r.filter(v=>!(i!=null&&i.includes(v.id))&&!(o!=null&&o.includes(v.id)));return Xc(n,[...d,...m,...p],e)},ke(e.options,un)),e.getCenterHeaderGroups=ze(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i,o)=>(r=r.filter(l=>!(i!=null&&i.includes(l.id))&&!(o!=null&&o.includes(l.id))),Xc(n,r,e,"center")),ke(e.options,un)),e.getLeftHeaderGroups=ze(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,r,i)=>{var o;const l=(o=i?.map(u=>r.find(d=>d.id===u)).filter(Boolean))!=null?o:[];return Xc(n,l,e,"left")},ke(e.options,un)),e.getRightHeaderGroups=ze(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,r,i)=>{var o;const l=(o=i?.map(u=>r.find(d=>d.id===u)).filter(Boolean))!=null?o:[];return Xc(n,l,e,"right")},ke(e.options,un)),e.getFooterGroups=ze(()=>[e.getHeaderGroups()],n=>[...n].reverse(),ke(e.options,un)),e.getLeftFooterGroups=ze(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),ke(e.options,un)),e.getCenterFooterGroups=ze(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),ke(e.options,un)),e.getRightFooterGroups=ze(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),ke(e.options,un)),e.getFlatHeaders=ze(()=>[e.getHeaderGroups()],n=>n.map(r=>r.headers).flat(),ke(e.options,un)),e.getLeftFlatHeaders=ze(()=>[e.getLeftHeaderGroups()],n=>n.map(r=>r.headers).flat(),ke(e.options,un)),e.getCenterFlatHeaders=ze(()=>[e.getCenterHeaderGroups()],n=>n.map(r=>r.headers).flat(),ke(e.options,un)),e.getRightFlatHeaders=ze(()=>[e.getRightHeaderGroups()],n=>n.map(r=>r.headers).flat(),ke(e.options,un)),e.getCenterLeafHeaders=ze(()=>[e.getCenterFlatHeaders()],n=>n.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),ke(e.options,un)),e.getLeftLeafHeaders=ze(()=>[e.getLeftFlatHeaders()],n=>n.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),ke(e.options,un)),e.getRightLeafHeaders=ze(()=>[e.getRightFlatHeaders()],n=>n.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),ke(e.options,un)),e.getLeafHeaders=ze(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,r,i)=>{var o,l,u,d,p,m;return[...(o=(l=n[0])==null?void 0:l.headers)!=null?o:[],...(u=(d=r[0])==null?void 0:d.headers)!=null?u:[],...(p=(m=i[0])==null?void 0:m.headers)!=null?p:[]].map(y=>y.getLeafHeaders()).flat()},ke(e.options,un))}};function Xc(e,n,r,i){var o,l;let u=0;const d=function(b,x){x===void 0&&(x=1),u=Math.max(u,x),b.filter(w=>w.getIsVisible()).forEach(w=>{var _;(_=w.columns)!=null&&_.length&&d(w.columns,x+1)},0)};d(e);let p=[];const m=(b,x)=>{const w={depth:x,id:[i,`${x}`].filter(Boolean).join("_"),headers:[]},_=[];b.forEach(E=>{const R=[..._].reverse()[0],T=E.column.depth===w.depth;let O,M=!1;if(T&&E.column.parent?O=E.column.parent:(O=E.column,M=!0),R&&R?.column===O)R.subHeaders.push(E);else{const D=gx(r,O,{id:[i,x,O.id,E?.id].filter(Boolean).join("_"),isPlaceholder:M,placeholderId:M?`${_.filter(P=>P.column===O).length}`:void 0,depth:x,index:_.length});D.subHeaders.push(E),_.push(D)}w.headers.push(E),E.headerGroup=w}),p.push(w),x>0&&m(_,x-1)},y=n.map((b,x)=>gx(r,b,{depth:u,index:x}));m(y,u-1),p.reverse();const v=b=>b.filter(w=>w.column.getIsVisible()).map(w=>{let _=0,E=0,R=[0];w.subHeaders&&w.subHeaders.length?(R=[],v(w.subHeaders).forEach(O=>{let{colSpan:M,rowSpan:D}=O;_+=M,R.push(D)})):_=1;const T=Math.min(...R);return E=E+T,w.colSpan=_,w.rowSpan=E,{colSpan:_,rowSpan:E}});return v((o=(l=p[0])==null?void 0:l.headers)!=null?o:[]),p}const F3=(e,n,r,i,o,l,u)=>{let d={id:n,index:i,original:r,depth:o,parentId:u,_valuesCache:{},_uniqueValuesCache:{},getValue:p=>{if(d._valuesCache.hasOwnProperty(p))return d._valuesCache[p];const m=e.getColumn(p);if(m!=null&&m.accessorFn)return d._valuesCache[p]=m.accessorFn(d.original,i),d._valuesCache[p]},getUniqueValues:p=>{if(d._uniqueValuesCache.hasOwnProperty(p))return d._uniqueValuesCache[p];const m=e.getColumn(p);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(d._uniqueValuesCache[p]=m.columnDef.getUniqueValues(d.original,i),d._uniqueValuesCache[p]):(d._uniqueValuesCache[p]=[d.getValue(p)],d._uniqueValuesCache[p])},renderValue:p=>{var m;return(m=d.getValue(p))!=null?m:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>L3(d.subRows,p=>p.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let p=[],m=d;for(;;){const y=m.getParentRow();if(!y)break;p.push(y),m=y}return p.reverse()},getAllCells:ze(()=>[e.getAllLeafColumns()],p=>p.map(m=>$3(e,d,m,m.id)),ke(e.options,"debugRows")),_getAllCellsByColumnId:ze(()=>[d.getAllCells()],p=>p.reduce((m,y)=>(m[y.column.id]=y,m),{}),ke(e.options,"debugRows"))};for(let p=0;p{e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},L_=(e,n,r)=>{var i,o;const l=r==null||(i=r.toString())==null?void 0:i.toLowerCase();return!!(!((o=e.getValue(n))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(l))};L_.autoRemove=e=>gr(e);const $_=(e,n,r)=>{var i;return!!(!((i=e.getValue(n))==null||(i=i.toString())==null)&&i.includes(r))};$_.autoRemove=e=>gr(e);const I_=(e,n,r)=>{var i;return((i=e.getValue(n))==null||(i=i.toString())==null?void 0:i.toLowerCase())===r?.toLowerCase()};I_.autoRemove=e=>gr(e);const P_=(e,n,r)=>{var i;return(i=e.getValue(n))==null?void 0:i.includes(r)};P_.autoRemove=e=>gr(e);const F_=(e,n,r)=>!r.some(i=>{var o;return!((o=e.getValue(n))!=null&&o.includes(i))});F_.autoRemove=e=>gr(e)||!(e!=null&&e.length);const V_=(e,n,r)=>r.some(i=>{var o;return(o=e.getValue(n))==null?void 0:o.includes(i)});V_.autoRemove=e=>gr(e)||!(e!=null&&e.length);const U_=(e,n,r)=>e.getValue(n)===r;U_.autoRemove=e=>gr(e);const H_=(e,n,r)=>e.getValue(n)==r;H_.autoRemove=e=>gr(e);const Qp=(e,n,r)=>{let[i,o]=r;const l=e.getValue(n);return l>=i&&l<=o};Qp.resolveFilterValue=e=>{let[n,r]=e,i=typeof n!="number"?parseFloat(n):n,o=typeof r!="number"?parseFloat(r):r,l=n===null||Number.isNaN(i)?-1/0:i,u=r===null||Number.isNaN(o)?1/0:o;if(l>u){const d=l;l=u,u=d}return[l,u]};Qp.autoRemove=e=>gr(e)||gr(e[0])&&gr(e[1]);const ta={includesString:L_,includesStringSensitive:$_,equalsString:I_,arrIncludes:P_,arrIncludesAll:F_,arrIncludesSome:V_,equals:U_,weakEquals:H_,inNumberRange:Qp};function gr(e){return e==null||e===""}const U3={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Fn("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const r=n.getCoreRowModel().flatRows[0],i=r?.getValue(e.id);return typeof i=="string"?ta.includesString:typeof i=="number"?ta.inNumberRange:typeof i=="boolean"||i!==null&&typeof i=="object"?ta.equals:Array.isArray(i)?ta.arrIncludes:ta.weakEquals},e.getFilterFn=()=>{var r,i;return ed(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(r=(i=n.options.filterFns)==null?void 0:i[e.columnDef.filterFn])!=null?r:ta[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,i,o;return((r=e.columnDef.enableColumnFilter)!=null?r:!0)&&((i=n.options.enableColumnFilters)!=null?i:!0)&&((o=n.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return(r=n.getState().columnFilters)==null||(r=r.find(i=>i.id===e.id))==null?void 0:r.value},e.getFilterIndex=()=>{var r,i;return(r=(i=n.getState().columnFilters)==null?void 0:i.findIndex(o=>o.id===e.id))!=null?r:-1},e.setFilterValue=r=>{n.setColumnFilters(i=>{const o=e.getFilterFn(),l=i?.find(y=>y.id===e.id),u=Da(r,l?l.value:void 0);if(vx(o,u,e)){var d;return(d=i?.filter(y=>y.id!==e.id))!=null?d:[]}const p={id:e.id,value:u};if(l){var m;return(m=i?.map(y=>y.id===e.id?p:y))!=null?m:[]}return i!=null&&i.length?[...i,p]:[p]})}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const r=e.getAllLeafColumns(),i=o=>{var l;return(l=Da(n,o))==null?void 0:l.filter(u=>{const d=r.find(p=>p.id===u.id);if(d){const p=d.getFilterFn();if(vx(p,u.value,d))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(i)},e.resetColumnFilters=n=>{var r,i;e.setColumnFilters(n?[]:(r=(i=e.initialState)==null?void 0:i.columnFilters)!=null?r:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function vx(e,n,r){return(e&&e.autoRemove?e.autoRemove(n,r):!1)||typeof n>"u"||typeof n=="string"&&!n}const H3=(e,n,r)=>r.reduce((i,o)=>{const l=o.getValue(e);return i+(typeof l=="number"?l:0)},0),B3=(e,n,r)=>{let i;return r.forEach(o=>{const l=o.getValue(e);l!=null&&(i>l||i===void 0&&l>=l)&&(i=l)}),i},q3=(e,n,r)=>{let i;return r.forEach(o=>{const l=o.getValue(e);l!=null&&(i=l)&&(i=l)}),i},G3=(e,n,r)=>{let i,o;return r.forEach(l=>{const u=l.getValue(e);u!=null&&(i===void 0?u>=u&&(i=o=u):(i>u&&(i=u),o{let r=0,i=0;if(n.forEach(o=>{let l=o.getValue(e);l!=null&&(l=+l)>=l&&(++r,i+=l)}),r)return i/r},K3=(e,n)=>{if(!n.length)return;const r=n.map(l=>l.getValue(e));if(!k3(r))return;if(r.length===1)return r[0];const i=Math.floor(r.length/2),o=r.sort((l,u)=>l-u);return r.length%2!==0?o[i]:(o[i-1]+o[i])/2},Y3=(e,n)=>Array.from(new Set(n.map(r=>r.getValue(e))).values()),Q3=(e,n)=>new Set(n.map(r=>r.getValue(e))).size,X3=(e,n)=>n.length,qh={sum:H3,min:B3,max:q3,extent:G3,mean:Z3,median:K3,unique:Y3,uniqueCount:Q3,count:X3},J3={getDefaultColumnDef:()=>({aggregatedCell:e=>{var n,r;return(n=(r=e.getValue())==null||r.toString==null?void 0:r.toString())!=null?n:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Fn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,n)=>{e.toggleGrouping=()=>{n.setGrouping(r=>r!=null&&r.includes(e.id)?r.filter(i=>i!==e.id):[...r??[],e.id])},e.getCanGroup=()=>{var r,i;return((r=e.columnDef.enableGrouping)!=null?r:!0)&&((i=n.options.enableGrouping)!=null?i:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return(r=n.getState().grouping)==null?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return(r=n.getState().grouping)==null?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const r=e.getCanGroup();return()=>{r&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=n.getCoreRowModel().flatRows[0],i=r?.getValue(e.id);if(typeof i=="number")return qh.sum;if(Object.prototype.toString.call(i)==="[object Date]")return qh.extent},e.getAggregationFn=()=>{var r,i;if(!e)throw new Error;return ed(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(r=(i=n.options.aggregationFns)==null?void 0:i[e.columnDef.aggregationFn])!=null?r:qh[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=n=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(n),e.resetGrouping=n=>{var r,i;e.setGrouping(n?[]:(r=(i=e.initialState)==null?void 0:i.grouping)!=null?r:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,n)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const i=n.getColumn(r);return i!=null&&i.columnDef.getGroupingValue?(e._groupingValuesCache[r]=i.columnDef.getGroupingValue(e.original),e._groupingValuesCache[r]):e.getValue(r)},e._groupingValuesCache={}},createCell:(e,n,r,i)=>{e.getIsGrouped=()=>n.getIsGrouped()&&n.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&n.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=r.subRows)!=null&&o.length)}}};function W3(e,n,r){if(!(n!=null&&n.length)||!r)return e;const i=e.filter(l=>!n.includes(l.id));return r==="remove"?i:[...n.map(l=>e.find(u=>u.id===l)).filter(Boolean),...i]}const e4={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Fn("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=ze(r=>[el(n,r)],r=>r.findIndex(i=>i.id===e.id),ke(n.options,"debugColumns")),e.getIsFirstColumn=r=>{var i;return((i=el(n,r)[0])==null?void 0:i.id)===e.id},e.getIsLastColumn=r=>{var i;const o=el(n,r);return((i=o[o.length-1])==null?void 0:i.id)===e.id}},createTable:e=>{e.setColumnOrder=n=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(n),e.resetColumnOrder=n=>{var r;e.setColumnOrder(n?[]:(r=e.initialState.columnOrder)!=null?r:[])},e._getOrderColumnsFn=ze(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,r,i)=>o=>{let l=[];if(!(n!=null&&n.length))l=o;else{const u=[...n],d=[...o];for(;d.length&&u.length;){const p=u.shift(),m=d.findIndex(y=>y.id===p);m>-1&&l.push(d.splice(m,1)[0])}l=[...l,...d]}return W3(l,r,i)},ke(e.options,"debugTable"))}},Gh=()=>({left:[],right:[]}),t4={getInitialState:e=>({columnPinning:Gh(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Fn("columnPinning",e)}),createColumn:(e,n)=>{e.pin=r=>{const i=e.getLeafColumns().map(o=>o.id).filter(Boolean);n.setColumnPinning(o=>{var l,u;if(r==="right"){var d,p;return{left:((d=o?.left)!=null?d:[]).filter(v=>!(i!=null&&i.includes(v))),right:[...((p=o?.right)!=null?p:[]).filter(v=>!(i!=null&&i.includes(v))),...i]}}if(r==="left"){var m,y;return{left:[...((m=o?.left)!=null?m:[]).filter(v=>!(i!=null&&i.includes(v))),...i],right:((y=o?.right)!=null?y:[]).filter(v=>!(i!=null&&i.includes(v)))}}return{left:((l=o?.left)!=null?l:[]).filter(v=>!(i!=null&&i.includes(v))),right:((u=o?.right)!=null?u:[]).filter(v=>!(i!=null&&i.includes(v)))}})},e.getCanPin=()=>e.getLeafColumns().some(i=>{var o,l,u;return((o=i.columnDef.enablePinning)!=null?o:!0)&&((l=(u=n.options.enableColumnPinning)!=null?u:n.options.enablePinning)!=null?l:!0)}),e.getIsPinned=()=>{const r=e.getLeafColumns().map(d=>d.id),{left:i,right:o}=n.getState().columnPinning,l=r.some(d=>i?.includes(d)),u=r.some(d=>o?.includes(d));return l?"left":u?"right":!1},e.getPinnedIndex=()=>{var r,i;const o=e.getIsPinned();return o?(r=(i=n.getState().columnPinning)==null||(i=i[o])==null?void 0:i.indexOf(e.id))!=null?r:-1:0}},createRow:(e,n)=>{e.getCenterVisibleCells=ze(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(r,i,o)=>{const l=[...i??[],...o??[]];return r.filter(u=>!l.includes(u.column.id))},ke(n.options,"debugRows")),e.getLeftVisibleCells=ze(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left],(r,i)=>(i??[]).map(l=>r.find(u=>u.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),ke(n.options,"debugRows")),e.getRightVisibleCells=ze(()=>[e._getAllVisibleCells(),n.getState().columnPinning.right],(r,i)=>(i??[]).map(l=>r.find(u=>u.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),ke(n.options,"debugRows"))},createTable:e=>{e.setColumnPinning=n=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(n),e.resetColumnPinning=n=>{var r,i;return e.setColumnPinning(n?Gh():(r=(i=e.initialState)==null?void 0:i.columnPinning)!=null?r:Gh())},e.getIsSomeColumnsPinned=n=>{var r;const i=e.getState().columnPinning;if(!n){var o,l;return!!((o=i.left)!=null&&o.length||(l=i.right)!=null&&l.length)}return!!((r=i[n])!=null&&r.length)},e.getLeftLeafColumns=ze(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(o=>o.id===i)).filter(Boolean),ke(e.options,"debugColumns")),e.getRightLeafColumns=ze(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(o=>o.id===i)).filter(Boolean),ke(e.options,"debugColumns")),e.getCenterLeafColumns=ze(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(l=>!o.includes(l.id))},ke(e.options,"debugColumns"))}};function n4(e){return e||(typeof document<"u"?document:null)}const Jc={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Zh=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),r4={getDefaultColumnDef:()=>Jc,getInitialState:e=>({columnSizing:{},columnSizingInfo:Zh(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Fn("columnSizing",e),onColumnSizingInfoChange:Fn("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var r,i,o;const l=n.getState().columnSizing[e.id];return Math.min(Math.max((r=e.columnDef.minSize)!=null?r:Jc.minSize,(i=l??e.columnDef.size)!=null?i:Jc.size),(o=e.columnDef.maxSize)!=null?o:Jc.maxSize)},e.getStart=ze(r=>[r,el(n,r),n.getState().columnSizing],(r,i)=>i.slice(0,e.getIndex(r)).reduce((o,l)=>o+l.getSize(),0),ke(n.options,"debugColumns")),e.getAfter=ze(r=>[r,el(n,r),n.getState().columnSizing],(r,i)=>i.slice(e.getIndex(r)+1).reduce((o,l)=>o+l.getSize(),0),ke(n.options,"debugColumns")),e.resetSize=()=>{n.setColumnSizing(r=>{let{[e.id]:i,...o}=r;return o})},e.getCanResize=()=>{var r,i;return((r=e.columnDef.enableResizing)!=null?r:!0)&&((i=n.options.enableColumnResizing)!=null?i:!0)},e.getIsResizing=()=>n.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,n)=>{e.getSize=()=>{let r=0;const i=o=>{if(o.subHeaders.length)o.subHeaders.forEach(i);else{var l;r+=(l=o.column.getSize())!=null?l:0}};return i(e),r},e.getStart=()=>{if(e.index>0){const r=e.headerGroup.headers[e.index-1];return r.getStart()+r.getSize()}return 0},e.getResizeHandler=r=>{const i=n.getColumn(e.column.id),o=i?.getCanResize();return l=>{if(!i||!o||(l.persist==null||l.persist(),Kh(l)&&l.touches&&l.touches.length>1))return;const u=e.getSize(),d=e?e.getLeafHeaders().map(R=>[R.column.id,R.column.getSize()]):[[i.id,i.getSize()]],p=Kh(l)?Math.round(l.touches[0].clientX):l.clientX,m={},y=(R,T)=>{typeof T=="number"&&(n.setColumnSizingInfo(O=>{var M,D;const P=n.options.columnResizeDirection==="rtl"?-1:1,F=(T-((M=O?.startOffset)!=null?M:0))*P,V=Math.max(F/((D=O?.startSize)!=null?D:0),-.999999);return O.columnSizingStart.forEach(ve=>{let[be,he]=ve;m[be]=Math.round(Math.max(he+he*V,0)*100)/100}),{...O,deltaOffset:F,deltaPercentage:V}}),(n.options.columnResizeMode==="onChange"||R==="end")&&n.setColumnSizing(O=>({...O,...m})))},v=R=>y("move",R),b=R=>{y("end",R),n.setColumnSizingInfo(T=>({...T,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},x=n4(r),w={moveHandler:R=>v(R.clientX),upHandler:R=>{x?.removeEventListener("mousemove",w.moveHandler),x?.removeEventListener("mouseup",w.upHandler),b(R.clientX)}},_={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),v(R.touches[0].clientX),!1),upHandler:R=>{var T;x?.removeEventListener("touchmove",_.moveHandler),x?.removeEventListener("touchend",_.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),b((T=R.touches[0])==null?void 0:T.clientX)}},E=a4()?{passive:!1}:!1;Kh(l)?(x?.addEventListener("touchmove",_.moveHandler,E),x?.addEventListener("touchend",_.upHandler,E)):(x?.addEventListener("mousemove",w.moveHandler,E),x?.addEventListener("mouseup",w.upHandler,E)),n.setColumnSizingInfo(R=>({...R,startOffset:p,startSize:u,deltaOffset:0,deltaPercentage:0,columnSizingStart:d,isResizingColumn:i.id}))}}},createTable:e=>{e.setColumnSizing=n=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(n),e.setColumnSizingInfo=n=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(n),e.resetColumnSizing=n=>{var r;e.setColumnSizing(n?{}:(r=e.initialState.columnSizing)!=null?r:{})},e.resetHeaderSizeInfo=n=>{var r;e.setColumnSizingInfo(n?Zh():(r=e.initialState.columnSizingInfo)!=null?r:Zh())},e.getTotalSize=()=>{var n,r;return(n=(r=e.getHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,r;return(n=(r=e.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,r;return(n=(r=e.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,r;return(n=(r=e.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?n:0}}};let Wc=null;function a4(){if(typeof Wc=="boolean")return Wc;let e=!1;try{const n={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,n),window.removeEventListener("test",r)}catch{e=!1}return Wc=e,Wc}function Kh(e){return e.type==="touchstart"}const i4={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Fn("columnVisibility",e)}),createColumn:(e,n)=>{e.toggleVisibility=r=>{e.getCanHide()&&n.setColumnVisibility(i=>({...i,[e.id]:r??!e.getIsVisible()}))},e.getIsVisible=()=>{var r,i;const o=e.columns;return(r=o.length?o.some(l=>l.getIsVisible()):(i=n.getState().columnVisibility)==null?void 0:i[e.id])!=null?r:!0},e.getCanHide=()=>{var r,i;return((r=e.columnDef.enableHiding)!=null?r:!0)&&((i=n.options.enableHiding)!=null?i:!0)},e.getToggleVisibilityHandler=()=>r=>{e.toggleVisibility==null||e.toggleVisibility(r.target.checked)}},createRow:(e,n)=>{e._getAllVisibleCells=ze(()=>[e.getAllCells(),n.getState().columnVisibility],r=>r.filter(i=>i.column.getIsVisible()),ke(n.options,"debugRows")),e.getVisibleCells=ze(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(r,i,o)=>[...r,...i,...o],ke(n.options,"debugRows"))},createTable:e=>{const n=(r,i)=>ze(()=>[i(),i().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),ke(e.options,"debugColumns"));e.getVisibleFlatColumns=n("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=n("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=n("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=n("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=n("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=r=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(r),e.resetColumnVisibility=r=>{var i;e.setColumnVisibility(r?{}:(i=e.initialState.columnVisibility)!=null?i:{})},e.toggleAllColumnsVisible=r=>{var i;r=(i=r)!=null?i:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,l)=>({...o,[l.id]:r||!(l.getCanHide!=null&&l.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>r=>{var i;e.toggleAllColumnsVisible((i=r.target)==null?void 0:i.checked)}}};function el(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const s4={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},o4={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Fn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:n=>{var r;const i=(r=e.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[n.id])==null?void 0:r.getValue();return typeof i=="string"||typeof i=="number"}}),createColumn:(e,n)=>{e.getCanGlobalFilter=()=>{var r,i,o,l;return((r=e.columnDef.enableGlobalFilter)!=null?r:!0)&&((i=n.options.enableGlobalFilter)!=null?i:!0)&&((o=n.options.enableFilters)!=null?o:!0)&&((l=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ta.includesString,e.getGlobalFilterFn=()=>{var n,r;const{globalFilterFn:i}=e.options;return ed(i)?i:i==="auto"?e.getGlobalAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[i])!=null?n:ta[i]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},l4={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Fn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,r=!1;e._autoResetExpanded=()=>{var i,o;if(!n){e._queue(()=>{n=!0});return}if((i=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?i:!e.options.manualExpanding){if(r)return;r=!0,e._queue(()=>{e.resetExpanded(),r=!1})}},e.setExpanded=i=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(i),e.toggleAllRowsExpanded=i=>{i??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=i=>{var o,l;e.setExpanded(i?{}:(o=(l=e.initialState)==null?void 0:l.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(i=>i.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>i=>{i.persist==null||i.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const i=e.getState().expanded;return i===!0||Object.values(i).some(Boolean)},e.getIsAllRowsExpanded=()=>{const i=e.getState().expanded;return typeof i=="boolean"?i===!0:!(!Object.keys(i).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let i=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(l=>{const u=l.split(".");i=Math.max(i,u.length)}),i},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,n)=>{e.toggleExpanded=r=>{n.setExpanded(i=>{var o;const l=i===!0?!0:!!(i!=null&&i[e.id]);let u={};if(i===!0?Object.keys(n.getRowModel().rowsById).forEach(d=>{u[d]=!0}):u=i,r=(o=r)!=null?o:!l,!l&&r)return{...u,[e.id]:!0};if(l&&!r){const{[e.id]:d,...p}=u;return p}return i})},e.getIsExpanded=()=>{var r;const i=n.getState().expanded;return!!((r=n.options.getIsRowExpanded==null?void 0:n.options.getIsRowExpanded(e))!=null?r:i===!0||i?.[e.id])},e.getCanExpand=()=>{var r,i,o;return(r=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?r:((i=n.options.enableExpanding)!=null?i:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let r=!0,i=e;for(;r&&i.parentId;)i=n.getRow(i.parentId,!0),r=i.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const r=e.getCanExpand();return()=>{r&&e.toggleExpanded()}}}},km=0,Lm=10,Yh=()=>({pageIndex:km,pageSize:Lm}),c4={getInitialState:e=>({...e,pagination:{...Yh(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Fn("pagination",e)}),createTable:e=>{let n=!1,r=!1;e._autoResetPageIndex=()=>{var i,o;if(!n){e._queue(()=>{n=!0});return}if((i=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?i:!e.options.manualPagination){if(r)return;r=!0,e._queue(()=>{e.resetPageIndex(),r=!1})}},e.setPagination=i=>{const o=l=>Da(i,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=i=>{var o;e.setPagination(i?Yh():(o=e.initialState.pagination)!=null?o:Yh())},e.setPageIndex=i=>{e.setPagination(o=>{let l=Da(i,o.pageIndex);const u=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.max(0,Math.min(l,u)),{...o,pageIndex:l}})},e.resetPageIndex=i=>{var o,l;e.setPageIndex(i?km:(o=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?o:km)},e.resetPageSize=i=>{var o,l;e.setPageSize(i?Lm:(o=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?o:Lm)},e.setPageSize=i=>{e.setPagination(o=>{const l=Math.max(1,Da(i,o.pageSize)),u=o.pageSize*o.pageIndex,d=Math.floor(u/l);return{...o,pageIndex:d,pageSize:l}})},e.setPageCount=i=>e.setPagination(o=>{var l;let u=Da(i,(l=e.options.pageCount)!=null?l:-1);return typeof u=="number"&&(u=Math.max(-1,u)),{...o,pageCount:u}}),e.getPageOptions=ze(()=>[e.getPageCount()],i=>{let o=[];return i&&i>0&&(o=[...new Array(i)].fill(null).map((l,u)=>u)),o},ke(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:i}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:ie.setPageIndex(i=>i-1),e.nextPage=()=>e.setPageIndex(i=>i+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var i;return(i=e.options.pageCount)!=null?i:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var i;return(i=e.options.rowCount)!=null?i:e.getPrePaginationRowModel().rows.length}}},Qh=()=>({top:[],bottom:[]}),u4={getInitialState:e=>({rowPinning:Qh(),...e}),getDefaultOptions:e=>({onRowPinningChange:Fn("rowPinning",e)}),createRow:(e,n)=>{e.pin=(r,i,o)=>{const l=i?e.getLeafRows().map(p=>{let{id:m}=p;return m}):[],u=o?e.getParentRows().map(p=>{let{id:m}=p;return m}):[],d=new Set([...u,e.id,...l]);n.setRowPinning(p=>{var m,y;if(r==="bottom"){var v,b;return{top:((v=p?.top)!=null?v:[]).filter(_=>!(d!=null&&d.has(_))),bottom:[...((b=p?.bottom)!=null?b:[]).filter(_=>!(d!=null&&d.has(_))),...Array.from(d)]}}if(r==="top"){var x,w;return{top:[...((x=p?.top)!=null?x:[]).filter(_=>!(d!=null&&d.has(_))),...Array.from(d)],bottom:((w=p?.bottom)!=null?w:[]).filter(_=>!(d!=null&&d.has(_)))}}return{top:((m=p?.top)!=null?m:[]).filter(_=>!(d!=null&&d.has(_))),bottom:((y=p?.bottom)!=null?y:[]).filter(_=>!(d!=null&&d.has(_)))}})},e.getCanPin=()=>{var r;const{enableRowPinning:i,enablePinning:o}=n.options;return typeof i=="function"?i(e):(r=i??o)!=null?r:!0},e.getIsPinned=()=>{const r=[e.id],{top:i,bottom:o}=n.getState().rowPinning,l=r.some(d=>i?.includes(d)),u=r.some(d=>o?.includes(d));return l?"top":u?"bottom":!1},e.getPinnedIndex=()=>{var r,i;const o=e.getIsPinned();if(!o)return-1;const l=(r=o==="top"?n.getTopRows():n.getBottomRows())==null?void 0:r.map(u=>{let{id:d}=u;return d});return(i=l?.indexOf(e.id))!=null?i:-1}},createTable:e=>{e.setRowPinning=n=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(n),e.resetRowPinning=n=>{var r,i;return e.setRowPinning(n?Qh():(r=(i=e.initialState)==null?void 0:i.rowPinning)!=null?r:Qh())},e.getIsSomeRowsPinned=n=>{var r;const i=e.getState().rowPinning;if(!n){var o,l;return!!((o=i.top)!=null&&o.length||(l=i.bottom)!=null&&l.length)}return!!((r=i[n])!=null&&r.length)},e._getPinnedRows=(n,r,i)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(r??[]).map(u=>{const d=e.getRow(u,!0);return d.getIsAllParentsExpanded()?d:null}):(r??[]).map(u=>n.find(d=>d.id===u))).filter(Boolean).map(u=>({...u,position:i}))},e.getTopRows=ze(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,r)=>e._getPinnedRows(n,r,"top"),ke(e.options,"debugRows")),e.getBottomRows=ze(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,r)=>e._getPinnedRows(n,r,"bottom"),ke(e.options,"debugRows")),e.getCenterRows=ze(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,r,i)=>{const o=new Set([...r??[],...i??[]]);return n.filter(l=>!o.has(l.id))},ke(e.options,"debugRows"))}},d4={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Fn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=n=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(n),e.resetRowSelection=n=>{var r;return e.setRowSelection(n?{}:(r=e.initialState.rowSelection)!=null?r:{})},e.toggleAllRowsSelected=n=>{e.setRowSelection(r=>{n=typeof n<"u"?n:!e.getIsAllRowsSelected();const i={...r},o=e.getPreGroupedRowModel().flatRows;return n?o.forEach(l=>{l.getCanSelect()&&(i[l.id]=!0)}):o.forEach(l=>{delete i[l.id]}),i})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(r=>{const i=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),o={...r};return e.getRowModel().rows.forEach(l=>{$m(o,l.id,i,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ze(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,r)=>Object.keys(n).length?Xh(e,r):{rows:[],flatRows:[],rowsById:{}},ke(e.options,"debugTable")),e.getFilteredSelectedRowModel=ze(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,r)=>Object.keys(n).length?Xh(e,r):{rows:[],flatRows:[],rowsById:{}},ke(e.options,"debugTable")),e.getGroupedSelectedRowModel=ze(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,r)=>Object.keys(n).length?Xh(e,r):{rows:[],flatRows:[],rowsById:{}},ke(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const n=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let i=!!(n.length&&Object.keys(r).length);return i&&n.some(o=>o.getCanSelect()&&!r[o.id])&&(i=!1),i},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:r}=e.getState();let i=!!n.length;return i&&n.some(o=>!r[o.id])&&(i=!1),i},e.getIsSomeRowsSelected=()=>{var n;const r=Object.keys((n=e.getState().rowSelection)!=null?n:{}).length;return r>0&&r{const n=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:n.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>n=>{e.toggleAllRowsSelected(n.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>n=>{e.toggleAllPageRowsSelected(n.target.checked)}},createRow:(e,n)=>{e.toggleSelected=(r,i)=>{const o=e.getIsSelected();n.setRowSelection(l=>{var u;if(r=typeof r<"u"?r:!o,e.getCanSelect()&&o===r)return l;const d={...l};return $m(d,e.id,r,(u=i?.selectChildren)!=null?u:!0,n),d})},e.getIsSelected=()=>{const{rowSelection:r}=n.getState();return Xp(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=n.getState();return Im(e,r)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=n.getState();return Im(e,r)==="all"},e.getCanSelect=()=>{var r;return typeof n.options.enableRowSelection=="function"?n.options.enableRowSelection(e):(r=n.options.enableRowSelection)!=null?r:!0},e.getCanSelectSubRows=()=>{var r;return typeof n.options.enableSubRowSelection=="function"?n.options.enableSubRowSelection(e):(r=n.options.enableSubRowSelection)!=null?r:!0},e.getCanMultiSelect=()=>{var r;return typeof n.options.enableMultiRowSelection=="function"?n.options.enableMultiRowSelection(e):(r=n.options.enableMultiRowSelection)!=null?r:!0},e.getToggleSelectedHandler=()=>{const r=e.getCanSelect();return i=>{var o;r&&e.toggleSelected((o=i.target)==null?void 0:o.checked)}}}},$m=(e,n,r,i,o)=>{var l;const u=o.getRow(n,!0);r?(u.getCanMultiSelect()||Object.keys(e).forEach(d=>delete e[d]),u.getCanSelect()&&(e[n]=!0)):delete e[n],i&&(l=u.subRows)!=null&&l.length&&u.getCanSelectSubRows()&&u.subRows.forEach(d=>$m(e,d.id,r,i,o))};function Xh(e,n){const r=e.getState().rowSelection,i=[],o={},l=function(u,d){return u.map(p=>{var m;const y=Xp(p,r);if(y&&(i.push(p),o[p.id]=p),(m=p.subRows)!=null&&m.length&&(p={...p,subRows:l(p.subRows)}),y)return p}).filter(Boolean)};return{rows:l(n.rows),flatRows:i,rowsById:o}}function Xp(e,n){var r;return(r=n[e.id])!=null?r:!1}function Im(e,n,r){var i;if(!((i=e.subRows)!=null&&i.length))return!1;let o=!0,l=!1;return e.subRows.forEach(u=>{if(!(l&&!o)&&(u.getCanSelect()&&(Xp(u,n)?l=!0:o=!1),u.subRows&&u.subRows.length)){const d=Im(u,n);d==="all"?l=!0:(d==="some"&&(l=!0),o=!1)}}),o?"all":l?"some":!1}const Pm=/([0-9]+)/gm,f4=(e,n,r)=>B_(Ba(e.getValue(r)).toLowerCase(),Ba(n.getValue(r)).toLowerCase()),h4=(e,n,r)=>B_(Ba(e.getValue(r)),Ba(n.getValue(r))),m4=(e,n,r)=>Jp(Ba(e.getValue(r)).toLowerCase(),Ba(n.getValue(r)).toLowerCase()),p4=(e,n,r)=>Jp(Ba(e.getValue(r)),Ba(n.getValue(r))),g4=(e,n,r)=>{const i=e.getValue(r),o=n.getValue(r);return i>o?1:iJp(e.getValue(r),n.getValue(r));function Jp(e,n){return e===n?0:e>n?1:-1}function Ba(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function B_(e,n){const r=e.split(Pm).filter(Boolean),i=n.split(Pm).filter(Boolean);for(;r.length&&i.length;){const o=r.shift(),l=i.shift(),u=parseInt(o,10),d=parseInt(l,10),p=[u,d].sort();if(isNaN(p[0])){if(o>l)return 1;if(l>o)return-1;continue}if(isNaN(p[1]))return isNaN(u)?-1:1;if(u>d)return 1;if(d>u)return-1}return r.length-i.length}const Bo={alphanumeric:f4,alphanumericCaseSensitive:h4,text:m4,textCaseSensitive:p4,datetime:g4,basic:v4},y4={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Fn("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const r=n.getFilteredRowModel().flatRows.slice(10);let i=!1;for(const o of r){const l=o?.getValue(e.id);if(Object.prototype.toString.call(l)==="[object Date]")return Bo.datetime;if(typeof l=="string"&&(i=!0,l.split(Pm).length>1))return Bo.alphanumeric}return i?Bo.text:Bo.basic},e.getAutoSortDir=()=>{const r=n.getFilteredRowModel().flatRows[0];return typeof r?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var r,i;if(!e)throw new Error;return ed(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(r=(i=n.options.sortingFns)==null?void 0:i[e.columnDef.sortingFn])!=null?r:Bo[e.columnDef.sortingFn]},e.toggleSorting=(r,i)=>{const o=e.getNextSortingOrder(),l=typeof r<"u"&&r!==null;n.setSorting(u=>{const d=u?.find(x=>x.id===e.id),p=u?.findIndex(x=>x.id===e.id);let m=[],y,v=l?r:o==="desc";if(u!=null&&u.length&&e.getCanMultiSort()&&i?d?y="toggle":y="add":u!=null&&u.length&&p!==u.length-1?y="replace":d?y="toggle":y="replace",y==="toggle"&&(l||o||(y="remove")),y==="add"){var b;m=[...u,{id:e.id,desc:v}],m.splice(0,m.length-((b=n.options.maxMultiSortColCount)!=null?b:Number.MAX_SAFE_INTEGER))}else y==="toggle"?m=u.map(x=>x.id===e.id?{...x,desc:v}:x):y==="remove"?m=u.filter(x=>x.id!==e.id):m=[{id:e.id,desc:v}];return m})},e.getFirstSortDir=()=>{var r,i;return((r=(i=e.columnDef.sortDescFirst)!=null?i:n.options.sortDescFirst)!=null?r:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=r=>{var i,o;const l=e.getFirstSortDir(),u=e.getIsSorted();return u?u!==l&&((i=n.options.enableSortingRemoval)==null||i)&&(!(r&&(o=n.options.enableMultiRemove)!=null)||o)?!1:u==="desc"?"asc":"desc":l},e.getCanSort=()=>{var r,i;return((r=e.columnDef.enableSorting)!=null?r:!0)&&((i=n.options.enableSorting)!=null?i:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,i;return(r=(i=e.columnDef.enableMultiSort)!=null?i:n.options.enableMultiSort)!=null?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const i=(r=n.getState().sorting)==null?void 0:r.find(o=>o.id===e.id);return i?i.desc?"desc":"asc":!1},e.getSortIndex=()=>{var r,i;return(r=(i=n.getState().sorting)==null?void 0:i.findIndex(o=>o.id===e.id))!=null?r:-1},e.clearSorting=()=>{n.setSorting(r=>r!=null&&r.length?r.filter(i=>i.id!==e.id):[])},e.getToggleSortingHandler=()=>{const r=e.getCanSort();return i=>{r&&(i.persist==null||i.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?n.options.isMultiSortEvent==null?void 0:n.options.isMultiSortEvent(i):!1))}}},createTable:e=>{e.setSorting=n=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(n),e.resetSorting=n=>{var r,i;e.setSorting(n?[]:(r=(i=e.initialState)==null?void 0:i.sorting)!=null?r:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},b4=[P3,i4,e4,t4,V3,U3,s4,o4,y4,J3,l4,c4,u4,d4,r4];function x4(e){var n,r;const i=[...b4,...(n=e._features)!=null?n:[]];let o={_features:i};const l=o._features.reduce((b,x)=>Object.assign(b,x.getDefaultOptions==null?void 0:x.getDefaultOptions(o)),{}),u=b=>o.options.mergeOptions?o.options.mergeOptions(l,b):{...l,...b};let p={...{},...(r=e.initialState)!=null?r:{}};o._features.forEach(b=>{var x;p=(x=b.getInitialState==null?void 0:b.getInitialState(p))!=null?x:p});const m=[];let y=!1;const v={_features:i,options:{...l,...e},initialState:p,_queue:b=>{m.push(b),y||(y=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();y=!1}).catch(x=>setTimeout(()=>{throw x})))},reset:()=>{o.setState(o.initialState)},setOptions:b=>{const x=Da(b,o.options);o.options=u(x)},getState:()=>o.options.state,setState:b=>{o.options.onStateChange==null||o.options.onStateChange(b)},_getRowId:(b,x,w)=>{var _;return(_=o.options.getRowId==null?void 0:o.options.getRowId(b,x,w))!=null?_:`${w?[w.id,x].join("."):x}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(b,x)=>{let w=(x?o.getPrePaginationRowModel():o.getRowModel()).rowsById[b];if(!w&&(w=o.getCoreRowModel().rowsById[b],!w))throw new Error;return w},_getDefaultColumnDef:ze(()=>[o.options.defaultColumn],b=>{var x;return b=(x=b)!=null?x:{},{header:w=>{const _=w.header.column.columnDef;return _.accessorKey?_.accessorKey:_.accessorFn?_.id:null},cell:w=>{var _,E;return(_=(E=w.renderValue())==null||E.toString==null?void 0:E.toString())!=null?_:null},...o._features.reduce((w,_)=>Object.assign(w,_.getDefaultColumnDef==null?void 0:_.getDefaultColumnDef()),{}),...b}},ke(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:ze(()=>[o._getColumnDefs()],b=>{const x=function(w,_,E){return E===void 0&&(E=0),w.map(R=>{const T=I3(o,R,E,_),O=R;return T.columns=O.columns?x(O.columns,T,E+1):[],T})};return x(b)},ke(e,"debugColumns")),getAllFlatColumns:ze(()=>[o.getAllColumns()],b=>b.flatMap(x=>x.getFlatColumns()),ke(e,"debugColumns")),_getAllFlatColumnsById:ze(()=>[o.getAllFlatColumns()],b=>b.reduce((x,w)=>(x[w.id]=w,x),{}),ke(e,"debugColumns")),getAllLeafColumns:ze(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(b,x)=>{let w=b.flatMap(_=>_.getLeafColumns());return x(w)},ke(e,"debugColumns")),getColumn:b=>o._getAllFlatColumnsById()[b]};Object.assign(o,v);for(let b=0;bze(()=>[e.options.data],n=>{const r={rows:[],flatRows:[],rowsById:{}},i=function(o,l,u){l===void 0&&(l=0);const d=[];for(let m=0;me._autoResetPageIndex()))}function G_(){return e=>ze(()=>[e.getState().sorting,e.getPreSortedRowModel()],(n,r)=>{if(!r.rows.length||!(n!=null&&n.length))return r;const i=e.getState().sorting,o=[],l=i.filter(p=>{var m;return(m=e.getColumn(p.id))==null?void 0:m.getCanSort()}),u={};l.forEach(p=>{const m=e.getColumn(p.id);m&&(u[p.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const d=p=>{const m=p.map(y=>({...y}));return m.sort((y,v)=>{for(let x=0;x{var v;o.push(y),(v=y.subRows)!=null&&v.length&&(y.subRows=d(y.subRows))}),m};return{rows:d(r.rows),flatRows:o,rowsById:r.rowsById}},ke(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Fm(e,n){return e?w4(e)?S.createElement(e,n):e:null}function w4(e){return S4(e)||typeof e=="function"||_4(e)}function S4(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function _4(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Z_(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=S.useState(()=>({current:x4(n)})),[i,o]=S.useState(()=>r.current.initialState);return r.current.setOptions(l=>({...l,...e,state:{...i,...e.state},onStateChange:u=>{o(u),e.onStateChange==null||e.onStateChange(u)}})),r.current}var El=e=>e.type==="checkbox",za=e=>e instanceof Date,an=e=>e==null;const Wp=e=>typeof e=="object";var Rt=e=>!an(e)&&!Array.isArray(e)&&Wp(e)&&!za(e),C4=e=>Rt(e)&&e.target?El(e.target)?e.target.checked:e.target.value:e,E4=(e,n)=>n.split(".").some((r,i,o)=>!isNaN(Number(r))&&e.has(o.slice(0,i).join("."))),K_=e=>{const n=e.constructor&&e.constructor.prototype;return Rt(n)&&n.hasOwnProperty("isPrototypeOf")},td=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Mt(e){if(e instanceof Date)return new Date(e);const n=typeof FileList<"u"&&e instanceof FileList;if(td&&(e instanceof Blob||n))return e;const r=Array.isArray(e);if(!r&&!(Rt(e)&&K_(e)))return e;const i=r?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=Mt(e[o]));return i}const Rs={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},pr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},hr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Y_="root",eg=["__proto__","constructor","prototype"],R4=/^\w*$/;var Rl=e=>R4.test(e),gt=e=>e===void 0;const j4=/[.[\]'"]/;var nd=e=>e.split(j4).filter(Boolean),Se=(e,n,r)=>{if(!n||!Rt(e))return r;const i=Rl(n)?[n]:nd(n);if(i.some(l=>eg.includes(l)))return r;const o=i.reduce((l,u)=>an(l)?void 0:l[u],e);return gt(o)||o===e?gt(e[n])?r:e[n]:o},Tr=e=>typeof e=="boolean",Jn=e=>typeof e=="function",ct=(e,n,r)=>{let i=-1;const o=Rl(n)?[n]:nd(n),l=o.length,u=l-1;for(;++i{const o={};for(const l in e)Object.defineProperty(o,l,{get:()=>{const u=l;return n._proxyFormState[u]!==pr.all&&(n._proxyFormState[u]=!i||pr.all),e[u]}});return o};const A4=td?me.useLayoutEffect:me.useEffect;var on=e=>typeof e=="string",M4=(e,n,r,i,o)=>on(e)?(i&&n.watch.add(e),Se(r,e,o)):Array.isArray(e)?e.map(l=>(i&&n.watch.add(l),Se(r,l))):(i&&(n.watchAll=!0),r),Vm=e=>an(e)||!Wp(e);const yx=(e,n)=>n.length===0&&!Array.isArray(e)&&!K_(e);function Or(e,n,r=new WeakMap){if(e===n)return!0;if(Vm(e)||Vm(n))return Object.is(e,n);if(za(e)&&za(n))return Object.is(e.getTime(),n.getTime());const i=Object.keys(e),o=Object.keys(n);if(i.length!==o.length)return!1;if(yx(e,i)||yx(n,o))return Object.is(e,n);if(!i.length&&Array.isArray(e)!==Array.isArray(n))return!1;const l=r.get(e);if(l&&l.has(n))return!0;if(l)l.add(n);else{const u=new WeakSet;u.add(n),r.set(e,u)}for(const u of i){const d=e[u];if(!(u in n))return!1;if(u!=="ref"){const p=n[u];if(za(d)&&za(p)||(Rt(d)||Array.isArray(d))&&(Rt(p)||Array.isArray(p))?!Or(d,p,r):!Object.is(d,p))return!1}}return!0}var eu=e=>({isOnSubmit:!e||e===pr.onSubmit,isOnBlur:e===pr.onBlur,isOnChange:e===pr.onChange,isOnAll:e===pr.all,isOnTouch:e===pr.onTouched}),Jh=(e,n,r)=>{if(r)return!1;if(n.watchAll||n.watch.has(e))return!0;for(const i of n.watch)if(e.startsWith(i)&&e.charAt(i.length)===".")return!0;return!1};const tl=(e,n,r,i)=>{for(const o of r||Object.keys(e)){const l=Se(e,o);if(l){const{_f:u,...d}=l;if(u){if(u.refs&&u.refs[0]&&n(u.refs[0],o)&&!i)return!0;if(u.ref&&n(u.ref,u.name)&&!i)return!0;if(tl(d,n))break}else if(Rt(d)&&tl(d,n))break}}};var bx=(e,n,r)=>{const i=Se(e,r),o=Array.isArray(i)?i:[];return ct(o,Y_,n[r]),ct(e,r,o),e},rn=e=>Rt(e)&&!Object.keys(e).length,tg=e=>e.type==="file",_u=e=>{if(!td)return!1;const n=e?e.ownerDocument:0;return e instanceof(n&&n.defaultView?n.defaultView.HTMLElement:HTMLElement)},ng=e=>e.type==="radio",Cu=e=>e instanceof RegExp,rg=(e,n,r,i,o)=>n?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[i]:o||!0}}:{};const xx={value:!1,isValid:!1},wx={value:!0,isValid:!0};var Q_=e=>{if(Array.isArray(e)){if(e.length>1){const n=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:n,isValid:!!n.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!gt(e[0].attributes.value)?gt(e[0].value)||e[0].value===""?wx:{value:e[0].value,isValid:!0}:wx:xx}return xx};const Sx={isValid:!1,value:null};var X_=e=>Array.isArray(e)?e.reduce((n,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:n,Sx):Sx;function _x(e,n,r="validate"){if(on(e)||Array.isArray(e)&&e.every(on)||Tr(e)&&!e)return{type:r,message:on(e)?e:"",ref:n}}var js=e=>Rt(e)&&!Cu(e)?e:{value:e,message:""},Cx=async(e,n,r,i,o,l)=>{const{ref:u,refs:d,required:p,maxLength:m,minLength:y,min:v,max:b,pattern:x,validate:w,name:_,valueAsNumber:E,mount:R}=e._f,T=Se(r,_);if(!R||n.has(_))return{};const O=d?d[0]:u,M=ue=>{if(o&&O.reportValidity){const X=Tr(ue)?"":ue||"";d?d.forEach(pe=>pe.setCustomValidity(X)):O.setCustomValidity(X),O.reportValidity()}},D={},P=ng(u),F=El(u),V=P||F,ve=(E||tg(u))&>(u.value)&>(T)||_u(u)&&u.value===""||T===""||Array.isArray(T)&&!T.length,be=rg.bind(null,_,i,D),he=(ue,X,pe,ge=hr.maxLength,L=hr.minLength)=>{const Z=ue?X:pe;D[_]={type:ue?ge:L,message:Z,ref:u,...be(ue?ge:L,Z)}};if(l?!Array.isArray(T)||!T.length:p&&(!V&&(ve||an(T))||Tr(T)&&!T||F&&!Q_(d).isValid||P&&!X_(d).isValid)){const{value:ue,message:X}=on(p)?{value:!!p,message:p}:js(p);if(ue&&(D[_]={type:hr.required,message:X,ref:O,...be(hr.required,X)},!i))return M(X),D}if(!ve&&(!an(v)||!an(b))){let ue,X;const pe=js(b),ge=js(v);if(!an(T)&&!isNaN(T)){const L=u.valueAsNumber||T&&+T;an(pe.value)||(ue=L>pe.value),an(ge.value)||(X=Lnew Date(new Date().toDateString()+" "+ne),re=u.type=="time",ee=u.type=="week";on(pe.value)&&T&&(ue=re?Z(T)>Z(pe.value):ee?T>pe.value:L>new Date(pe.value)),on(ge.value)&&T&&(X=re?Z(T)+ue.value,ge=!an(X.value)&&T.length<+X.value;if((pe||ge)&&(he(pe,ue.message,X.message),!i))return M(D[_].message),D}if(x&&!ve&&on(T)){const{value:ue,message:X}=js(x);if(Cu(ue)&&!T.match(ue)&&(D[_]={type:hr.pattern,message:X,ref:u,...be(hr.pattern,X)},!i))return M(X),D}if(w){if(Jn(w)){const ue=await w(T,r),X=_x(ue,O);if(X&&(D[_]={...X,...be(hr.validate,X.message)},!i))return M(X.message),D}else if(Rt(w)){let ue={};for(const X in w){if(!rn(ue)&&!i)break;const pe=_x(await w[X](T,r),O,X);pe&&(ue={...pe,...be(X,pe.message)},M(pe.message),i&&(D[_]=ue))}if(!rn(ue)&&(D[_]={ref:O,...ue},!i))return D}}return M(!0),D},cu=e=>Array.isArray(e)?e:[e],J_=e=>Array.isArray(e)?e.filter(Boolean):[];function N4(e,n){const r=n.slice(0,-1).length;let i=0;for(;ieg.includes(String(u))))return e;const i=r.length===1?e:N4(e,r),o=r.length-1,l=r[o];return i&&delete i[l],o!==0&&(Rt(i)&&rn(i)||Array.isArray(i)&&D4(i))&&Nt(e,r.slice(0,-1)),e}const W_=e=>{const n={};for(const r of Object.keys(e))if(Wp(e[r])&&e[r]!==null&&!za(e[r])){const i=W_(e[r]);for(const o of Object.keys(i))n[`${r}.${o}`]=i[o]}else n[r]=e[r];return n},z4=me.createContext(null);z4.displayName="HookFormContext";var Ex=()=>{let e=[];return{get observers(){return e},next:o=>{for(const l of e)l.next&&l.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(l=>l!==o)}}),unsubscribe:()=>{e=[]}}};function eC(e,n){const r={};for(const i in e)if(e.hasOwnProperty(i)){const o=e[i],l=n[i];if(o&&Rt(o)&&l){const u=eC(o,l);Rt(u)&&(r[i]=u)}else e[i]&&(r[i]=l)}return r}var tC=e=>e.type==="select-multiple",k4=e=>ng(e)||El(e),Wh=e=>_u(e)&&e.isConnected,L4=e=>{for(const n in e)if(Jn(e[n]))return!0;return!1};function nC(e){return Array.isArray(e)||Rt(e)&&!L4(e)}function rC(e){return!!(e&&"_f"in e)}function aC(e){return Array.isArray(e)?!e.some(n=>!gt(n)):!Object.keys(e).length}function Um(e,n){Array.isArray(e)?e[n]=void 0:delete e[n]}function Hm(e,n={},r){for(const i in e){const o=e[i],l=r&&r[i];nC(o)&&(!Array.isArray(o)||!rC(l))?(n[i]=Array.isArray(o)?[]:{},Hm(o,n[i],l),aC(n[i])&&Um(n,i)):gt(o)||(n[i]=!0)}return n}function bi(e,n,r,i){r||(r=Hm(n,{},i));for(const o in e){const l=e[o],u=i&&i[o];nC(l)&&(!Array.isArray(l)||!rC(u))?(gt(n)||Vm(r[o])?r[o]=Hm(l,Array.isArray(l)?[]:{},u):bi(l,an(n)?{}:n[o],r[o],u),aC(r[o])&&Um(r,o)):Or(l,n[o])?Um(r,o):r[o]=!0}return r}var iC=(e,{valueAsNumber:n,valueAsDate:r,setValueAs:i})=>gt(e)?e:n?e===""?NaN:e&&+e:r&&on(e)?new Date(e):i?i(e):e;function Rx(e){const n=e.ref;return tg(n)?n.files:ng(n)?X_(e.refs).value:tC(n)?[...n.selectedOptions].map(({value:r})=>r):El(n)?Q_(e.refs).value:iC(gt(n.value)?e.ref.value:n.value,e)}var $4=(e,n,r,i)=>{const o={};for(const l of e){const u=Se(n,l);u&&ct(o,l,u._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:i}},qo=e=>gt(e)?e:Cu(e)?e.source:Rt(e)?Cu(e.value)?e.value.source:e.value:e;const jx="AsyncFunction";var I4=e=>{if(!e||!e.validate)return!1;if(Jn(e.validate))return e.validate.constructor.name===jx;if(Rt(e.validate)){for(const n in e.validate)if(e.validate[n].constructor.name===jx)return!0}return!1},P4=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Tx(e,n,r){const i=Se(e,r);if(i||Rl(r))return{error:i,name:r};const o=r.split(".");for(;o.length;){const l=o.join("."),u=Se(n,l),d=Se(e,l);if(u&&!Array.isArray(u)&&r!==l)return{name:r};if(d&&d.type)return{name:l,error:d};if(d&&d.root&&d.root.type)return{name:`${l}.root`,error:d.root};o.pop()}return{name:r}}var F4=(e,n,r,i)=>{r(e);const{name:o,...l}=e,u=Object.keys(l);return!u.length||i&&u.length>=Object.keys(n).length||u.find(d=>n[d]===(!i||pr.all))},V4=(e,n,r)=>!e||!n||e===n||cu(e).some(i=>i&&(r?i===n||i.startsWith(n+"."):i.startsWith(n)||n.startsWith(i))),U4=(e,n,r,i,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(n||e):(r?i.isOnBlur:o.isOnBlur)?!e:(r?i.isOnChange:o.isOnChange)?e:!0,H4=(e,n)=>!J_(Se(e,n)).length&&Nt(e,n);const B4={mode:pr.onSubmit,reValidateMode:pr.onChange,shouldFocusError:!0},em="form",sC={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function q4(e={}){let n={...B4,...e},r={...Mt(sC),isLoading:Jn(n.defaultValues),errors:n.errors||{},disabled:n.disabled||!1},i={},o=Rt(n.defaultValues)||Rt(n.values)?Mt(n.defaultValues||n.values)||{}:{},l=n.shouldUnregister?{}:Mt(o),u={action:!1,mount:!1,watch:!1,keepIsValid:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const p={},m={};let y=0,v=eu(n.mode),b=eu(n.reValidateMode);const x={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},w={...x};let _={...w};const E={array:Ex(),state:Ex()};let R=0;const T=n.criteriaMode===pr.all,O=(A,I)=>U=>{clearTimeout(m[A]),m[A]=setTimeout(I,U)},M=async A=>{if(!u.keepIsValid&&!n.disabled&&(w.isValid||_.isValid||A)){const I=++R;let U;n.resolver?(U=rn((await pe()).errors),I===R&&D()):U=await Z({fields:i,onlyCheckValid:!0,eventType:Rs.VALID}),I===R&&U!==r.isValid&&E.state.next({isValid:U})}},D=(A,I)=>{!n.disabled&&(w.isValidating||w.validatingFields||_.isValidating||_.validatingFields)&&((A||Array.from(d.mount)).forEach(U=>{U&&(I?ct(r.validatingFields,U,I):Nt(r.validatingFields,U))}),E.state.next({validatingFields:r.validatingFields,isValidating:!rn(r.validatingFields)}))},P=()=>{r.dirtyFields=bi(o,l,void 0,i)},F=(A,I=[],U,ce,Y=!0,W=!0)=>{if(ce&&U&&!n.disabled){if(u.action=!0,W&&Array.isArray(Se(i,A))){const de=U(Se(i,A),ce.argA,ce.argB);Y&&ct(i,A,de)}if(W&&Array.isArray(Se(r.errors,A))){const de=U(Se(r.errors,A),ce.argA,ce.argB);Y&&ct(r.errors,A,de),H4(r.errors,A)}if((w.touchedFields||_.touchedFields)&&W&&Array.isArray(Se(r.touchedFields,A))){const de=U(Se(r.touchedFields,A),ce.argA,ce.argB);Y&&ct(r.touchedFields,A,de)}(w.dirtyFields||_.dirtyFields)&&P(),E.state.next({name:A,isDirty:ee(A,I),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ct(l,A,I)},V=(A,I)=>{ct(r.errors,A,I),r.errors={...r.errors},E.state.next({errors:r.errors})},ve=A=>{r.errors=A,E.state.next({errors:r.errors,isValid:!1})},be=A=>{const I=Rl(A)?[A]:nd(A);let U=l,ce=o;for(let Y=0;Y{const Y=Se(i,A);if(Y){if(be(A))return;const W=gt(Se(l,A)),de=Se(l,A,gt(U)?Se(o,A):U);gt(de)||ce&&ce.defaultChecked||I?ct(l,A,I?de:Rx(Y._f)):N(A,de),u.mount&&!u.action&&(M(),W&&r.isDirty&&(w.isDirty||_.isDirty)&&(ee()||(r.isDirty=!1,E.state.next({...r}))),e.shouldUnregister&&W&&!gt(Se(l,A))&&Jh(A,d)&&(u.watch=!0))}},ue=(A,I,U,ce,Y)=>{let W=!1,de=!1;const we={name:A};if(!n.disabled||ce===!0){if(!U||ce){const _e=Or(Se(o,A),I);(w.isDirty||_.isDirty)&&(de=r.isDirty,r.isDirty=we.isDirty=!_e||ee(),W=de!==we.isDirty),de=!!Se(r.dirtyFields,A),_e!==r.isDirty?r.dirtyFields=bi(o,l,void 0,i):_e?Nt(r.dirtyFields,A):ct(r.dirtyFields,A,!0),we.dirtyFields=r.dirtyFields,W=W||(w.dirtyFields||_.dirtyFields)&&de!==!_e}if(U){const _e=Se(r.touchedFields,A);_e||(ct(r.touchedFields,A,U),we.touchedFields=r.touchedFields,W=W||(w.touchedFields||_.touchedFields)&&_e!==U)}W&&Y&&E.state.next(we)}return W?we:{}},X=(A,I,U,ce)=>{const Y=Se(r.errors,A),W=(w.isValid||_.isValid)&&Tr(I)&&r.isValid!==I;if(n.delayError&&U?(p[A]=O(A,()=>V(A,U)),p[A](n.delayError)):(clearTimeout(m[A]),delete p[A],U?ct(r.errors,A,U):Nt(r.errors,A),r.errors={...r.errors}),(U?!Or(Y,U):Y)||!rn(ce)||W){const de={...ce,...W&&Tr(I)?{isValid:I}:{},errors:r.errors,name:A};r={...r,...de},E.state.next(de)}},pe=async A=>(D(A,!0),await n.resolver(l,n.context,$4(A||d.mount,i,n.criteriaMode,n.shouldUseNativeValidation))),ge=async A=>{const{errors:I}=await pe(A);if(D(A),A){for(const U of A){const ce=Se(I,U);ce?d.array.has(U)&&Rt(ce)&&!Object.keys(ce).some(Y=>!Number.isNaN(Number(Y)))?bx(r.errors,{[U]:ce},U):ct(r.errors,U,ce):Nt(r.errors,U)}r.errors={...r.errors}}else r.errors=I;return I},L=async({name:A,eventType:I})=>{if(e.validate){const U=await e.validate({formValues:l,formState:r,name:A,eventType:I});if(Rt(U))for(const ce in U){const Y=U[ce];Y&&it(`${em}.${ce}`,{message:on(Y.message)?Y.message:"",type:Y.type||hr.validate})}else on(U)||!U?it(em,{message:U||"",type:hr.validate}):Ve(em);return U}return!0},Z=async({fields:A,onlyCheckValid:I,name:U,eventType:ce,context:Y={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(Y.runRootValidation=!0,!await L({name:U,eventType:ce})&&(Y.valid=!1,I)))return Y.valid;for(const W in A){const de=A[W];if(de){const{_f:we,..._e}=de;if(we){const Xe=d.array.has(we.name),wt=de._f&&I4(de._f),Xt=w.validatingFields||w.isValidating||_.validatingFields||_.isValidating;wt&&Xt&&D([we.name],!0);const zt=await Cx(de,d.disabled,l,T,n.shouldUseNativeValidation&&!I,Xe);if(wt&&Xt&&D([we.name]),zt[we.name]&&(Y.valid=!1,I)||(!I&&(Se(zt,we.name)?Xe?bx(r.errors,zt,we.name):ct(r.errors,we.name,zt[we.name]):Nt(r.errors,we.name)),e.shouldUseNativeValidation&&zt[we.name]))break}!rn(_e)&&await Z({context:Y,onlyCheckValid:I,fields:_e,name:W,eventType:ce})}}return Y.valid},re=()=>{for(const A of d.unMount){const I=Se(i,A);I&&(I._f.refs?I._f.refs.every(U=>!Wh(U)):!Wh(I._f.ref))&&Qt(A)}d.unMount=new Set},ee=(A,I)=>(A&&I&&ct(l,A,I),!Or(u.mount?l:o,o)),ne=(A,I,U)=>M4(A,d,{...u.mount?l:gt(I)?o:on(A)?{[A]:I}:I},U,I),z=A=>J_(Se(u.mount?l:o,A,n.shouldUnregister?Se(o,A,[]):[])),N=(A,I,U={},ce=!1,Y=!1)=>{const W=Se(i,A);let de=I;if(W){const we=W._f;we&&(!we.disabled&&ct(l,A,iC(I,we)),de=_u(we.ref)&&an(I)?"":I,tC(we.ref)?[...we.ref.options].forEach(_e=>_e.selected=de.includes(_e.value)):we.refs?El(we.ref)?we.refs.forEach(_e=>{(!_e.defaultChecked||!_e.disabled)&&(Array.isArray(de)?_e.checked=!!de.find(Xe=>Xe===_e.value):_e.checked=de===_e.value||!!de)}):we.refs.forEach(_e=>_e.checked=_e.value===de):tg(we.ref)?we.ref.value="":(we.ref.value=de,!we.ref.type&&!Y&&E.state.next({name:A,values:ce?l:Mt(l)})))}(U.shouldDirty||U.shouldTouch)&&ue(A,de,U.shouldTouch,U.shouldDirty,!Y),U.shouldValidate&&xe(A,{delayError:U.delayError})},B=(A,I,U,ce=!1,Y=!1)=>{for(const W in I){if(!I.hasOwnProperty(W))return;const de=I[W],we=A+"."+W,_e=Se(i,we);(d.array.has(A)||Rt(de)||_e&&!_e._f)&&!za(de)?B(we,de,U,ce,Y):N(we,de,U,ce,Y)}},J=(A,I,U,ce,Y=!1)=>{const W=Se(i,A),de=d.array.has(A),we=ce?I:Mt(I),_e=Se(l,A),Xe=Or(_e,we);if(Xe||ct(l,A,we),de)E.array.next({name:A,values:ce?l:Mt(l)}),(w.isDirty||w.dirtyFields||_.isDirty||_.dirtyFields)&&U.shouldDirty&&(P(),Y||E.state.next({name:A,dirtyFields:r.dirtyFields,isDirty:ee(A,we)}));else{const wt=Array.isArray(we)&&!we.length||rn(we);!W||W._f||an(we)||wt?N(A,we,U,ce,Y):B(A,we,U,ce,Y)}if(!Xe&&!Y){const wt=Jh(A,d),Xt=ce?l:Mt(l);E.state.next({...wt&&r,name:u.mount||wt?A:void 0,values:Xt})}},K=(A,I,U={})=>J(A,I,U,!1),le=(A,I={})=>{const U=Jn(A)?A(l):A;if(!Or(l,U)){l={...l,...U};const ce=W_(U);for(const Y of d.mount)Y in ce&&J(Y,ce[Y],I,!0,!0);E.state.next({...r,name:void 0,type:void 0,...y?{values:l}:{}}),I.shouldValidate&&M()}},ae=async A=>{u.mount=!0;const I=A.target;let U=I.name,ce=!0;const Y=Se(i,U),W=de=>{ce=Number.isNaN(de)||za(de)&&isNaN(de.getTime())||Or(de,Se(l,U,de))};if(Y){let de,we;const _e=I.type?Rx(Y._f):C4(A),Xe=A.type===Rs.BLUR||A.type===Rs.FOCUS_OUT,wt=!P4(Y._f)&&!e.validate&&!n.resolver&&!Se(r.errors,U)&&!Y._f.deps,Xt=wt||U4(Xe,Se(r.touchedFields,U),r.isSubmitted,b,v),zt=Jh(U,d,Xe);if(ct(l,U,_e),Xe){if(!I||!I.readOnly){Y._f.onBlur&&Y._f.onBlur(A);const yt=p[U];yt&&yt(0)}}else Y._f.onChange&&Y._f.onChange(A);const Ne=ue(U,_e,Xe),ht=!rn(Ne)||zt;if(!Xe&&E.state.next({name:U,type:A.type,...y?{values:Mt(l)}:{}}),Xt)return(!wt||!r.isValid)&&(w.isValid||_.isValid)&&(n.mode==="onBlur"?Xe&&M():Xe||M()),ht&&E.state.next({name:U,...zt?{}:Ne});if(!n.resolver&&e.validate&&await L({name:U,eventType:A.type}),!Xe&&zt&&E.state.next({...r}),n.resolver){const{errors:yt}=await pe([U]);if(D([U]),W(_e),!ce){!rn(Ne)&&E.state.next(Ne);return}const qt=Tx(r.errors,i,U),or=Tx(yt,i,qt.name||U);de=or.error,U=or.name,we=rn(yt)}else D([U],!0),de=(await Cx(Y,d.disabled,l,T,n.shouldUseNativeValidation))[U],D([U]),W(_e),ce&&(de?we=!1:(w.isValid||_.isValid)&&(we=await Z({fields:i,onlyCheckValid:!0,name:U,eventType:A.type})));ce&&(Y._f.deps&&(!Array.isArray(Y._f.deps)||Y._f.deps.length>0)&&xe(Y._f.deps),X(U,we,de,Ne))}},ye=(A,I)=>{if(Se(r.errors,I)&&A.focus)return A.focus(),1},xe=async(A,I={})=>{let U,ce;const Y=cu(A);if(n.resolver){const W=await ge(gt(A)?A:Y);U=rn(W),ce=A?!Y.some(de=>Se(W,de)):U}else A?(ce=(await Promise.all(Y.map(async W=>{const de=Se(i,W);return await Z({fields:de&&de._f?{[W]:de}:de,eventType:Rs.TRIGGER})}))).every(Boolean),!(!ce&&!r.isValid)&&M()):ce=U=await Z({fields:i,name:A,eventType:Rs.TRIGGER});if(I.delayError&&n.delayError&&on(A)){const W=Se(r.errors,A);W?(Nt(r.errors,A),p[A]=O(A,()=>V(A,W)),p[A](n.delayError)):(clearTimeout(m[A]),delete p[A])}return E.state.next({...!on(A)||(w.isValid||_.isValid)&&U!==r.isValid?{}:{name:A},...n.resolver||!A?{isValid:U}:{},errors:r.errors}),I.shouldFocus&&!ce&&tl(i,ye,A?Y:d.mount),ce},Oe=(A,I)=>{let U={...u.mount?l:o};return I&&(U=eC(I.dirtyFields?r.dirtyFields:r.touchedFields,U)),gt(A)?U:on(A)?Se(U,A):A.map(ce=>Se(U,ce))},Ie=(A,I)=>({invalid:!!Se((I||r).errors,A),isDirty:!!Se((I||r).dirtyFields,A),error:Se((I||r).errors,A),isValidating:!!Se(r.validatingFields,A),isTouched:!!Se((I||r).touchedFields,A)}),Ve=A=>{const I=A?cu(A):void 0;I?.forEach(U=>Nt(r.errors,U)),I?I.forEach(U=>{E.state.next({name:U,errors:r.errors})}):E.state.next({errors:{}})},it=(A,I,U)=>{const ce=(Se(i,A,{_f:{}})._f||{}).ref,Y=Se(r.errors,A)||{},{ref:W,message:de,type:we,..._e}=Y;ct(r.errors,A,{..._e,...I,ref:ce}),E.state.next({name:A,errors:r.errors,isValid:!1}),U&&U.shouldFocus&&ce&&ce.focus&&ce.focus()},Qe=(A,I)=>{if(Jn(A)){y++;const{unsubscribe:U}=E.state.subscribe({next:Y=>"values"in Y&&A(Y.values||ne(void 0,I),Y)});let ce=!1;return{unsubscribe:()=>{ce||(ce=!0,y--,U())}}}return ne(A,I,!0)},fn=A=>{var I;const U=!!(!((I=A.formState)===null||I===void 0)&&I.values);U&&y++;const{unsubscribe:ce}=E.state.subscribe({next:W=>{if(V4(A.name,W.name,A.exact)&&F4(W,A.formState||w,ir,A.reRenderRoot)){const de={...l};A.callback({values:de,...r,...W,defaultValues:o})}}});if(!U)return ce;let Y=!1;return()=>{Y||(Y=!0,y--,ce())}},hn=A=>(u.mount=!0,_={..._,...A.formState},fn({...A,formState:{...x,...A.formState}})),Qt=(A,I={})=>{for(const U of A?cu(A):d.mount)d.mount.delete(U),d.array.delete(U),I.keepValue||(Nt(i,U),Nt(l,U)),!I.keepError&&Nt(r.errors,U),!I.keepDirty&&Nt(r.dirtyFields,U),!I.keepTouched&&Nt(r.touchedFields,U),!I.keepIsValidating&&Nt(r.validatingFields,U),!n.shouldUnregister&&!I.keepDefaultValue&&Nt(o,U);E.state.next({values:Mt(l)}),E.state.next({...r,...I.keepDirty?{isDirty:ee()}:{}}),!I.keepIsValid&&M()},br=({disabled:A,name:I})=>{if(Tr(A)&&u.mount||A||d.disabled.has(I)){const Y=d.disabled.has(I)!==!!A;A?d.disabled.add(I):d.disabled.delete(I),Y&&u.mount&&!u.action&&M()}},jt=(A,I={})=>{let U=Se(i,A);const ce=Tr(I.disabled)||Tr(n.disabled),Y=!d.registerName.has(A)&&U&&U._f&&!U._f.mount;return ct(i,A,{...U||{},_f:{...U&&U._f?U._f:{ref:{name:A}},name:A,mount:!0,...I}}),d.mount.add(A),U&&!Y?br({disabled:Tr(I.disabled)?I.disabled:n.disabled,name:A}):he(A,!0,I.value),{...ce?{disabled:I.disabled||n.disabled}:{},...n.progressive?{required:!!I.required,min:qo(I.min),max:qo(I.max),minLength:qo(I.minLength),maxLength:qo(I.maxLength),pattern:qo(I.pattern)}:{},name:A,onChange:ae,onBlur:ae,ref:W=>{if(W){d.registerName.add(A),jt(A,I),d.registerName.delete(A),U=Se(i,A);const de=gt(W.value)&&W.querySelectorAll&&W.querySelectorAll("input,select,textarea")[0]||W,we=k4(de),_e=U._f.refs||[];if(we?_e.find(Xe=>Xe===de):de===U._f.ref)return;ct(i,A,{_f:{...U._f,...we?{refs:[..._e.filter(Wh),de,...Array.isArray(Se(o,A))?[{}]:[]],ref:{type:de.type,name:A}}:{ref:de}}}),he(A,!1,void 0,de)}else U=Se(i,A,{}),U._f&&(U._f.mount=!1),(n.shouldUnregister||I.shouldUnregister)&&!(E4(d.array,A)&&u.action)&&d.unMount.add(A)}}},rr=()=>n.shouldFocusError&&!n.shouldUseNativeValidation&&tl(i,ye,d.mount),xr=A=>{Tr(A)&&(E.state.next({disabled:A}),tl(i,(I,U)=>{const ce=Se(i,U);ce&&(I.disabled=ce._f.disabled||A,Array.isArray(ce._f.refs)&&ce._f.refs.forEach(Y=>{Y.disabled=ce._f.disabled||A}))},0,!1))},Tt=(A,I)=>async U=>{let ce;U&&(U.preventDefault&&U.preventDefault(),U.persist&&U.persist());let Y=Mt(l);if(E.state.next({isSubmitting:!0}),n.resolver){const{errors:W,values:de}=await pe();D(),r.errors=W,Y=Mt(de)}else await Z({fields:i,eventType:Rs.SUBMIT});if(d.disabled.size)for(const W of d.disabled)Nt(Y,W);if(Nt(r.errors,Y_),rn(r.errors)){E.state.next({errors:{}});try{await A(Y,U)}catch(W){ce=W}}else I&&await I({...r.errors},U),rr(),setTimeout(rr);if(E.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:rn(r.errors)&&!ce,submitCount:r.submitCount+1,errors:r.errors}),ce)throw ce},Vn=(A,I={})=>{Se(i,A)&&(gt(I.defaultValue)?K(A,Mt(Se(o,A))):(K(A,I.defaultValue),ct(o,A,Mt(I.defaultValue))),I.keepTouched||Nt(r.touchedFields,A),I.keepDirty||(Nt(r.dirtyFields,A),r.isDirty=I.defaultValue?ee(A,Mt(Se(o,A))):ee()),I.keepError||(Nt(r.errors,A),w.isValid&&M()),E.state.next({...r}))},Dt=(A,I={})=>{const U=A?Mt(A):o,ce=Mt(U),Y=rn(A),W=ce,de=i;if(I.keepDefaultValues||(o=U),!I.keepValues){if(I.keepDirtyValues){const we=new Set([...d.mount,...Object.keys(bi(o,l,void 0,de))]);for(const _e of Array.from(we)){const Xe=Se(r.dirtyFields,_e),wt=Se(l,_e),Xt=Se(W,_e);Xe&&!gt(wt)?ct(W,_e,wt):!Xe&&!gt(Xt)&&K(_e,Xt)}}else{if(td&>(A))for(const we of d.mount){const _e=Se(i,we);if(_e&&_e._f){const Xe=Array.isArray(_e._f.refs)?_e._f.refs[0]:_e._f.ref;if(_u(Xe)){const wt=Xe.closest("form");if(wt){wt.reset();break}}}}if(I.keepFieldsRef)for(const we of d.mount)K(we,Se(W,we));else i={}}if(n.shouldUnregister){if(l=I.keepDefaultValues?Mt(o):{},I.keepFieldsRef)for(const we of d.mount)ct(l,we,Se(W,we))}else l=Mt(W);E.array.next({values:{...W}}),E.state.next({name:void 0,type:void 0,values:{...W}})}d={mount:I.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},u.mount=!w.isValid||!!I.keepIsValid||!!I.keepDirtyValues||!n.shouldUnregister&&!rn(W),u.watch=!!n.shouldUnregister,u.keepIsValid=!!I.keepIsValid,u.action=!1,I.keepErrors||(r.errors={}),E.state.next({submitCount:I.keepSubmitCount?r.submitCount:0,isDirty:Y?!1:I.keepDirty?r.isDirty:I.keepValues?ee():!!(I.keepDefaultValues&&!Or(A,o)),isSubmitted:I.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:Y?{}:I.keepDirtyValues?I.keepDefaultValues&&l?bi(o,l,void 0,de):r.dirtyFields:I.keepDefaultValues&&A?bi(o,A,void 0,de):I.keepDirty?r.dirtyFields:{},touchedFields:I.keepTouched?r.touchedFields:{},errors:I.keepErrors?r.errors:{},isSubmitSuccessful:I.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},kr=(A,I)=>Dt(Jn(A)?A(l):A,{...n.resetOptions,...I}),ar=(A,I={})=>{const U=Se(i,A),ce=U&&U._f;if(ce){const Y=ce.refs?ce.refs[0]:ce.ref;Y.focus&&setTimeout(()=>{Y.focus(),I.shouldSelect&&Jn(Y.select)&&Y.select()})}},ir=A=>{const{name:I,type:U,values:ce,...Y}=A;r={...r,...Y}},mn={control:{register:jt,unregister:Qt,getFieldState:Ie,handleSubmit:Tt,setError:it,_subscribe:fn,_runSchema:pe,_updateIsValidating:D,_focusError:rr,_getWatch:ne,_getDirty:ee,_setValid:M,_setFieldArray:F,_setDisabledField:br,_setErrors:ve,_getFieldArray:z,_reset:Dt,_resetDefaultValues:()=>Jn(n.defaultValues)&&n.defaultValues().then(A=>{kr(A,n.resetOptions),E.state.next({isLoading:!1})}),_removeUnmounted:re,_disableForm:xr,_subjects:E,_proxyFormState:w,get _fields(){return i},get _formValues(){return l},get _state(){return u},set _state(A){u=A},get _defaultValues(){return o},get _names(){return d},set _names(A){d=A},get _formState(){return r},get _options(){return n},set _options(A){n={...n,...A},v=eu(n.mode),b=eu(n.reValidateMode)}},subscribe:hn,trigger:xe,register:jt,handleSubmit:Tt,watch:Qe,setValue:K,setValues:le,getValues:Oe,reset:kr,resetField:Vn,resetDefaultValues:(A,I={})=>{if(o=Mt(A),!I.keepDirty){const U=bi(o,l,void 0,i);r.dirtyFields=U,r.isDirty=!rn(U)}I.keepIsValid||M(),E.state.next({...r,defaultValues:o})},clearErrors:Ve,unregister:Qt,setError:it,setFocus:ar,getFieldState:Ie};return{...mn,formControl:mn}}function ag(e={}){const n=me.useRef(void 0),r=me.useRef(void 0),i=me.useRef(e.formControl),[o,l]=me.useState(()=>({...Mt(sC),isLoading:Jn(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Jn(e.defaultValues)?void 0:e.defaultValues}));if(!n.current||e.formControl&&i.current!==e.formControl)if(i.current=e.formControl,e.formControl)n.current={...e.formControl,formState:o},e.defaultValues&&!Jn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:d,...p}=q4(e);n.current={...p,formState:o}}const u=n.current.control;return u._options=e,A4(()=>{const d=u._subscribe({formState:u._proxyFormState,callback:()=>l({...u._formState,defaultValues:u._defaultValues}),reRenderRoot:!0});return l(p=>({...p,isReady:!0})),u._formState.isReady=!0,d},[u]),me.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),me.useEffect(()=>{e.mode&&(u._options.mode=e.mode),e.reValidateMode&&(u._options.reValidateMode=e.reValidateMode)},[u,e.mode,e.reValidateMode]),me.useEffect(()=>{e.errors&&(u._setErrors(e.errors),u._focusError())},[u,e.errors]),me.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,e.shouldUnregister]),me.useEffect(()=>{if(u._proxyFormState.isDirty){const d=u._getDirty();d!==o.isDirty&&u._subjects.state.next({isDirty:d})}},[u,o.isDirty]),me.useEffect(()=>{var d;e.values&&!Or(e.values,r.current)?(u._reset(e.values,{keepFieldsRef:!0,...u._options.resetOptions}),!((d=u._options.resetOptions)===null||d===void 0)&&d.keepIsValid||u._setValid(),r.current=e.values,l(p=>({...p}))):u._resetDefaultValues()},[u,e.values]),me.useEffect(()=>{u._state.mount||(u._setValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),n.current.formState=me.useMemo(()=>O4(o,u),[u,o]),n.current}const Ox=(e,n,r)=>{if(e&&"reportValidity"in e){const i=Se(r,n);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},Bm=(e,n)=>{for(const r in n.fields){const i=n.fields[r];i&&i.ref&&"reportValidity"in i.ref?Ox(i.ref,r,e):i&&i.refs&&i.refs.forEach(o=>Ox(o,r,e))}},Ax=(e,n)=>{n.shouldUseNativeValidation&&Bm(e,n);const r={};for(const i in e){const o=Se(n.fields,i),l=Object.assign(e[i]||{},{ref:o&&o.ref});if(G4(n.names||Object.keys(e),i)){const u=Object.assign({},Se(r,i));ct(u,"root",l),ct(r,i,u)}else ct(r,i,l)}return r},G4=(e,n)=>{const r=Mx(n).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(i=>Mx(i).match(`^${r}\\.\\d+`))};function Mx(e){return e.replace(/[\[\]]/g,"")}var Nx;function fe(e,n,r){function i(d,p){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:p,constr:u,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),n(d,p);const m=u.prototype,y=Object.keys(m);for(let v=0;vr?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class $s extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class oC extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}(Nx=globalThis).__zod_globalConfig??(Nx.__zod_globalConfig={});const ig=globalThis.__zod_globalConfig;function ji(e){return ig}function lC(e){const n=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>n.indexOf(+i)===-1).map(([i,o])=>o)}function qm(e,n){return typeof n=="bigint"?n.toString():n}function sg(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function og(e){return e==null}function lg(e){const n=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(n,r)}const Dx=Symbol("evaluating");function dt(e,n,r){let i;Object.defineProperty(e,n,{get(){if(i!==Dx)return i===void 0&&(i=Dx,i=r()),i},set(o){Object.defineProperty(e,n,{value:o})},configurable:!0})}function Li(e,n,r){Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Xa(...e){const n={};for(const r of e){const i=Object.getOwnPropertyDescriptors(r);Object.assign(n,i)}return Object.defineProperties({},n)}function zx(e){return JSON.stringify(e)}function Z4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const cC="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Eu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const K4=sg(()=>{if(ig.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function hl(e){if(Eu(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const r=n.prototype;return!(Eu(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function uC(e){return hl(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Y4=new Set(["string","number","symbol"]);function rd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ja(e,n,r){const i=new e._zod.constr(n??e._zod.def);return(!n||r?.parent)&&(i._zod.parent=e),i}function Le(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function Q4(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}function X4(e,n){const r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const l=Xa(e._zod.def,{get shape(){const u={};for(const d in n){if(!(d in r.shape))throw new Error(`Unrecognized key: "${d}"`);n[d]&&(u[d]=r.shape[d])}return Li(this,"shape",u),u},checks:[]});return Ja(e,l)}function J4(e,n){const r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const l=Xa(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const d in n){if(!(d in r.shape))throw new Error(`Unrecognized key: "${d}"`);n[d]&&delete u[d]}return Li(this,"shape",u),u},checks:[]});return Ja(e,l)}function W4(e,n){if(!hl(n))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const l=e._zod.def.shape;for(const u in n)if(Object.getOwnPropertyDescriptor(l,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Xa(e._zod.def,{get shape(){const l={...e._zod.def.shape,...n};return Li(this,"shape",l),l}});return Ja(e,o)}function e5(e,n){if(!hl(n))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Xa(e._zod.def,{get shape(){const i={...e._zod.def.shape,...n};return Li(this,"shape",i),i}});return Ja(e,r)}function t5(e,n){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=Xa(e._zod.def,{get shape(){const i={...e._zod.def.shape,...n._zod.def.shape};return Li(this,"shape",i),i},get catchall(){return n._zod.def.catchall},checks:n._zod.def.checks??[]});return Ja(e,r)}function n5(e,n,r){const o=n._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Xa(n._zod.def,{get shape(){const d=n._zod.def.shape,p={...d};if(r)for(const m in r){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);r[m]&&(p[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)p[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Li(this,"shape",p),p},checks:[]});return Ja(n,u)}function r5(e,n,r){const i=Xa(n._zod.def,{get shape(){const o=n._zod.def.shape,l={...o};if(r)for(const u in r){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=new e({type:"nonoptional",innerType:o[u]}))}else for(const u in o)l[u]=new e({type:"nonoptional",innerType:o[u]});return Li(this,"shape",l),l}});return Ja(n,i)}function Ns(e,n=0){if(e.aborted===!0)return!0;for(let r=n;r{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function tu(e){return typeof e=="string"?e:e?.message}function Ti(e,n,r){const i=e.message?e.message:tu(e.inst?._zod.def?.error?.(e))??tu(n?.error?.(e))??tu(r.customError?.(e))??tu(r.localeError?.(e))??"Invalid input",{inst:o,continue:l,input:u,...d}=e;return d.path??(d.path=[]),d.message=i,n?.reportInput&&(d.input=u),d}function cg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ml(...e){const[n,r,i]=e;return typeof n=="string"?{message:n,code:"custom",input:r,inst:i}:{...n}}const fC=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,qm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ug=fe("$ZodError",fC),ad=fe("$ZodError",fC,{Parent:Error});function i5(e,n=r=>r.message){const r={},i=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(n(o))):i.push(n(o));return{formErrors:i,fieldErrors:r}}function s5(e,n=r=>r.message){const r={_errors:[]},i=(o,l=[])=>{for(const u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>i({issues:d},[...l,...u.path]));else if(u.code==="invalid_key")i({issues:u.issues},[...l,...u.path]);else if(u.code==="invalid_element")i({issues:u.issues},[...l,...u.path]);else{const d=[...l,...u.path];if(d.length===0)r._errors.push(n(u));else{let p=r,m=0;for(;m(n,r,i,o)=>{const l=i?{...i,async:!1}:{async:!1},u=n._zod.run({value:r,issues:[]},l);if(u instanceof Promise)throw new $s;if(u.issues.length){const d=new(o?.Err??e)(u.issues.map(p=>Ti(p,l,ji())));throw cC(d,o?.callee),d}return u.value},o5=id(ad),sd=e=>async(n,r,i,o)=>{const l=i?{...i,async:!0}:{async:!0};let u=n._zod.run({value:r,issues:[]},l);if(u instanceof Promise&&(u=await u),u.issues.length){const d=new(o?.Err??e)(u.issues.map(p=>Ti(p,l,ji())));throw cC(d,o?.callee),d}return u.value},l5=sd(ad),od=e=>(n,r,i)=>{const o=i?{...i,async:!1}:{async:!1},l=n._zod.run({value:r,issues:[]},o);if(l instanceof Promise)throw new $s;return l.issues.length?{success:!1,error:new(e??ug)(l.issues.map(u=>Ti(u,o,ji())))}:{success:!0,data:l.value}},c5=od(ad),ld=e=>async(n,r,i)=>{const o=i?{...i,async:!0}:{async:!0};let l=n._zod.run({value:r,issues:[]},o);return l instanceof Promise&&(l=await l),l.issues.length?{success:!1,error:new e(l.issues.map(u=>Ti(u,o,ji())))}:{success:!0,data:l.value}},u5=ld(ad),d5=e=>(n,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return id(e)(n,r,o)},f5=e=>(n,r,i)=>id(e)(n,r,i),h5=e=>async(n,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return sd(e)(n,r,o)},m5=e=>async(n,r,i)=>sd(e)(n,r,i),p5=e=>(n,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return od(e)(n,r,o)},g5=e=>(n,r,i)=>od(e)(n,r,i),v5=e=>async(n,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return ld(e)(n,r,o)},y5=e=>async(n,r,i)=>ld(e)(n,r,i),b5=/^[cC][0-9a-z]{6,}$/,x5=/^[0-9a-z]+$/,w5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,S5=/^[0-9a-vA-V]{20}$/,_5=/^[A-Za-z0-9]{27}$/,C5=/^[a-zA-Z0-9_-]{21}$/,E5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,R5=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,kx=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,j5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,T5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function O5(){return new RegExp(T5,"u")}const A5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,M5=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,N5=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,D5=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,z5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,hC=/^[A-Za-z0-9_-]*$/,k5=/^https?$/,L5=/^\+[1-9]\d{6,14}$/,mC="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",$5=new RegExp(`^${mC}$`);function pC(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function I5(e){return new RegExp(`^${pC(e)}$`)}function P5(e){const n=pC({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${n}(?:${r.join("|")})`;return new RegExp(`^${mC}T(?:${i})$`)}const F5=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},V5=/^(?:true|false)$/i,U5=/^[^A-Z]*$/,H5=/^[^a-z]*$/,zr=fe("$ZodCheck",(e,n)=>{var r;e._zod??(e._zod={}),e._zod.def=n,(r=e._zod).onattach??(r.onattach=[])}),B5=fe("$ZodCheckMaxLength",(e,n)=>{var r;zr.init(e,n),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!og(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum{const o=i.value;if(o.length<=n.maximum)return;const u=cg(o);i.issues.push({origin:u,code:"too_big",maximum:n.maximum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),q5=fe("$ZodCheckMinLength",(e,n)=>{var r;zr.init(e,n),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!og(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>o&&(i._zod.bag.minimum=n.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=n.minimum)return;const u=cg(o);i.issues.push({origin:u,code:"too_small",minimum:n.minimum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),G5=fe("$ZodCheckLengthEquals",(e,n)=>{var r;zr.init(e,n),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!og(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=n.length,o.maximum=n.length,o.length=n.length}),e._zod.check=i=>{const o=i.value,l=o.length;if(l===n.length)return;const u=cg(o),d=l>n.length;i.issues.push({origin:u,...d?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!n.abort})}}),cd=fe("$ZodCheckStringFormat",(e,n)=>{var r,i;zr.init(e,n),e._zod.onattach.push(o=>{const l=o._zod.bag;l.format=n.format,n.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(n.pattern))}),n.pattern?(r=e._zod).check??(r.check=o=>{n.pattern.lastIndex=0,!n.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:n.format,input:o.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(i=e._zod).check??(i.check=()=>{})}),Z5=fe("$ZodCheckRegex",(e,n)=>{cd.init(e,n),e._zod.check=r=>{n.pattern.lastIndex=0,!n.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),K5=fe("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=U5),cd.init(e,n)}),Y5=fe("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=H5),cd.init(e,n)}),Q5=fe("$ZodCheckIncludes",(e,n)=>{zr.init(e,n);const r=rd(n.includes),i=new RegExp(typeof n.position=="number"?`^.{${n.position}}${r}`:r);n.pattern=i,e._zod.onattach.push(o=>{const l=o._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(i)}),e._zod.check=o=>{o.value.includes(n.includes,n.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:o.value,inst:e,continue:!n.abort})}}),X5=fe("$ZodCheckStartsWith",(e,n)=>{zr.init(e,n);const r=new RegExp(`^${rd(n.prefix)}.*`);n.pattern??(n.pattern=r),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(n.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:i.value,inst:e,continue:!n.abort})}}),J5=fe("$ZodCheckEndsWith",(e,n)=>{zr.init(e,n);const r=new RegExp(`.*${rd(n.suffix)}$`);n.pattern??(n.pattern=r),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(n.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:i.value,inst:e,continue:!n.abort})}}),W5=fe("$ZodCheckOverwrite",(e,n)=>{zr.init(e,n),e._zod.check=r=>{r.value=n.tx(r.value)}});class e6{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const i=n.split(` `).filter(u=>u),o=Math.min(...i.map(u=>u.length-u.trimStart().length)),l=i.map(u=>u.slice(o)).map(u=>" ".repeat(this.indent*2)+u);for(const u of l)this.content.push(u)}compile(){const n=Function,r=this?.args,o=[...(this?.content??[""]).map(l=>` ${l}`)];return new n(...r,o.join(` -`))}}const W5={major:4,minor:4,patch:3},Ft=fe("$ZodType",(e,n)=>{var r;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=W5;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const l of o._zod.onattach)l(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(u,d,p)=>{let m=Ns(u),y;for(const v of d){if(v._zod.def.when){if(n5(u)||!v._zod.def.when(u))continue}else if(m)continue;const b=u.issues.length,x=v._zod.check(u);if(x instanceof Promise&&p?.async===!1)throw new $s;if(y||x instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await x,u.issues.length!==b&&(m||(m=Ns(u,b)))});else{if(u.issues.length===b)continue;m||(m=Ns(u,b))}}return y?y.then(()=>u):u},l=(u,d,p)=>{if(Ns(u))return u.aborted=!0,u;const m=o(d,i,p);if(m instanceof Promise){if(p.async===!1)throw new $s;return m.then(y=>e._zod.parse(y,p))}return e._zod.parse(m,p)};e._zod.run=(u,d)=>{if(d.skipChecks)return e._zod.parse(u,d);if(d.direction==="backward"){const m=e._zod.parse({value:u.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(y=>l(y,u,d)):l(m,u,d)}const p=e._zod.parse(u,d);if(p instanceof Promise){if(d.async===!1)throw new $s;return p.then(m=>o(m,i,d))}return o(p,i,d)}}dt(e,"~standard",()=>({validate:o=>{try{const l=o5(e,o);return l.success?{value:l.data}:{issues:l.error?.issues}}catch{return l5(e,o).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),dg=fe("$ZodString",(e,n)=>{Ft.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??I5(e._zod.bag),e._zod.parse=(r,i)=>{if(n.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),xt=fe("$ZodStringFormat",(e,n)=>{cd.init(e,n),dg.init(e,n)}),e6=fe("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=C5),xt.init(e,n)}),t6=fe("$ZodUUID",(e,n)=>{if(n.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(i===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=kx(i))}else n.pattern??(n.pattern=kx());xt.init(e,n)}),n6=fe("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=E5),xt.init(e,n)}),r6=fe("$ZodURL",(e,n)=>{xt.init(e,n),e._zod.check=r=>{try{const i=r.value.trim();if(!n.normalize&&n.protocol?.source===D5.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!n.abort});return}const o=new URL(i);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:r.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:r.value,inst:e,continue:!n.abort})),n.normalize?r.value=o.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!n.abort})}}}),a6=fe("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=j5()),xt.init(e,n)}),i6=fe("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=S5),xt.init(e,n)}),s6=fe("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=v5),xt.init(e,n)}),o6=fe("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=y5),xt.init(e,n)}),l6=fe("$ZodULID",(e,n)=>{n.pattern??(n.pattern=b5),xt.init(e,n)}),c6=fe("$ZodXID",(e,n)=>{n.pattern??(n.pattern=x5),xt.init(e,n)}),u6=fe("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=w5),xt.init(e,n)}),d6=fe("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=$5(n)),xt.init(e,n)}),f6=fe("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=k5),xt.init(e,n)}),h6=fe("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=L5(n)),xt.init(e,n)}),m6=fe("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=_5),xt.init(e,n)}),p6=fe("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=T5),xt.init(e,n),e._zod.bag.format="ipv4"}),g6=fe("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=O5),xt.init(e,n),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!n.abort})}}}),v6=fe("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=A5),xt.init(e,n)}),y6=fe("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=M5),xt.init(e,n),e._zod.check=r=>{const i=r.value.split("/");try{if(i.length!==2)throw new Error;const[o,l]=i;if(!l)throw new Error;const u=Number(l);if(`${u}`!==l)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!n.abort})}}});function gC(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const b6=fe("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=N5),xt.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{gC(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!n.abort})}});function x6(e){if(!hC.test(e))return!1;const n=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return gC(r)}const w6=fe("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=hC),xt.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{x6(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!n.abort})}}),S6=fe("$ZodE164",(e,n)=>{n.pattern??(n.pattern=z5),xt.init(e,n)});function _6(e,n=null){try{const r=e.split(".");if(r.length!==3)return!1;const[i]=r;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||n&&(!("alg"in o)||o.alg!==n))}catch{return!1}}const C6=fe("$ZodJWT",(e,n)=>{xt.init(e,n),e._zod.check=r=>{_6(r.value,n.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!n.abort})}}),E6=fe("$ZodBoolean",(e,n)=>{Ft.init(e,n),e._zod.pattern=P5,e._zod.parse=(r,i)=>{if(n.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),R6=fe("$ZodUnknown",(e,n)=>{Ft.init(e,n),e._zod.parse=r=>r}),j6=fe("$ZodNever",(e,n)=>{Ft.init(e,n),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Lx(e,n,r){e.issues.length&&n.issues.push(...dC(r,e.issues)),n.value[r]=e.value}const T6=fe("$ZodArray",(e,n)=>{Ft.init(e,n),e._zod.parse=(r,i)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const l=[];for(let u=0;uLx(m,r,u))):Lx(p,r,u)}return l.length?Promise.all(l).then(()=>r):r}});function Ru(e,n,r,i,o,l){const u=r in i;if(e.issues.length){if(o&&l&&!u)return;n.issues.push(...dC(r,e.issues))}if(!u&&!o){e.issues.length||n.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?u&&(n.value[r]=void 0):n.value[r]=e.value}function vC(e){const n=Object.keys(e.shape);for(const i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const r=K4(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function yC(e,n,r,i,o,l){const u=[],d=o.keySet,p=o.catchall._zod,m=p.def.type,y=p.optin==="optional",v=p.optout==="optional";for(const b in n){if(b==="__proto__"||d.has(b))continue;if(m==="never"){u.push(b);continue}const x=p.run({value:n[b],issues:[]},i);x instanceof Promise?e.push(x.then(S=>Ru(S,r,b,n,y,v))):Ru(x,r,b,n,y,v)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:n,inst:l}),e.length?Promise.all(e).then(()=>r):r}const O6=fe("$ZodObject",(e,n)=>{if(Ft.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const d=n.shape;Object.defineProperty(n,"shape",{get:()=>{const p={...d};return Object.defineProperty(n,"shape",{value:p}),p}})}const i=sg(()=>vC(n));dt(e._zod,"propValues",()=>{const d=n.shape,p={};for(const m in d){const y=d[m]._zod;if(y.values){p[m]??(p[m]=new Set);for(const v of y.values)p[m].add(v)}}return p});const o=Eu,l=n.catchall;let u;e._zod.parse=(d,p)=>{u??(u=i.value);const m=d.value;if(!o(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const y=[],v=u.shape;for(const b of u.keys){const x=v[b],S=x._zod.optin==="optional",_=x._zod.optout==="optional",E=x._zod.run({value:m[b],issues:[]},p);E instanceof Promise?y.push(E.then(R=>Ru(R,d,b,m,S,_))):Ru(E,d,b,m,S,_)}return l?yC(y,m,d,p,i.value,e):y.length?Promise.all(y).then(()=>d):d}}),A6=fe("$ZodObjectJIT",(e,n)=>{O6.init(e,n);const r=e._zod.parse,i=sg(()=>vC(n)),o=b=>{const x=new J5(["shape","payload","ctx"]),S=i.value,_=O=>{const M=zx(O);return`shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`};x.write("const input = payload.value;");const E=Object.create(null);let R=0;for(const O of S.keys)E[O]=`key_${R++}`;x.write("const newResult = {};");for(const O of S.keys){const M=E[O],D=zx(O),P=b[O],F=P?._zod?.optin==="optional",V=P?._zod?.optout==="optional";x.write(`const ${M} = ${_(O)};`),F&&V?x.write(` +`))}}const t6={major:4,minor:4,patch:3},Ft=fe("$ZodType",(e,n)=>{var r;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=t6;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const l of o._zod.onattach)l(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(u,d,p)=>{let m=Ns(u),y;for(const v of d){if(v._zod.def.when){if(a5(u)||!v._zod.def.when(u))continue}else if(m)continue;const b=u.issues.length,x=v._zod.check(u);if(x instanceof Promise&&p?.async===!1)throw new $s;if(y||x instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await x,u.issues.length!==b&&(m||(m=Ns(u,b)))});else{if(u.issues.length===b)continue;m||(m=Ns(u,b))}}return y?y.then(()=>u):u},l=(u,d,p)=>{if(Ns(u))return u.aborted=!0,u;const m=o(d,i,p);if(m instanceof Promise){if(p.async===!1)throw new $s;return m.then(y=>e._zod.parse(y,p))}return e._zod.parse(m,p)};e._zod.run=(u,d)=>{if(d.skipChecks)return e._zod.parse(u,d);if(d.direction==="backward"){const m=e._zod.parse({value:u.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(y=>l(y,u,d)):l(m,u,d)}const p=e._zod.parse(u,d);if(p instanceof Promise){if(d.async===!1)throw new $s;return p.then(m=>o(m,i,d))}return o(p,i,d)}}dt(e,"~standard",()=>({validate:o=>{try{const l=c5(e,o);return l.success?{value:l.data}:{issues:l.error?.issues}}catch{return u5(e,o).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),dg=fe("$ZodString",(e,n)=>{Ft.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??F5(e._zod.bag),e._zod.parse=(r,i)=>{if(n.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),xt=fe("$ZodStringFormat",(e,n)=>{cd.init(e,n),dg.init(e,n)}),n6=fe("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=R5),xt.init(e,n)}),r6=fe("$ZodUUID",(e,n)=>{if(n.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(i===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=kx(i))}else n.pattern??(n.pattern=kx());xt.init(e,n)}),a6=fe("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=j5),xt.init(e,n)}),i6=fe("$ZodURL",(e,n)=>{xt.init(e,n),e._zod.check=r=>{try{const i=r.value.trim();if(!n.normalize&&n.protocol?.source===k5.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!n.abort});return}const o=new URL(i);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:r.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:r.value,inst:e,continue:!n.abort})),n.normalize?r.value=o.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!n.abort})}}}),s6=fe("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=O5()),xt.init(e,n)}),o6=fe("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=C5),xt.init(e,n)}),l6=fe("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=b5),xt.init(e,n)}),c6=fe("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=x5),xt.init(e,n)}),u6=fe("$ZodULID",(e,n)=>{n.pattern??(n.pattern=w5),xt.init(e,n)}),d6=fe("$ZodXID",(e,n)=>{n.pattern??(n.pattern=S5),xt.init(e,n)}),f6=fe("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=_5),xt.init(e,n)}),h6=fe("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=P5(n)),xt.init(e,n)}),m6=fe("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=$5),xt.init(e,n)}),p6=fe("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=I5(n)),xt.init(e,n)}),g6=fe("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=E5),xt.init(e,n)}),v6=fe("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=A5),xt.init(e,n),e._zod.bag.format="ipv4"}),y6=fe("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=M5),xt.init(e,n),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!n.abort})}}}),b6=fe("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=N5),xt.init(e,n)}),x6=fe("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=D5),xt.init(e,n),e._zod.check=r=>{const i=r.value.split("/");try{if(i.length!==2)throw new Error;const[o,l]=i;if(!l)throw new Error;const u=Number(l);if(`${u}`!==l)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!n.abort})}}});function gC(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const w6=fe("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=z5),xt.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{gC(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!n.abort})}});function S6(e){if(!hC.test(e))return!1;const n=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return gC(r)}const _6=fe("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=hC),xt.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{S6(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!n.abort})}}),C6=fe("$ZodE164",(e,n)=>{n.pattern??(n.pattern=L5),xt.init(e,n)});function E6(e,n=null){try{const r=e.split(".");if(r.length!==3)return!1;const[i]=r;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||n&&(!("alg"in o)||o.alg!==n))}catch{return!1}}const R6=fe("$ZodJWT",(e,n)=>{xt.init(e,n),e._zod.check=r=>{E6(r.value,n.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!n.abort})}}),j6=fe("$ZodBoolean",(e,n)=>{Ft.init(e,n),e._zod.pattern=V5,e._zod.parse=(r,i)=>{if(n.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),T6=fe("$ZodUnknown",(e,n)=>{Ft.init(e,n),e._zod.parse=r=>r}),O6=fe("$ZodNever",(e,n)=>{Ft.init(e,n),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Lx(e,n,r){e.issues.length&&n.issues.push(...dC(r,e.issues)),n.value[r]=e.value}const A6=fe("$ZodArray",(e,n)=>{Ft.init(e,n),e._zod.parse=(r,i)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const l=[];for(let u=0;uLx(m,r,u))):Lx(p,r,u)}return l.length?Promise.all(l).then(()=>r):r}});function Ru(e,n,r,i,o,l){const u=r in i;if(e.issues.length){if(o&&l&&!u)return;n.issues.push(...dC(r,e.issues))}if(!u&&!o){e.issues.length||n.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?u&&(n.value[r]=void 0):n.value[r]=e.value}function vC(e){const n=Object.keys(e.shape);for(const i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const r=Q4(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function yC(e,n,r,i,o,l){const u=[],d=o.keySet,p=o.catchall._zod,m=p.def.type,y=p.optin==="optional",v=p.optout==="optional";for(const b in n){if(b==="__proto__"||d.has(b))continue;if(m==="never"){u.push(b);continue}const x=p.run({value:n[b],issues:[]},i);x instanceof Promise?e.push(x.then(w=>Ru(w,r,b,n,y,v))):Ru(x,r,b,n,y,v)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:n,inst:l}),e.length?Promise.all(e).then(()=>r):r}const M6=fe("$ZodObject",(e,n)=>{if(Ft.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const d=n.shape;Object.defineProperty(n,"shape",{get:()=>{const p={...d};return Object.defineProperty(n,"shape",{value:p}),p}})}const i=sg(()=>vC(n));dt(e._zod,"propValues",()=>{const d=n.shape,p={};for(const m in d){const y=d[m]._zod;if(y.values){p[m]??(p[m]=new Set);for(const v of y.values)p[m].add(v)}}return p});const o=Eu,l=n.catchall;let u;e._zod.parse=(d,p)=>{u??(u=i.value);const m=d.value;if(!o(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const y=[],v=u.shape;for(const b of u.keys){const x=v[b],w=x._zod.optin==="optional",_=x._zod.optout==="optional",E=x._zod.run({value:m[b],issues:[]},p);E instanceof Promise?y.push(E.then(R=>Ru(R,d,b,m,w,_))):Ru(E,d,b,m,w,_)}return l?yC(y,m,d,p,i.value,e):y.length?Promise.all(y).then(()=>d):d}}),N6=fe("$ZodObjectJIT",(e,n)=>{M6.init(e,n);const r=e._zod.parse,i=sg(()=>vC(n)),o=b=>{const x=new e6(["shape","payload","ctx"]),w=i.value,_=O=>{const M=zx(O);return`shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`};x.write("const input = payload.value;");const E=Object.create(null);let R=0;for(const O of w.keys)E[O]=`key_${R++}`;x.write("const newResult = {};");for(const O of w.keys){const M=E[O],D=zx(O),P=b[O],F=P?._zod?.optin==="optional",V=P?._zod?.optout==="optional";x.write(`const ${M} = ${_(O)};`),F&&V?x.write(` if (${M}.issues.length) { if (${D} in input) { payload.issues = payload.issues.concat(${M}.issues.map(iss => ({ @@ -110,13 +110,13 @@ Error generating stack: `+c.message+` } } - `)}x.write("payload.value = newResult;"),x.write("return payload;");const T=x.compile();return(O,M)=>T(b,O,M)};let l;const u=Eu,d=!ig.jitless,m=d&&G4.value,y=n.catchall;let v;e._zod.parse=(b,x)=>{v??(v=i.value);const S=b.value;return u(S)?d&&m&&x?.async===!1&&x.jitless!==!0?(l||(l=o(n.shape)),b=l(b,x),y?yC([],S,b,x,v,e):b):r(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function $x(e,n,r,i){for(const l of e)if(l.issues.length===0)return n.value=l.value,n;const o=e.filter(l=>!Ns(l));return o.length===1?(n.value=o[0].value,o[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:r,errors:e.map(l=>l.issues.map(u=>Ti(u,i,ji())))}),n)}const M6=fe("$ZodUnion",(e,n)=>{Ft.init(e,n),dt(e._zod,"optin",()=>n.options.some(i=>i._zod.optin==="optional")?"optional":void 0),dt(e._zod,"optout",()=>n.options.some(i=>i._zod.optout==="optional")?"optional":void 0),dt(e._zod,"values",()=>{if(n.options.every(i=>i._zod.values))return new Set(n.options.flatMap(i=>Array.from(i._zod.values)))}),dt(e._zod,"pattern",()=>{if(n.options.every(i=>i._zod.pattern)){const i=n.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>lg(o.source)).join("|")})$`)}});const r=n.options.length===1?n.options[0]._zod.run:null;e._zod.parse=(i,o)=>{if(r)return r(i,o);let l=!1;const u=[];for(const d of n.options){const p=d._zod.run({value:i.value,issues:[]},o);if(p instanceof Promise)u.push(p),l=!0;else{if(p.issues.length===0)return p;u.push(p)}}return l?Promise.all(u).then(d=>$x(d,i,e,o)):$x(u,i,e,o)}}),N6=fe("$ZodIntersection",(e,n)=>{Ft.init(e,n),e._zod.parse=(r,i)=>{const o=r.value,l=n.left._zod.run({value:o,issues:[]},i),u=n.right._zod.run({value:o,issues:[]},i);return l instanceof Promise||u instanceof Promise?Promise.all([l,u]).then(([p,m])=>Ix(r,p,m)):Ix(r,l,u)}});function Gm(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(hl(e)&&hl(n)){const r=Object.keys(n),i=Object.keys(e).filter(l=>r.indexOf(l)!==-1),o={...e,...n};for(const l of i){const u=Gm(e[l],n[l]);if(!u.valid)return{valid:!1,mergeErrorPath:[l,...u.mergeErrorPath]};o[l]=u.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let i=0;id.l&&d.r).map(([d])=>d);if(l.length&&o&&e.issues.push({...o,keys:l}),Ns(e))return e;const u=Gm(n.value,r.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const D6=fe("$ZodEnum",(e,n)=>{Ft.init(e,n);const r=lC(n.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(o=>Z4.has(typeof o)).map(o=>typeof o=="string"?rd(o):o.toString()).join("|")})$`),e._zod.parse=(o,l)=>{const u=o.value;return i.has(u)||o.issues.push({code:"invalid_value",values:r,input:u,inst:e}),o}}),z6=fe("$ZodTransform",(e,n)=>{Ft.init(e,n),e._zod.optin="optional",e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new oC(e.constructor.name);const o=n.transform(r.value,r);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(u=>(r.value=u,r.fallback=!0,r));if(o instanceof Promise)throw new $s;return r.value=o,r.fallback=!0,r}});function Px(e,n){return n===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const bC=fe("$ZodOptional",(e,n)=>{Ft.init(e,n),e._zod.optin="optional",e._zod.optout="optional",dt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),dt(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${lg(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(n.innerType._zod.optin==="optional"){const o=r.value,l=n.innerType._zod.run(r,i);return l instanceof Promise?l.then(u=>Px(u,o)):Px(l,o)}return r.value===void 0?r:n.innerType._zod.run(r,i)}}),k6=fe("$ZodExactOptional",(e,n)=>{bC.init(e,n),dt(e._zod,"values",()=>n.innerType._zod.values),dt(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(r,i)=>n.innerType._zod.run(r,i)}),L6=fe("$ZodNullable",(e,n)=>{Ft.init(e,n),dt(e._zod,"optin",()=>n.innerType._zod.optin),dt(e._zod,"optout",()=>n.innerType._zod.optout),dt(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${lg(r.source)}|null)$`):void 0}),dt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:n.innerType._zod.run(r,i)}),$6=fe("$ZodDefault",(e,n)=>{Ft.init(e,n),e._zod.optin="optional",dt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return n.innerType._zod.run(r,i);if(r.value===void 0)return r.value=n.defaultValue,r;const o=n.innerType._zod.run(r,i);return o instanceof Promise?o.then(l=>Fx(l,n)):Fx(o,n)}});function Fx(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const I6=fe("$ZodPrefault",(e,n)=>{Ft.init(e,n),e._zod.optin="optional",dt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=n.defaultValue),n.innerType._zod.run(r,i))}),P6=fe("$ZodNonOptional",(e,n)=>{Ft.init(e,n),dt(e._zod,"values",()=>{const r=n.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const o=n.innerType._zod.run(r,i);return o instanceof Promise?o.then(l=>Vx(l,e)):Vx(o,e)}});function Vx(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const F6=fe("$ZodCatch",(e,n)=>{Ft.init(e,n),e._zod.optin="optional",dt(e._zod,"optout",()=>n.innerType._zod.optout),dt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return n.innerType._zod.run(r,i);const o=n.innerType._zod.run(r,i);return o instanceof Promise?o.then(l=>(r.value=l.value,l.issues.length&&(r.value=n.catchValue({...r,error:{issues:l.issues.map(u=>Ti(u,i,ji()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=o.value,o.issues.length&&(r.value=n.catchValue({...r,error:{issues:o.issues.map(l=>Ti(l,i,ji()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),V6=fe("$ZodPipe",(e,n)=>{Ft.init(e,n),dt(e._zod,"values",()=>n.in._zod.values),dt(e._zod,"optin",()=>n.in._zod.optin),dt(e._zod,"optout",()=>n.out._zod.optout),dt(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){const l=n.out._zod.run(r,i);return l instanceof Promise?l.then(u=>nu(u,n.in,i)):nu(l,n.in,i)}const o=n.in._zod.run(r,i);return o instanceof Promise?o.then(l=>nu(l,n.out,i)):nu(o,n.out,i)}});function nu(e,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}const U6=fe("$ZodReadonly",(e,n)=>{Ft.init(e,n),dt(e._zod,"propValues",()=>n.innerType._zod.propValues),dt(e._zod,"values",()=>n.innerType._zod.values),dt(e._zod,"optin",()=>n.innerType?._zod?.optin),dt(e._zod,"optout",()=>n.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return n.innerType._zod.run(r,i);const o=n.innerType._zod.run(r,i);return o instanceof Promise?o.then(Ux):Ux(o)}});function Ux(e){return e.value=Object.freeze(e.value),e}const H6=fe("$ZodCustom",(e,n)=>{zr.init(e,n),Ft.init(e,n),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,o=n.fn(i);if(o instanceof Promise)return o.then(l=>Hx(l,r,i,e));Hx(o,r,i,e)}});function Hx(e,n,r,i){if(!e){const o={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),n.issues.push(ml(o))}}var Bx;class B6{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...r){const i=r[0];return this._map.set(n,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const r=this._map.get(n);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(n),this}get(n){const r=n._zod.parent;if(r){const i={...this.get(r)??{}};delete i.id;const o={...i,...this._map.get(n)};return Object.keys(o).length?o:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function q6(){return new B6}(Bx=globalThis).__zod_globalRegistry??(Bx.__zod_globalRegistry=q6());const Xo=globalThis.__zod_globalRegistry;function G6(e,n){return new e({type:"string",...Le(n)})}function Z6(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Le(n)})}function qx(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Le(n)})}function K6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Le(n)})}function Y6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Le(n)})}function Q6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Le(n)})}function X6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Le(n)})}function J6(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Le(n)})}function W6(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Le(n)})}function eL(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Le(n)})}function tL(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Le(n)})}function nL(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Le(n)})}function rL(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Le(n)})}function aL(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Le(n)})}function iL(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Le(n)})}function sL(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Le(n)})}function oL(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Le(n)})}function lL(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Le(n)})}function cL(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Le(n)})}function uL(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Le(n)})}function dL(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Le(n)})}function fL(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Le(n)})}function hL(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Le(n)})}function mL(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Le(n)})}function pL(e,n){return new e({type:"string",format:"date",check:"string_format",...Le(n)})}function gL(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...Le(n)})}function vL(e,n){return new e({type:"string",format:"duration",check:"string_format",...Le(n)})}function yL(e,n){return new e({type:"boolean",...Le(n)})}function bL(e){return new e({type:"unknown"})}function xL(e,n){return new e({type:"never",...Le(n)})}function xC(e,n){return new U5({check:"max_length",...Le(n),maximum:e})}function ju(e,n){return new H5({check:"min_length",...Le(n),minimum:e})}function wC(e,n){return new B5({check:"length_equals",...Le(n),length:e})}function wL(e,n){return new q5({check:"string_format",format:"regex",...Le(n),pattern:e})}function SL(e){return new G5({check:"string_format",format:"lowercase",...Le(e)})}function _L(e){return new Z5({check:"string_format",format:"uppercase",...Le(e)})}function CL(e,n){return new K5({check:"string_format",format:"includes",...Le(n),includes:e})}function EL(e,n){return new Y5({check:"string_format",format:"starts_with",...Le(n),prefix:e})}function RL(e,n){return new Q5({check:"string_format",format:"ends_with",...Le(n),suffix:e})}function Ys(e){return new X5({check:"overwrite",tx:e})}function jL(e){return Ys(n=>n.normalize(e))}function TL(){return Ys(e=>e.trim())}function OL(){return Ys(e=>e.toLowerCase())}function AL(){return Ys(e=>e.toUpperCase())}function ML(){return Ys(e=>q4(e))}function NL(e,n,r){return new e({type:"array",element:n,...Le(r)})}function DL(e,n,r){return new e({type:"custom",check:"custom",fn:n,...Le(r)})}function zL(e,n){const r=kL(i=>(i.addIssue=o=>{if(typeof o=="string")i.issues.push(ml(o,i.value,r._zod.def));else{const l=o;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=i.value),l.inst??(l.inst=r),l.continue??(l.continue=!r._zod.def.abort),i.issues.push(ml(l))}},e(i.value,i)),n);return r}function kL(e,n){const r=new zr({check:"custom",...Le(n)});return r._zod.check=e,r}function SC(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Xo,target:n,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ln(e,n,r={path:[],schemaPath:[]}){var i;const o=e._zod.def,l=n.seen.get(e);if(l)return l.count++,r.schemaPath.includes(e)&&(l.cycle=r.path),l.schema;const u={schema:{},count:1,cycle:void 0,path:r.path};n.seen.set(e,u);const d=e._zod.toJSONSchema?.();if(d)u.schema=d;else{const y={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,u.schema,y);else{const b=u.schema,x=n.processors[o.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);x(e,n,b,y)}const v=e._zod.parent;v&&(u.ref||(u.ref=v),ln(v,n,y),n.seen.get(v).isParent=!0)}const p=n.metadataRegistry.get(e);return p&&Object.assign(u.schema,p),n.io==="input"&&gn(e)&&(delete u.schema.examples,delete u.schema.default),n.io==="input"&&"_prefault"in u.schema&&((i=u.schema).default??(i.default=u.schema._prefault)),delete u.schema._prefault,n.seen.get(e).schema}function _C(e,n){const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const u of e.seen.entries()){const d=e.metadataRegistry.get(u[0])?.id;if(d){const p=i.get(d);if(p&&p!==u[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(d,u[0])}}const o=u=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=e.external.registry.get(u[0])?.id,b=e.external.uri??(S=>S);if(v)return{ref:b(v)};const x=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=x,{defId:x,ref:`${b("__shared")}#/${d}/${x}`}}if(u[1]===r)return{ref:"#"};const m=`#/${d}/`,y=u[1].schema.id??`__schema${e.counter++}`;return{defId:y,ref:m+y}},l=u=>{if(u[1].schema.$ref)return;const d=u[1],{ref:p,defId:m}=o(u);d.def={...d.schema},m&&(d.defId=m);const y=d.schema;for(const v in y)delete y[v];y.$ref=p};if(e.cycles==="throw")for(const u of e.seen.entries()){const d=u[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/ + `)}x.write("payload.value = newResult;"),x.write("return payload;");const T=x.compile();return(O,M)=>T(b,O,M)};let l;const u=Eu,d=!ig.jitless,m=d&&K4.value,y=n.catchall;let v;e._zod.parse=(b,x)=>{v??(v=i.value);const w=b.value;return u(w)?d&&m&&x?.async===!1&&x.jitless!==!0?(l||(l=o(n.shape)),b=l(b,x),y?yC([],w,b,x,v,e):b):r(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),b)}});function $x(e,n,r,i){for(const l of e)if(l.issues.length===0)return n.value=l.value,n;const o=e.filter(l=>!Ns(l));return o.length===1?(n.value=o[0].value,o[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:r,errors:e.map(l=>l.issues.map(u=>Ti(u,i,ji())))}),n)}const D6=fe("$ZodUnion",(e,n)=>{Ft.init(e,n),dt(e._zod,"optin",()=>n.options.some(i=>i._zod.optin==="optional")?"optional":void 0),dt(e._zod,"optout",()=>n.options.some(i=>i._zod.optout==="optional")?"optional":void 0),dt(e._zod,"values",()=>{if(n.options.every(i=>i._zod.values))return new Set(n.options.flatMap(i=>Array.from(i._zod.values)))}),dt(e._zod,"pattern",()=>{if(n.options.every(i=>i._zod.pattern)){const i=n.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>lg(o.source)).join("|")})$`)}});const r=n.options.length===1?n.options[0]._zod.run:null;e._zod.parse=(i,o)=>{if(r)return r(i,o);let l=!1;const u=[];for(const d of n.options){const p=d._zod.run({value:i.value,issues:[]},o);if(p instanceof Promise)u.push(p),l=!0;else{if(p.issues.length===0)return p;u.push(p)}}return l?Promise.all(u).then(d=>$x(d,i,e,o)):$x(u,i,e,o)}}),z6=fe("$ZodIntersection",(e,n)=>{Ft.init(e,n),e._zod.parse=(r,i)=>{const o=r.value,l=n.left._zod.run({value:o,issues:[]},i),u=n.right._zod.run({value:o,issues:[]},i);return l instanceof Promise||u instanceof Promise?Promise.all([l,u]).then(([p,m])=>Ix(r,p,m)):Ix(r,l,u)}});function Gm(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(hl(e)&&hl(n)){const r=Object.keys(n),i=Object.keys(e).filter(l=>r.indexOf(l)!==-1),o={...e,...n};for(const l of i){const u=Gm(e[l],n[l]);if(!u.valid)return{valid:!1,mergeErrorPath:[l,...u.mergeErrorPath]};o[l]=u.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let i=0;id.l&&d.r).map(([d])=>d);if(l.length&&o&&e.issues.push({...o,keys:l}),Ns(e))return e;const u=Gm(n.value,r.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const k6=fe("$ZodEnum",(e,n)=>{Ft.init(e,n);const r=lC(n.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(o=>Y4.has(typeof o)).map(o=>typeof o=="string"?rd(o):o.toString()).join("|")})$`),e._zod.parse=(o,l)=>{const u=o.value;return i.has(u)||o.issues.push({code:"invalid_value",values:r,input:u,inst:e}),o}}),L6=fe("$ZodTransform",(e,n)=>{Ft.init(e,n),e._zod.optin="optional",e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new oC(e.constructor.name);const o=n.transform(r.value,r);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(u=>(r.value=u,r.fallback=!0,r));if(o instanceof Promise)throw new $s;return r.value=o,r.fallback=!0,r}});function Px(e,n){return n===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const bC=fe("$ZodOptional",(e,n)=>{Ft.init(e,n),e._zod.optin="optional",e._zod.optout="optional",dt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),dt(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${lg(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(n.innerType._zod.optin==="optional"){const o=r.value,l=n.innerType._zod.run(r,i);return l instanceof Promise?l.then(u=>Px(u,o)):Px(l,o)}return r.value===void 0?r:n.innerType._zod.run(r,i)}}),$6=fe("$ZodExactOptional",(e,n)=>{bC.init(e,n),dt(e._zod,"values",()=>n.innerType._zod.values),dt(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(r,i)=>n.innerType._zod.run(r,i)}),I6=fe("$ZodNullable",(e,n)=>{Ft.init(e,n),dt(e._zod,"optin",()=>n.innerType._zod.optin),dt(e._zod,"optout",()=>n.innerType._zod.optout),dt(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${lg(r.source)}|null)$`):void 0}),dt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:n.innerType._zod.run(r,i)}),P6=fe("$ZodDefault",(e,n)=>{Ft.init(e,n),e._zod.optin="optional",dt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return n.innerType._zod.run(r,i);if(r.value===void 0)return r.value=n.defaultValue,r;const o=n.innerType._zod.run(r,i);return o instanceof Promise?o.then(l=>Fx(l,n)):Fx(o,n)}});function Fx(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const F6=fe("$ZodPrefault",(e,n)=>{Ft.init(e,n),e._zod.optin="optional",dt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=n.defaultValue),n.innerType._zod.run(r,i))}),V6=fe("$ZodNonOptional",(e,n)=>{Ft.init(e,n),dt(e._zod,"values",()=>{const r=n.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const o=n.innerType._zod.run(r,i);return o instanceof Promise?o.then(l=>Vx(l,e)):Vx(o,e)}});function Vx(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const U6=fe("$ZodCatch",(e,n)=>{Ft.init(e,n),e._zod.optin="optional",dt(e._zod,"optout",()=>n.innerType._zod.optout),dt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return n.innerType._zod.run(r,i);const o=n.innerType._zod.run(r,i);return o instanceof Promise?o.then(l=>(r.value=l.value,l.issues.length&&(r.value=n.catchValue({...r,error:{issues:l.issues.map(u=>Ti(u,i,ji()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=o.value,o.issues.length&&(r.value=n.catchValue({...r,error:{issues:o.issues.map(l=>Ti(l,i,ji()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),H6=fe("$ZodPipe",(e,n)=>{Ft.init(e,n),dt(e._zod,"values",()=>n.in._zod.values),dt(e._zod,"optin",()=>n.in._zod.optin),dt(e._zod,"optout",()=>n.out._zod.optout),dt(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){const l=n.out._zod.run(r,i);return l instanceof Promise?l.then(u=>nu(u,n.in,i)):nu(l,n.in,i)}const o=n.in._zod.run(r,i);return o instanceof Promise?o.then(l=>nu(l,n.out,i)):nu(o,n.out,i)}});function nu(e,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}const B6=fe("$ZodReadonly",(e,n)=>{Ft.init(e,n),dt(e._zod,"propValues",()=>n.innerType._zod.propValues),dt(e._zod,"values",()=>n.innerType._zod.values),dt(e._zod,"optin",()=>n.innerType?._zod?.optin),dt(e._zod,"optout",()=>n.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return n.innerType._zod.run(r,i);const o=n.innerType._zod.run(r,i);return o instanceof Promise?o.then(Ux):Ux(o)}});function Ux(e){return e.value=Object.freeze(e.value),e}const q6=fe("$ZodCustom",(e,n)=>{zr.init(e,n),Ft.init(e,n),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,o=n.fn(i);if(o instanceof Promise)return o.then(l=>Hx(l,r,i,e));Hx(o,r,i,e)}});function Hx(e,n,r,i){if(!e){const o={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),n.issues.push(ml(o))}}var Bx;class G6{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...r){const i=r[0];return this._map.set(n,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const r=this._map.get(n);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(n),this}get(n){const r=n._zod.parent;if(r){const i={...this.get(r)??{}};delete i.id;const o={...i,...this._map.get(n)};return Object.keys(o).length?o:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function Z6(){return new G6}(Bx=globalThis).__zod_globalRegistry??(Bx.__zod_globalRegistry=Z6());const Xo=globalThis.__zod_globalRegistry;function K6(e,n){return new e({type:"string",...Le(n)})}function Y6(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Le(n)})}function qx(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Le(n)})}function Q6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Le(n)})}function X6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Le(n)})}function J6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Le(n)})}function W6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Le(n)})}function eL(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Le(n)})}function tL(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Le(n)})}function nL(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Le(n)})}function rL(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Le(n)})}function aL(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Le(n)})}function iL(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Le(n)})}function sL(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Le(n)})}function oL(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Le(n)})}function lL(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Le(n)})}function cL(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Le(n)})}function uL(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Le(n)})}function dL(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Le(n)})}function fL(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Le(n)})}function hL(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Le(n)})}function mL(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Le(n)})}function pL(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Le(n)})}function gL(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Le(n)})}function vL(e,n){return new e({type:"string",format:"date",check:"string_format",...Le(n)})}function yL(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...Le(n)})}function bL(e,n){return new e({type:"string",format:"duration",check:"string_format",...Le(n)})}function xL(e,n){return new e({type:"boolean",...Le(n)})}function wL(e){return new e({type:"unknown"})}function SL(e,n){return new e({type:"never",...Le(n)})}function xC(e,n){return new B5({check:"max_length",...Le(n),maximum:e})}function ju(e,n){return new q5({check:"min_length",...Le(n),minimum:e})}function wC(e,n){return new G5({check:"length_equals",...Le(n),length:e})}function _L(e,n){return new Z5({check:"string_format",format:"regex",...Le(n),pattern:e})}function CL(e){return new K5({check:"string_format",format:"lowercase",...Le(e)})}function EL(e){return new Y5({check:"string_format",format:"uppercase",...Le(e)})}function RL(e,n){return new Q5({check:"string_format",format:"includes",...Le(n),includes:e})}function jL(e,n){return new X5({check:"string_format",format:"starts_with",...Le(n),prefix:e})}function TL(e,n){return new J5({check:"string_format",format:"ends_with",...Le(n),suffix:e})}function Ys(e){return new W5({check:"overwrite",tx:e})}function OL(e){return Ys(n=>n.normalize(e))}function AL(){return Ys(e=>e.trim())}function ML(){return Ys(e=>e.toLowerCase())}function NL(){return Ys(e=>e.toUpperCase())}function DL(){return Ys(e=>Z4(e))}function zL(e,n,r){return new e({type:"array",element:n,...Le(r)})}function kL(e,n,r){return new e({type:"custom",check:"custom",fn:n,...Le(r)})}function LL(e,n){const r=$L(i=>(i.addIssue=o=>{if(typeof o=="string")i.issues.push(ml(o,i.value,r._zod.def));else{const l=o;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=i.value),l.inst??(l.inst=r),l.continue??(l.continue=!r._zod.def.abort),i.issues.push(ml(l))}},e(i.value,i)),n);return r}function $L(e,n){const r=new zr({check:"custom",...Le(n)});return r._zod.check=e,r}function SC(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Xo,target:n,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ln(e,n,r={path:[],schemaPath:[]}){var i;const o=e._zod.def,l=n.seen.get(e);if(l)return l.count++,r.schemaPath.includes(e)&&(l.cycle=r.path),l.schema;const u={schema:{},count:1,cycle:void 0,path:r.path};n.seen.set(e,u);const d=e._zod.toJSONSchema?.();if(d)u.schema=d;else{const y={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,u.schema,y);else{const b=u.schema,x=n.processors[o.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);x(e,n,b,y)}const v=e._zod.parent;v&&(u.ref||(u.ref=v),ln(v,n,y),n.seen.get(v).isParent=!0)}const p=n.metadataRegistry.get(e);return p&&Object.assign(u.schema,p),n.io==="input"&&gn(e)&&(delete u.schema.examples,delete u.schema.default),n.io==="input"&&"_prefault"in u.schema&&((i=u.schema).default??(i.default=u.schema._prefault)),delete u.schema._prefault,n.seen.get(e).schema}function _C(e,n){const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const u of e.seen.entries()){const d=e.metadataRegistry.get(u[0])?.id;if(d){const p=i.get(d);if(p&&p!==u[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(d,u[0])}}const o=u=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=e.external.registry.get(u[0])?.id,b=e.external.uri??(w=>w);if(v)return{ref:b(v)};const x=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=x,{defId:x,ref:`${b("__shared")}#/${d}/${x}`}}if(u[1]===r)return{ref:"#"};const m=`#/${d}/`,y=u[1].schema.id??`__schema${e.counter++}`;return{defId:y,ref:m+y}},l=u=>{if(u[1].schema.$ref)return;const d=u[1],{ref:p,defId:m}=o(u);d.def={...d.schema},m&&(d.defId=m);const y=d.schema;for(const v in y)delete y[v];y.$ref=p};if(e.cycles==="throw")for(const u of e.seen.entries()){const d=u[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const d=u[1];if(n===u[0]){l(u);continue}if(e.external){const m=e.external.registry.get(u[0])?.id;if(n!==u[0]&&m){l(u);continue}}if(e.metadataRegistry.get(u[0])?.id){l(u);continue}if(d.cycle){l(u);continue}if(d.count>1&&e.reused==="ref"){l(u);continue}}}function CC(e,n){const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=d=>{const p=e.seen.get(d);if(p.ref===null)return;const m=p.def??p.schema,y={...m},v=p.ref;if(p.ref=null,v){i(v);const x=e.seen.get(v),S=x.schema;if(S.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(S)):Object.assign(m,S),Object.assign(m,y),d._zod.parent===v)for(const E in m)E==="$ref"||E==="allOf"||E in y||delete m[E];if(S.$ref&&x.def)for(const E in m)E==="$ref"||E==="allOf"||E in x.def&&JSON.stringify(m[E])===JSON.stringify(x.def[E])&&delete m[E]}const b=d._zod.parent;if(b&&b!==v){i(b);const x=e.seen.get(b);if(x?.schema.$ref&&(m.$ref=x.schema.$ref,x.def))for(const S in m)S==="$ref"||S==="allOf"||S in x.def&&JSON.stringify(m[S])===JSON.stringify(x.def[S])&&delete m[S]}e.override({zodSchema:d,jsonSchema:m,path:p.path??[]})};for(const d of[...e.seen.entries()].reverse())i(d[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(n)?.id;if(!d)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(d)}Object.assign(o,r.def??r.schema);const l=e.metadataRegistry.get(n)?.id;l!==void 0&&o.id===l&&delete o.id;const u=e.external?.defs??{};for(const d of e.seen.entries()){const p=d[1];p.def&&p.defId&&(p.def.id===p.defId&&delete p.def.id,u[p.defId]=p.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?o.$defs=u:o.definitions=u);try{const d=JSON.parse(JSON.stringify(o));return Object.defineProperty(d,"~standard",{value:{...n["~standard"],jsonSchema:{input:Tu(n,"input",e.processors),output:Tu(n,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function gn(e,n){const r=n??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return gn(i.element,r);if(i.type==="set")return gn(i.valueType,r);if(i.type==="lazy")return gn(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return gn(i.innerType,r);if(i.type==="intersection")return gn(i.left,r)||gn(i.right,r);if(i.type==="record"||i.type==="map")return gn(i.keyType,r)||gn(i.valueType,r);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:gn(i.in,r)||gn(i.out,r);if(i.type==="object"){for(const o in i.shape)if(gn(i.shape[o],r))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(gn(o,r))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(gn(o,r))return!0;return!!(i.rest&&gn(i.rest,r))}return!1}const LL=(e,n={})=>r=>{const i=SC({...r,processors:n});return ln(e,i),_C(i,e),CC(i,e)},Tu=(e,n,r={})=>i=>{const{libraryOptions:o,target:l}=i??{},u=SC({...o??{},target:l,io:n,processors:r});return ln(e,u),_C(u,e),CC(u,e)},$L={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},IL=(e,n,r,i)=>{const o=r;o.type="string";const{minimum:l,maximum:u,format:d,patterns:p,contentEncoding:m}=e._zod.bag;if(typeof l=="number"&&(o.minLength=l),typeof u=="number"&&(o.maxLength=u),d&&(o.format=$L[d]??d,o.format===""&&delete o.format,d==="time"&&delete o.format),m&&(o.contentEncoding=m),p&&p.size>0){const y=[...p];y.length===1?o.pattern=y[0].source:y.length>1&&(o.allOf=[...y.map(v=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},PL=(e,n,r,i)=>{r.type="boolean"},FL=(e,n,r,i)=>{r.not={}},VL=(e,n,r,i)=>{},UL=(e,n,r,i)=>{const o=e._zod.def,l=lC(o.entries);l.every(u=>typeof u=="number")&&(r.type="number"),l.every(u=>typeof u=="string")&&(r.type="string"),r.enum=l},HL=(e,n,r,i)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},BL=(e,n,r,i)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},qL=(e,n,r,i)=>{const o=r,l=e._zod.def,{minimum:u,maximum:d}=e._zod.bag;typeof u=="number"&&(o.minItems=u),typeof d=="number"&&(o.maxItems=d),o.type="array",o.items=ln(l.element,n,{...i,path:[...i.path,"items"]})},GL=(e,n,r,i)=>{const o=r,l=e._zod.def;o.type="object",o.properties={};const u=l.shape;for(const m in u)o.properties[m]=ln(u[m],n,{...i,path:[...i.path,"properties",m]});const d=new Set(Object.keys(u)),p=new Set([...d].filter(m=>{const y=l.shape[m]._zod;return n.io==="input"?y.optin===void 0:y.optout===void 0}));p.size>0&&(o.required=Array.from(p)),l.catchall?._zod.def.type==="never"?o.additionalProperties=!1:l.catchall?l.catchall&&(o.additionalProperties=ln(l.catchall,n,{...i,path:[...i.path,"additionalProperties"]})):n.io==="output"&&(o.additionalProperties=!1)},ZL=(e,n,r,i)=>{const o=e._zod.def,l=o.inclusive===!1,u=o.options.map((d,p)=>ln(d,n,{...i,path:[...i.path,l?"oneOf":"anyOf",p]}));l?r.oneOf=u:r.anyOf=u},KL=(e,n,r,i)=>{const o=e._zod.def,l=ln(o.left,n,{...i,path:[...i.path,"allOf",0]}),u=ln(o.right,n,{...i,path:[...i.path,"allOf",1]}),d=m=>"allOf"in m&&Object.keys(m).length===1,p=[...d(l)?l.allOf:[l],...d(u)?u.allOf:[u]];r.allOf=p},YL=(e,n,r,i)=>{const o=e._zod.def,l=ln(o.innerType,n,i),u=n.seen.get(e);n.target==="openapi-3.0"?(u.ref=o.innerType,r.nullable=!0):r.anyOf=[l,{type:"null"}]},QL=(e,n,r,i)=>{const o=e._zod.def;ln(o.innerType,n,i);const l=n.seen.get(e);l.ref=o.innerType},XL=(e,n,r,i)=>{const o=e._zod.def;ln(o.innerType,n,i);const l=n.seen.get(e);l.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},JL=(e,n,r,i)=>{const o=e._zod.def;ln(o.innerType,n,i);const l=n.seen.get(e);l.ref=o.innerType,n.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},WL=(e,n,r,i)=>{const o=e._zod.def;ln(o.innerType,n,i);const l=n.seen.get(e);l.ref=o.innerType;let u;try{u=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=u},e8=(e,n,r,i)=>{const o=e._zod.def,l=o.in._zod.traits.has("$ZodTransform"),u=n.io==="input"?l?o.out:o.in:o.out;ln(u,n,i);const d=n.seen.get(e);d.ref=u},t8=(e,n,r,i)=>{const o=e._zod.def;ln(o.innerType,n,i);const l=n.seen.get(e);l.ref=o.innerType,r.readOnly=!0},EC=(e,n,r,i)=>{const o=e._zod.def;ln(o.innerType,n,i);const l=n.seen.get(e);l.ref=o.innerType};function Zm(){return Zm=Object.assign?Object.assign.bind():function(e){for(var n=1;n0){var p=o.errors[0][0];r[d]={message:p.message,type:p.code}}else r[d]={message:u,type:l};if(o.code==="invalid_union"&&o.errors.forEach(function(v){return v.forEach(function(b){return e.push(Zm({},b,{path:[].concat(o.path,b.path)}))})}),n){var m=r[d].types,y=m&&m[o.code];r[d]=rg(d,n,r,l,y?[].concat(y,o.message):o.message)}e.shift()};e.length;)i();return r}function fg(e,n,r){if(r===void 0&&(r={}),(function(i){return"_def"in i&&typeof i._def=="object"&&"typeName"in i._def})(e))return function(i,o,l){try{return Promise.resolve(Gx(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](i,n)).then(function(u){return l.shouldUseNativeValidation&&Bm({},l),{errors:{},values:r.raw?Object.assign({},i):u}})},function(u){if((function(d){return Array.isArray(d?.issues)})(u))return{values:{},errors:Ax(n8(u.errors,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw u}))}catch(u){return Promise.reject(u)}};if((function(i){return"_zod"in i&&typeof i._zod=="object"})(e))return function(i,o,l){try{return Promise.resolve(Gx(function(){return Promise.resolve((r.mode==="sync"?i5:s5)(e,i,n)).then(function(u){return l.shouldUseNativeValidation&&Bm({},l),{errors:{},values:r.raw?Object.assign({},i):u}})},function(u){if((function(d){return d instanceof ug})(u))return{values:{},errors:Ax(r8(u.issues,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw u}))}catch(u){return Promise.reject(u)}};throw new Error("Invalid input: not a Zod schema")}const a8=fe("ZodISODateTime",(e,n)=>{d6.init(e,n),_t.init(e,n)});function i8(e){return mL(a8,e)}const s8=fe("ZodISODate",(e,n)=>{f6.init(e,n),_t.init(e,n)});function o8(e){return pL(s8,e)}const l8=fe("ZodISOTime",(e,n)=>{h6.init(e,n),_t.init(e,n)});function c8(e){return gL(l8,e)}const u8=fe("ZodISODuration",(e,n)=>{m6.init(e,n),_t.init(e,n)});function d8(e){return vL(u8,e)}const f8=(e,n)=>{ug.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>a5(e,r)},flatten:{value:r=>r5(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,qm,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,qm,2)}},isEmpty:{get(){return e.issues.length===0}}})},nr=fe("ZodError",f8,{Parent:Error}),h8=id(nr),m8=sd(nr),p8=od(nr),g8=ld(nr),v8=c5(nr),y8=u5(nr),b8=d5(nr),x8=f5(nr),w8=h5(nr),S8=m5(nr),_8=p5(nr),C8=g5(nr),Zx=new WeakMap;function ud(e,n,r){const i=Object.getPrototypeOf(e);let o=Zx.get(i);if(o||(o=new Set,Zx.set(i,o)),!o.has(n)){o.add(n);for(const l in r){const u=r[l];Object.defineProperty(i,l,{configurable:!0,enumerable:!1,get(){const d=u.bind(this);return Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:!0,value:d}),d},set(d){Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:!0,value:d})}})}}}const Vt=fe("ZodType",(e,n)=>(Ft.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:Tu(e,"input"),output:Tu(e,"output")}}),e.toJSONSchema=LL(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.parse=(r,i)=>h8(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>p8(e,r,i),e.parseAsync=async(r,i)=>m8(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>g8(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>v8(e,r,i),e.decode=(r,i)=>y8(e,r,i),e.encodeAsync=async(r,i)=>b8(e,r,i),e.decodeAsync=async(r,i)=>x8(e,r,i),e.safeEncode=(r,i)=>w8(e,r,i),e.safeDecode=(r,i)=>S8(e,r,i),e.safeEncodeAsync=async(r,i)=>_8(e,r,i),e.safeDecodeAsync=async(r,i)=>C8(e,r,i),ud(e,"ZodType",{check(...r){const i=this.def;return this.clone(Xa(i,{checks:[...i.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,i){return Ja(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(v$(r,i))},superRefine(r,i){return this.check(y$(r,i))},overwrite(r){return this.check(Ys(r))},optional(){return Xx(this)},exactOptional(){return a$(this)},nullable(){return Jx(this)},nullish(){return Xx(Jx(this))},nonoptional(r){return u$(this,r)},array(){return K8(this)},or(r){return X8([this,r])},and(r){return W8(this,r)},transform(r){return Wx(this,n$(r))},default(r){return o$(this,r)},prefault(r){return c$(this,r)},catch(r){return f$(this,r)},pipe(r){return Wx(this,r)},readonly(){return p$(this)},describe(r){const i=this.clone();return Xo.add(i,{description:r}),i},meta(...r){if(r.length===0)return Xo.get(this);const i=this.clone();return Xo.add(i,r[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Xo.get(e)?.description},configurable:!0}),e)),RC=fe("_ZodString",(e,n)=>{dg.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(i,o,l)=>IL(e,i,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,ud(e,"_ZodString",{regex(...i){return this.check(wL(...i))},includes(...i){return this.check(CL(...i))},startsWith(...i){return this.check(EL(...i))},endsWith(...i){return this.check(RL(...i))},min(...i){return this.check(ju(...i))},max(...i){return this.check(xC(...i))},length(...i){return this.check(wC(...i))},nonempty(...i){return this.check(ju(1,...i))},lowercase(i){return this.check(SL(i))},uppercase(i){return this.check(_L(i))},trim(){return this.check(TL())},normalize(...i){return this.check(jL(...i))},toLowerCase(){return this.check(OL())},toUpperCase(){return this.check(AL())},slugify(){return this.check(ML())}})}),E8=fe("ZodString",(e,n)=>{dg.init(e,n),RC.init(e,n),e.email=r=>e.check(Z6(R8,r)),e.url=r=>e.check(J6(j8,r)),e.jwt=r=>e.check(hL(U8,r)),e.emoji=r=>e.check(W6(T8,r)),e.guid=r=>e.check(qx(Kx,r)),e.uuid=r=>e.check(K6(ru,r)),e.uuidv4=r=>e.check(Y6(ru,r)),e.uuidv6=r=>e.check(Q6(ru,r)),e.uuidv7=r=>e.check(X6(ru,r)),e.nanoid=r=>e.check(eL(O8,r)),e.guid=r=>e.check(qx(Kx,r)),e.cuid=r=>e.check(tL(A8,r)),e.cuid2=r=>e.check(nL(M8,r)),e.ulid=r=>e.check(rL(N8,r)),e.base64=r=>e.check(uL(P8,r)),e.base64url=r=>e.check(dL(F8,r)),e.xid=r=>e.check(aL(D8,r)),e.ksuid=r=>e.check(iL(z8,r)),e.ipv4=r=>e.check(sL(k8,r)),e.ipv6=r=>e.check(oL(L8,r)),e.cidrv4=r=>e.check(lL($8,r)),e.cidrv6=r=>e.check(cL(I8,r)),e.e164=r=>e.check(fL(V8,r)),e.datetime=r=>e.check(i8(r)),e.date=r=>e.check(o8(r)),e.time=r=>e.check(c8(r)),e.duration=r=>e.check(d8(r))});function uu(e){return G6(E8,e)}const _t=fe("ZodStringFormat",(e,n)=>{xt.init(e,n),RC.init(e,n)}),R8=fe("ZodEmail",(e,n)=>{n6.init(e,n),_t.init(e,n)}),Kx=fe("ZodGUID",(e,n)=>{e6.init(e,n),_t.init(e,n)}),ru=fe("ZodUUID",(e,n)=>{t6.init(e,n),_t.init(e,n)}),j8=fe("ZodURL",(e,n)=>{r6.init(e,n),_t.init(e,n)}),T8=fe("ZodEmoji",(e,n)=>{a6.init(e,n),_t.init(e,n)}),O8=fe("ZodNanoID",(e,n)=>{i6.init(e,n),_t.init(e,n)}),A8=fe("ZodCUID",(e,n)=>{s6.init(e,n),_t.init(e,n)}),M8=fe("ZodCUID2",(e,n)=>{o6.init(e,n),_t.init(e,n)}),N8=fe("ZodULID",(e,n)=>{l6.init(e,n),_t.init(e,n)}),D8=fe("ZodXID",(e,n)=>{c6.init(e,n),_t.init(e,n)}),z8=fe("ZodKSUID",(e,n)=>{u6.init(e,n),_t.init(e,n)}),k8=fe("ZodIPv4",(e,n)=>{p6.init(e,n),_t.init(e,n)}),L8=fe("ZodIPv6",(e,n)=>{g6.init(e,n),_t.init(e,n)}),$8=fe("ZodCIDRv4",(e,n)=>{v6.init(e,n),_t.init(e,n)}),I8=fe("ZodCIDRv6",(e,n)=>{y6.init(e,n),_t.init(e,n)}),P8=fe("ZodBase64",(e,n)=>{b6.init(e,n),_t.init(e,n)}),F8=fe("ZodBase64URL",(e,n)=>{w6.init(e,n),_t.init(e,n)}),V8=fe("ZodE164",(e,n)=>{S6.init(e,n),_t.init(e,n)}),U8=fe("ZodJWT",(e,n)=>{C6.init(e,n),_t.init(e,n)}),H8=fe("ZodBoolean",(e,n)=>{E6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>PL(e,r,i)});function Yx(e){return yL(H8,e)}const B8=fe("ZodUnknown",(e,n)=>{R6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>VL()});function Qx(){return bL(B8)}const q8=fe("ZodNever",(e,n)=>{j6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>FL(e,r,i)});function G8(e){return xL(q8,e)}const Z8=fe("ZodArray",(e,n)=>{T6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>qL(e,r,i,o),e.element=n.element,ud(e,"ZodArray",{min(r,i){return this.check(ju(r,i))},nonempty(r){return this.check(ju(1,r))},max(r,i){return this.check(xC(r,i))},length(r,i){return this.check(wC(r,i))},unwrap(){return this.element}})});function K8(e,n){return NL(Z8,e,n)}const Y8=fe("ZodObject",(e,n)=>{A6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>GL(e,r,i,o),dt(e,"shape",()=>n.shape),ud(e,"ZodObject",{keyof(){return e$(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Qx()})},loose(){return this.clone({...this._zod.def,catchall:Qx()})},strict(){return this.clone({...this._zod.def,catchall:G8()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return X4(this,r)},safeExtend(r){return J4(this,r)},merge(r){return W4(this,r)},pick(r){return Y4(this,r)},omit(r){return Q4(this,r)},partial(...r){return e5(jC,this,r[0])},required(...r){return t5(TC,this,r[0])}})});function hg(e,n){const r={type:"object",shape:e??{},...Le(n)};return new Y8(r)}const Q8=fe("ZodUnion",(e,n)=>{M6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>ZL(e,r,i,o),e.options=n.options});function X8(e,n){return new Q8({type:"union",options:e,...Le(n)})}const J8=fe("ZodIntersection",(e,n)=>{N6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>KL(e,r,i,o)});function W8(e,n){return new J8({type:"intersection",left:e,right:n})}const Km=fe("ZodEnum",(e,n)=>{D6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(i,o,l)=>UL(e,i,o),e.enum=n.entries,e.options=Object.values(n.entries);const r=new Set(Object.keys(n.entries));e.extract=(i,o)=>{const l={};for(const u of i)if(r.has(u))l[u]=n.entries[u];else throw new Error(`Key ${u} not found in enum`);return new Km({...n,checks:[],...Le(o),entries:l})},e.exclude=(i,o)=>{const l={...n.entries};for(const u of i)if(r.has(u))delete l[u];else throw new Error(`Key ${u} not found in enum`);return new Km({...n,checks:[],...Le(o),entries:l})}});function e$(e,n){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Km({type:"enum",entries:r,...Le(n)})}const t$=fe("ZodTransform",(e,n)=>{z6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>BL(e,r),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new oC(e.constructor.name);r.addIssue=l=>{if(typeof l=="string")r.issues.push(ml(l,r.value,n));else{const u=l;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=r.value),u.inst??(u.inst=e),r.issues.push(ml(u))}};const o=n.transform(r.value,r);return o instanceof Promise?o.then(l=>(r.value=l,r.fallback=!0,r)):(r.value=o,r.fallback=!0,r)}});function n$(e){return new t$({type:"transform",transform:e})}const jC=fe("ZodOptional",(e,n)=>{bC.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>EC(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function Xx(e){return new jC({type:"optional",innerType:e})}const r$=fe("ZodExactOptional",(e,n)=>{k6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>EC(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function a$(e){return new r$({type:"optional",innerType:e})}const i$=fe("ZodNullable",(e,n)=>{L6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>YL(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function Jx(e){return new i$({type:"nullable",innerType:e})}const s$=fe("ZodDefault",(e,n)=>{$6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>XL(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function o$(e,n){return new s$({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():uC(n)}})}const l$=fe("ZodPrefault",(e,n)=>{I6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>JL(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function c$(e,n){return new l$({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():uC(n)}})}const TC=fe("ZodNonOptional",(e,n)=>{P6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>QL(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function u$(e,n){return new TC({type:"nonoptional",innerType:e,...Le(n)})}const d$=fe("ZodCatch",(e,n)=>{F6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>WL(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function f$(e,n){return new d$({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const h$=fe("ZodPipe",(e,n)=>{V6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>e8(e,r,i,o),e.in=n.in,e.out=n.out});function Wx(e,n){return new h$({type:"pipe",in:e,out:n})}const m$=fe("ZodReadonly",(e,n)=>{U6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>t8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function p$(e){return new m$({type:"readonly",innerType:e})}const g$=fe("ZodCustom",(e,n)=>{H6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>HL(e,r)});function v$(e,n={}){return DL(g$,e,n)}function y$(e,n){return zL(e,n)}const b$=/\.(md|markdown)$/i,x$=/\.(png|jpe?g|gif|svg|webp|ico|bmp|avif)$/i,OC=/\.html?$/i,AC=/\.pdf$/i,w$=/\.(csv|tsv)$/i,S$=/\.(txt|log|json|ya?ml|toml|csv|go|py|js|ts|jsx|tsx|sh|bash|zsh|rb|rs|c|h|cpp|java|kt|swift|sql|css|xml|ini|conf|env|mod|sum|jsonl)$/i;function mg(e){if(e<1024)return e+" B";const n=["KB","MB","GB","TB"];let r=-1;do e/=1024,r++;while(e>=1024&&r`:e.user||e.author||"unknown"}function E$({className:e,...n}){return f.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:f.jsx("table",{"data-slot":"table",className:Je("w-full caption-bottom text-sm",e),...n})})}function R$({className:e,...n}){return f.jsx("thead",{"data-slot":"table-header",className:Je("[&_tr]:border-b",e),...n})}function j$({className:e,...n}){return f.jsx("tbody",{"data-slot":"table-body",className:Je("[&_tr:last-child]:border-0",e),...n})}function ew({className:e,...n}){return f.jsx("tr",{"data-slot":"table-row",className:Je("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...n})}function tw({className:e,...n}){return f.jsx("th",{"data-slot":"table-head",className:Je("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n})}function T$({className:e,...n}){return f.jsx("td",{"data-slot":"table-cell",className:Je("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n})}function O$({header:e}){const n=e.column.getIsSorted();return e.column.getCanSort()?f.jsx(tw,{"data-sort":n||void 0,"aria-sort":n==="asc"?"ascending":n==="desc"?"descending":"none",children:f.jsxs("button",{type:"button",className:"th-sort",onClick:e.column.getToggleSortingHandler(),children:[Fm(e.column.columnDef.header,e.getContext()),n==="asc"?" ↑":n==="desc"?" ↓":""]})}):f.jsx(tw,{children:Fm(e.column.columnDef.header,e.getContext())})}function DC({table:e,className:n}){return f.jsx("div",{className:"admin-list admin-card-table"+(n?" "+n:""),children:f.jsxs(E$,{className:"admin-table",children:[f.jsx(R$,{children:e.getHeaderGroups().map(r=>f.jsx(ew,{children:r.headers.map(i=>f.jsx(O$,{header:i},i.id))},r.id))}),f.jsx(j$,{children:e.getRowModel().rows.map(r=>f.jsx(ew,{className:"admin-item",children:r.getVisibleCells().map(i=>f.jsx(T$,{children:Fm(i.column.columnDef.cell,i.getContext())},i.id))},r.id))})]})})}function zC(e){return e?"expires "+new Date(e).toLocaleDateString():"no expiry"}function A$(e){if(e.opens===void 0)return null;if(e.opens===0)return"not opened yet";const n=`${e.opens} open${e.opens===1?"":"s"}`;return e.last_opened?`${n} · last opened ${new Date(e.last_opened).toLocaleDateString()}`:n}function kC(e,n){const r=[];n&&e.project_name&&r.push(e.project_name),e.creator&&r.push("by "+e.creator),e.created&&r.push(new Date(e.created).toLocaleDateString()),r.push(zC(e.expires));const i=A$(e);return i&&r.push(i),r.join(" · ")}const LC="Opens count how many times a file has been read through a public link. Repeat opens by the same reader within 10 minutes count once.";function $C({shares:e,onChanged:n,showProject:r=!1,canRevoke:i=!0,empty:o="No public shares.",loading:l=!1}){const[u,d]=w.useState([]),p=w.useMemo(()=>k_(),[]),m=w.useMemo(()=>[p.accessor("path",{header:"Path",cell:v=>f.jsx("a",{className:"ai-main mono",title:v.getValue(),...Bs(fl(v.getValue(),v.row.original.project)),children:v.getValue()})}),p.accessor(v=>kC(v,r),{id:"detail",header:r?"Project":"Shared",cell:v=>f.jsx("span",{className:"ai-tag",children:v.getValue()})}),p.display({id:"actions",header:"",cell:v=>i?f.jsx("button",{className:"ai-del","aria-label":`Revoke the share of ${v.row.original.path}`,onClick:()=>IC(v.row.original,n),children:"Revoke"}):null})],[p,n,r,i]),y=Z_({data:e,columns:m,state:{sorting:u},onSortingChange:d,getCoreRowModel:q_(),getSortedRowModel:G_()});return l?f.jsx("div",{className:"admin-list",children:f.jsx("div",{className:"admin-empty",children:"Loading…"})}):e.length===0?f.jsx("div",{className:"admin-list",children:f.jsx("div",{className:"admin-empty",children:o})}):f.jsx(DC,{table:y,className:"shares-table"})}async function IC(e,n){if(await Hs("Revoke share link",`Revoke the public link to “${e.path}”? Anyone with the URL will lose access.`,"Revoke",!0))try{await Wn("DELETE","/api/shares/"+e.token),Ke("Share revoked."),n()}catch(r){Ke(r.message,!0)}}const M$=hg({name:uu().trim().min(1,"Give the organization a name.").max(60,"Keep it under 60 characters.")});function N$({org:e,projects:n,myEmail:r}){const i=Ai(),o=e.role==="owner",l=()=>i.invalidateQueries({queryKey:["orgs"]}),u=()=>i.invalidateQueries({queryKey:["invites",e.id]}),d=()=>i.invalidateQueries({queryKey:["orgShares",e.id]}),p=ag({resolver:fg(M$),values:{name:e.name}}),{data:m}=Pt({queryKey:["invites",e.id],queryFn:()=>Bt(`/api/orgs/${e.id}/invites`),enabled:o,select:x=>x.invites||[]}),{data:y,isLoading:v}=Pt({queryKey:["orgShares",e.id],queryFn:()=>Bt(`/api/orgs/${e.id}/shares`),enabled:o,select:x=>x.shares||[]}),b=n.filter(x=>x.org===e.id);return f.jsxs("div",{className:"admin",children:[f.jsx("h1",{id:"org-title",children:e.name}),!o&&f.jsx("p",{className:"role-chip-row",children:f.jsx("span",{className:"ai-tag role-chip",children:"Member"})}),!o&&f.jsx("p",{className:"admin-sub",children:"Only owners can rename this organization, manage members, or issue invite links."}),o&&f.jsxs("form",{className:"admin-row",onSubmit:p.handleSubmit(async({name:x})=>{try{await Wn("PATCH","/api/orgs/"+e.id,{name:x}),Ke("Renamed."),l()}catch(S){Ke(S.message,!0)}}),children:[f.jsx("label",{className:"admin-lbl",htmlFor:"org-rename",children:"Organization name"}),f.jsx("input",{id:"org-rename",type:"text","aria-invalid":!!p.formState.errors.name,"aria-describedby":p.formState.errors.name?"org-rename-err":void 0,...p.register("name")}),f.jsx(vt,{variant:"subtle",id:"org-rename-btn",type:"submit",disabled:!p.formState.isDirty,children:"Rename org"}),p.formState.errors.name&&f.jsx("span",{id:"org-rename-err",role:"alert",className:"field-err",children:p.formState.errors.name.message})]}),f.jsx("h3",{children:"Members"}),f.jsx(D$,{org:e,owner:o,myEmail:r,onChanged:l}),f.jsx("h3",{children:"Projects"}),f.jsxs("div",{className:"admin-list",children:[b.length===0&&f.jsx("div",{className:"admin-empty",children:"No projects yet."}),b.map(x=>f.jsx("div",{className:"admin-item",children:f.jsx("span",{className:"ai-main",title:x.name,children:x.name})},x.id))]}),o&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"admin-h",children:[f.jsx("h3",{children:"Invite links"}),f.jsx(vt,{variant:"primary",onClick:async()=>{try{const x=await Si(`/api/orgs/${e.id}/invites`),S=await qs(x.url);Ke(S?"Invite link copied to clipboard.":"Invite created — copy it from the list below."),u()}catch(x){Ke(x.message,!0)}},children:"New invite"})]}),f.jsxs("div",{className:"admin-list",children:[m&&m.length===0&&f.jsx("div",{className:"admin-empty",children:"No active invite links."}),(m||[]).map(x=>f.jsxs("div",{className:"admin-item",children:[f.jsx("button",{type:"button",className:"ai-main mono ai-copy","aria-label":`Copy invite link ${x.url}`,title:x.url,onClick:()=>qs(x.url).then(S=>Ke(S?"Copied.":"Select and copy the link.")),children:x.url}),f.jsx("span",{className:"ai-tag",children:(x.creator?"by "+x.creator+" · ":"")+(x.uses?x.uses+" joined · ":"unused · ")+"expires "+new Date(x.expires).toLocaleDateString()}),f.jsx("button",{className:"ai-del","aria-label":`Revoke invite ${x.token.slice(0,8)}`,onClick:async()=>{if(await Hs("Revoke invite",`Revoke the link starting ${x.token.slice(0,8)}…? Anyone still holding it won't be able to join.`,"Revoke",!0))try{await Wn("DELETE",`/api/orgs/${e.id}/invites/${x.token}`),Ke("Revoked."),u()}catch(S){Ke(S.message,!0)}},children:"Revoke"})]},x.token))]}),f.jsx("h3",{children:"Public share links"}),f.jsx("p",{className:"admin-sub",children:"Every live link across this organization's projects. A project's own links are on its Settings page, and on the file itself."}),f.jsx($C,{shares:y||[],loading:v,onChanged:d,showProject:!0})]})]})}function D$({org:e,owner:n,myEmail:r,onChanged:i}){const[o,l]=w.useState([{id:"email",desc:!1}]),u=w.useMemo(()=>k_(),[]),d=w.useMemo(()=>[u.accessor("email",{id:"email",header:"Member",cell:m=>{const y=!!r&&m.getValue().toLowerCase()===r.toLowerCase();return f.jsx("span",{className:"ai-main",title:m.getValue(),children:m.getValue()+(y?" (you)":"")})}}),u.accessor("role",{id:"role",header:"Role",cell:m=>{const y=m.row.original,v=!!r&&y.email.toLowerCase()===r.toLowerCase();return!n||v?f.jsx("span",{className:"ai-tag role-static",children:y.role}):f.jsxs("span",{className:"role-cell",children:[f.jsxs("select",{"aria-label":`Role for ${y.email}`,value:y.role,onChange:async b=>{try{await Wn("PATCH",`/api/orgs/${e.id}/members/${encodeURIComponent(y.email)}`,{role:b.target.value}),Ke("Role updated.")}catch(x){Ke(x.message,!0)}i()},children:[f.jsx("option",{value:"owner",children:"owner"}),f.jsx("option",{value:"member",children:"member"})]}),f.jsx("button",{className:"ai-del","aria-label":`Remove ${y.email}`,onClick:async()=>{if(await Hs("Remove member",`Remove ${y.email} from ${e.name}?`,"Remove",!0))try{await Wn("DELETE",`/api/orgs/${e.id}/members/${encodeURIComponent(y.email)}`),Ke("Removed."),i()}catch(b){Ke(b.message,!0)}},children:"Remove"})]})}})],[u,e.id,e.name,n,r]),p=Z_({data:e.members,columns:d,state:{sorting:o},onSortingChange:l,getCoreRowModel:q_(),getSortedRowModel:G_()});return f.jsx(DC,{table:p})}const z$=hg({require_verification:Yx(),require_approval:Yx()});function k$(){const e=Ai(),{data:n,error:r}=Pt({queryKey:["admin","policy"],queryFn:()=>Bt("/api/admin/policy")}),{data:i}=T_(!0),o=ag({resolver:fg(z$),values:n?{require_verification:n.require_verification&&n.mailer,require_approval:n.require_approval}:{require_verification:!1,require_approval:!1}});if(w.useEffect(()=>{r&&Ke(r.message,!0)},[r]),!n)return null;const l=async(u,d,p)=>{try{await Si(`/api/admin/pending/${u}/${d}`),Ke((d==="approve"?"Approved ":"Denied ")+p),e.invalidateQueries({queryKey:["admin","pending"]})}catch(m){Ke(m.message,!0)}};return f.jsxs("div",{className:"admin",children:[f.jsx("h1",{children:"Signup & access"}),f.jsx("p",{className:"admin-sub",children:"Who can create an account on this hub, and how new accounts are vetted."}),f.jsx("h3",{children:"New-account vetting"}),f.jsxs("form",{onSubmit:o.handleSubmit(async u=>{try{await Si("/api/admin/policy",u),Ke("Signup policy saved."),e.invalidateQueries({queryKey:["admin","policy"]})}catch(d){Ke(d.message,!0)}}),children:[f.jsxs("div",{className:"admin-list",children:[f.jsx(nw,{label:"Require email verification",desc:n.mailer?"New accounts must click an emailed link before they can sign in — proves they control the address.":"Configure SMTP on the server (auth.smtp) to enable email verification.",disabled:!n.mailer,inputProps:o.register("require_verification")}),f.jsx(nw,{label:"Require admin approval",desc:"New accounts wait for a hub admin to approve them before they gain access.",inputProps:o.register("require_approval")})]}),f.jsx(vt,{variant:"primary",type:"submit",style:{marginTop:14},disabled:!o.formState.isDirty,children:"Save policy"})]}),f.jsx("h3",{children:"Who can sign up"}),f.jsxs("div",{className:"admin-list",children:[f.jsxs("div",{className:"admin-item",children:[f.jsx("span",{className:"ai-main",children:"Allowed email domains"}),f.jsx("span",{className:"ai-tag",children:n.allowed_domains&&n.allowed_domains.length?n.allowed_domains.map(u=>"@"+u).join(", "):"any"})]}),f.jsxs("div",{className:"admin-item",children:[f.jsx("span",{className:"ai-main",children:"Self-signup"}),f.jsx("span",{className:"ai-tag",children:n.allow_signup?"open":"invite-only"})]}),f.jsxs("div",{className:"admin-item",children:[f.jsx("span",{className:"ai-main",children:"Hub admins"}),f.jsx("span",{className:"ai-tag",children:n.admins&&n.admins.length?n.admins.join(", "):"none"})]})]}),f.jsx("p",{className:"admin-sub",children:"Domains and admins are set in the server config file (they can't be widened from the browser)."}),f.jsx("h3",{children:"Pending signups"}),f.jsxs("div",{className:"admin-list",children:[(!i||i.length===0)&&f.jsx("div",{className:"admin-empty",children:"No one is waiting for approval."}),(i||[]).map(u=>f.jsxs("div",{className:"admin-item",children:[f.jsx("span",{className:"ai-main",children:(u.name?u.name+" · ":"")+u.email}),f.jsx(vt,{variant:"primary",onClick:()=>l(u.id,"approve",u.email),children:"Approve"}),f.jsx("button",{className:"ai-del",onClick:()=>l(u.id,"deny",u.email),children:"Deny"})]},u.id))]})]})}function nw({label:e,desc:n,disabled:r,inputProps:i}){return f.jsxs("label",{className:"admin-item toggle",style:r?{opacity:.55}:void 0,children:[f.jsxs("span",{className:"ai-main",children:[f.jsx("div",{className:"tg-label",children:e}),f.jsx("div",{className:"tg-desc",children:n})]}),f.jsx("input",{type:"checkbox",disabled:r,...i})]})}function L$({...e}){return f.jsx(f1,{"data-slot":"select",...e})}function $$({...e}){return f.jsx(g1,{"data-slot":"select-value",...e})}function I$({className:e,size:n="default",children:r,...i}){return f.jsxs(m1,{"data-slot":"select-trigger","data-size":n,className:Je("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...i,children:[r,f.jsx(v1,{asChild:!0,children:f.jsx(Bp,{className:"size-4 opacity-50"})})]})}function P$({className:e,children:n,position:r="item-aligned",align:i="center",...o}){return f.jsx(b1,{children:f.jsxs(x1,{"data-slot":"select-content",className:Je("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,align:i,...o,children:[f.jsx(V$,{}),f.jsx(E1,{className:Je("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),f.jsx(U$,{})]})})}function F$({className:e,children:n,...r}){return f.jsxs(O1,{"data-slot":"select-item",className:Je("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[f.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(N1,{children:f.jsx(m_,{className:"size-4"})})}),f.jsx(A1,{children:n})]})}function V$({className:e,...n}){return f.jsx(D1,{"data-slot":"select-scroll-up-button",className:Je("flex cursor-default items-center justify-center py-1",e),...n,children:f.jsx(uz,{className:"size-4"})})}function U$({className:e,...n}){return f.jsx(z1,{"data-slot":"select-scroll-down-button",className:Je("flex cursor-default items-center justify-center py-1",e),...n,children:f.jsx(Bp,{className:"size-4"})})}const rw=["#5b8def","#f5a623","#4cc38a","#e0679b","#8b7bf0","#3ec8c8","#e6934a"];function pl(e){let n=0;for(const r of e)n=n*31+r.charCodeAt(0)>>>0;return rw[n%rw.length]}function aw({projects:e,currentId:n,menu:r,onNew:i}){const o=e.find(l=>l.id===n);return f.jsxs("nav",{id:"projects","aria-label":"Projects",children:[f.jsxs("div",{className:"nav-head",children:[f.jsx("span",{children:"Projects"}),f.jsx("button",{className:"nav-add",title:"New project","aria-label":"New project",onClick:i,children:"+"})]}),f.jsx("div",{className:"proj-row",children:f.jsxs(L$,{value:n||"",onValueChange:l=>{l&&l!==n&&(Kt("/"+l),mr())},children:[f.jsxs(I$,{id:"project-select","aria-label":`Switch project — current: ${o?.name??"none"}`,title:o?.name,className:"proj-trigger",children:[o&&f.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:pl(o.name)},children:f.jsx(Ls,{name:o.icon})}),o?f.jsx("span",{"data-slot":"select-value",children:o.name}):f.jsx($$,{placeholder:"Select a project"})]}),f.jsx(P$,{className:"proj-menu",position:"popper",sideOffset:4,children:e.map(l=>f.jsxs(F$,{value:l.id,children:[f.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:pl(l.name)},children:f.jsx(Ls,{name:l.icon})}),l.name]},l.id))})]})}),r&&f.jsx("ul",{className:"nav-menu","aria-label":"Project pages",children:[["dashboard","Dashboard","dashboard",r.onDashboard],["install","Installation","terminal",r.onInstall],["history","History","hist",r.onHistory],["settings","Settings","gear",r.onSettings]].map(([l,u,d,p])=>f.jsx("li",{children:f.jsxs("div",{id:"nav-"+l,className:"row"+(r.active===l?" active":""),role:"button",tabIndex:0,onClick:p,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),p())},children:[f.jsx(ut,{name:d}),f.jsx("span",{className:"label",children:u})]})},l))})]})}function PC({...e}){return f.jsx(UM,{"data-slot":"dropdown-menu",...e})}function FC({...e}){return f.jsx(HM,{"data-slot":"dropdown-menu-trigger",...e})}function VC({className:e,sideOffset:n=4,...r}){return f.jsx(BM,{children:f.jsx(qM,{"data-slot":"dropdown-menu-content",sideOffset:n,className:Je("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...r})})}function Ds({className:e,inset:n,variant:r="default",...i}){return f.jsx(ZM,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":r,className:Je("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",e),...i})}function tm({className:e,inset:n,...r}){return f.jsx(GM,{"data-slot":"dropdown-menu-label","data-inset":n,className:Je("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}const H$="https://github.com/runbear-io/beardrive";function B$(){return f.jsx("svg",{viewBox:"0 0 16 16",className:"gh-mark",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function q$({me:e,org:n,admin:r,orgActive:i,billing:o}){const l=e.name||e.email,[u,d]=w.useState(!1),p=n?Bs(n.manage_url):null,m=o?Bs(o.url):null;return f.jsxs("footer",{id:"accountbar",children:[f.jsxs("a",{className:"gh-star",href:H$,target:"_blank",rel:"noreferrer",children:[f.jsx(B$,{}),f.jsx("span",{children:"Star on GitHub"}),f.jsx("span",{className:"ext","aria-hidden":"true",children:"↗"}),f.jsx("span",{className:"sr-only",children:" (opens in a new tab)"})]}),f.jsxs(PC,{modal:!1,open:u,onOpenChange:d,children:[f.jsx(FC,{asChild:!0,children:f.jsxs("button",{id:"account-btn",className:i?"active":void 0,"aria-label":"Account menu",children:[f.jsx("span",{className:"avatar",style:{background:pl(e.email)},"aria-hidden":"true",children:(l.trim()[0]||"?").toUpperCase()}),f.jsxs("span",{className:"acct",children:[f.jsx("b",{children:l}),e.name&&f.jsx("small",{children:e.email})]}),f.jsx(ut,{name:"chev"})]})}),f.jsxs(VC,{id:"account-menu",side:"top",align:"start",sideOffset:6,className:"acct-menu",children:[n&&f.jsxs(f.Fragment,{children:[f.jsx(tm,{className:"menu-sec",children:"Organization"}),f.jsx(Ds,{asChild:!0,children:f.jsxs("a",{id:"menu-org-settings","aria-current":i?"page":void 0,...p,onClick:y=>{p?.onClick?.(y),d(!1)},children:[f.jsx(ut,{name:"gear"}),f.jsxs("span",{children:[f.jsx("b",{children:n.name})," Settings"]}),!n.manage_url.startsWith("/")&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"ext","aria-hidden":"true",children:"↗"}),f.jsx("span",{className:"sr-only",children:" (opens in a new tab)"})]})]})}),o&&f.jsx(Ds,{asChild:!0,children:f.jsxs("a",{id:"menu-billing",...m,onClick:y=>{m?.onClick?.(y),d(!1)},children:[f.jsx(ut,{name:"card"}),f.jsx("span",{children:"Billing"}),f.jsx("span",{className:"ps-chip plan-chip",children:o.plan})]})})]}),r&&f.jsxs(f.Fragment,{children:[f.jsx(tm,{className:"menu-sec",children:"Hub"}),f.jsxs(Ds,{id:"menu-hub-admin",onSelect:r.onClick,children:[f.jsx(ut,{name:"shield"}),f.jsxs("span",{children:["Signup & access",r.pending?` · ${r.pending}`:""]})]})]}),f.jsx(tm,{className:"menu-sec",children:"Account"}),f.jsx(Ds,{asChild:!0,children:f.jsxs("a",{id:"signout",href:"/auth/logout",children:[f.jsx(ut,{name:"power"}),f.jsx("span",{children:"Log out"})]})})]})]})]})}function $a({className:e,...n}){return f.jsx("div",{"data-slot":"card",className:Je("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...n})}function Ia({className:e,...n}){return f.jsx("div",{"data-slot":"card-header",className:Je("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...n})}function Pa({className:e,...n}){return f.jsx("div",{"data-slot":"card-title",className:Je("leading-none font-semibold",e),...n})}function Is({className:e,...n}){return f.jsx("div",{"data-slot":"card-description",className:Je("text-muted-foreground text-sm",e),...n})}function Fa({className:e,...n}){return f.jsx("div",{"data-slot":"card-content",className:Je("px-6",e),...n})}function na({className:e,orientation:n="horizontal",decorative:r=!0,...i}){return f.jsx(CN,{"data-slot":"separator",decorative:r,orientation:n,className:Je("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...i})}function G$({url:e}){const n=Pt({queryKey:["billing"],queryFn:()=>Bt(e)});if(n.isLoading)return f.jsx("div",{className:"empty",children:"Loading…"});if(n.error||!n.data)return f.jsxs("div",{className:"empty",children:[f.jsx("h3",{children:"Billing is unavailable"}),f.jsx("p",{children:n.error?.message||"Try again shortly."})]});const r=n.data;return f.jsxs("div",{className:"project-settings",id:"billing-view",children:[f.jsxs("h2",{children:["Billing",f.jsx("span",{className:"ps-chip plan-chip",children:r.plan.name})]}),f.jsxs($a,{children:[f.jsxs(Ia,{children:[f.jsxs(Pa,{children:[r.plan.name," plan",r.plan.status?` (${r.plan.status})`:""]}),f.jsxs(Is,{children:["Organization ",r.org," · ",r.usage.used," of ",r.usage.cap," used · ",r.seats.used," of ",r.seats.cap," ",r.seats.cap===1?"seat":"seats"]})]}),f.jsx(na,{}),f.jsx(Fa,{children:f.jsx("div",{className:"usage-bar",children:f.jsx("div",{style:{width:`${r.usage.pct}%`}})})})]}),r.owner?f.jsx("div",{className:"plan-grid",children:r.plans.map(i=>f.jsxs($a,{children:[f.jsxs(Ia,{children:[f.jsx(Pa,{children:i.name}),f.jsx(Is,{children:i.blurb})]}),f.jsx(na,{}),f.jsxs(Fa,{children:[f.jsxs("p",{className:"plan-price",children:[i.price,f.jsx("small",{children:" / user / month"})]}),f.jsxs("form",{method:"post",action:r.checkout_url,children:[f.jsx("input",{type:"hidden",name:"plan",value:i.id}),f.jsx(vt,{type:"submit",disabled:i.current,variant:i.current?"subtle":"default",children:i.current?"Current plan":`Upgrade to ${i.name}`})]})]})]},i.id))}):f.jsx("p",{className:"muted-note",children:"Only an organization owner can change the plan."}),r.owner&&r.has_customer&&f.jsxs($a,{children:[f.jsxs(Ia,{children:[f.jsx(Pa,{children:"Manage subscription"}),f.jsx(Is,{children:"Change seats, update the card, download invoices, or cancel."})]}),f.jsx(na,{}),f.jsx(Fa,{children:f.jsx("form",{method:"post",action:r.portal_url,children:f.jsx(vt,{type:"submit",variant:"subtle",children:"Open the billing portal"})})})]})]})}function du({className:e,type:n,...r}){return f.jsx("input",{type:n,"data-slot":"input",className:Je("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...r})}function nm({className:e,...n}){return f.jsx(YM,{"data-slot":"label",className:Je("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}function Z$({className:e,...n}){return f.jsx("textarea",{"data-slot":"textarea",className:Je("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...n})}const iw={read:1,write:2,admin:3};function wi(e,n){return(iw[e||""]||0)>=(iw[n]||0)}const Ym=280,K$=hg({name:uu().trim().min(1,"Give the project a name.").max(120,"Keep the name under 120 characters."),description:uu().max(Ym,`Keep the description under ${Ym} characters.`),icon:uu()});function Y$({project:e,org:n,onDeleted:r}){const i=O_(),o=wi(e.perm,"admin"),l=ag({resolver:fg(K$),defaultValues:{name:e.name,description:e.description??"",icon:e.icon??""}});w.useEffect(()=>{l.reset({name:e.name,description:e.description??"",icon:e.icon??""})},[e.id,e.name,e.description,e.icon]);const u=l.watch("icon"),d=l.watch("description"),p=l.handleSubmit(async m=>{const y=l.formState.dirtyFields,v={};if(y.name&&(v.name=m.name.trim()),y.description&&(v.description=m.description),y.icon&&(v.icon=m.icon),Object.keys(v).length!==0)try{await Wn("PATCH","/api/projects/"+e.id,v),Ke("Saved."),l.reset({...m,name:m.name.trim()}),await i()}catch(b){Ke(b.message,!0)}});return f.jsxs("div",{className:"project-settings",children:[f.jsxs("h2",{children:[e.name,!wi(e.perm,"write")&&f.jsx("span",{className:"ps-chip",children:"Read-only"})]}),f.jsxs($a,{children:[f.jsxs(Ia,{children:[f.jsx(Pa,{children:"General"}),f.jsx(Is,{children:"Name, description and icon for this project."})]}),f.jsx(na,{}),f.jsx(Fa,{children:f.jsxs("form",{className:"ps-form",onSubmit:p,children:[f.jsxs("div",{className:"ps-field",children:[f.jsx(nm,{htmlFor:"ps-icon-btn",children:"Icon"}),f.jsxs("div",{className:"ps-icon-row",children:[f.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:pl(e.name)},children:f.jsx(Ls,{name:u})}),f.jsxs(PC,{children:[f.jsx(FC,{asChild:!0,children:f.jsx(vt,{id:"ps-icon-btn",type:"button",variant:"subtle",disabled:!o,children:"Change"})}),f.jsxs(VC,{align:"start",className:"ps-icon-grid",children:[f.jsx(Ds,{className:"ps-icon-cell"+(u===""?" active":""),title:"Default","aria-label":"Default icon",onSelect:()=>l.setValue("icon","",{shouldDirty:!0}),children:f.jsx(Ls,{})}),Object.keys(Nm).map(m=>f.jsx(Ds,{className:"ps-icon-cell"+(u===m?" active":""),title:m,"aria-label":m,onSelect:()=>l.setValue("icon",m,{shouldDirty:!0}),children:f.jsx(Ls,{name:m})},m))]})]})]})]}),f.jsxs("div",{className:"ps-field",children:[f.jsx(nm,{htmlFor:"ps-name",children:"Name"}),f.jsx(du,{id:"ps-name",disabled:!o,"aria-invalid":!!l.formState.errors.name,"aria-describedby":l.formState.errors.name?"ps-name-err":void 0,...l.register("name")}),l.formState.errors.name&&f.jsx("span",{id:"ps-name-err",role:"alert",className:"field-err",children:l.formState.errors.name.message})]}),f.jsxs("div",{className:"ps-field",children:[f.jsxs(nm,{htmlFor:"ps-desc",children:["Description ",f.jsx("span",{className:"ps-opt",children:"(optional)"})]}),f.jsx(Z$,{id:"ps-desc",rows:2,disabled:!o,placeholder:"What this project is for.","aria-invalid":!!l.formState.errors.description,"aria-describedby":l.formState.errors.description?"ps-desc-err":void 0,...l.register("description")}),f.jsxs("div",{className:"ps-meta",children:[l.formState.errors.description?f.jsx("span",{id:"ps-desc-err",role:"alert",className:"field-err",children:l.formState.errors.description.message}):f.jsx("span",{}),f.jsxs("span",{className:"ps-count",children:[d.length," / ",Ym]})]})]}),o&&f.jsxs(f.Fragment,{children:[f.jsx(na,{}),f.jsx("div",{className:"ps-actions",children:f.jsx(vt,{id:"ps-save",type:"submit",variant:"primary",disabled:!l.formState.isDirty||l.formState.isSubmitting,children:"Save changes"})})]})]})})]}),f.jsx(Q$,{project:e}),f.jsx(J$,{project:e,org:n}),f.jsxs($a,{children:[f.jsx(Ia,{children:f.jsx(Pa,{children:"About"})}),f.jsx(na,{}),f.jsx(Fa,{children:f.jsxs("dl",{className:"ps-facts",children:[f.jsx("dt",{children:"Project id"}),f.jsx("dd",{children:f.jsx("code",{children:e.id})}),n&&f.jsxs(f.Fragment,{children:[f.jsx("dt",{children:"Workspace"}),f.jsx("dd",{children:n.name})]}),e.created&&f.jsxs(f.Fragment,{children:[f.jsx("dt",{children:"Created"}),f.jsx("dd",{children:new Date(e.created).toLocaleDateString()})]})]})})]}),o&&f.jsxs($a,{className:"ps-danger",children:[f.jsx(Ia,{children:f.jsx(Pa,{children:"Danger zone"})}),f.jsx(na,{}),f.jsxs(Fa,{children:[f.jsx("p",{children:"Deleting removes the project from this hub. Its files stay in storage. This can't be undone."}),f.jsx(vt,{variant:"danger",onClick:async()=>{if(await R_(`Delete “${e.name}”?`,"This can't be undone. Type the project name to confirm:","","Delete project",{match:e.name,danger:!0})!==null)try{await Wn("DELETE","/api/projects/"+e.id),Ke(`Deleted “${e.name}”.`),await r()}catch(y){Ke(y.message,!0)}},children:"Delete project"})]})]})]})}function Q$({project:e}){const n=Ai(),{data:r,error:i,isLoading:o}=j_(e.id);return i?null:f.jsxs($a,{children:[f.jsxs(Ia,{children:[f.jsx(Pa,{children:"Public links"}),f.jsxs(Is,{children:["Files in this project that anyone with the URL can read — no account needed.",(r||[]).some(l=>l.opens!==void 0)&&f.jsxs(f.Fragment,{children:[" ",LC]})]})]}),f.jsx(na,{}),f.jsx(Fa,{children:f.jsx($C,{shares:r||[],loading:o,canRevoke:wi(e.perm,"write"),onChanged:()=>n.invalidateQueries({queryKey:["shares",e.id]}),empty:"No public links."})})]})}const Qm=[{value:"admin",label:"Admin"},{value:"write",label:"Write"},{value:"read",label:"Read"},{value:"none",label:"No access"}],X$=Object.fromEntries(Qm.map(e=>[e.value,e.label]));function J$({project:e,org:n}){const r=Ai(),{data:i,error:o}=j3(e.id),l=wi(e.perm,"admin"),u=()=>{r.invalidateQueries({queryKey:["permissions",e.id]}),r.invalidateQueries({queryKey:["projects"]})},d=async(x,S)=>{try{await x(),Ke(S)}catch(_){Ke(_.message,!0)}u()};if(o||!i)return null;const p=i,m=`/api/p/${e.id}/permissions`,y=new Set((n?.members||[]).filter(x=>x.role==="owner").map(x=>x.email.toLowerCase())),v=[...p.grants.filter(x=>!y.has(x.email.toLowerCase())),...[...y].sort().map(x=>({email:x,level:"admin",owner:!0}))],b=async()=>{const x=await R_("Add an exception","Email of a workspace member. They get Read access; change it in the table.","","Add");x===null||!x.trim()||await d(()=>Wn("PUT",`${m}/${encodeURIComponent(x.trim())}`,{level:"read"}),"Added.")};return f.jsxs($a,{className:"ps-people",children:[f.jsxs(Ia,{children:[f.jsx(Pa,{children:"People"}),f.jsx(Is,{children:"Who can see and change this project."})]}),f.jsx(na,{}),f.jsxs(Fa,{children:[f.jsxs("p",{className:"ps-row",children:[f.jsxs("span",{children:["Everyone in ",n?.name||"this workspace"," can"]}),f.jsx("select",{"aria-label":"Default access for workspace members",disabled:!l,value:p.default,onChange:async x=>{const S=x.target.value;if(S==="none"&&!await Hs("Make this project invite-only?","Only people listed below (and workspace owners) will see this project.","Make invite-only")){u();return}await d(()=>Wn("PUT",m,{default:S}),"Default access updated.")},children:Qm.filter(x=>x.value!=="admin").map(x=>f.jsx("option",{value:x.value,children:x.label},x.value))})]}),p.default==="none"&&f.jsx("p",{className:"ps-note",children:"This project is invite-only: only the people below and workspace owners can see it."}),f.jsxs("div",{className:"ps-people-head",children:[f.jsx("h4",{children:"Exceptions"}),l&&f.jsx(vt,{type:"button",variant:"subtle",onClick:b,children:"+ Add"})]}),v.length===0?f.jsx("p",{className:"ps-note",children:"No exceptions — everyone gets the access above."}):f.jsx("div",{className:"admin-list",children:v.map(x=>{const S="owner"in x;return f.jsxs("div",{className:"admin-item",children:[f.jsxs("span",{className:"ai-main",title:x.email,children:[x.email,p.creator&&x.email.toLowerCase()===p.creator.toLowerCase()&&f.jsx("span",{className:"ai-tag",children:" (creator)"})]}),S?f.jsx("span",{className:"ai-tag",children:"Workspace owner — always admin"}):f.jsxs("span",{className:"role-cell",children:[f.jsx("select",{"aria-label":`Access for ${x.email}`,disabled:!l,value:x.level,onChange:_=>d(()=>Wn("PUT",`${m}/${encodeURIComponent(x.email)}`,{level:_.target.value}),`${x.email} is now ${X$[_.target.value]||_.target.value}.`),children:Qm.map(_=>f.jsx("option",{value:_.value,children:_.label},_.value))}),l&&f.jsx("button",{className:"ai-del","aria-label":`Remove exception for ${x.email}`,onClick:()=>d(()=>Wn("DELETE",`${m}/${encodeURIComponent(x.email)}`),"Reverted to the default access."),children:"Remove"})]})]},x.email)})})]})]})}const UC="https://raw.githubusercontent.com/runbear-io/beardrive/main/INSTALL_FOR_AGENTS.md";function HC({project:e,existing:n}){const r=window.location.origin,i=n?'. I already have a folder of notes — ask me which one to sync (the project is named "':'. Ask me which folder to sync (the project is named "',o="Follow "+UC+` +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const d=u[1];if(n===u[0]){l(u);continue}if(e.external){const m=e.external.registry.get(u[0])?.id;if(n!==u[0]&&m){l(u);continue}}if(e.metadataRegistry.get(u[0])?.id){l(u);continue}if(d.cycle){l(u);continue}if(d.count>1&&e.reused==="ref"){l(u);continue}}}function CC(e,n){const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=d=>{const p=e.seen.get(d);if(p.ref===null)return;const m=p.def??p.schema,y={...m},v=p.ref;if(p.ref=null,v){i(v);const x=e.seen.get(v),w=x.schema;if(w.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(w)):Object.assign(m,w),Object.assign(m,y),d._zod.parent===v)for(const E in m)E==="$ref"||E==="allOf"||E in y||delete m[E];if(w.$ref&&x.def)for(const E in m)E==="$ref"||E==="allOf"||E in x.def&&JSON.stringify(m[E])===JSON.stringify(x.def[E])&&delete m[E]}const b=d._zod.parent;if(b&&b!==v){i(b);const x=e.seen.get(b);if(x?.schema.$ref&&(m.$ref=x.schema.$ref,x.def))for(const w in m)w==="$ref"||w==="allOf"||w in x.def&&JSON.stringify(m[w])===JSON.stringify(x.def[w])&&delete m[w]}e.override({zodSchema:d,jsonSchema:m,path:p.path??[]})};for(const d of[...e.seen.entries()].reverse())i(d[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(n)?.id;if(!d)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(d)}Object.assign(o,r.def??r.schema);const l=e.metadataRegistry.get(n)?.id;l!==void 0&&o.id===l&&delete o.id;const u=e.external?.defs??{};for(const d of e.seen.entries()){const p=d[1];p.def&&p.defId&&(p.def.id===p.defId&&delete p.def.id,u[p.defId]=p.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?o.$defs=u:o.definitions=u);try{const d=JSON.parse(JSON.stringify(o));return Object.defineProperty(d,"~standard",{value:{...n["~standard"],jsonSchema:{input:Tu(n,"input",e.processors),output:Tu(n,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function gn(e,n){const r=n??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return gn(i.element,r);if(i.type==="set")return gn(i.valueType,r);if(i.type==="lazy")return gn(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return gn(i.innerType,r);if(i.type==="intersection")return gn(i.left,r)||gn(i.right,r);if(i.type==="record"||i.type==="map")return gn(i.keyType,r)||gn(i.valueType,r);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:gn(i.in,r)||gn(i.out,r);if(i.type==="object"){for(const o in i.shape)if(gn(i.shape[o],r))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(gn(o,r))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(gn(o,r))return!0;return!!(i.rest&&gn(i.rest,r))}return!1}const IL=(e,n={})=>r=>{const i=SC({...r,processors:n});return ln(e,i),_C(i,e),CC(i,e)},Tu=(e,n,r={})=>i=>{const{libraryOptions:o,target:l}=i??{},u=SC({...o??{},target:l,io:n,processors:r});return ln(e,u),_C(u,e),CC(u,e)},PL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},FL=(e,n,r,i)=>{const o=r;o.type="string";const{minimum:l,maximum:u,format:d,patterns:p,contentEncoding:m}=e._zod.bag;if(typeof l=="number"&&(o.minLength=l),typeof u=="number"&&(o.maxLength=u),d&&(o.format=PL[d]??d,o.format===""&&delete o.format,d==="time"&&delete o.format),m&&(o.contentEncoding=m),p&&p.size>0){const y=[...p];y.length===1?o.pattern=y[0].source:y.length>1&&(o.allOf=[...y.map(v=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},VL=(e,n,r,i)=>{r.type="boolean"},UL=(e,n,r,i)=>{r.not={}},HL=(e,n,r,i)=>{},BL=(e,n,r,i)=>{const o=e._zod.def,l=lC(o.entries);l.every(u=>typeof u=="number")&&(r.type="number"),l.every(u=>typeof u=="string")&&(r.type="string"),r.enum=l},qL=(e,n,r,i)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},GL=(e,n,r,i)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ZL=(e,n,r,i)=>{const o=r,l=e._zod.def,{minimum:u,maximum:d}=e._zod.bag;typeof u=="number"&&(o.minItems=u),typeof d=="number"&&(o.maxItems=d),o.type="array",o.items=ln(l.element,n,{...i,path:[...i.path,"items"]})},KL=(e,n,r,i)=>{const o=r,l=e._zod.def;o.type="object",o.properties={};const u=l.shape;for(const m in u)o.properties[m]=ln(u[m],n,{...i,path:[...i.path,"properties",m]});const d=new Set(Object.keys(u)),p=new Set([...d].filter(m=>{const y=l.shape[m]._zod;return n.io==="input"?y.optin===void 0:y.optout===void 0}));p.size>0&&(o.required=Array.from(p)),l.catchall?._zod.def.type==="never"?o.additionalProperties=!1:l.catchall?l.catchall&&(o.additionalProperties=ln(l.catchall,n,{...i,path:[...i.path,"additionalProperties"]})):n.io==="output"&&(o.additionalProperties=!1)},YL=(e,n,r,i)=>{const o=e._zod.def,l=o.inclusive===!1,u=o.options.map((d,p)=>ln(d,n,{...i,path:[...i.path,l?"oneOf":"anyOf",p]}));l?r.oneOf=u:r.anyOf=u},QL=(e,n,r,i)=>{const o=e._zod.def,l=ln(o.left,n,{...i,path:[...i.path,"allOf",0]}),u=ln(o.right,n,{...i,path:[...i.path,"allOf",1]}),d=m=>"allOf"in m&&Object.keys(m).length===1,p=[...d(l)?l.allOf:[l],...d(u)?u.allOf:[u]];r.allOf=p},XL=(e,n,r,i)=>{const o=e._zod.def,l=ln(o.innerType,n,i),u=n.seen.get(e);n.target==="openapi-3.0"?(u.ref=o.innerType,r.nullable=!0):r.anyOf=[l,{type:"null"}]},JL=(e,n,r,i)=>{const o=e._zod.def;ln(o.innerType,n,i);const l=n.seen.get(e);l.ref=o.innerType},WL=(e,n,r,i)=>{const o=e._zod.def;ln(o.innerType,n,i);const l=n.seen.get(e);l.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},e8=(e,n,r,i)=>{const o=e._zod.def;ln(o.innerType,n,i);const l=n.seen.get(e);l.ref=o.innerType,n.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},t8=(e,n,r,i)=>{const o=e._zod.def;ln(o.innerType,n,i);const l=n.seen.get(e);l.ref=o.innerType;let u;try{u=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=u},n8=(e,n,r,i)=>{const o=e._zod.def,l=o.in._zod.traits.has("$ZodTransform"),u=n.io==="input"?l?o.out:o.in:o.out;ln(u,n,i);const d=n.seen.get(e);d.ref=u},r8=(e,n,r,i)=>{const o=e._zod.def;ln(o.innerType,n,i);const l=n.seen.get(e);l.ref=o.innerType,r.readOnly=!0},EC=(e,n,r,i)=>{const o=e._zod.def;ln(o.innerType,n,i);const l=n.seen.get(e);l.ref=o.innerType};function Zm(){return Zm=Object.assign?Object.assign.bind():function(e){for(var n=1;n0){var p=o.errors[0][0];r[d]={message:p.message,type:p.code}}else r[d]={message:u,type:l};if(o.code==="invalid_union"&&o.errors.forEach(function(v){return v.forEach(function(b){return e.push(Zm({},b,{path:[].concat(o.path,b.path)}))})}),n){var m=r[d].types,y=m&&m[o.code];r[d]=rg(d,n,r,l,y?[].concat(y,o.message):o.message)}e.shift()};e.length;)i();return r}function fg(e,n,r){if(r===void 0&&(r={}),(function(i){return"_def"in i&&typeof i._def=="object"&&"typeName"in i._def})(e))return function(i,o,l){try{return Promise.resolve(Gx(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](i,n)).then(function(u){return l.shouldUseNativeValidation&&Bm({},l),{errors:{},values:r.raw?Object.assign({},i):u}})},function(u){if((function(d){return Array.isArray(d?.issues)})(u))return{values:{},errors:Ax(a8(u.errors,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw u}))}catch(u){return Promise.reject(u)}};if((function(i){return"_zod"in i&&typeof i._zod=="object"})(e))return function(i,o,l){try{return Promise.resolve(Gx(function(){return Promise.resolve((r.mode==="sync"?o5:l5)(e,i,n)).then(function(u){return l.shouldUseNativeValidation&&Bm({},l),{errors:{},values:r.raw?Object.assign({},i):u}})},function(u){if((function(d){return d instanceof ug})(u))return{values:{},errors:Ax(i8(u.issues,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw u}))}catch(u){return Promise.reject(u)}};throw new Error("Invalid input: not a Zod schema")}const s8=fe("ZodISODateTime",(e,n)=>{h6.init(e,n),_t.init(e,n)});function o8(e){return gL(s8,e)}const l8=fe("ZodISODate",(e,n)=>{m6.init(e,n),_t.init(e,n)});function c8(e){return vL(l8,e)}const u8=fe("ZodISOTime",(e,n)=>{p6.init(e,n),_t.init(e,n)});function d8(e){return yL(u8,e)}const f8=fe("ZodISODuration",(e,n)=>{g6.init(e,n),_t.init(e,n)});function h8(e){return bL(f8,e)}const m8=(e,n)=>{ug.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>s5(e,r)},flatten:{value:r=>i5(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,qm,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,qm,2)}},isEmpty:{get(){return e.issues.length===0}}})},nr=fe("ZodError",m8,{Parent:Error}),p8=id(nr),g8=sd(nr),v8=od(nr),y8=ld(nr),b8=d5(nr),x8=f5(nr),w8=h5(nr),S8=m5(nr),_8=p5(nr),C8=g5(nr),E8=v5(nr),R8=y5(nr),Zx=new WeakMap;function ud(e,n,r){const i=Object.getPrototypeOf(e);let o=Zx.get(i);if(o||(o=new Set,Zx.set(i,o)),!o.has(n)){o.add(n);for(const l in r){const u=r[l];Object.defineProperty(i,l,{configurable:!0,enumerable:!1,get(){const d=u.bind(this);return Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:!0,value:d}),d},set(d){Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:!0,value:d})}})}}}const Vt=fe("ZodType",(e,n)=>(Ft.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:Tu(e,"input"),output:Tu(e,"output")}}),e.toJSONSchema=IL(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.parse=(r,i)=>p8(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>v8(e,r,i),e.parseAsync=async(r,i)=>g8(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>y8(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>b8(e,r,i),e.decode=(r,i)=>x8(e,r,i),e.encodeAsync=async(r,i)=>w8(e,r,i),e.decodeAsync=async(r,i)=>S8(e,r,i),e.safeEncode=(r,i)=>_8(e,r,i),e.safeDecode=(r,i)=>C8(e,r,i),e.safeEncodeAsync=async(r,i)=>E8(e,r,i),e.safeDecodeAsync=async(r,i)=>R8(e,r,i),ud(e,"ZodType",{check(...r){const i=this.def;return this.clone(Xa(i,{checks:[...i.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,i){return Ja(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(b$(r,i))},superRefine(r,i){return this.check(x$(r,i))},overwrite(r){return this.check(Ys(r))},optional(){return Xx(this)},exactOptional(){return s$(this)},nullable(){return Jx(this)},nullish(){return Xx(Jx(this))},nonoptional(r){return f$(this,r)},array(){return Q8(this)},or(r){return W8([this,r])},and(r){return t$(this,r)},transform(r){return Wx(this,a$(r))},default(r){return c$(this,r)},prefault(r){return d$(this,r)},catch(r){return m$(this,r)},pipe(r){return Wx(this,r)},readonly(){return v$(this)},describe(r){const i=this.clone();return Xo.add(i,{description:r}),i},meta(...r){if(r.length===0)return Xo.get(this);const i=this.clone();return Xo.add(i,r[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Xo.get(e)?.description},configurable:!0}),e)),RC=fe("_ZodString",(e,n)=>{dg.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(i,o,l)=>FL(e,i,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,ud(e,"_ZodString",{regex(...i){return this.check(_L(...i))},includes(...i){return this.check(RL(...i))},startsWith(...i){return this.check(jL(...i))},endsWith(...i){return this.check(TL(...i))},min(...i){return this.check(ju(...i))},max(...i){return this.check(xC(...i))},length(...i){return this.check(wC(...i))},nonempty(...i){return this.check(ju(1,...i))},lowercase(i){return this.check(CL(i))},uppercase(i){return this.check(EL(i))},trim(){return this.check(AL())},normalize(...i){return this.check(OL(...i))},toLowerCase(){return this.check(ML())},toUpperCase(){return this.check(NL())},slugify(){return this.check(DL())}})}),j8=fe("ZodString",(e,n)=>{dg.init(e,n),RC.init(e,n),e.email=r=>e.check(Y6(T8,r)),e.url=r=>e.check(eL(O8,r)),e.jwt=r=>e.check(pL(B8,r)),e.emoji=r=>e.check(tL(A8,r)),e.guid=r=>e.check(qx(Kx,r)),e.uuid=r=>e.check(Q6(ru,r)),e.uuidv4=r=>e.check(X6(ru,r)),e.uuidv6=r=>e.check(J6(ru,r)),e.uuidv7=r=>e.check(W6(ru,r)),e.nanoid=r=>e.check(nL(M8,r)),e.guid=r=>e.check(qx(Kx,r)),e.cuid=r=>e.check(rL(N8,r)),e.cuid2=r=>e.check(aL(D8,r)),e.ulid=r=>e.check(iL(z8,r)),e.base64=r=>e.check(fL(V8,r)),e.base64url=r=>e.check(hL(U8,r)),e.xid=r=>e.check(sL(k8,r)),e.ksuid=r=>e.check(oL(L8,r)),e.ipv4=r=>e.check(lL($8,r)),e.ipv6=r=>e.check(cL(I8,r)),e.cidrv4=r=>e.check(uL(P8,r)),e.cidrv6=r=>e.check(dL(F8,r)),e.e164=r=>e.check(mL(H8,r)),e.datetime=r=>e.check(o8(r)),e.date=r=>e.check(c8(r)),e.time=r=>e.check(d8(r)),e.duration=r=>e.check(h8(r))});function uu(e){return K6(j8,e)}const _t=fe("ZodStringFormat",(e,n)=>{xt.init(e,n),RC.init(e,n)}),T8=fe("ZodEmail",(e,n)=>{a6.init(e,n),_t.init(e,n)}),Kx=fe("ZodGUID",(e,n)=>{n6.init(e,n),_t.init(e,n)}),ru=fe("ZodUUID",(e,n)=>{r6.init(e,n),_t.init(e,n)}),O8=fe("ZodURL",(e,n)=>{i6.init(e,n),_t.init(e,n)}),A8=fe("ZodEmoji",(e,n)=>{s6.init(e,n),_t.init(e,n)}),M8=fe("ZodNanoID",(e,n)=>{o6.init(e,n),_t.init(e,n)}),N8=fe("ZodCUID",(e,n)=>{l6.init(e,n),_t.init(e,n)}),D8=fe("ZodCUID2",(e,n)=>{c6.init(e,n),_t.init(e,n)}),z8=fe("ZodULID",(e,n)=>{u6.init(e,n),_t.init(e,n)}),k8=fe("ZodXID",(e,n)=>{d6.init(e,n),_t.init(e,n)}),L8=fe("ZodKSUID",(e,n)=>{f6.init(e,n),_t.init(e,n)}),$8=fe("ZodIPv4",(e,n)=>{v6.init(e,n),_t.init(e,n)}),I8=fe("ZodIPv6",(e,n)=>{y6.init(e,n),_t.init(e,n)}),P8=fe("ZodCIDRv4",(e,n)=>{b6.init(e,n),_t.init(e,n)}),F8=fe("ZodCIDRv6",(e,n)=>{x6.init(e,n),_t.init(e,n)}),V8=fe("ZodBase64",(e,n)=>{w6.init(e,n),_t.init(e,n)}),U8=fe("ZodBase64URL",(e,n)=>{_6.init(e,n),_t.init(e,n)}),H8=fe("ZodE164",(e,n)=>{C6.init(e,n),_t.init(e,n)}),B8=fe("ZodJWT",(e,n)=>{R6.init(e,n),_t.init(e,n)}),q8=fe("ZodBoolean",(e,n)=>{j6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>VL(e,r,i)});function Yx(e){return xL(q8,e)}const G8=fe("ZodUnknown",(e,n)=>{T6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>HL()});function Qx(){return wL(G8)}const Z8=fe("ZodNever",(e,n)=>{O6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>UL(e,r,i)});function K8(e){return SL(Z8,e)}const Y8=fe("ZodArray",(e,n)=>{A6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>ZL(e,r,i,o),e.element=n.element,ud(e,"ZodArray",{min(r,i){return this.check(ju(r,i))},nonempty(r){return this.check(ju(1,r))},max(r,i){return this.check(xC(r,i))},length(r,i){return this.check(wC(r,i))},unwrap(){return this.element}})});function Q8(e,n){return zL(Y8,e,n)}const X8=fe("ZodObject",(e,n)=>{N6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>KL(e,r,i,o),dt(e,"shape",()=>n.shape),ud(e,"ZodObject",{keyof(){return n$(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Qx()})},loose(){return this.clone({...this._zod.def,catchall:Qx()})},strict(){return this.clone({...this._zod.def,catchall:K8()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return W4(this,r)},safeExtend(r){return e5(this,r)},merge(r){return t5(this,r)},pick(r){return X4(this,r)},omit(r){return J4(this,r)},partial(...r){return n5(jC,this,r[0])},required(...r){return r5(TC,this,r[0])}})});function hg(e,n){const r={type:"object",shape:e??{},...Le(n)};return new X8(r)}const J8=fe("ZodUnion",(e,n)=>{D6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>YL(e,r,i,o),e.options=n.options});function W8(e,n){return new J8({type:"union",options:e,...Le(n)})}const e$=fe("ZodIntersection",(e,n)=>{z6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>QL(e,r,i,o)});function t$(e,n){return new e$({type:"intersection",left:e,right:n})}const Km=fe("ZodEnum",(e,n)=>{k6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(i,o,l)=>BL(e,i,o),e.enum=n.entries,e.options=Object.values(n.entries);const r=new Set(Object.keys(n.entries));e.extract=(i,o)=>{const l={};for(const u of i)if(r.has(u))l[u]=n.entries[u];else throw new Error(`Key ${u} not found in enum`);return new Km({...n,checks:[],...Le(o),entries:l})},e.exclude=(i,o)=>{const l={...n.entries};for(const u of i)if(r.has(u))delete l[u];else throw new Error(`Key ${u} not found in enum`);return new Km({...n,checks:[],...Le(o),entries:l})}});function n$(e,n){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Km({type:"enum",entries:r,...Le(n)})}const r$=fe("ZodTransform",(e,n)=>{L6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>GL(e,r),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new oC(e.constructor.name);r.addIssue=l=>{if(typeof l=="string")r.issues.push(ml(l,r.value,n));else{const u=l;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=r.value),u.inst??(u.inst=e),r.issues.push(ml(u))}};const o=n.transform(r.value,r);return o instanceof Promise?o.then(l=>(r.value=l,r.fallback=!0,r)):(r.value=o,r.fallback=!0,r)}});function a$(e){return new r$({type:"transform",transform:e})}const jC=fe("ZodOptional",(e,n)=>{bC.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>EC(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function Xx(e){return new jC({type:"optional",innerType:e})}const i$=fe("ZodExactOptional",(e,n)=>{$6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>EC(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function s$(e){return new i$({type:"optional",innerType:e})}const o$=fe("ZodNullable",(e,n)=>{I6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>XL(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function Jx(e){return new o$({type:"nullable",innerType:e})}const l$=fe("ZodDefault",(e,n)=>{P6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>WL(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function c$(e,n){return new l$({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():uC(n)}})}const u$=fe("ZodPrefault",(e,n)=>{F6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>e8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function d$(e,n){return new u$({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():uC(n)}})}const TC=fe("ZodNonOptional",(e,n)=>{V6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>JL(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function f$(e,n){return new TC({type:"nonoptional",innerType:e,...Le(n)})}const h$=fe("ZodCatch",(e,n)=>{U6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>t8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function m$(e,n){return new h$({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const p$=fe("ZodPipe",(e,n)=>{H6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>n8(e,r,i,o),e.in=n.in,e.out=n.out});function Wx(e,n){return new p$({type:"pipe",in:e,out:n})}const g$=fe("ZodReadonly",(e,n)=>{B6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>r8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function v$(e){return new g$({type:"readonly",innerType:e})}const y$=fe("ZodCustom",(e,n)=>{q6.init(e,n),Vt.init(e,n),e._zod.processJSONSchema=(r,i,o)=>qL(e,r)});function b$(e,n={}){return kL(y$,e,n)}function x$(e,n){return LL(e,n)}const w$=/\.(md|markdown)$/i,S$=/\.(png|jpe?g|gif|svg|webp|ico|bmp|avif)$/i,OC=/\.html?$/i,AC=/\.pdf$/i,_$=/\.(csv|tsv)$/i,C$=/\.(txt|log|json|ya?ml|toml|csv|go|py|js|ts|jsx|tsx|sh|bash|zsh|rb|rs|c|h|cpp|java|kt|swift|sql|css|xml|ini|conf|env|mod|sum|jsonl)$/i;function mg(e){if(e<1024)return e+" B";const n=["KB","MB","GB","TB"];let r=-1;do e/=1024,r++;while(e>=1024&&r`:e.user||e.author||"unknown"}function j$({className:e,...n}){return f.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:f.jsx("table",{"data-slot":"table",className:Je("w-full caption-bottom text-sm",e),...n})})}function T$({className:e,...n}){return f.jsx("thead",{"data-slot":"table-header",className:Je("[&_tr]:border-b",e),...n})}function O$({className:e,...n}){return f.jsx("tbody",{"data-slot":"table-body",className:Je("[&_tr:last-child]:border-0",e),...n})}function ew({className:e,...n}){return f.jsx("tr",{"data-slot":"table-row",className:Je("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...n})}function tw({className:e,...n}){return f.jsx("th",{"data-slot":"table-head",className:Je("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n})}function A$({className:e,...n}){return f.jsx("td",{"data-slot":"table-cell",className:Je("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n})}function M$({header:e}){const n=e.column.getIsSorted();return e.column.getCanSort()?f.jsx(tw,{"data-sort":n||void 0,"aria-sort":n==="asc"?"ascending":n==="desc"?"descending":"none",children:f.jsxs("button",{type:"button",className:"th-sort",onClick:e.column.getToggleSortingHandler(),children:[Fm(e.column.columnDef.header,e.getContext()),n==="asc"?" ↑":n==="desc"?" ↓":""]})}):f.jsx(tw,{children:Fm(e.column.columnDef.header,e.getContext())})}function DC({table:e,className:n}){return f.jsx("div",{className:"admin-list admin-card-table"+(n?" "+n:""),children:f.jsxs(j$,{className:"admin-table",children:[f.jsx(T$,{children:e.getHeaderGroups().map(r=>f.jsx(ew,{children:r.headers.map(i=>f.jsx(M$,{header:i},i.id))},r.id))}),f.jsx(O$,{children:e.getRowModel().rows.map(r=>f.jsx(ew,{className:"admin-item",children:r.getVisibleCells().map(i=>f.jsx(A$,{children:Fm(i.column.columnDef.cell,i.getContext())},i.id))},r.id))})]})})}function zC(e){return e?"expires "+new Date(e).toLocaleDateString():"no expiry"}function N$(e){if(e.opens===void 0)return null;if(e.opens===0)return"not opened yet";const n=`${e.opens} open${e.opens===1?"":"s"}`;return e.last_opened?`${n} · last opened ${new Date(e.last_opened).toLocaleDateString()}`:n}function kC(e,n){const r=[];n&&e.project_name&&r.push(e.project_name),e.creator&&r.push("by "+e.creator),e.created&&r.push(new Date(e.created).toLocaleDateString()),r.push(zC(e.expires));const i=N$(e);return i&&r.push(i),r.join(" · ")}const LC="Opens count how many times a file has been read through a public link. Repeat opens by the same reader within 10 minutes count once.";function $C({shares:e,onChanged:n,showProject:r=!1,canRevoke:i=!0,empty:o="No public shares.",loading:l=!1}){const[u,d]=S.useState([]),p=S.useMemo(()=>k_(),[]),m=S.useMemo(()=>[p.accessor("path",{header:"Path",cell:v=>f.jsx("a",{className:"ai-main mono",title:v.getValue(),...Bs(fl(v.getValue(),v.row.original.project)),children:v.getValue()})}),p.accessor(v=>kC(v,r),{id:"detail",header:r?"Project":"Shared",cell:v=>f.jsx("span",{className:"ai-tag",children:v.getValue()})}),p.display({id:"actions",header:"",cell:v=>i?f.jsx("button",{className:"ai-del","aria-label":`Revoke the share of ${v.row.original.path}`,onClick:()=>IC(v.row.original,n),children:"Revoke"}):null})],[p,n,r,i]),y=Z_({data:e,columns:m,state:{sorting:u},onSortingChange:d,getCoreRowModel:q_(),getSortedRowModel:G_()});return l?f.jsx("div",{className:"admin-list",children:f.jsx("div",{className:"admin-empty",children:"Loading…"})}):e.length===0?f.jsx("div",{className:"admin-list",children:f.jsx("div",{className:"admin-empty",children:o})}):f.jsx(DC,{table:y,className:"shares-table"})}async function IC(e,n){if(await Hs("Revoke share link",`Revoke the public link to “${e.path}”? Anyone with the URL will lose access.`,"Revoke",!0))try{await Wn("DELETE","/api/shares/"+e.token),Ke("Share revoked."),n()}catch(r){Ke(r.message,!0)}}const D$=hg({name:uu().trim().min(1,"Give the organization a name.").max(60,"Keep it under 60 characters.")});function z$({org:e,projects:n,myEmail:r}){const i=Ai(),o=e.role==="owner",l=()=>i.invalidateQueries({queryKey:["orgs"]}),u=()=>i.invalidateQueries({queryKey:["invites",e.id]}),d=()=>i.invalidateQueries({queryKey:["orgShares",e.id]}),p=ag({resolver:fg(D$),values:{name:e.name}}),{data:m}=Pt({queryKey:["invites",e.id],queryFn:()=>Bt(`/api/orgs/${e.id}/invites`),enabled:o,select:x=>x.invites||[]}),{data:y,isLoading:v}=Pt({queryKey:["orgShares",e.id],queryFn:()=>Bt(`/api/orgs/${e.id}/shares`),enabled:o,select:x=>x.shares||[]}),b=n.filter(x=>x.org===e.id);return f.jsxs("div",{className:"admin",children:[f.jsx("h1",{id:"org-title",children:e.name}),!o&&f.jsx("p",{className:"role-chip-row",children:f.jsx("span",{className:"ai-tag role-chip",children:"Member"})}),!o&&f.jsx("p",{className:"admin-sub",children:"Only owners can rename this organization, manage members, or issue invite links."}),o&&f.jsxs("form",{className:"admin-row",onSubmit:p.handleSubmit(async({name:x})=>{try{await Wn("PATCH","/api/orgs/"+e.id,{name:x}),Ke("Renamed."),l()}catch(w){Ke(w.message,!0)}}),children:[f.jsx("label",{className:"admin-lbl",htmlFor:"org-rename",children:"Organization name"}),f.jsx("input",{id:"org-rename",type:"text","aria-invalid":!!p.formState.errors.name,"aria-describedby":p.formState.errors.name?"org-rename-err":void 0,...p.register("name")}),f.jsx(vt,{variant:"subtle",id:"org-rename-btn",type:"submit",disabled:!p.formState.isDirty,children:"Rename org"}),p.formState.errors.name&&f.jsx("span",{id:"org-rename-err",role:"alert",className:"field-err",children:p.formState.errors.name.message})]}),f.jsx("h3",{children:"Members"}),f.jsx(k$,{org:e,owner:o,myEmail:r,onChanged:l}),f.jsx("h3",{children:"Projects"}),f.jsxs("div",{className:"admin-list",children:[b.length===0&&f.jsx("div",{className:"admin-empty",children:"No projects yet."}),b.map(x=>f.jsx("div",{className:"admin-item",children:f.jsx("span",{className:"ai-main",title:x.name,children:x.name})},x.id))]}),o&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"admin-h",children:[f.jsx("h3",{children:"Invite links"}),f.jsx(vt,{variant:"primary",onClick:async()=>{try{const x=await Si(`/api/orgs/${e.id}/invites`),w=await qs(x.url);Ke(w?"Invite link copied to clipboard.":"Invite created — copy it from the list below."),u()}catch(x){Ke(x.message,!0)}},children:"New invite"})]}),f.jsxs("div",{className:"admin-list",children:[m&&m.length===0&&f.jsx("div",{className:"admin-empty",children:"No active invite links."}),(m||[]).map(x=>f.jsxs("div",{className:"admin-item",children:[f.jsx("button",{type:"button",className:"ai-main mono ai-copy","aria-label":`Copy invite link ${x.url}`,title:x.url,onClick:()=>qs(x.url).then(w=>Ke(w?"Copied.":"Select and copy the link.")),children:x.url}),f.jsx("span",{className:"ai-tag",children:(x.creator?"by "+x.creator+" · ":"")+(x.uses?x.uses+" joined · ":"unused · ")+"expires "+new Date(x.expires).toLocaleDateString()}),f.jsx("button",{className:"ai-del","aria-label":`Revoke invite ${x.token.slice(0,8)}`,onClick:async()=>{if(await Hs("Revoke invite",`Revoke the link starting ${x.token.slice(0,8)}…? Anyone still holding it won't be able to join.`,"Revoke",!0))try{await Wn("DELETE",`/api/orgs/${e.id}/invites/${x.token}`),Ke("Revoked."),u()}catch(w){Ke(w.message,!0)}},children:"Revoke"})]},x.token))]}),f.jsx("h3",{children:"Public share links"}),f.jsx("p",{className:"admin-sub",children:"Every live link across this organization's projects. A project's own links are on its Settings page, and on the file itself."}),f.jsx($C,{shares:y||[],loading:v,onChanged:d,showProject:!0})]})]})}function k$({org:e,owner:n,myEmail:r,onChanged:i}){const[o,l]=S.useState([{id:"email",desc:!1}]),u=S.useMemo(()=>k_(),[]),d=S.useMemo(()=>[u.accessor("email",{id:"email",header:"Member",cell:m=>{const y=!!r&&m.getValue().toLowerCase()===r.toLowerCase();return f.jsx("span",{className:"ai-main",title:m.getValue(),children:m.getValue()+(y?" (you)":"")})}}),u.accessor("role",{id:"role",header:"Role",cell:m=>{const y=m.row.original,v=!!r&&y.email.toLowerCase()===r.toLowerCase();return!n||v?f.jsx("span",{className:"ai-tag role-static",children:y.role}):f.jsxs("span",{className:"role-cell",children:[f.jsxs("select",{"aria-label":`Role for ${y.email}`,value:y.role,onChange:async b=>{try{await Wn("PATCH",`/api/orgs/${e.id}/members/${encodeURIComponent(y.email)}`,{role:b.target.value}),Ke("Role updated.")}catch(x){Ke(x.message,!0)}i()},children:[f.jsx("option",{value:"owner",children:"owner"}),f.jsx("option",{value:"member",children:"member"})]}),f.jsx("button",{className:"ai-del","aria-label":`Remove ${y.email}`,onClick:async()=>{if(await Hs("Remove member",`Remove ${y.email} from ${e.name}?`,"Remove",!0))try{await Wn("DELETE",`/api/orgs/${e.id}/members/${encodeURIComponent(y.email)}`),Ke("Removed."),i()}catch(b){Ke(b.message,!0)}},children:"Remove"})]})}})],[u,e.id,e.name,n,r]),p=Z_({data:e.members,columns:d,state:{sorting:o},onSortingChange:l,getCoreRowModel:q_(),getSortedRowModel:G_()});return f.jsx(DC,{table:p})}const L$=hg({require_verification:Yx(),require_approval:Yx()});function $$(){const e=Ai(),{data:n,error:r}=Pt({queryKey:["admin","policy"],queryFn:()=>Bt("/api/admin/policy")}),{data:i}=T_(!0),o=ag({resolver:fg(L$),values:n?{require_verification:n.require_verification&&n.mailer,require_approval:n.require_approval}:{require_verification:!1,require_approval:!1}});if(S.useEffect(()=>{r&&Ke(r.message,!0)},[r]),!n)return null;const l=async(u,d,p)=>{try{await Si(`/api/admin/pending/${u}/${d}`),Ke((d==="approve"?"Approved ":"Denied ")+p),e.invalidateQueries({queryKey:["admin","pending"]})}catch(m){Ke(m.message,!0)}};return f.jsxs("div",{className:"admin",children:[f.jsx("h1",{children:"Signup & access"}),f.jsx("p",{className:"admin-sub",children:"Who can create an account on this hub, and how new accounts are vetted."}),f.jsx("h3",{children:"New-account vetting"}),f.jsxs("form",{onSubmit:o.handleSubmit(async u=>{try{await Si("/api/admin/policy",u),Ke("Signup policy saved."),e.invalidateQueries({queryKey:["admin","policy"]})}catch(d){Ke(d.message,!0)}}),children:[f.jsxs("div",{className:"admin-list",children:[f.jsx(nw,{label:"Require email verification",desc:n.mailer?"New accounts must click an emailed link before they can sign in — proves they control the address.":"Configure SMTP on the server (auth.smtp) to enable email verification.",disabled:!n.mailer,inputProps:o.register("require_verification")}),f.jsx(nw,{label:"Require admin approval",desc:"New accounts wait for a hub admin to approve them before they gain access.",inputProps:o.register("require_approval")})]}),f.jsx(vt,{variant:"primary",type:"submit",style:{marginTop:14},disabled:!o.formState.isDirty,children:"Save policy"})]}),f.jsx("h3",{children:"Who can sign up"}),f.jsxs("div",{className:"admin-list",children:[f.jsxs("div",{className:"admin-item",children:[f.jsx("span",{className:"ai-main",children:"Allowed email domains"}),f.jsx("span",{className:"ai-tag",children:n.allowed_domains&&n.allowed_domains.length?n.allowed_domains.map(u=>"@"+u).join(", "):"any"})]}),f.jsxs("div",{className:"admin-item",children:[f.jsx("span",{className:"ai-main",children:"Self-signup"}),f.jsx("span",{className:"ai-tag",children:n.allow_signup?"open":"invite-only"})]}),f.jsxs("div",{className:"admin-item",children:[f.jsx("span",{className:"ai-main",children:"Hub admins"}),f.jsx("span",{className:"ai-tag",children:n.admins&&n.admins.length?n.admins.join(", "):"none"})]})]}),f.jsx("p",{className:"admin-sub",children:"Domains and admins are set in the server config file (they can't be widened from the browser)."}),f.jsx("h3",{children:"Pending signups"}),f.jsxs("div",{className:"admin-list",children:[(!i||i.length===0)&&f.jsx("div",{className:"admin-empty",children:"No one is waiting for approval."}),(i||[]).map(u=>f.jsxs("div",{className:"admin-item",children:[f.jsx("span",{className:"ai-main",children:(u.name?u.name+" · ":"")+u.email}),f.jsx(vt,{variant:"primary",onClick:()=>l(u.id,"approve",u.email),children:"Approve"}),f.jsx("button",{className:"ai-del",onClick:()=>l(u.id,"deny",u.email),children:"Deny"})]},u.id))]})]})}function nw({label:e,desc:n,disabled:r,inputProps:i}){return f.jsxs("label",{className:"admin-item toggle",style:r?{opacity:.55}:void 0,children:[f.jsxs("span",{className:"ai-main",children:[f.jsx("div",{className:"tg-label",children:e}),f.jsx("div",{className:"tg-desc",children:n})]}),f.jsx("input",{type:"checkbox",disabled:r,...i})]})}function I$({...e}){return f.jsx(f1,{"data-slot":"select",...e})}function P$({...e}){return f.jsx(g1,{"data-slot":"select-value",...e})}function F$({className:e,size:n="default",children:r,...i}){return f.jsxs(m1,{"data-slot":"select-trigger","data-size":n,className:Je("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...i,children:[r,f.jsx(v1,{asChild:!0,children:f.jsx(Bp,{className:"size-4 opacity-50"})})]})}function V$({className:e,children:n,position:r="item-aligned",align:i="center",...o}){return f.jsx(b1,{children:f.jsxs(x1,{"data-slot":"select-content",className:Je("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,align:i,...o,children:[f.jsx(H$,{}),f.jsx(E1,{className:Je("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),f.jsx(B$,{})]})})}function U$({className:e,children:n,...r}){return f.jsxs(O1,{"data-slot":"select-item",className:Je("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[f.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(N1,{children:f.jsx(m_,{className:"size-4"})})}),f.jsx(A1,{children:n})]})}function H$({className:e,...n}){return f.jsx(D1,{"data-slot":"select-scroll-up-button",className:Je("flex cursor-default items-center justify-center py-1",e),...n,children:f.jsx(fz,{className:"size-4"})})}function B$({className:e,...n}){return f.jsx(z1,{"data-slot":"select-scroll-down-button",className:Je("flex cursor-default items-center justify-center py-1",e),...n,children:f.jsx(Bp,{className:"size-4"})})}const rw=["#5b8def","#f5a623","#4cc38a","#e0679b","#8b7bf0","#3ec8c8","#e6934a"];function pl(e){let n=0;for(const r of e)n=n*31+r.charCodeAt(0)>>>0;return rw[n%rw.length]}function aw({projects:e,currentId:n,menu:r,onNew:i}){const o=e.find(l=>l.id===n);return f.jsxs("nav",{id:"projects","aria-label":"Projects",children:[f.jsxs("div",{className:"nav-head",children:[f.jsx("span",{children:"Projects"}),f.jsx("button",{className:"nav-add",title:"New project","aria-label":"New project",onClick:i,children:"+"})]}),f.jsx("div",{className:"proj-row",children:f.jsxs(I$,{value:n||"",onValueChange:l=>{l&&l!==n&&(Kt("/"+l),mr())},children:[f.jsxs(F$,{id:"project-select","aria-label":`Switch project — current: ${o?.name??"none"}`,title:o?.name,className:"proj-trigger",children:[o&&f.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:pl(o.name)},children:f.jsx(Ls,{name:o.icon})}),o?f.jsx("span",{"data-slot":"select-value",children:o.name}):f.jsx(P$,{placeholder:"Select a project"})]}),f.jsx(V$,{className:"proj-menu",position:"popper",sideOffset:4,children:e.map(l=>f.jsxs(U$,{value:l.id,children:[f.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:pl(l.name)},children:f.jsx(Ls,{name:l.icon})}),l.name]},l.id))})]})}),r&&f.jsx("ul",{className:"nav-menu","aria-label":"Project pages",children:[["dashboard","Dashboard","dashboard",r.onDashboard],["install","Installation","terminal",r.onInstall],["history","History","hist",r.onHistory],["settings","Settings","gear",r.onSettings]].map(([l,u,d,p])=>f.jsx("li",{children:f.jsxs("div",{id:"nav-"+l,className:"row"+(r.active===l?" active":""),role:"button",tabIndex:0,onClick:p,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),p())},children:[f.jsx(ut,{name:d}),f.jsx("span",{className:"label",children:u})]})},l))})]})}function PC({...e}){return f.jsx(BM,{"data-slot":"dropdown-menu",...e})}function FC({...e}){return f.jsx(qM,{"data-slot":"dropdown-menu-trigger",...e})}function VC({className:e,sideOffset:n=4,...r}){return f.jsx(GM,{children:f.jsx(ZM,{"data-slot":"dropdown-menu-content",sideOffset:n,className:Je("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...r})})}function Ds({className:e,inset:n,variant:r="default",...i}){return f.jsx(YM,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":r,className:Je("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",e),...i})}function tm({className:e,inset:n,...r}){return f.jsx(KM,{"data-slot":"dropdown-menu-label","data-inset":n,className:Je("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}const q$="https://github.com/runbear-io/beardrive";function G$(){return f.jsx("svg",{viewBox:"0 0 16 16",className:"gh-mark",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function Z$({me:e,org:n,admin:r,orgActive:i,billing:o}){const l=e.name||e.email,[u,d]=S.useState(!1),p=n?Bs(n.manage_url):null,m=o?Bs(o.url):null;return f.jsxs("footer",{id:"accountbar",children:[f.jsxs("a",{className:"gh-star",href:q$,target:"_blank",rel:"noreferrer",children:[f.jsx(G$,{}),f.jsx("span",{children:"Star on GitHub"}),f.jsx("span",{className:"ext","aria-hidden":"true",children:"↗"}),f.jsx("span",{className:"sr-only",children:" (opens in a new tab)"})]}),f.jsxs(PC,{modal:!1,open:u,onOpenChange:d,children:[f.jsx(FC,{asChild:!0,children:f.jsxs("button",{id:"account-btn",className:i?"active":void 0,"aria-label":"Account menu",children:[f.jsx("span",{className:"avatar",style:{background:pl(e.email)},"aria-hidden":"true",children:(l.trim()[0]||"?").toUpperCase()}),f.jsxs("span",{className:"acct",children:[f.jsx("b",{children:l}),e.name&&f.jsx("small",{children:e.email})]}),f.jsx(ut,{name:"chev"})]})}),f.jsxs(VC,{id:"account-menu",side:"top",align:"start",sideOffset:6,className:"acct-menu",children:[n&&f.jsxs(f.Fragment,{children:[f.jsx(tm,{className:"menu-sec",children:"Organization"}),f.jsx(Ds,{asChild:!0,children:f.jsxs("a",{id:"menu-org-settings","aria-current":i?"page":void 0,...p,onClick:y=>{p?.onClick?.(y),d(!1)},children:[f.jsx(ut,{name:"gear"}),f.jsxs("span",{children:[f.jsx("b",{children:n.name})," Settings"]}),!n.manage_url.startsWith("/")&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"ext","aria-hidden":"true",children:"↗"}),f.jsx("span",{className:"sr-only",children:" (opens in a new tab)"})]})]})}),o&&f.jsx(Ds,{asChild:!0,children:f.jsxs("a",{id:"menu-billing",...m,onClick:y=>{m?.onClick?.(y),d(!1)},children:[f.jsx(ut,{name:"card"}),f.jsx("span",{children:"Billing"}),f.jsx("span",{className:"ps-chip plan-chip",children:o.plan})]})})]}),r&&f.jsxs(f.Fragment,{children:[f.jsx(tm,{className:"menu-sec",children:"Hub"}),f.jsxs(Ds,{id:"menu-hub-admin",onSelect:r.onClick,children:[f.jsx(ut,{name:"shield"}),f.jsxs("span",{children:["Signup & access",r.pending?` · ${r.pending}`:""]})]})]}),f.jsx(tm,{className:"menu-sec",children:"Account"}),f.jsx(Ds,{asChild:!0,children:f.jsxs("a",{id:"signout",href:"/auth/logout",children:[f.jsx(ut,{name:"power"}),f.jsx("span",{children:"Log out"})]})})]})]})]})}function $a({className:e,...n}){return f.jsx("div",{"data-slot":"card",className:Je("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...n})}function Ia({className:e,...n}){return f.jsx("div",{"data-slot":"card-header",className:Je("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...n})}function Pa({className:e,...n}){return f.jsx("div",{"data-slot":"card-title",className:Je("leading-none font-semibold",e),...n})}function Is({className:e,...n}){return f.jsx("div",{"data-slot":"card-description",className:Je("text-muted-foreground text-sm",e),...n})}function Fa({className:e,...n}){return f.jsx("div",{"data-slot":"card-content",className:Je("px-6",e),...n})}function na({className:e,orientation:n="horizontal",decorative:r=!0,...i}){return f.jsx(RN,{"data-slot":"separator",decorative:r,orientation:n,className:Je("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...i})}function K$({url:e}){const n=Pt({queryKey:["billing"],queryFn:()=>Bt(e)});if(n.isLoading)return f.jsx("div",{className:"empty",children:"Loading…"});if(n.error||!n.data)return f.jsxs("div",{className:"empty",children:[f.jsx("h3",{children:"Billing is unavailable"}),f.jsx("p",{children:n.error?.message||"Try again shortly."})]});const r=n.data;return f.jsxs("div",{className:"project-settings",id:"billing-view",children:[f.jsxs("h2",{children:["Billing",f.jsx("span",{className:"ps-chip plan-chip",children:r.plan.name})]}),f.jsxs($a,{children:[f.jsxs(Ia,{children:[f.jsxs(Pa,{children:[r.plan.name," plan",r.plan.status?` (${r.plan.status})`:""]}),f.jsxs(Is,{children:["Organization ",r.org," · ",r.usage.used," of ",r.usage.cap," used · ",r.seats.used," of ",r.seats.cap," ",r.seats.cap===1?"seat":"seats"]})]}),f.jsx(na,{}),f.jsx(Fa,{children:f.jsx("div",{className:"usage-bar",children:f.jsx("div",{style:{width:`${r.usage.pct}%`}})})})]}),r.owner?f.jsx("div",{className:"plan-grid",children:r.plans.map(i=>f.jsxs($a,{children:[f.jsxs(Ia,{children:[f.jsx(Pa,{children:i.name}),f.jsx(Is,{children:i.blurb})]}),f.jsx(na,{}),f.jsxs(Fa,{children:[f.jsxs("p",{className:"plan-price",children:[i.price,f.jsx("small",{children:" / user / month"})]}),f.jsxs("form",{method:"post",action:r.checkout_url,children:[f.jsx("input",{type:"hidden",name:"plan",value:i.id}),f.jsx(vt,{type:"submit",disabled:i.current,variant:i.current?"subtle":"default",children:i.current?"Current plan":`Upgrade to ${i.name}`})]})]})]},i.id))}):f.jsx("p",{className:"muted-note",children:"Only an organization owner can change the plan."}),r.owner&&r.has_customer&&f.jsxs($a,{children:[f.jsxs(Ia,{children:[f.jsx(Pa,{children:"Manage subscription"}),f.jsx(Is,{children:"Change seats, update the card, download invoices, or cancel."})]}),f.jsx(na,{}),f.jsx(Fa,{children:f.jsx("form",{method:"post",action:r.portal_url,children:f.jsx(vt,{type:"submit",variant:"subtle",children:"Open the billing portal"})})})]})]})}function du({className:e,type:n,...r}){return f.jsx("input",{type:n,"data-slot":"input",className:Je("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...r})}function nm({className:e,...n}){return f.jsx(XM,{"data-slot":"label",className:Je("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}function Y$({className:e,...n}){return f.jsx("textarea",{"data-slot":"textarea",className:Je("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...n})}const iw={read:1,write:2,admin:3};function wi(e,n){return(iw[e||""]||0)>=(iw[n]||0)}const Ym=280,Q$=hg({name:uu().trim().min(1,"Give the project a name.").max(120,"Keep the name under 120 characters."),description:uu().max(Ym,`Keep the description under ${Ym} characters.`),icon:uu()});function X$({project:e,org:n,onDeleted:r}){const i=O_(),o=wi(e.perm,"admin"),l=ag({resolver:fg(Q$),defaultValues:{name:e.name,description:e.description??"",icon:e.icon??""}});S.useEffect(()=>{l.reset({name:e.name,description:e.description??"",icon:e.icon??""})},[e.id,e.name,e.description,e.icon]);const u=l.watch("icon"),d=l.watch("description"),p=l.handleSubmit(async m=>{const y=l.formState.dirtyFields,v={};if(y.name&&(v.name=m.name.trim()),y.description&&(v.description=m.description),y.icon&&(v.icon=m.icon),Object.keys(v).length!==0)try{await Wn("PATCH","/api/projects/"+e.id,v),Ke("Saved."),l.reset({...m,name:m.name.trim()}),await i()}catch(b){Ke(b.message,!0)}});return f.jsxs("div",{className:"project-settings",children:[f.jsxs("h2",{children:[e.name,!wi(e.perm,"write")&&f.jsx("span",{className:"ps-chip",children:"Read-only"})]}),f.jsxs($a,{children:[f.jsxs(Ia,{children:[f.jsx(Pa,{children:"General"}),f.jsx(Is,{children:"Name, description and icon for this project."})]}),f.jsx(na,{}),f.jsx(Fa,{children:f.jsxs("form",{className:"ps-form",onSubmit:p,children:[f.jsxs("div",{className:"ps-field",children:[f.jsx(nm,{htmlFor:"ps-icon-btn",children:"Icon"}),f.jsxs("div",{className:"ps-icon-row",children:[f.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:pl(e.name)},children:f.jsx(Ls,{name:u})}),f.jsxs(PC,{children:[f.jsx(FC,{asChild:!0,children:f.jsx(vt,{id:"ps-icon-btn",type:"button",variant:"subtle",disabled:!o,children:"Change"})}),f.jsxs(VC,{align:"start",className:"ps-icon-grid",children:[f.jsx(Ds,{className:"ps-icon-cell"+(u===""?" active":""),title:"Default","aria-label":"Default icon",onSelect:()=>l.setValue("icon","",{shouldDirty:!0}),children:f.jsx(Ls,{})}),Object.keys(Nm).map(m=>f.jsx(Ds,{className:"ps-icon-cell"+(u===m?" active":""),title:m,"aria-label":m,onSelect:()=>l.setValue("icon",m,{shouldDirty:!0}),children:f.jsx(Ls,{name:m})},m))]})]})]})]}),f.jsxs("div",{className:"ps-field",children:[f.jsx(nm,{htmlFor:"ps-name",children:"Name"}),f.jsx(du,{id:"ps-name",disabled:!o,"aria-invalid":!!l.formState.errors.name,"aria-describedby":l.formState.errors.name?"ps-name-err":void 0,...l.register("name")}),l.formState.errors.name&&f.jsx("span",{id:"ps-name-err",role:"alert",className:"field-err",children:l.formState.errors.name.message})]}),f.jsxs("div",{className:"ps-field",children:[f.jsxs(nm,{htmlFor:"ps-desc",children:["Description ",f.jsx("span",{className:"ps-opt",children:"(optional)"})]}),f.jsx(Y$,{id:"ps-desc",rows:2,disabled:!o,placeholder:"What this project is for.","aria-invalid":!!l.formState.errors.description,"aria-describedby":l.formState.errors.description?"ps-desc-err":void 0,...l.register("description")}),f.jsxs("div",{className:"ps-meta",children:[l.formState.errors.description?f.jsx("span",{id:"ps-desc-err",role:"alert",className:"field-err",children:l.formState.errors.description.message}):f.jsx("span",{}),f.jsxs("span",{className:"ps-count",children:[d.length," / ",Ym]})]})]}),o&&f.jsxs(f.Fragment,{children:[f.jsx(na,{}),f.jsx("div",{className:"ps-actions",children:f.jsx(vt,{id:"ps-save",type:"submit",variant:"primary",disabled:!l.formState.isDirty||l.formState.isSubmitting,children:"Save changes"})})]})]})})]}),f.jsx(J$,{project:e}),f.jsx(eI,{project:e,org:n}),f.jsxs($a,{children:[f.jsx(Ia,{children:f.jsx(Pa,{children:"About"})}),f.jsx(na,{}),f.jsx(Fa,{children:f.jsxs("dl",{className:"ps-facts",children:[f.jsx("dt",{children:"Project id"}),f.jsx("dd",{children:f.jsx("code",{children:e.id})}),n&&f.jsxs(f.Fragment,{children:[f.jsx("dt",{children:"Workspace"}),f.jsx("dd",{children:n.name})]}),e.created&&f.jsxs(f.Fragment,{children:[f.jsx("dt",{children:"Created"}),f.jsx("dd",{children:new Date(e.created).toLocaleDateString()})]})]})})]}),o&&f.jsxs($a,{className:"ps-danger",children:[f.jsx(Ia,{children:f.jsx(Pa,{children:"Danger zone"})}),f.jsx(na,{}),f.jsxs(Fa,{children:[f.jsx("p",{children:"Deleting removes the project from this hub. Its files stay in storage. This can't be undone."}),f.jsx(vt,{variant:"danger",onClick:async()=>{if(await R_(`Delete “${e.name}”?`,"This can't be undone. Type the project name to confirm:","","Delete project",{match:e.name,danger:!0})!==null)try{await Wn("DELETE","/api/projects/"+e.id),Ke(`Deleted “${e.name}”.`),await r()}catch(y){Ke(y.message,!0)}},children:"Delete project"})]})]})]})}function J$({project:e}){const n=Ai(),{data:r,error:i,isLoading:o}=j_(e.id);return i?null:f.jsxs($a,{children:[f.jsxs(Ia,{children:[f.jsx(Pa,{children:"Public links"}),f.jsxs(Is,{children:["Files in this project that anyone with the URL can read — no account needed.",(r||[]).some(l=>l.opens!==void 0)&&f.jsxs(f.Fragment,{children:[" ",LC]})]})]}),f.jsx(na,{}),f.jsx(Fa,{children:f.jsx($C,{shares:r||[],loading:o,canRevoke:wi(e.perm,"write"),onChanged:()=>n.invalidateQueries({queryKey:["shares",e.id]}),empty:"No public links."})})]})}const Qm=[{value:"admin",label:"Admin"},{value:"write",label:"Write"},{value:"read",label:"Read"},{value:"none",label:"No access"}],W$=Object.fromEntries(Qm.map(e=>[e.value,e.label]));function eI({project:e,org:n}){const r=Ai(),{data:i,error:o}=O3(e.id),l=wi(e.perm,"admin"),u=()=>{r.invalidateQueries({queryKey:["permissions",e.id]}),r.invalidateQueries({queryKey:["projects"]})},d=async(x,w)=>{try{await x(),Ke(w)}catch(_){Ke(_.message,!0)}u()};if(o||!i)return null;const p=i,m=`/api/p/${e.id}/permissions`,y=new Set((n?.members||[]).filter(x=>x.role==="owner").map(x=>x.email.toLowerCase())),v=[...p.grants.filter(x=>!y.has(x.email.toLowerCase())),...[...y].sort().map(x=>({email:x,level:"admin",owner:!0}))],b=async()=>{const x=await R_("Add an exception","Email of a workspace member. They get Read access; change it in the table.","","Add");x===null||!x.trim()||await d(()=>Wn("PUT",`${m}/${encodeURIComponent(x.trim())}`,{level:"read"}),"Added.")};return f.jsxs($a,{className:"ps-people",children:[f.jsxs(Ia,{children:[f.jsx(Pa,{children:"People"}),f.jsx(Is,{children:"Who can see and change this project."})]}),f.jsx(na,{}),f.jsxs(Fa,{children:[f.jsxs("p",{className:"ps-row",children:[f.jsxs("span",{children:["Everyone in ",n?.name||"this workspace"," can"]}),f.jsx("select",{"aria-label":"Default access for workspace members",disabled:!l,value:p.default,onChange:async x=>{const w=x.target.value;if(w==="none"&&!await Hs("Make this project invite-only?","Only people listed below (and workspace owners) will see this project.","Make invite-only")){u();return}await d(()=>Wn("PUT",m,{default:w}),"Default access updated.")},children:Qm.filter(x=>x.value!=="admin").map(x=>f.jsx("option",{value:x.value,children:x.label},x.value))})]}),p.default==="none"&&f.jsx("p",{className:"ps-note",children:"This project is invite-only: only the people below and workspace owners can see it."}),f.jsxs("div",{className:"ps-people-head",children:[f.jsx("h4",{children:"Exceptions"}),l&&f.jsx(vt,{type:"button",variant:"subtle",onClick:b,children:"+ Add"})]}),v.length===0?f.jsx("p",{className:"ps-note",children:"No exceptions — everyone gets the access above."}):f.jsx("div",{className:"admin-list",children:v.map(x=>{const w="owner"in x;return f.jsxs("div",{className:"admin-item",children:[f.jsxs("span",{className:"ai-main",title:x.email,children:[x.email,p.creator&&x.email.toLowerCase()===p.creator.toLowerCase()&&f.jsx("span",{className:"ai-tag",children:" (creator)"})]}),w?f.jsx("span",{className:"ai-tag",children:"Workspace owner — always admin"}):f.jsxs("span",{className:"role-cell",children:[f.jsx("select",{"aria-label":`Access for ${x.email}`,disabled:!l,value:x.level,onChange:_=>d(()=>Wn("PUT",`${m}/${encodeURIComponent(x.email)}`,{level:_.target.value}),`${x.email} is now ${W$[_.target.value]||_.target.value}.`),children:Qm.map(_=>f.jsx("option",{value:_.value,children:_.label},_.value))}),l&&f.jsx("button",{className:"ai-del","aria-label":`Remove exception for ${x.email}`,onClick:()=>d(()=>Wn("DELETE",`${m}/${encodeURIComponent(x.email)}`),"Reverted to the default access."),children:"Remove"})]})]},x.email)})})]})]})}const UC="https://raw.githubusercontent.com/runbear-io/beardrive/main/INSTALL_FOR_AGENTS.md";function HC({project:e,existing:n}){const r=window.location.origin,i=n?'. I already have a folder of notes — ask me which one to sync (the project is named "':'. Ask me which folder to sync (the project is named "',o="Follow "+UC+` to set up BearDrive project `+e.id+" on "+r+i+e.name+'").',l=`brew install runbear-io/tap/beardrive bdrive login `+r+` -bdrive init --project `+e.id;return f.jsxs("div",{className:"guide",children:[f.jsxs("h1",{className:"in-title gd-head",children:[f.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:pl(e.name)},children:f.jsx(Ls,{name:e.icon})}),e.name]}),e.description&&f.jsx("p",{className:"in-desc",children:e.description}),f.jsxs("div",{className:"gd-body",children:[f.jsx("p",{className:"gd-desc",children:n?"Paste into your coding agent — Claude Code, Cowork, Codex, Gemini CLI, Hermes — in the folder you already have:":"Paste into your coding agent — Claude Code, Cowork, Codex, Gemini CLI, Hermes — in the folder where you want the files:"}),n&&f.jsx("p",{className:"gd-note",children:"Your files stay exactly where they are. Connecting a folder never moves, renames or overwrites anything in it — it uploads what is there and keeps it in sync."}),f.jsx(Xm,{code:o}),f.jsx("p",{className:"gd-desc",children:"The agent installs the CLI, signs this machine in, and registers the sync hooks — asking before anything it changes."}),f.jsx("p",{className:"gd-desc",children:"Runs on macOS and Linux. Windows is not supported yet."}),f.jsxs("details",{className:"gd-manual",children:[f.jsx("summary",{children:"What exactly happens"}),f.jsxs("ul",{className:"gd-desc gd-list",children:[f.jsx("li",{children:"Sign-in uses a device code you approve in this browser — the folder itself never holds credentials."}),f.jsx("li",{children:"Sync hooks pull the latest before every agent turn, push edits seconds after they happen, and stamp each change with the session that made it; agent reads feed Insights. They register once per machine in your agent's own config, so every session is covered and nothing is written into the synced folder."}),f.jsx("li",{children:"Codex hooks are off by default: set [features] codex_hooks = true in ~/.codex/config.toml."})]})]}),f.jsxs("details",{className:"gd-manual",children:[f.jsx("summary",{children:"Or run it yourself"}),f.jsx("p",{className:"gd-desc",children:"Same result, in the folder you want the files. One command: init signs this device in, registers the sync hooks and starts syncing."}),f.jsx(Xm,{code:l}),f.jsx("p",{className:"gd-desc",children:f.jsx("a",{href:"https://docs.beardrive.ai/manual/install/",target:"_blank",rel:"noreferrer",children:"Full manual setup guide →"})})]})]})]})}function Xm({code:e}){const[n,r]=w.useState("Copy");return f.jsxs("pre",{className:"gd-code",children:[f.jsx("code",{children:e}),f.jsx("button",{className:"gd-copy",onClick:async()=>{r(await qs(e)?"Copied":"Copy failed"),setTimeout(()=>r("Copy"),1400)},children:n})]})}function W$({onNew:e,canCreate:n}){return f.jsxs("div",{className:"onboard",children:[f.jsx("h1",{children:"Welcome to BearDrive"}),f.jsx("p",{children:"You're signed in, but you're not part of any project yet."}),n&&f.jsxs("div",{className:"ob-card ob-start",children:[f.jsx("h3",{children:"Start a project"}),f.jsx("p",{children:"Name it and pick what it starts from — a structure, or nothing at all. Then connect a folder on any machine and it stays in sync."}),f.jsx(vt,{variant:"primary",id:"ob-new",onClick:e,children:"New project"})]}),f.jsxs("div",{className:"ob-card ob-agent",children:[f.jsx("h3",{children:n?"Or let your agent do it":"Connect a new drive to your project"}),f.jsx("p",{children:"Paste into your coding agent — Claude Code, Cowork, Codex, Gemini CLI, Hermes — in the folder where you want the files. It creates the project and starts syncing:"}),f.jsx(Xm,{code:"Follow "+UC+` -to set up a new BearDrive project on `+window.location.origin+". Ask me which folder to sync."}),f.jsx("p",{className:"ob-alt",children:f.jsx("a",{href:"https://docs.beardrive.ai/manual/setup-by-hand/",target:"_blank",rel:"noreferrer",children:"Or start a project manually →"})})]})]})}const BC="__existing__";function eI({templates:e,onCreate:n,onClose:r}){const i=[...e.map(x=>({value:x.name,title:x.title,blurb:x.blurb,rule:!1})),{value:BC,title:"I already have a folder",blurb:"nothing is seeded — connect it and your files stay as they are",rule:!0},{value:"",title:"Empty project",blurb:"just the folder",rule:!1}],[o,l]=w.useState(""),[u,d]=w.useState(i[0].value),[p,m]=w.useState(""),[y,v]=w.useState(!1),b=async()=>{if(!y){if(!o.trim()){m("Give it a name.");return}v(!0);try{await n(o.trim(),u)}finally{v(!1)}}};return f.jsx(Ju,{open:!0,onOpenChange:x=>!x&&r(),children:f.jsxs(Wu,{className:"modal",showCloseButton:!1,children:[f.jsx(_l,{asChild:!0,children:f.jsx("h3",{children:"New project"})}),f.jsx("label",{className:"modal-label",htmlFor:"modal-input",children:"Name"}),f.jsx("input",{className:"modal-input",type:"text",autoComplete:"off",id:"modal-input",autoFocus:!0,value:o,"aria-invalid":!!p,"aria-describedby":p?"modal-input-err":void 0,onChange:x=>{l(x.currentTarget.value),p&&m("")},onKeyDown:x=>x.key==="Enter"&&b()}),p&&f.jsx("span",{id:"modal-input-err",role:"alert",className:"field-err",children:p}),i.length>1&&f.jsxs("fieldset",{className:"start-points",children:[f.jsx("legend",{className:"modal-label",children:"Starting point"}),i.map((x,S)=>f.jsxs("label",{className:"start-point"+(u===x.value?" on":"")+(x.rule?" sp-rule":""),children:[f.jsx("input",{type:"radio",name:"template",value:x.value,checked:u===x.value,onChange:()=>d(x.value)}),f.jsxs("span",{className:"sp-text",children:[f.jsxs("span",{className:"sp-title",children:[x.title,S===0&&f.jsx("span",{className:"sp-rec",children:"Recommended"})]}),f.jsx("span",{className:"sp-blurb",children:x.blurb})]})]},x.value))]}),f.jsxs("div",{className:"modal-actions",children:[f.jsx(vt,{variant:"subtle",onClick:r,children:"Cancel"}),f.jsx(vt,{variant:"primary",onClick:b,disabled:y,children:"Create"})]})]})})}function sw(e,n,r){if(!e)return null;if(!r)return e[n]||null;const i={human:0,agent:0,share:0};for(const[o,l]of Object.entries(e))o.startsWith(n+"/")&&(i.human+=l.human||0,i.agent+=l.agent||0,i.share+=l.share||0);return i.human||i.agent||i.share?i:null}function ka(e){return(e.human||0)+(e.agent||0)+(e.share||0)}function Jo(e){const n=ka(e);if(!n)return"";const r=n+(n===1?" read":" reads");if(!e.agent&&!e.share)return r;const i=[];return e.human&&i.push(e.human+" human"),e.agent&&i.push(e.agent+" agent"),e.share&&i.push(e.share+" shared"),r+" ("+i.join(", ")+")"}function tI(e){const n=ka(e);return n?n<3?1:n<10?2:n<30?3:4:0}function nI(e){const n=ka(e);return n?{agent:(e.agent||0)/n,human:(e.human||0)/n,share:(e.share||0)/n}:{agent:0,human:0,share:0}}function rI(e,n){return e?Object.keys(e).filter(r=>!n.has(r)).sort():[]}const aI=7;function iI(e){if(!e.length)return null;let n=e[0],r=e[0];for(const i of e)ir&&(r=i);return{min:n,max:r}}const sI=(e,n)=>n-el.reads-o.reads).slice(0,lI)){const o=i.path.split("/").pop();let l=i.cx+i.r+4,u="start";l+o.length*cI>n.right&&(l=i.cx-i.r-4,u="end");const d=m=>r.every(y=>Math.abs(y.y-m)>=rm);let p=i.cy;for(;p<=n.bottom&&!d(p);)p+=rm;if(p>n.bottom)for(p=i.cy;p>=n.top&&!d(p);)p-=rm;r.push({path:i.path,name:o,x:l,y:Math.min(n.bottom,Math.max(n.top,p)),anchor:u})}return r}function dI(e,n=!0){const r=Pt({queryKey:["tree",e],queryFn:()=>Bt(e+"tree"),enabled:n,refetchInterval:15e3}),i=w.useMemo(()=>{const o=[],l=new Map,u=d=>{for(const p of d.children||[])p.dir?(l.set(p.path,p),u(p)):o.push(p)};return r.data&&u(r.data),{flatFiles:o,dirIndex:l}},[r.data]);return{tree:r.data,...i,loaded:!!r.data}}function fI(e,n){return Pt({queryKey:["heat",e],queryFn:()=>Bt(e+"heat?days=30"),enabled:n,staleTime:6e4,refetchInterval:6e4}).data?.entries??null}function hI(e,n,r){return Pt({queryKey:["history",e,"prefix",n,20],queryFn:()=>Bt(e+"history?prefix="+encodeURIComponent(n)+"&n=20"),enabled:r,staleTime:15e3}).data?.entries??null}function mI(e,n,r){const i=new Array(e);return new Proxy(i,{get(o,l,u){if(typeof l=="string"){const d=l.charCodeAt(0);if(d>=48&&d<=57){const p=+l;if(Number.isInteger(p)&&p>=0&&pi[y]!==m))&&(i=d,o=n(...d),r?.onChange&&!(l&&r.skipInitialOnChange)&&r.onChange(o),l=!1),o}return u.updateDeps=d=>{i=d},u}function ow(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const pI=(e,n)=>Math.abs(e-n)<1.01,gI=(e,n,r)=>{let i;return function(...o){e.clearTimeout(i),i=e.setTimeout(()=>n.apply(this,o),r)}};let Go;const am=()=>{if(Go!==void 0)return Go;if(typeof navigator>"u")return Go=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Go=!0;const e=navigator.maxTouchPoints;return Go=navigator.platform==="MacIntel"&&e!==void 0&&e>0},lw=e=>{const{offsetWidth:n,offsetHeight:r}=e;return{width:n,height:r}},vI=e=>e,yI=e=>{const n=Math.max(e.startIndex-e.overscan,0),i=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,o=new Array(i);for(let l=0;l{const r=e.scrollElement;if(!r)return;const i=e.targetWindow;if(!i)return;const o=u=>{const{width:d,height:p}=u;n({width:Math.round(d),height:Math.round(p)})};if(o(lw(r)),!i.ResizeObserver)return()=>{};const l=new i.ResizeObserver(u=>{const d=()=>{const p=u[0];if(p?.borderBoxSize){const m=p.borderBoxSize[0];if(m){o({width:m.inlineSize,height:m.blockSize});return}}o(lw(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return l.observe(r,{box:"border-box"}),()=>{l.unobserve(r)}},Ou={passive:!0},xI=typeof window>"u"?!0:"onscrollend"in window,wI=(e,n,r)=>{const i=e.scrollElement;if(!i)return;const o=e.targetWindow;if(!o)return;const l=e.options.useScrollendEvent&&xI;let u=0;const d=l?null:gI(o,()=>n(u,!1),e.options.isScrollingResetDelay),p=v=>()=>{u=r(i),d?.(),n(u,v)},m=p(!0),y=p(!1);return i.addEventListener("scroll",m,Ou),l&&i.addEventListener("scrollend",y,Ou),()=>{i.removeEventListener("scroll",m),l&&i.removeEventListener("scrollend",y)}},SI=(e,n)=>wI(e,n,r=>{const{horizontal:i,isRtl:o}=e.options;return i?r.scrollLeft*(o&&-1||1):r.scrollTop}),_I=(e,n,r)=>{if(r.options.useCachedMeasurements){const i=r.indexFromElement(e),o=r.options.getItemKey(i);return r.itemSizeCache.get(o)??r.options.estimateSize(i)}if(n?.borderBoxSize){const i=n.borderBoxSize[0];if(i)return Math.round(i[r.options.horizontal?"inlineSize":"blockSize"])}if(!n){const i=r.indexFromElement(e),o=r.options.getItemKey(i),l=r.itemSizeCache.get(o);if(l!==void 0)return l}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},CI=(e,{adjustments:n=0,behavior:r},i)=>{var o,l;(l=(o=i.scrollElement)==null?void 0:o.scrollTo)==null||l.call(o,{[i.options.horizontal?"left":"top"]:e+n,behavior:r})},EI=CI;class RI{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var r,i,o;return((o=(i=(r=this.targetWindow)==null?void 0:r.performance)==null?void 0:i.now)==null?void 0:o.call(i))??Date.now()},this.observer=(()=>{let r=null;const i=()=>r||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:r=new this.targetWindow.ResizeObserver(o=>{o.forEach(l=>{const u=()=>{const d=l.target,p=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[m,y]of this.elementsCache)if(y===d){this.elementsCache.delete(m);break}return}this.shouldMeasureDuringScroll(p)&&this.resizeItem(p,this.options.measureElement(d,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()})}));return{disconnect:()=>{var o;(o=i())==null||o.disconnect(),r=null},observe:o=>{var l;return(l=i())==null?void 0:l.observe(o,{box:"border-box"})},unobserve:o=>{var l;return(l=i())==null?void 0:l.unobserve(o)}}})(),this.range=null,this.setOptions=r=>{var i,o;const l={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:vI,rangeExtractor:yI,onChange:()=>{},measureElement:_I,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const b in r){const x=r[b];x!==void 0&&(l[b]=x)}const u=this.options;let d=null,p=null,m=!1;if(u!==void 0&&u.enabled&&l.enabled&&l.anchorTo==="end"&&this.scrollElement!==null){const b=u.count,x=l.count,S=this.getMeasurements(),_=b>0?((i=S[0])==null?void 0:i.key)??u.getItemKey(0):null,E=b>0?((o=S[b-1])==null?void 0:o.key)??u.getItemKey(b-1):null;if(x!==b||b>0&&x>0&&(l.getItemKey(0)!==_||l.getItemKey(x-1)!==E)){m=!0;const O=b>0?this.getVirtualItemForOffset(this.getScrollOffset())??S[0]:null;O&&(d=[O.key,this.getScrollOffset()-O.start]);const M=l.followOnAppend===!0?"auto":l.followOnAppend||null;M&&x>b&&this.isAtEnd(u.scrollEndThreshold)&&(b===0||l.getItemKey(x-1)!==E)&&(p=M)}}this.options=l,m&&(this.pendingMin=0,this.itemSizeCacheVersion++);let y=!1,v=0;if(d&&this.scrollOffset!==null){const[b,x]=d,S=this.getMeasurements(),{count:_,getItemKey:E}=this.options;let R=0;for(;R<_&&E(R)!==b;)R++;if(R<_){const T=S[R];if(T){const O=T.start+x;O!==this.scrollOffset&&(v=O-this.scrollOffset,this.scrollOffset=O,y=!0)}}}(y||p)&&(this.pendingScrollAnchor=[y?d[0]:null,y?d[1]:0,p,v])},this.notify=r=>{var i,o;(o=(i=this.options).onChange)==null||o.call(i,this,r)},this.maybeNotify=Ts(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),r=>{this.notify(r)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(r=>r()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var r;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}if(this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((r=this.scrollElement)==null?void 0:r.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,u)=>{if(u&&this._intendedScrollOffset===null&&l===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(l-this._intendedScrollOffset)<1.5&&(l=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=u?d===l?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!am()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};l.addEventListener("touchstart",u,Ou),l.addEventListener("touchend",d,Ou),this.unsubs.push(()=>{l.removeEventListener("touchstart",u),l.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[l,u,d,p]=o;l!==null&&!d&&(am()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?p!==0&&(this._iosDeferredAdjustment+=p):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const r=this.getScrollOffset(),i=this.getMaxScrollOffset();if(r<0||r>i)return;const o=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(r,{adjustments:this.scrollAdjustments+=o,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Ts(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(r,i,o,l,u,d,p,m)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:r,paddingStart:i,scrollMargin:o,getItemKey:l,enabled:u,lanes:d,laneAssignmentMode:p,gap:m}),{key:!1}),this.getMeasurements=Ts(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:r,paddingStart:i,scrollMargin:o,getItemKey:l,enabled:u,lanes:d,laneAssignmentMode:p,gap:m},y)=>{const v=this.itemSizeCache;if(!u)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>r)for(const R of this.laneAssignments.keys())R>=r&&this.laneAssignments.delete(R);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(R=>{this.itemSizeCache.set(R.key,R.size)}));const b=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===r&&(this.lanesSettling=!1),d===1){const R=r*2;let T=this._flatMeasurements;if(!T||T.length0&&D.set(T.subarray(0,b*2)),T=D,this._flatMeasurements=T}let O;if(b===0)O=i+o;else{const D=b-1;O=T[D*2]+T[D*2+1]+m}for(let D=b;D1){M=O;const be=S[M],he=be!==void 0?x[be]:void 0;D=he?he.end+m:i+o}else if(E===d){let be=0,he=_[0],ue=S[0];for(let X=1;Xthis.options.debug}),this.calculateRange=Ts(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(r,i,o,l)=>r.length===0||i===0?(this.range=null,null):(this.range=TI(r,i,o,l,l===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ts(()=>{let r=null,i=null;const o=this.calculateRange();return o&&(r=o.startIndex,i=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,r,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,r,i]},(r,i,o,l,u)=>l===null||u===null?[]:r({startIndex:l,endIndex:u,overscan:i,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=r=>{const i=this.options.indexAttribute,o=r.getAttribute(i);return o?parseInt(o,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=r=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(o!==void 0&&this.range){const l=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),u=Math.max(0,o-l),d=Math.min(this.options.count-1,o+l);return r>=u&&r<=d}return!0},this.measureElement=r=>{if(!r){this.elementsCache.forEach((u,d)=>{u.isConnected||(this.observer.unobserve(u),this.elementsCache.delete(d))});return}const i=this.indexFromElement(r),o=this.options.getItemKey(i),l=this.elementsCache.get(o);l!==r&&(l&&this.observer.unobserve(l),this.observer.observe(r),this.elementsCache.set(o,r)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(r,void 0,this))},this.resizeItem=(r,i)=>{var o,l;if(r<0||r>=this.options.count)return;let u,d,p;const m=this._flatMeasurements;if(this.options.lanes===1&&m!==null)p=this.options.getItemKey(r),d=m[r*2],u=m[r*2+1];else{const b=this.measurementsCache[r];if(!b)return;p=b.key,d=b.start,u=b.size}const y=this.itemSizeCache.get(p)??u,v=i-y;if(v!==0){const b=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,x=b?this.getTotalSize():0,S=((l=this.scrollState)==null?void 0:l.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[r]??{index:r,key:p,start:d,size:u,end:d+u,lane:0},v,this):d[this.getVirtualIndexes(),this.getMeasurements()],(r,i)=>{const o=[];for(let l=0,u=r.length;lthis.options.debug}),this.getVirtualItemForOffset=r=>{const i=this.getMeasurements();if(i.length===0)return;const o=this._flatMeasurements,l=this.options.lanes===1&&o!=null,u=qC(0,i.length-1,l?d=>o[d*2]:d=>ow(i[d]).start,r);return ow(i[u])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const r=this.scrollElement.document.documentElement;return this.options.horizontal?r.scrollWidth-this.scrollElement.innerWidth:r.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(r=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=r,this.getOffsetForAlignment=(r,i,o=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),u=this.getScrollOffset();i==="auto"&&(i=r>=u+l?"end":"start"),i==="center"?r+=(o-l)/2:i==="end"&&(r-=l);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,r),0)},this.getOffsetForIndex=(r,i="auto")=>{r=Math.max(0,Math.min(r,this.options.count-1));const o=this.getSize(),l=this.getScrollOffset(),u=this.measurementsCache[r];if(!u)return;if(i==="auto")if(u.end>=l+o-this.options.scrollPaddingEnd)i="end";else if(u.start<=l+this.options.scrollPaddingStart)i="start";else return[l,i];if(i==="end"&&r===this.options.count-1)return[this.getMaxScrollOffset(),i];const d=i==="end"?u.end+this.options.scrollPaddingEnd:u.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,i,u.size),i]},this.scrollToOffset=(r,{align:i="start",behavior:o="auto"}={})=>{const l=this.getOffsetForAlignment(r,i),u=this.now();this.scrollState={index:null,align:i,behavior:o,startedAt:u,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(r,{align:i="auto",behavior:o="auto"}={})=>{r=Math.max(0,Math.min(r,this.options.count-1));const l=this.getOffsetForIndex(r,i);if(!l)return;const[u,d]=l,p=this.now();this.scrollState={index:r,align:d,behavior:o,startedAt:p,lastTargetOffset:u,stableFrames:0},this._scrollToOffset(u,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(r,{behavior:i="auto"}={})=>{const o=this.getScrollOffset()+r,l=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:r="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:r});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:r})},this.getTotalSize=()=>{var r;const i=this.getMeasurements();let o;if(i.length===0)o=this.options.paddingStart;else if(this.options.lanes===1){const l=i.length-1,u=this._flatMeasurements;u!=null?o=u[l*2]+u[l*2+1]:o=((r=i[l])==null?void 0:r.end)??0}else{const l=Array(this.options.lanes).fill(null);let u=i.length-1;for(;u>=0&&l.some(d=>d===null);){const d=i[u];l[d.lane]===null&&(l[d.lane]=d.end),u--}o=Math.max(...l.filter(d=>d!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const r=[];if(this.itemSizeCache.size===0)return r;const i=this.getMeasurements();for(const o of i)o&&this.itemSizeCache.has(o.key)&&r.push({index:o.index,key:o.key,start:o.start,size:o.size,end:o.end,lane:o.lane});return r},this._scrollToOffset=(r,{adjustments:i,behavior:o})=>{this._intendedScrollOffset=r+(i??0),this.options.scrollToFn(r,{behavior:o,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,r){n!==0&&(am()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=n:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:r}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=i?i[0]:this.scrollState.lastTargetOffset,l=1,u=o!==this.scrollState.lastTargetOffset;if(!u&&pI(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,u){const d=this.getSize()||600,p=Math.abs(o-this.getScrollOffset()),m=this.scrollState.behavior==="smooth"&&p>d;this.scrollState.lastTargetOffset=o,m||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:m?"smooth":"auto"})}this.scheduleScrollReconcile()}}const qC=(e,n,r,i)=>{for(;e<=n;){const o=(e+n)/2|0,l=r(o);if(li)n=o-1;else return o}return e>0?e-1:0};function jI(e,n,r){let i=0;for(;i<=n;){const o=(i+n)/2|0,l=e[o*2];if(lr)n=o-1;else return o}return i>0?i-1:0}function TI(e,n,r,i,o){const l=e.length-1;if(e.length<=i)return{startIndex:0,endIndex:l};if(i===1&&o!==null){const m=jI(o,l,r);let y=m;const v=r+n;for(;ye[m].start,r),p=d;if(i===1)for(;p1){const m=Array(i).fill(0);for(;pv=0&&y.some(v=>v>=r);){const v=e[d];y[v.lane]=v.start,d--}d=Math.max(0,d-d%i),p=Math.min(l,p+(i-1-p%i))}return{startIndex:d,endIndex:p}}const im=typeof document<"u"?w.useLayoutEffect:w.useEffect;function OI({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:r="transform",...i}){const o=w.useReducer(m=>m+1,0)[1],l=w.useRef({enabled:n,mode:r,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});l.current.enabled=n,l.current.mode=r;const u=m=>{const y=l.current;if(!y.enabled||!y.container)return;const v=m.getTotalSize();if(v!==y.lastSize){y.lastSize=v;const R=m.options.horizontal?"width":"height";y.container.style[R]=`${v}px`}const b=!!m.options.horizontal,x=y.mode==="transform",S=b?"left":"top",_=m.options.scrollMargin,E=m.getVirtualItems();for(const R of E){const T=R.start-_,O=m.elementsCache.get(R.key);O&&y.lastPositions.get(O)!==T&&(y.lastPositions.set(O,T),x?O.style.transform=b?`translate3d(${T}px, 0, 0)`:`translate3d(0, ${T}px, 0)`:O.style[S]=`${T}px`)}},d={...i,onChange:(m,y)=>{var v;const b=l.current;let x=!0;if(b.enabled){u(m);const S=m.range,_=b.prevRange;x=!_||_.isScrolling!==m.isScrolling||_.startIndex!==S?.startIndex||_.endIndex!==S?.endIndex,x&&(b.prevRange=S?{startIndex:S.startIndex,endIndex:S.endIndex,isScrolling:m.isScrolling}:null)}x&&(e&&y?Mi.flushSync(o):o()),(v=i.onChange)==null||v.call(i,m,y)}},[p]=w.useState(()=>{const m=new RI(d);return Object.assign(m,{containerRef:y=>{const v=l.current;if(v.container=y,v.lastSize=null,y&&v.enabled){const b=m.getTotalSize();v.lastSize=b;const x=m.options.horizontal?"width":"height";y.style[x]=`${b}px`}}})});return p.setOptions(d),im(()=>p._didMount(),[]),im(()=>p._willUpdate()),im(()=>{u(p)}),p}function AI(e){return OI({observeElementRect:bI,observeElementOffset:SI,scrollToFn:EI,...e})}function MI(e,n){const r=[],i=(o,l)=>{for(const u of o)r.push({node:u,depth:l}),u.dir&&n.has(u.path)&&i(u.children||[],l+1)};return i(e?.children||[],0),r}function NI(e){const{root:n,expanded:r,onToggle:i,currentPath:o,listingShowing:l,onOpen:u}=e,d=w.useRef(null),p=w.useMemo(()=>MI(n,r),[n,r]),m=AI({count:p.length,getScrollElement:()=>d.current,estimateSize:()=>window.matchMedia("(max-width: 768px)").matches?44:28,overscan:12,getItemKey:y=>p[y].node.path});return w.useEffect(()=>{if(!o)return;const y=p.findIndex(v=>v.node.path===o);y>=0&&m.scrollToIndex(y,{align:"auto"})},[o,p]),f.jsx("nav",{id:"tree","aria-label":"Files",ref:d,children:f.jsx("div",{style:{height:m.getTotalSize(),position:"relative"},children:m.getVirtualItems().map(y=>{const{node:v,depth:b}=p[y.index],x=v.dir?r.has(v.path):!1,S=()=>{if(v.dir&&o===v.path&&l){i(v.path);return}u(v.path),v.dir||mr()};return f.jsxs("div",{className:"row "+(v.dir?"dir":"file")+(o===v.path?" active":"")+(v.dir&&!x?" collapsed":""),"data-path":v.path,tabIndex:0,role:"button",title:v.name,"aria-expanded":v.dir?x:void 0,style:{position:"absolute",top:0,left:0,right:0,transform:`translateY(${y.start}px)`,paddingLeft:8+b*13},onClick:S,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),S())},children:[Array.from({length:b},(_,E)=>f.jsx("span",{className:"tguide",style:{left:8+E*13+5},"aria-hidden":"true"},E)),f.jsx("span",{className:"chev",onClick:_=>{v.dir&&(_.stopPropagation(),i(v.path))},children:f.jsx(ut,{name:"chevd"})}),f.jsx("span",{className:"ticon",children:f.jsx(ut,{name:v.dir?"folder":"doc"})}),f.jsx("span",{className:"label",children:v.name})]},y.key)})})})}function DI(e){const n=e.split("/"),r=[];let i="";for(let o=0;o{i=i?i+"/"+o:o;const u=i,d=l===r.length-1;return f.jsxs("span",{children:[l>0&&f.jsx("span",{className:"crumb-sep",children:"/"}),d?f.jsx("span",{children:o}):f.jsx("span",{className:"crumb-seg",title:u,onClick:()=>n(u),children:o})]},u)})})}function cw(e){if(e==="")return[];const n=e.split(` -`);return n[n.length-1]===""&&n.pop(),n}const kI=4e6;function LI(e,n){let r=0;for(;ro.push({op:"-",line:l[v],an:r+v+1}),y=v=>o.push({op:"+",line:u[v],bn:r+v+1});if(d*p>kI){for(let v=0;v=0;S--)for(let _=p-1;_>=0;_--)v[S][_]=l[S]===u[_]?v[S+1][_+1]+1:Math.max(v[S+1][_],v[S][_+1]);let b=0,x=0;for(;b=v[b][x+1]?m(b++):y(x++);for(;bi.op==="+").length,del:r.filter(i=>i.op==="-").length}}const GC=1<<20,II=8192;function PI(e){if(e.byteLength>GC)return{kind:"too-large",size:e.byteLength};if(e.subarray(0,II).includes(0))return{kind:"binary"};try{return{kind:"text",text:new TextDecoder("utf-8",{fatal:!0}).decode(e)}}catch{return{kind:"binary"}}}function Jm(e,n,r,i){let o=e+"blob?sha="+encodeURIComponent(n);return r&&(o+="&name="+encodeURIComponent(r)),i&&(o+="&download=1"),o}async function FI(e){const n=await gj(e),r=Number(n.headers.get("Content-Length"));return r>GC?{kind:"too-large",size:r}:PI(new Uint8Array(await n.arrayBuffer()))}function ZC(e,n,r,i){return Pt({queryKey:n,queryFn:()=>FI(e),enabled:r,...i?{staleTime:1/0,gcTime:1/0}:{},retry:!1})}function uw(e,n,r){return ZC(n?Jm(e,n):"",["blob",e,n],!!n,!0)}function VI(e){return e.slice(e.lastIndexOf("/")+1)}function UI({apiBase:e,path:n,prev:r,cur:i}){const o=VI(n);return f.jsxs("span",{className:"dv-dl",children:[f.jsx("a",{href:Jm(e,r,o,!0),children:"download previous"}),f.jsx("a",{href:Jm(e,i,o,!0),children:"download this version"})]})}function HI({apiBase:e,path:n,prev:r,cur:i}){const o=uw(e,r),l=uw(e,i),u=o.data?.kind==="text"&&l.data?.kind==="text",d=w.useMemo(()=>o.data?.kind==="text"&&l.data?.kind==="text"?$I(o.data.text,l.data.text):null,[o.data,l.data]);if(o.error||l.error)return f.jsx("div",{className:"dv dv-msg",children:"Could not load one of the versions."});if(!o.data||!l.data)return f.jsx("div",{className:"dv dv-msg",children:"Loading changes…"});if(!u){const v=o.data.kind==="too-large"||l.data.kind==="too-large";return f.jsxs("div",{className:"dv dv-msg",children:[v?"Too large to diff — download to compare.":"Binary file — no diff available.",f.jsx(UI,{apiBase:e,path:n,prev:r,cur:i})]})}const{lines:p,add:m,del:y}=d;return f.jsxs("div",{className:"dv",children:[f.jsxs("div",{className:"dv-head",children:[f.jsxs("span",{className:"dv-stat",children:[f.jsxs("span",{className:"dv-add",children:["+",m]})," ",f.jsxs("span",{className:"dv-del",children:["−",y]})]}),m===0&&y===0&&f.jsx("span",{className:"dv-same",children:"No line changes"})]}),f.jsx("div",{className:"dv-body",children:p.map((v,b)=>f.jsxs("div",{className:"dv-line dv-"+(v.op==="="?"ctx":v.op==="+"?"ins":"rm"),children:[f.jsx("span",{className:"dv-n",children:v.an??""}),f.jsx("span",{className:"dv-n",children:v.bn??""}),f.jsx("span",{className:"dv-mark",children:v.op==="="?" ":v.op}),f.jsx("span",{className:"dv-text",children:v.line||" "})]},b))})]})}const BI={add:"added",edit:"edited",delete:"deleted"};function KC({text:e}){return f.jsx(f.Fragment,{children:e.split(/(https?:\/\/\S+)/).map((n,r)=>/^https?:\/\//.test(n)?f.jsx("a",{href:n,target:"_blank",rel:"noopener",children:n},r):n)})}function pg({entry:e,apiBase:n,onOpen:r,diff:i,restore:o,remove:l,restoreSha:u,inRun:d,read:p}){const[m,y]=w.useState(!1),[v,b]=w.useState(!1),x=e.kind==="put"?"edit":e.kind,S=dd(e),_=[e.device.name||e.device.id,e.device.os].filter(Boolean).join(" · "),E=x!=="delete",R=!!i&&x!=="delete"&&!!e.blob,T=!!d&&x==="add",O=!!o&&!!u&&!T,M=!!l&&T,D=!!o?.busy&&o.busy===e.path+u,P=!!l?.busy&&l.busy===e.path,F=E&&!!e.blob,V=e.path.split("/").pop()||e.path,ve=new Date(e.time).toLocaleString(),be=n+"blob?sha="+e.blob+"&name="+encodeURIComponent(V)+"&download=1",he=()=>b(!v),ue=X=>{X.target.tagName!=="A"&&E&&r(e.path,e.blob)};return f.jsxs("div",{className:"hentry "+x+(E?" clickable":""),tabIndex:E?0:void 0,role:E?"button":void 0,onClick:ue,onKeyDown:X=>{E&&(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),r(e.path,e.blob))},children:[f.jsxs("div",{className:"hline",children:[f.jsx("span",{className:"hkind",children:BI[x]||x}),p&&f.jsx("span",{className:"hread",title:"This run read this file before changing it",children:"read"}),f.jsx("span",{className:"hpath",children:e.path}),f.jsx("span",{className:"htime",children:ve})]}),f.jsxs("div",{className:"hmeta",children:[f.jsx("span",{className:"hwho",children:S}),f.jsx("span",{className:"hdev",children:_}),f.jsx("span",{className:"hsize",children:e.size?mg(e.size):""}),O&&f.jsxs("button",{type:"button",className:"hrestore-btn",disabled:D,title:"Put this version of "+e.path+" back as a new change",onClick:X=>{X.stopPropagation(),o.onRestore(e.path,u)},onKeyDown:X=>X.stopPropagation(),children:[f.jsx(ut,{name:"hist"}),D?"restoring…":"restore"]}),M&&f.jsxs("button",{type:"button",className:"hremove-btn",disabled:P,title:"Remove "+e.path+" — this run created it",onClick:X=>{X.stopPropagation(),l.onRemove(e.path)},onKeyDown:X=>X.stopPropagation(),children:[f.jsx(ut,{name:"trash"}),P?"removing…":"undo — remove file"]})]}),e.note&&!d&&f.jsx("div",{className:"hnote"+(m?" open":""),tabIndex:0,role:"button",title:m?"Collapse note":"Show full note","aria-expanded":m,onClick:X=>{X.stopPropagation(),X.target.tagName!=="A"&&y(!m)},onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),X.stopPropagation(),y(!m))},children:f.jsx(KC,{text:e.note})}),(R||F)&&f.jsxs("div",{className:"hactions",children:[R&&(i.prev?f.jsxs("button",{type:"button",className:"hdiff-btn"+(v?" open":""),"aria-expanded":v,onClick:X=>{X.stopPropagation(),he()},onKeyDown:X=>X.stopPropagation(),children:[f.jsx(ut,{name:v?"chevd":"chev"}),v?"hide changes":"show changes"]}):f.jsx("div",{className:"hdiff-none",children:"First version — nothing to compare against"})),F&&f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"hver-btn","aria-label":`Open ${V} as of ${ve}`,onClick:X=>{X.stopPropagation(),r(e.path,e.blob)},onKeyDown:X=>X.stopPropagation(),children:[f.jsx(ut,{name:"clock"}),"Open this version"]}),f.jsxs("a",{className:"hver-btn",download:!0,href:be,"aria-label":`Download ${V} as of ${ve}`,onClick:X=>X.stopPropagation(),onKeyDown:X=>{X.stopPropagation(),X.key===" "&&(X.preventDefault(),X.currentTarget.click())},children:[f.jsx(ut,{name:"download"}),"Download"]})]})]}),R&&i.prev&&v&&f.jsx("div",{onClick:X=>X.stopPropagation(),children:f.jsx(HI,{apiBase:i.apiBase,path:e.path,prev:i.prev,cur:e.blob})})]})}function qI(e){const{node:n,heatMap:r,onOpen:i}=e,o=(n.children||[]).slice().sort((m,y)=>Number(y.dir||!1)-Number(m.dir||!1)||m.name.localeCompare(y.name)),l=o.filter(m=>m.dir).length,u=o.length-l,d=[];l&&d.push(l+(l===1?" folder":" folders")),u&&d.push(u+(u===1?" file":" files"));const p=sw(r,n.path,!0);return p&&d.push(Jo(p)+" in 30 days"),f.jsxs("div",{className:"dirlist",children:[f.jsxs("h1",{className:"dl-title",children:[f.jsx("span",{className:"dl-title-icon",children:f.jsx(ut,{name:"folder"})}),f.jsx("span",{children:n.name})]}),f.jsx("p",{className:"dl-sub",children:d.join(" · ")||"Empty folder"}),o.length===0?f.jsx("div",{className:"dl-empty",children:"Nothing in this folder yet."}):f.jsx("div",{className:"dl-items",children:o.map(m=>{let y="";if(m.dir){const b=(m.children||[]).length;y=b+(b===1?" item":" items")}else y=[m.size?mg(m.size):"",m.time?new Date(m.time).toLocaleDateString():""].filter(Boolean).join(" · ");const v=sw(r,m.path,!!m.dir);return v&&(y=Jo(v)+(y?" · "+y:"")),f.jsxs("div",{className:"dl-row",tabIndex:0,role:"button",title:m.path,onClick:()=>i(m.path),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),i(m.path))},children:[f.jsx("span",{className:"ticon",children:f.jsx(ut,{name:m.dir?"folder":"doc"})}),f.jsx("span",{className:"dl-name",children:m.name}),v&&f.jsx("span",{className:"heatdot lvl"+tI(v),role:"img","aria-label":Jo(v)+" in 30 days",title:Jo(v)+" in 30 days"}),f.jsx("span",{className:"dl-meta",children:y})]},m.path)})}),e.hub&&f.jsx(GI,{apiBase:e.apiBase,prefix:n.path+"/",onOpen:i,onFullHistory:()=>e.onFullHistory(n.path+"/"),onRendered:e.onRendered})]})}function GI(e){const n=hI(e.apiBase,e.prefix,!0),{onRendered:r}=e;return w.useEffect(()=>{n&&n.length&&r&&r()},[n,r]),!n||n.length===0?null:f.jsxs("div",{className:"dl-history",children:[f.jsx("h3",{className:"dl-h3",children:"Recent changes"}),f.jsx("div",{className:"history dl-hlist",children:n.map((i,o)=>f.jsx(pg,{entry:i,apiBase:e.apiBase,onOpen:e.onOpen},o))}),f.jsx("button",{className:"ai-btn dl-more",onClick:e.onFullHistory,children:"Full history"})]})}const YC=5e3;function ZI(e,n,r=YC){const i=[];let o=[],l="",u=!1,d=0;const p=()=>{o.push(l),l="",i.length{r(await qs(e)?"Copied":"Copy failed"),setTimeout(()=>r("Copy"),1400)},children:n})]})}function tI({onNew:e,canCreate:n}){return f.jsxs("div",{className:"onboard",children:[f.jsx("h1",{children:"Welcome to BearDrive"}),f.jsx("p",{children:"You're signed in, but you're not part of any project yet."}),n&&f.jsxs("div",{className:"ob-card ob-start",children:[f.jsx("h3",{children:"Start a project"}),f.jsx("p",{children:"Name it and pick what it starts from — a structure, or nothing at all. Then connect a folder on any machine and it stays in sync."}),f.jsx(vt,{variant:"primary",id:"ob-new",onClick:e,children:"New project"})]}),f.jsxs("div",{className:"ob-card ob-agent",children:[f.jsx("h3",{children:n?"Or let your agent do it":"Connect a new drive to your project"}),f.jsx("p",{children:"Paste into your coding agent — Claude Code, Cowork, Codex, Gemini CLI, Hermes — in the folder where you want the files. It creates the project and starts syncing:"}),f.jsx(Xm,{code:"Follow "+UC+` +to set up a new BearDrive project on `+window.location.origin+". Ask me which folder to sync."}),f.jsx("p",{className:"ob-alt",children:f.jsx("a",{href:"https://docs.beardrive.ai/manual/setup-by-hand/",target:"_blank",rel:"noreferrer",children:"Or start a project manually →"})})]})]})}const BC="__existing__";function nI({templates:e,onCreate:n,onClose:r}){const i=[...e.map(x=>({value:x.name,title:x.title,blurb:x.blurb,rule:!1})),{value:BC,title:"I already have a folder",blurb:"nothing is seeded — connect it and your files stay as they are",rule:!0},{value:"",title:"Empty project",blurb:"just the folder",rule:!1}],[o,l]=S.useState(""),[u,d]=S.useState(i[0].value),[p,m]=S.useState(""),[y,v]=S.useState(!1),b=async()=>{if(!y){if(!o.trim()){m("Give it a name.");return}v(!0);try{await n(o.trim(),u)}finally{v(!1)}}};return f.jsx(Ju,{open:!0,onOpenChange:x=>!x&&r(),children:f.jsxs(Wu,{className:"modal",showCloseButton:!1,children:[f.jsx(_l,{asChild:!0,children:f.jsx("h3",{children:"New project"})}),f.jsx("label",{className:"modal-label",htmlFor:"modal-input",children:"Name"}),f.jsx("input",{className:"modal-input",type:"text",autoComplete:"off",id:"modal-input",autoFocus:!0,value:o,"aria-invalid":!!p,"aria-describedby":p?"modal-input-err":void 0,onChange:x=>{l(x.currentTarget.value),p&&m("")},onKeyDown:x=>x.key==="Enter"&&b()}),p&&f.jsx("span",{id:"modal-input-err",role:"alert",className:"field-err",children:p}),i.length>1&&f.jsxs("fieldset",{className:"start-points",children:[f.jsx("legend",{className:"modal-label",children:"Starting point"}),i.map((x,w)=>f.jsxs("label",{className:"start-point"+(u===x.value?" on":"")+(x.rule?" sp-rule":""),children:[f.jsx("input",{type:"radio",name:"template",value:x.value,checked:u===x.value,onChange:()=>d(x.value)}),f.jsxs("span",{className:"sp-text",children:[f.jsxs("span",{className:"sp-title",children:[x.title,w===0&&f.jsx("span",{className:"sp-rec",children:"Recommended"})]}),f.jsx("span",{className:"sp-blurb",children:x.blurb})]})]},x.value))]}),f.jsxs("div",{className:"modal-actions",children:[f.jsx(vt,{variant:"subtle",onClick:r,children:"Cancel"}),f.jsx(vt,{variant:"primary",onClick:b,disabled:y,children:"Create"})]})]})})}function sw(e,n,r){if(!e)return null;if(!r)return e[n]||null;const i={human:0,agent:0,share:0};for(const[o,l]of Object.entries(e))o.startsWith(n+"/")&&(i.human+=l.human||0,i.agent+=l.agent||0,i.share+=l.share||0);return i.human||i.agent||i.share?i:null}function ka(e){return(e.human||0)+(e.agent||0)+(e.share||0)}function Jo(e){const n=ka(e);if(!n)return"";const r=n+(n===1?" read":" reads");if(!e.agent&&!e.share)return r;const i=[];return e.human&&i.push(e.human+" human"),e.agent&&i.push(e.agent+" agent"),e.share&&i.push(e.share+" shared"),r+" ("+i.join(", ")+")"}function rI(e){const n=ka(e);return n?n<3?1:n<10?2:n<30?3:4:0}function aI(e){const n=ka(e);return n?{agent:(e.agent||0)/n,human:(e.human||0)/n,share:(e.share||0)/n}:{agent:0,human:0,share:0}}function iI(e,n){return e?Object.keys(e).filter(r=>!n.has(r)).sort():[]}const sI=7;function oI(e){if(!e.length)return null;let n=e[0],r=e[0];for(const i of e)ir&&(r=i);return{min:n,max:r}}const lI=(e,n)=>n-el.reads-o.reads).slice(0,uI)){const o=i.path.split("/").pop();let l=i.cx+i.r+4,u="start";l+o.length*dI>n.right&&(l=i.cx-i.r-4,u="end");const d=m=>r.every(y=>Math.abs(y.y-m)>=rm);let p=i.cy;for(;p<=n.bottom&&!d(p);)p+=rm;if(p>n.bottom)for(p=i.cy;p>=n.top&&!d(p);)p-=rm;r.push({path:i.path,name:o,x:l,y:Math.min(n.bottom,Math.max(n.top,p)),anchor:u})}return r}function hI(e,n=!0){const r=Pt({queryKey:["tree",e],queryFn:()=>Bt(e+"tree"),enabled:n,refetchInterval:15e3}),i=S.useMemo(()=>{const o=[],l=new Map,u=d=>{for(const p of d.children||[])p.dir?(l.set(p.path,p),u(p)):o.push(p)};return r.data&&u(r.data),{flatFiles:o,dirIndex:l}},[r.data]);return{tree:r.data,...i,loaded:!!r.data}}function mI(e,n){return Pt({queryKey:["heat",e],queryFn:()=>Bt(e+"heat?days=30"),enabled:n,staleTime:6e4,refetchInterval:6e4}).data?.entries??null}function pI(e,n,r){return Pt({queryKey:["history",e,"prefix",n,20],queryFn:()=>Bt(e+"history?prefix="+encodeURIComponent(n)+"&n=20"),enabled:r,staleTime:15e3}).data?.entries??null}function gI(e,n,r){const i=new Array(e);return new Proxy(i,{get(o,l,u){if(typeof l=="string"){const d=l.charCodeAt(0);if(d>=48&&d<=57){const p=+l;if(Number.isInteger(p)&&p>=0&&pi[y]!==m))&&(i=d,o=n(...d),r?.onChange&&!(l&&r.skipInitialOnChange)&&r.onChange(o),l=!1),o}return u.updateDeps=d=>{i=d},u}function ow(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const vI=(e,n)=>Math.abs(e-n)<1.01,yI=(e,n,r)=>{let i;return function(...o){e.clearTimeout(i),i=e.setTimeout(()=>n.apply(this,o),r)}};let Go;const am=()=>{if(Go!==void 0)return Go;if(typeof navigator>"u")return Go=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Go=!0;const e=navigator.maxTouchPoints;return Go=navigator.platform==="MacIntel"&&e!==void 0&&e>0},lw=e=>{const{offsetWidth:n,offsetHeight:r}=e;return{width:n,height:r}},bI=e=>e,xI=e=>{const n=Math.max(e.startIndex-e.overscan,0),i=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,o=new Array(i);for(let l=0;l{const r=e.scrollElement;if(!r)return;const i=e.targetWindow;if(!i)return;const o=u=>{const{width:d,height:p}=u;n({width:Math.round(d),height:Math.round(p)})};if(o(lw(r)),!i.ResizeObserver)return()=>{};const l=new i.ResizeObserver(u=>{const d=()=>{const p=u[0];if(p?.borderBoxSize){const m=p.borderBoxSize[0];if(m){o({width:m.inlineSize,height:m.blockSize});return}}o(lw(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return l.observe(r,{box:"border-box"}),()=>{l.unobserve(r)}},Ou={passive:!0},SI=typeof window>"u"?!0:"onscrollend"in window,_I=(e,n,r)=>{const i=e.scrollElement;if(!i)return;const o=e.targetWindow;if(!o)return;const l=e.options.useScrollendEvent&&SI;let u=0;const d=l?null:yI(o,()=>n(u,!1),e.options.isScrollingResetDelay),p=v=>()=>{u=r(i),d?.(),n(u,v)},m=p(!0),y=p(!1);return i.addEventListener("scroll",m,Ou),l&&i.addEventListener("scrollend",y,Ou),()=>{i.removeEventListener("scroll",m),l&&i.removeEventListener("scrollend",y)}},CI=(e,n)=>_I(e,n,r=>{const{horizontal:i,isRtl:o}=e.options;return i?r.scrollLeft*(o&&-1||1):r.scrollTop}),EI=(e,n,r)=>{if(r.options.useCachedMeasurements){const i=r.indexFromElement(e),o=r.options.getItemKey(i);return r.itemSizeCache.get(o)??r.options.estimateSize(i)}if(n?.borderBoxSize){const i=n.borderBoxSize[0];if(i)return Math.round(i[r.options.horizontal?"inlineSize":"blockSize"])}if(!n){const i=r.indexFromElement(e),o=r.options.getItemKey(i),l=r.itemSizeCache.get(o);if(l!==void 0)return l}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},RI=(e,{adjustments:n=0,behavior:r},i)=>{var o,l;(l=(o=i.scrollElement)==null?void 0:o.scrollTo)==null||l.call(o,{[i.options.horizontal?"left":"top"]:e+n,behavior:r})},jI=RI;class TI{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var r,i,o;return((o=(i=(r=this.targetWindow)==null?void 0:r.performance)==null?void 0:i.now)==null?void 0:o.call(i))??Date.now()},this.observer=(()=>{let r=null;const i=()=>r||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:r=new this.targetWindow.ResizeObserver(o=>{o.forEach(l=>{const u=()=>{const d=l.target,p=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[m,y]of this.elementsCache)if(y===d){this.elementsCache.delete(m);break}return}this.shouldMeasureDuringScroll(p)&&this.resizeItem(p,this.options.measureElement(d,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()})}));return{disconnect:()=>{var o;(o=i())==null||o.disconnect(),r=null},observe:o=>{var l;return(l=i())==null?void 0:l.observe(o,{box:"border-box"})},unobserve:o=>{var l;return(l=i())==null?void 0:l.unobserve(o)}}})(),this.range=null,this.setOptions=r=>{var i,o;const l={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:bI,rangeExtractor:xI,onChange:()=>{},measureElement:EI,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const b in r){const x=r[b];x!==void 0&&(l[b]=x)}const u=this.options;let d=null,p=null,m=!1;if(u!==void 0&&u.enabled&&l.enabled&&l.anchorTo==="end"&&this.scrollElement!==null){const b=u.count,x=l.count,w=this.getMeasurements(),_=b>0?((i=w[0])==null?void 0:i.key)??u.getItemKey(0):null,E=b>0?((o=w[b-1])==null?void 0:o.key)??u.getItemKey(b-1):null;if(x!==b||b>0&&x>0&&(l.getItemKey(0)!==_||l.getItemKey(x-1)!==E)){m=!0;const O=b>0?this.getVirtualItemForOffset(this.getScrollOffset())??w[0]:null;O&&(d=[O.key,this.getScrollOffset()-O.start]);const M=l.followOnAppend===!0?"auto":l.followOnAppend||null;M&&x>b&&this.isAtEnd(u.scrollEndThreshold)&&(b===0||l.getItemKey(x-1)!==E)&&(p=M)}}this.options=l,m&&(this.pendingMin=0,this.itemSizeCacheVersion++);let y=!1,v=0;if(d&&this.scrollOffset!==null){const[b,x]=d,w=this.getMeasurements(),{count:_,getItemKey:E}=this.options;let R=0;for(;R<_&&E(R)!==b;)R++;if(R<_){const T=w[R];if(T){const O=T.start+x;O!==this.scrollOffset&&(v=O-this.scrollOffset,this.scrollOffset=O,y=!0)}}}(y||p)&&(this.pendingScrollAnchor=[y?d[0]:null,y?d[1]:0,p,v])},this.notify=r=>{var i,o;(o=(i=this.options).onChange)==null||o.call(i,this,r)},this.maybeNotify=Ts(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),r=>{this.notify(r)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(r=>r()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var r;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}if(this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((r=this.scrollElement)==null?void 0:r.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,u)=>{if(u&&this._intendedScrollOffset===null&&l===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(l-this._intendedScrollOffset)<1.5&&(l=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=u?d===l?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!am()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};l.addEventListener("touchstart",u,Ou),l.addEventListener("touchend",d,Ou),this.unsubs.push(()=>{l.removeEventListener("touchstart",u),l.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[l,u,d,p]=o;l!==null&&!d&&(am()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?p!==0&&(this._iosDeferredAdjustment+=p):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const r=this.getScrollOffset(),i=this.getMaxScrollOffset();if(r<0||r>i)return;const o=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(r,{adjustments:this.scrollAdjustments+=o,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Ts(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(r,i,o,l,u,d,p,m)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:r,paddingStart:i,scrollMargin:o,getItemKey:l,enabled:u,lanes:d,laneAssignmentMode:p,gap:m}),{key:!1}),this.getMeasurements=Ts(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:r,paddingStart:i,scrollMargin:o,getItemKey:l,enabled:u,lanes:d,laneAssignmentMode:p,gap:m},y)=>{const v=this.itemSizeCache;if(!u)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>r)for(const R of this.laneAssignments.keys())R>=r&&this.laneAssignments.delete(R);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(R=>{this.itemSizeCache.set(R.key,R.size)}));const b=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===r&&(this.lanesSettling=!1),d===1){const R=r*2;let T=this._flatMeasurements;if(!T||T.length0&&D.set(T.subarray(0,b*2)),T=D,this._flatMeasurements=T}let O;if(b===0)O=i+o;else{const D=b-1;O=T[D*2]+T[D*2+1]+m}for(let D=b;D1){M=O;const be=w[M],he=be!==void 0?x[be]:void 0;D=he?he.end+m:i+o}else if(E===d){let be=0,he=_[0],ue=w[0];for(let X=1;Xthis.options.debug}),this.calculateRange=Ts(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(r,i,o,l)=>r.length===0||i===0?(this.range=null,null):(this.range=AI(r,i,o,l,l===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ts(()=>{let r=null,i=null;const o=this.calculateRange();return o&&(r=o.startIndex,i=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,r,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,r,i]},(r,i,o,l,u)=>l===null||u===null?[]:r({startIndex:l,endIndex:u,overscan:i,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=r=>{const i=this.options.indexAttribute,o=r.getAttribute(i);return o?parseInt(o,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=r=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(o!==void 0&&this.range){const l=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),u=Math.max(0,o-l),d=Math.min(this.options.count-1,o+l);return r>=u&&r<=d}return!0},this.measureElement=r=>{if(!r){this.elementsCache.forEach((u,d)=>{u.isConnected||(this.observer.unobserve(u),this.elementsCache.delete(d))});return}const i=this.indexFromElement(r),o=this.options.getItemKey(i),l=this.elementsCache.get(o);l!==r&&(l&&this.observer.unobserve(l),this.observer.observe(r),this.elementsCache.set(o,r)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(r,void 0,this))},this.resizeItem=(r,i)=>{var o,l;if(r<0||r>=this.options.count)return;let u,d,p;const m=this._flatMeasurements;if(this.options.lanes===1&&m!==null)p=this.options.getItemKey(r),d=m[r*2],u=m[r*2+1];else{const b=this.measurementsCache[r];if(!b)return;p=b.key,d=b.start,u=b.size}const y=this.itemSizeCache.get(p)??u,v=i-y;if(v!==0){const b=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,x=b?this.getTotalSize():0,w=((l=this.scrollState)==null?void 0:l.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[r]??{index:r,key:p,start:d,size:u,end:d+u,lane:0},v,this):d[this.getVirtualIndexes(),this.getMeasurements()],(r,i)=>{const o=[];for(let l=0,u=r.length;lthis.options.debug}),this.getVirtualItemForOffset=r=>{const i=this.getMeasurements();if(i.length===0)return;const o=this._flatMeasurements,l=this.options.lanes===1&&o!=null,u=qC(0,i.length-1,l?d=>o[d*2]:d=>ow(i[d]).start,r);return ow(i[u])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const r=this.scrollElement.document.documentElement;return this.options.horizontal?r.scrollWidth-this.scrollElement.innerWidth:r.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(r=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=r,this.getOffsetForAlignment=(r,i,o=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),u=this.getScrollOffset();i==="auto"&&(i=r>=u+l?"end":"start"),i==="center"?r+=(o-l)/2:i==="end"&&(r-=l);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,r),0)},this.getOffsetForIndex=(r,i="auto")=>{r=Math.max(0,Math.min(r,this.options.count-1));const o=this.getSize(),l=this.getScrollOffset(),u=this.measurementsCache[r];if(!u)return;if(i==="auto")if(u.end>=l+o-this.options.scrollPaddingEnd)i="end";else if(u.start<=l+this.options.scrollPaddingStart)i="start";else return[l,i];if(i==="end"&&r===this.options.count-1)return[this.getMaxScrollOffset(),i];const d=i==="end"?u.end+this.options.scrollPaddingEnd:u.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,i,u.size),i]},this.scrollToOffset=(r,{align:i="start",behavior:o="auto"}={})=>{const l=this.getOffsetForAlignment(r,i),u=this.now();this.scrollState={index:null,align:i,behavior:o,startedAt:u,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(r,{align:i="auto",behavior:o="auto"}={})=>{r=Math.max(0,Math.min(r,this.options.count-1));const l=this.getOffsetForIndex(r,i);if(!l)return;const[u,d]=l,p=this.now();this.scrollState={index:r,align:d,behavior:o,startedAt:p,lastTargetOffset:u,stableFrames:0},this._scrollToOffset(u,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(r,{behavior:i="auto"}={})=>{const o=this.getScrollOffset()+r,l=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:r="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:r});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:r})},this.getTotalSize=()=>{var r;const i=this.getMeasurements();let o;if(i.length===0)o=this.options.paddingStart;else if(this.options.lanes===1){const l=i.length-1,u=this._flatMeasurements;u!=null?o=u[l*2]+u[l*2+1]:o=((r=i[l])==null?void 0:r.end)??0}else{const l=Array(this.options.lanes).fill(null);let u=i.length-1;for(;u>=0&&l.some(d=>d===null);){const d=i[u];l[d.lane]===null&&(l[d.lane]=d.end),u--}o=Math.max(...l.filter(d=>d!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const r=[];if(this.itemSizeCache.size===0)return r;const i=this.getMeasurements();for(const o of i)o&&this.itemSizeCache.has(o.key)&&r.push({index:o.index,key:o.key,start:o.start,size:o.size,end:o.end,lane:o.lane});return r},this._scrollToOffset=(r,{adjustments:i,behavior:o})=>{this._intendedScrollOffset=r+(i??0),this.options.scrollToFn(r,{behavior:o,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,r){n!==0&&(am()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=n:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:r}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=i?i[0]:this.scrollState.lastTargetOffset,l=1,u=o!==this.scrollState.lastTargetOffset;if(!u&&vI(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,u){const d=this.getSize()||600,p=Math.abs(o-this.getScrollOffset()),m=this.scrollState.behavior==="smooth"&&p>d;this.scrollState.lastTargetOffset=o,m||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:m?"smooth":"auto"})}this.scheduleScrollReconcile()}}const qC=(e,n,r,i)=>{for(;e<=n;){const o=(e+n)/2|0,l=r(o);if(li)n=o-1;else return o}return e>0?e-1:0};function OI(e,n,r){let i=0;for(;i<=n;){const o=(i+n)/2|0,l=e[o*2];if(lr)n=o-1;else return o}return i>0?i-1:0}function AI(e,n,r,i,o){const l=e.length-1;if(e.length<=i)return{startIndex:0,endIndex:l};if(i===1&&o!==null){const m=OI(o,l,r);let y=m;const v=r+n;for(;ye[m].start,r),p=d;if(i===1)for(;p1){const m=Array(i).fill(0);for(;pv=0&&y.some(v=>v>=r);){const v=e[d];y[v.lane]=v.start,d--}d=Math.max(0,d-d%i),p=Math.min(l,p+(i-1-p%i))}return{startIndex:d,endIndex:p}}const im=typeof document<"u"?S.useLayoutEffect:S.useEffect;function MI({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:r="transform",...i}){const o=S.useReducer(m=>m+1,0)[1],l=S.useRef({enabled:n,mode:r,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});l.current.enabled=n,l.current.mode=r;const u=m=>{const y=l.current;if(!y.enabled||!y.container)return;const v=m.getTotalSize();if(v!==y.lastSize){y.lastSize=v;const R=m.options.horizontal?"width":"height";y.container.style[R]=`${v}px`}const b=!!m.options.horizontal,x=y.mode==="transform",w=b?"left":"top",_=m.options.scrollMargin,E=m.getVirtualItems();for(const R of E){const T=R.start-_,O=m.elementsCache.get(R.key);O&&y.lastPositions.get(O)!==T&&(y.lastPositions.set(O,T),x?O.style.transform=b?`translate3d(${T}px, 0, 0)`:`translate3d(0, ${T}px, 0)`:O.style[w]=`${T}px`)}},d={...i,onChange:(m,y)=>{var v;const b=l.current;let x=!0;if(b.enabled){u(m);const w=m.range,_=b.prevRange;x=!_||_.isScrolling!==m.isScrolling||_.startIndex!==w?.startIndex||_.endIndex!==w?.endIndex,x&&(b.prevRange=w?{startIndex:w.startIndex,endIndex:w.endIndex,isScrolling:m.isScrolling}:null)}x&&(e&&y?Mi.flushSync(o):o()),(v=i.onChange)==null||v.call(i,m,y)}},[p]=S.useState(()=>{const m=new TI(d);return Object.assign(m,{containerRef:y=>{const v=l.current;if(v.container=y,v.lastSize=null,y&&v.enabled){const b=m.getTotalSize();v.lastSize=b;const x=m.options.horizontal?"width":"height";y.style[x]=`${b}px`}}})});return p.setOptions(d),im(()=>p._didMount(),[]),im(()=>p._willUpdate()),im(()=>{u(p)}),p}function NI(e){return MI({observeElementRect:wI,observeElementOffset:CI,scrollToFn:jI,...e})}function DI(e,n){const r=[],i=(o,l)=>{for(const u of o)r.push({node:u,depth:l}),u.dir&&n.has(u.path)&&i(u.children||[],l+1)};return i(e?.children||[],0),r}function zI(e){const{root:n,expanded:r,onToggle:i,currentPath:o,listingShowing:l,onOpen:u}=e,d=S.useRef(null),p=S.useMemo(()=>DI(n,r),[n,r]),m=NI({count:p.length,getScrollElement:()=>d.current,estimateSize:()=>window.matchMedia("(max-width: 768px)").matches?44:28,overscan:12,getItemKey:y=>p[y].node.path});return S.useEffect(()=>{if(!o)return;const y=p.findIndex(v=>v.node.path===o);y>=0&&m.scrollToIndex(y,{align:"auto"})},[o,p]),f.jsx("nav",{id:"tree","aria-label":"Files",ref:d,children:f.jsx("div",{style:{height:m.getTotalSize(),position:"relative"},children:m.getVirtualItems().map(y=>{const{node:v,depth:b}=p[y.index],x=v.dir?r.has(v.path):!1,w=()=>{if(v.dir&&o===v.path&&l){i(v.path);return}u(v.path),v.dir||mr()};return f.jsxs("div",{className:"row "+(v.dir?"dir":"file")+(o===v.path?" active":"")+(v.dir&&!x?" collapsed":""),"data-path":v.path,tabIndex:0,role:"button",title:v.name,"aria-expanded":v.dir?x:void 0,style:{position:"absolute",top:0,left:0,right:0,transform:`translateY(${y.start}px)`,paddingLeft:8+b*13},onClick:w,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),w())},children:[Array.from({length:b},(_,E)=>f.jsx("span",{className:"tguide",style:{left:8+E*13+5},"aria-hidden":"true"},E)),f.jsx("span",{className:"chev",onClick:_=>{v.dir&&(_.stopPropagation(),i(v.path))},children:f.jsx(ut,{name:"chevd"})}),f.jsx("span",{className:"ticon",children:f.jsx(ut,{name:v.dir?"folder":"doc"})}),f.jsx("span",{className:"label",children:v.name})]},y.key)})})})}function kI(e){const n=e.split("/"),r=[];let i="";for(let o=0;o{i=i?i+"/"+o:o;const u=i,d=l===r.length-1;return f.jsxs("span",{children:[l>0&&f.jsx("span",{className:"crumb-sep",children:"/"}),d?f.jsx("span",{children:o}):f.jsx("span",{className:"crumb-seg",title:u,onClick:()=>n(u),children:o})]},u)})})}function cw(e){if(e==="")return[];const n=e.split(` +`);return n[n.length-1]===""&&n.pop(),n}const $I=4e6;function II(e,n){let r=0;for(;ro.push({op:"-",line:l[v],an:r+v+1}),y=v=>o.push({op:"+",line:u[v],bn:r+v+1});if(d*p>$I){for(let v=0;v=0;w--)for(let _=p-1;_>=0;_--)v[w][_]=l[w]===u[_]?v[w+1][_+1]+1:Math.max(v[w+1][_],v[w][_+1]);let b=0,x=0;for(;b=v[b][x+1]?m(b++):y(x++);for(;bi.op==="+").length,del:r.filter(i=>i.op==="-").length}}const GC=1<<20,FI=8192;function VI(e){if(e.byteLength>GC)return{kind:"too-large",size:e.byteLength};if(e.subarray(0,FI).includes(0))return{kind:"binary"};try{return{kind:"text",text:new TextDecoder("utf-8",{fatal:!0}).decode(e)}}catch{return{kind:"binary"}}}function Jm(e,n,r,i){let o=e+"blob?sha="+encodeURIComponent(n);return r&&(o+="&name="+encodeURIComponent(r)),i&&(o+="&download=1"),o}async function UI(e){const n=await yj(e),r=Number(n.headers.get("Content-Length"));return r>GC?{kind:"too-large",size:r}:VI(new Uint8Array(await n.arrayBuffer()))}function ZC(e,n,r,i){return Pt({queryKey:n,queryFn:()=>UI(e),enabled:r,...i?{staleTime:1/0,gcTime:1/0}:{},retry:!1})}function uw(e,n,r){return ZC(n?Jm(e,n):"",["blob",e,n],!!n,!0)}function HI(e){return e.slice(e.lastIndexOf("/")+1)}function BI({apiBase:e,path:n,prev:r,cur:i}){const o=HI(n);return f.jsxs("span",{className:"dv-dl",children:[f.jsx("a",{href:Jm(e,r,o,!0),children:"download previous"}),f.jsx("a",{href:Jm(e,i,o,!0),children:"download this version"})]})}function qI({apiBase:e,path:n,prev:r,cur:i}){const o=uw(e,r),l=uw(e,i),u=o.data?.kind==="text"&&l.data?.kind==="text",d=S.useMemo(()=>o.data?.kind==="text"&&l.data?.kind==="text"?PI(o.data.text,l.data.text):null,[o.data,l.data]);if(o.error||l.error)return f.jsx("div",{className:"dv dv-msg",children:"Could not load one of the versions."});if(!o.data||!l.data)return f.jsx("div",{className:"dv dv-msg",children:"Loading changes…"});if(!u){const v=o.data.kind==="too-large"||l.data.kind==="too-large";return f.jsxs("div",{className:"dv dv-msg",children:[v?"Too large to diff — download to compare.":"Binary file — no diff available.",f.jsx(BI,{apiBase:e,path:n,prev:r,cur:i})]})}const{lines:p,add:m,del:y}=d;return f.jsxs("div",{className:"dv",children:[f.jsxs("div",{className:"dv-head",children:[f.jsxs("span",{className:"dv-stat",children:[f.jsxs("span",{className:"dv-add",children:["+",m]})," ",f.jsxs("span",{className:"dv-del",children:["−",y]})]}),m===0&&y===0&&f.jsx("span",{className:"dv-same",children:"No line changes"})]}),f.jsx("div",{className:"dv-body",children:p.map((v,b)=>f.jsxs("div",{className:"dv-line dv-"+(v.op==="="?"ctx":v.op==="+"?"ins":"rm"),children:[f.jsx("span",{className:"dv-n",children:v.an??""}),f.jsx("span",{className:"dv-n",children:v.bn??""}),f.jsx("span",{className:"dv-mark",children:v.op==="="?" ":v.op}),f.jsx("span",{className:"dv-text",children:v.line||" "})]},b))})]})}const GI={add:"added",edit:"edited",delete:"deleted"};function KC({text:e}){return f.jsx(f.Fragment,{children:e.split(/(https?:\/\/\S+)/).map((n,r)=>/^https?:\/\//.test(n)?f.jsx("a",{href:n,target:"_blank",rel:"noopener",children:n},r):n)})}function pg({entry:e,apiBase:n,onOpen:r,diff:i,restore:o,remove:l,restoreSha:u,inRun:d,read:p}){const[m,y]=S.useState(!1),[v,b]=S.useState(!1),x=e.kind==="put"?"edit":e.kind,w=dd(e),_=[e.device.name||e.device.id,e.device.os].filter(Boolean).join(" · "),E=x!=="delete",R=!!i&&x!=="delete"&&!!e.blob,T=!!d&&x==="add",O=!!o&&!!u&&!T,M=!!l&&T,D=!!o?.busy&&o.busy===e.path+u,P=!!l?.busy&&l.busy===e.path,F=E&&!!e.blob,V=e.path.split("/").pop()||e.path,ve=new Date(e.time).toLocaleString(),be=n+"blob?sha="+e.blob+"&name="+encodeURIComponent(V)+"&download=1",he=()=>b(!v),ue=X=>{X.target.tagName!=="A"&&E&&r(e.path,e.blob)};return f.jsxs("div",{className:"hentry "+x+(E?" clickable":""),tabIndex:E?0:void 0,role:E?"button":void 0,onClick:ue,onKeyDown:X=>{E&&(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),r(e.path,e.blob))},children:[f.jsxs("div",{className:"hline",children:[f.jsx("span",{className:"hkind",children:GI[x]||x}),p&&f.jsx("span",{className:"hread",title:"This run read this file before changing it",children:"read"}),f.jsx("span",{className:"hpath",children:e.path}),f.jsx("span",{className:"htime",children:ve})]}),f.jsxs("div",{className:"hmeta",children:[f.jsx("span",{className:"hwho",children:w}),f.jsx("span",{className:"hdev",children:_}),f.jsx("span",{className:"hsize",children:e.size?mg(e.size):""}),O&&f.jsxs("button",{type:"button",className:"hrestore-btn",disabled:D,title:"Put this version of "+e.path+" back as a new change",onClick:X=>{X.stopPropagation(),o.onRestore(e.path,u)},onKeyDown:X=>X.stopPropagation(),children:[f.jsx(ut,{name:"hist"}),D?"restoring…":"restore"]}),M&&f.jsxs("button",{type:"button",className:"hremove-btn",disabled:P,title:"Remove "+e.path+" — this run created it",onClick:X=>{X.stopPropagation(),l.onRemove(e.path)},onKeyDown:X=>X.stopPropagation(),children:[f.jsx(ut,{name:"trash"}),P?"removing…":"undo — remove file"]})]}),e.note&&!d&&f.jsx("div",{className:"hnote"+(m?" open":""),tabIndex:0,role:"button",title:m?"Collapse note":"Show full note","aria-expanded":m,onClick:X=>{X.stopPropagation(),X.target.tagName!=="A"&&y(!m)},onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),X.stopPropagation(),y(!m))},children:f.jsx(KC,{text:e.note})}),(R||F)&&f.jsxs("div",{className:"hactions",children:[R&&(i.prev?f.jsxs("button",{type:"button",className:"hdiff-btn"+(v?" open":""),"aria-expanded":v,onClick:X=>{X.stopPropagation(),he()},onKeyDown:X=>X.stopPropagation(),children:[f.jsx(ut,{name:v?"chevd":"chev"}),v?"hide changes":"show changes"]}):f.jsx("div",{className:"hdiff-none",children:"First version — nothing to compare against"})),F&&f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"hver-btn","aria-label":`Open ${V} as of ${ve}`,onClick:X=>{X.stopPropagation(),r(e.path,e.blob)},onKeyDown:X=>X.stopPropagation(),children:[f.jsx(ut,{name:"clock"}),"Open this version"]}),f.jsxs("a",{className:"hver-btn",download:!0,href:be,"aria-label":`Download ${V} as of ${ve}`,onClick:X=>X.stopPropagation(),onKeyDown:X=>{X.stopPropagation(),X.key===" "&&(X.preventDefault(),X.currentTarget.click())},children:[f.jsx(ut,{name:"download"}),"Download"]})]})]}),R&&i.prev&&v&&f.jsx("div",{onClick:X=>X.stopPropagation(),children:f.jsx(qI,{apiBase:i.apiBase,path:e.path,prev:i.prev,cur:e.blob})})]})}function ZI(e){const{node:n,heatMap:r,onOpen:i}=e,o=(n.children||[]).slice().sort((m,y)=>Number(y.dir||!1)-Number(m.dir||!1)||m.name.localeCompare(y.name)),l=o.filter(m=>m.dir).length,u=o.length-l,d=[];l&&d.push(l+(l===1?" folder":" folders")),u&&d.push(u+(u===1?" file":" files"));const p=sw(r,n.path,!0);return p&&d.push(Jo(p)+" in 30 days"),f.jsxs("div",{className:"dirlist",children:[f.jsxs("h1",{className:"dl-title",children:[f.jsx("span",{className:"dl-title-icon",children:f.jsx(ut,{name:"folder"})}),f.jsx("span",{children:n.name})]}),f.jsx("p",{className:"dl-sub",children:d.join(" · ")||"Empty folder"}),o.length===0?f.jsx("div",{className:"dl-empty",children:"Nothing in this folder yet."}):f.jsx("div",{className:"dl-items",children:o.map(m=>{let y="";if(m.dir){const b=(m.children||[]).length;y=b+(b===1?" item":" items")}else y=[m.size?mg(m.size):"",m.time?new Date(m.time).toLocaleDateString():""].filter(Boolean).join(" · ");const v=sw(r,m.path,!!m.dir);return v&&(y=Jo(v)+(y?" · "+y:"")),f.jsxs("div",{className:"dl-row",tabIndex:0,role:"button",title:m.path,onClick:()=>i(m.path),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),i(m.path))},children:[f.jsx("span",{className:"ticon",children:f.jsx(ut,{name:m.dir?"folder":"doc"})}),f.jsx("span",{className:"dl-name",children:m.name}),v&&f.jsx("span",{className:"heatdot lvl"+rI(v),role:"img","aria-label":Jo(v)+" in 30 days",title:Jo(v)+" in 30 days"}),f.jsx("span",{className:"dl-meta",children:y})]},m.path)})}),e.hub&&f.jsx(KI,{apiBase:e.apiBase,prefix:n.path+"/",onOpen:i,onFullHistory:()=>e.onFullHistory(n.path+"/"),onRendered:e.onRendered})]})}function KI(e){const n=pI(e.apiBase,e.prefix,!0),{onRendered:r}=e;return S.useEffect(()=>{n&&n.length&&r&&r()},[n,r]),!n||n.length===0?null:f.jsxs("div",{className:"dl-history",children:[f.jsx("h3",{className:"dl-h3",children:"Recent changes"}),f.jsx("div",{className:"history dl-hlist",children:n.map((i,o)=>f.jsx(pg,{entry:i,apiBase:e.apiBase,onOpen:e.onOpen},o))}),f.jsx("button",{className:"ai-btn dl-more",onClick:e.onFullHistory,children:"Full history"})]})}const YC=5e3;function YI(e,n,r=YC){const i=[];let o=[],l="",u=!1,d=0;const p=()=>{o.push(l),l="",i.length()=>o(""),[r,o]),b$.test(r)?f.jsx(XI,{...e}):OC.test(r)?f.jsx("iframe",{className:"htmlview",sandbox:"allow-scripts",src:l,title:r,onLoad:e.onRendered}):AC.test(r)?f.jsx("iframe",{className:"pdfview",src:l,title:r,onLoad:e.onRendered}):x$.test(r)?f.jsx(eP,{src:l,alt:r,version:i,onRendered:e.onRendered}):w$.test(r)?f.jsx(dw,{...e,fileURL:l,delim:/\.tsv$/i.test(r)?" ":","}):S$.test(r)?f.jsx(dw,{...e,fileURL:l}):f.jsx(YI,{...e,fileURL:l})}function YI(e){const{apiBase:n,path:r,version:i,fileURL:o,onRendered:l}=e,{data:u,error:d}=ZC(o,["text",o],!0,!!i);return w.useEffect(()=>{u&&l?.()},[u,l]),d?f.jsx(fd,{version:i,err:d}):u?u.kind==="text"?f.jsx("pre",{className:"plain",children:u.text},r):f.jsx(QI,{apiBase:n,path:r,version:i,fileURL:o,children:u.kind==="too-large"?`Too large to preview (${mg(u.size)}).`:"No preview for this file type."}):null}function QI(e){const{apiBase:n,path:r,version:i,fileURL:o}=e;return f.jsxs("div",{className:"filecard",children:[f.jsx("div",{className:"name",children:r.split("/").pop()}),f.jsx("p",{children:e.children}),f.jsx("a",{className:"btn",download:!0,href:i?o+"&download=1":n+"download?path="+encodeURIComponent(r),children:"Download"})]})}function XI(e){const{apiBase:n,path:r,version:i,heatMap:o,flatFiles:l,onOpenFile:u,onMeta:d,onRendered:p}=e,{data:m,error:y}=Pt({queryKey:["render",n,r,i||""],queryFn:()=>Bt(n+"render?path="+encodeURIComponent(r)+(i?"&sha="+i:"")),retry:i?!1:void 0}),v=w.useMemo(()=>m?WI(m.html,r,n):"",[m,r,n]);return w.useEffect(()=>{if(!m)return;const b=[];(m.user_name||m.user||m.author)&&b.push(dd(m)+(m.device?" on "+m.device:"")),m.time&&b.push(new Date(m.time).toLocaleString());const x=i?null:o&&o[m.path];x&&ka(x)&&b.push(Jo(x)+" / 30d"),d(b.join(" · ")),p?.()},[m,i,o,d,p]),y?f.jsx(fd,{version:i,err:y}):m?f.jsx("div",{dangerouslySetInnerHTML:{__html:v},onClick:b=>JI(b,r,l,u)}):null}function JI(e,n,r,i){const o=e.target.closest("a");if(!o||!e.currentTarget.contains(o))return;const l=o.getAttribute("href")||"",u=n.includes("/")?n.slice(0,n.lastIndexOf("/")):"";l.startsWith("wiki:")?(e.preventDefault(),nP(decodeURIComponent(l.slice(5)),r,i)):/^([a-z]+:|\/|#)/i.test(l)||(e.preventDefault(),i(MC(u,decodeURIComponent(l))))}function WI(e,n,r){const i=n.includes("/")?n.slice(0,n.lastIndexOf("/")):"",o=u=>r+"file?path="+encodeURIComponent(u),l=new DOMParser().parseFromString(e,"text/html");for(const u of l.querySelectorAll("img")){const d=u.getAttribute("src")||"";/^\s*data:image\/svg/i.test(d)?u.removeAttribute("src"):/^([a-z]+:|\/)/i.test(d)||u.setAttribute("src",o(MC(i,d)))}for(const u of l.querySelectorAll("a")){const d=u.getAttribute("href")||"";/^\s*data:/i.test(d)?u.removeAttribute("href"):/^https?:/i.test(d)&&(u.setAttribute("target","_blank"),u.setAttribute("rel","noopener"))}return l.body.innerHTML}function eP(e){const[n,r]=w.useState(!1);return n?f.jsx(fd,{version:e.version,err:new Error("could not be loaded")}):f.jsx("img",{src:e.src,alt:e.alt,onLoad:e.onRendered,onError:()=>r(!0)})}function fd({version:e,err:n}){return f.jsx("div",{className:"empty",children:e?"That version isn't available.":"Could not load file: "+n.message})}function dw(e){const{path:n,version:r,fileURL:i,delim:o,onRendered:l}=e,{data:u,error:d}=Pt({queryKey:["text",i],queryFn:async()=>{const m=await fetch(i);if(!m.ok)throw new Error(await m.text());return m.text()},retry:r?!1:void 0});w.useEffect(()=>{u!=null&&l?.()},[u,l]);const p=w.useMemo(()=>o&&u!=null?ZI(u,o,YC):null,[u,o]);return d?f.jsx(fd,{version:r,err:d}):u==null?null:p?f.jsx(tP,{csv:p},n):f.jsx("pre",{className:"plain",children:u},n)}function tP({csv:e}){const[n,...r]=e.rows,i=e.rows.reduce((l,u)=>Math.max(l,u.length),0),o=Array.from({length:i},(l,u)=>u);return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"csvbox",children:f.jsxs("table",{className:"csvview",children:[f.jsx("thead",{children:f.jsx("tr",{children:o.map(l=>f.jsx("th",{children:n[l]??""},l))})}),f.jsx("tbody",{children:r.map((l,u)=>f.jsx("tr",{children:o.map(d=>f.jsx("td",{children:l[d]??""},d))},u))})]})}),e.truncated>0&&f.jsxs("p",{className:"csvnote",children:["showing ",e.rows.length.toLocaleString()," of"," ",(e.rows.length+e.truncated).toLocaleString()," rows — Download for the rest"]})]})}function nP(e,n,r){const i=e.toLowerCase(),o=n.find(l=>l.path.toLowerCase()===i||l.path.toLowerCase()===i+".md")||n.find(l=>{const u=l.name.toLowerCase();return u===i||u===i+".md"});o&&r(o.path)}const rP=[{value:"",label:"Never"},{value:"24h",label:"In 24 hours"},{value:"168h",label:"In 7 days"},{value:"720h",label:"In 30 days"}];function aP({url:e,copied:n,onClose:r}){const i=e.split("/s/")[1],[o,l]=w.useState(""),[u,d]=w.useState(),[p,m]=w.useState(!1),y=w.useRef(null);async function v(b){const x=o;l(b),m(!0);try{const S=await Wn("PATCH","/api/shares/"+i,{expires_in:b});d(S.expires)}catch(S){Ke(S.message,!0),l(x)}finally{m(!1)}}return f.jsx(Ju,{open:!0,onOpenChange:b=>!b&&r(),children:f.jsxs(Wu,{className:"modal",showCloseButton:!1,onOpenAutoFocus:b=>{b.preventDefault(),y.current?.focus()},children:[f.jsx(_l,{asChild:!0,children:f.jsx("h3",{children:"Public link"})}),f.jsxs("p",{children:[f.jsx("b",{children:"Anyone with this link can view this file"})," — no account needed. It always shows the latest version until it expires or you revoke it."]}),f.jsx("div",{className:"modal-url",children:e}),f.jsxs("div",{className:"modal-expiry",children:[f.jsx("label",{htmlFor:"share-expiry",children:"Expires"}),f.jsx("select",{id:"share-expiry",value:o,disabled:p,onChange:b=>v(b.target.value),children:rP.map(b=>f.jsx("option",{value:b.value,children:b.label},b.value))}),f.jsx("span",{className:"modal-expiry-note",children:zC(u)})]}),f.jsxs("div",{className:"modal-actions",children:[f.jsx(vt,{ref:y,variant:"primary",onClick:()=>qs(e).then(b=>Ke(b?"Copied.":"Select and copy the link above.")),children:n?"Copied ✓":"Copy link"}),f.jsx(vt,{variant:"subtle",onClick:()=>window.open(e,"_blank"),children:"Open"}),f.jsx(vt,{variant:"subtle",onClick:r,children:"Done"})]})]})})}function iP({shares:e,canRevoke:n,onChanged:r}){return e.length===0?null:f.jsxs("div",{className:"share-banner",role:"status",children:[f.jsxs("div",{className:"sb-head",children:[f.jsx(ut,{name:"share"}),f.jsx("b",{children:"Publicly shared"}),f.jsxs("span",{className:"sb-count",children:[e.length," active link",e.length>1?"s":""]})]}),f.jsxs("p",{className:"sb-note",children:[f.jsx("b",{children:"Anyone with this link can view this file"})," — no account needed. It always shows the latest version until you revoke it.",e.some(i=>i.opens!==void 0)&&f.jsxs(f.Fragment,{children:[" ",LC]})]}),e.map(i=>f.jsxs("div",{className:"sb-link",children:[f.jsx("span",{className:"sb-url mono",title:i.url,children:i.url}),f.jsx("span",{className:"sb-meta",children:kC(i,!1)}),f.jsxs("span",{className:"sb-actions",children:[f.jsx(vt,{variant:"subtle",onClick:()=>qs(i.url).then(o=>Ke(o?"Copied.":"Select and copy the link.")),children:"Copy link"}),f.jsx(vt,{variant:"subtle",onClick:()=>window.open(i.url,"_blank"),children:"Open"}),n&&f.jsx("button",{className:"ai-del","aria-label":`Revoke the share of ${i.path}`,onClick:()=>IC(i,r),children:"Revoke"})]})]},i.token))]})}var fw=1,sP=.9,oP=.8,lP=.17,sm=.1,om=.999,cP=.9999,uP=.99,dP=/[\\\/_+.#"@\[\(\{&]/,fP=/[\\\/_+.#"@\[\(\{&]/g,hP=/[\s-]/,QC=/[\s-]/g;function Wm(e,n,r,i,o,l,u){if(l===n.length)return o===e.length?fw:uP;var d=`${o},${l}`;if(u[d]!==void 0)return u[d];for(var p=i.charAt(l),m=r.indexOf(p,o),y=0,v,b,x,S;m>=0;)v=Wm(e,n,r,i,m+1,l+1,u),v>y&&(m===o?v*=fw:dP.test(e.charAt(m-1))?(v*=oP,x=e.slice(o,m-1).match(fP),x&&o>0&&(v*=Math.pow(om,x.length))):hP.test(e.charAt(m-1))?(v*=sP,S=e.slice(o,m-1).match(QC),S&&o>0&&(v*=Math.pow(om,S.length))):(v*=lP,o>0&&(v*=Math.pow(om,m-o))),e.charAt(m)!==n.charAt(l)&&(v*=cP)),(vv&&(v=b*sm)),v>y&&(y=v),m=r.indexOf(p,m+1);return u[d]=y,y}function hw(e){return e.toLowerCase().replace(QC," ")}function mP(e,n,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Wm(e,n,hw(e),hw(n),0,0,{})}var Zo='[cmdk-group=""]',lm='[cmdk-group-items=""]',pP='[cmdk-group-heading=""]',XC='[cmdk-item=""]',mw=`${XC}:not([aria-disabled="true"])`,ep="cmdk-item-select",Os="data-value",gP=(e,n,r)=>mP(e,n,r),JC=w.createContext(void 0),jl=()=>w.useContext(JC),WC=w.createContext(void 0),gg=()=>w.useContext(WC),eE=w.createContext(void 0),tE=w.forwardRef((e,n)=>{let r=As(()=>{var N,B;return{search:"",value:(B=(N=e.value)!=null?N:e.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=As(()=>new Set),o=As(()=>new Map),l=As(()=>new Map),u=As(()=>new Set),d=nE(e),{label:p,children:m,value:y,onValueChange:v,filter:b,shouldFilter:x,loop:S,disablePointerSelection:_=!1,vimBindings:E=!0,...R}=e,T=dn(),O=dn(),M=dn(),D=w.useRef(null),P=jP();Oi(()=>{if(y!==void 0){let N=y.trim();r.current.value=N,F.emit()}},[y]),Oi(()=>{P(6,X)},[]);let F=w.useMemo(()=>({subscribe:N=>(u.current.add(N),()=>u.current.delete(N)),snapshot:()=>r.current,setState:(N,B,J)=>{var K,le,ae,ye;if(!Object.is(r.current[N],B)){if(r.current[N]=B,N==="search")ue(),be(),P(1,he);else if(N==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let xe=document.getElementById(M);xe?xe.focus():(K=document.getElementById(T))==null||K.focus()}if(P(7,()=>{var xe;r.current.selectedItemId=(xe=pe())==null?void 0:xe.id,F.emit()}),J||P(5,X),((le=d.current)==null?void 0:le.value)!==void 0){let xe=B??"";(ye=(ae=d.current).onValueChange)==null||ye.call(ae,xe);return}}F.emit()}},emit:()=>{u.current.forEach(N=>N())}}),[]),V=w.useMemo(()=>({value:(N,B,J)=>{var K;B!==((K=l.current.get(N))==null?void 0:K.value)&&(l.current.set(N,{value:B,keywords:J}),r.current.filtered.items.set(N,ve(B,J)),P(2,()=>{be(),F.emit()}))},item:(N,B)=>(i.current.add(N),B&&(o.current.has(B)?o.current.get(B).add(N):o.current.set(B,new Set([N]))),P(3,()=>{ue(),be(),r.current.value||he(),F.emit()}),()=>{l.current.delete(N),i.current.delete(N),r.current.filtered.items.delete(N);let J=pe();P(4,()=>{ue(),J?.getAttribute("id")===N&&he(),F.emit()})}),group:N=>(o.current.has(N)||o.current.set(N,new Set),()=>{l.current.delete(N),o.current.delete(N)}),filter:()=>d.current.shouldFilter,label:p||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:T,inputId:M,labelId:O,listInnerRef:D}),[]);function ve(N,B){var J,K;let le=(K=(J=d.current)==null?void 0:J.filter)!=null?K:gP;return N?le(N,r.current.search,B):0}function be(){if(!r.current.search||d.current.shouldFilter===!1)return;let N=r.current.filtered.items,B=[];r.current.filtered.groups.forEach(K=>{let le=o.current.get(K),ae=0;le.forEach(ye=>{let xe=N.get(ye);ae=Math.max(xe,ae)}),B.push([K,ae])});let J=D.current;ge().sort((K,le)=>{var ae,ye;let xe=K.getAttribute("id"),Oe=le.getAttribute("id");return((ae=N.get(Oe))!=null?ae:0)-((ye=N.get(xe))!=null?ye:0)}).forEach(K=>{let le=K.closest(lm);le?le.appendChild(K.parentElement===le?K:K.closest(`${lm} > *`)):J.appendChild(K.parentElement===J?K:K.closest(`${lm} > *`))}),B.sort((K,le)=>le[1]-K[1]).forEach(K=>{var le;let ae=(le=D.current)==null?void 0:le.querySelector(`${Zo}[${Os}="${encodeURIComponent(K[0])}"]`);ae?.parentElement.appendChild(ae)})}function he(){let N=ge().find(J=>J.getAttribute("aria-disabled")!=="true"),B=N?.getAttribute(Os);F.setState("value",B||void 0)}function ue(){var N,B,J,K;if(!r.current.search||d.current.shouldFilter===!1){r.current.filtered.count=i.current.size;return}r.current.filtered.groups=new Set;let le=0;for(let ae of i.current){let ye=(B=(N=l.current.get(ae))==null?void 0:N.value)!=null?B:"",xe=(K=(J=l.current.get(ae))==null?void 0:J.keywords)!=null?K:[],Oe=ve(ye,xe);r.current.filtered.items.set(ae,Oe),Oe>0&&le++}for(let[ae,ye]of o.current)for(let xe of ye)if(r.current.filtered.items.get(xe)>0){r.current.filtered.groups.add(ae);break}r.current.filtered.count=le}function X(){var N,B,J;let K=pe();K&&(((N=K.parentElement)==null?void 0:N.firstChild)===K&&((J=(B=K.closest(Zo))==null?void 0:B.querySelector(pP))==null||J.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function pe(){var N;return(N=D.current)==null?void 0:N.querySelector(`${XC}[aria-selected="true"]`)}function ge(){var N;return Array.from(((N=D.current)==null?void 0:N.querySelectorAll(mw))||[])}function L(N){let B=ge()[N];B&&F.setState("value",B.getAttribute(Os))}function Z(N){var B;let J=pe(),K=ge(),le=K.findIndex(ye=>ye===J),ae=K[le+N];(B=d.current)!=null&&B.loop&&(ae=le+N<0?K[K.length-1]:le+N===K.length?K[0]:K[le+N]),ae&&F.setState("value",ae.getAttribute(Os))}function re(N){let B=pe(),J=B?.closest(Zo),K;for(;J&&!K;)J=N>0?EP(J,Zo):RP(J,Zo),K=J?.querySelector(mw);K?F.setState("value",K.getAttribute(Os)):Z(N)}let ee=()=>L(ge().length-1),ne=N=>{N.preventDefault(),N.metaKey?ee():N.altKey?re(1):Z(1)},z=N=>{N.preventDefault(),N.metaKey?L(0):N.altKey?re(-1):Z(-1)};return w.createElement($e.div,{ref:n,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:N=>{var B;(B=R.onKeyDown)==null||B.call(R,N);let J=N.nativeEvent.isComposing||N.keyCode===229;if(!(N.defaultPrevented||J))switch(N.key){case"n":case"j":{E&&N.ctrlKey&&ne(N);break}case"ArrowDown":{ne(N);break}case"p":case"k":{E&&N.ctrlKey&&z(N);break}case"ArrowUp":{z(N);break}case"Home":{N.preventDefault(),L(0);break}case"End":{N.preventDefault(),ee();break}case"Enter":{N.preventDefault();let K=pe();if(K){let le=new Event(ep);K.dispatchEvent(le)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:V.inputId,id:V.labelId,style:OP},p),md(e,N=>w.createElement(WC.Provider,{value:F},w.createElement(JC.Provider,{value:V},N))))}),vP=w.forwardRef((e,n)=>{var r,i;let o=dn(),l=w.useRef(null),u=w.useContext(eE),d=jl(),p=nE(e),m=(i=(r=p.current)==null?void 0:r.forceMount)!=null?i:u?.forceMount;Oi(()=>{if(!m)return d.item(o,u?.id)},[m]);let y=rE(o,l,[e.value,e.children,l],e.keywords),v=gg(),b=qa(P=>P.value&&P.value===y.current),x=qa(P=>m||d.filter()===!1?!0:P.search?P.filtered.items.get(o)>0:!0);w.useEffect(()=>{let P=l.current;if(!(!P||e.disabled))return P.addEventListener(ep,S),()=>P.removeEventListener(ep,S)},[x,e.onSelect,e.disabled]);function S(){var P,F;_(),(F=(P=p.current).onSelect)==null||F.call(P,y.current)}function _(){v.setState("value",y.current,!0)}if(!x)return null;let{disabled:E,value:R,onSelect:T,forceMount:O,keywords:M,...D}=e;return w.createElement($e.div,{ref:Ps(l,n),...D,id:o,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!b,"data-disabled":!!E,"data-selected":!!b,onPointerMove:E||d.getDisablePointerSelection()?void 0:_,onClick:E?void 0:S},e.children)}),yP=w.forwardRef((e,n)=>{let{heading:r,children:i,forceMount:o,...l}=e,u=dn(),d=w.useRef(null),p=w.useRef(null),m=dn(),y=jl(),v=qa(x=>o||y.filter()===!1?!0:x.search?x.filtered.groups.has(u):!0);Oi(()=>y.group(u),[]),rE(u,d,[e.value,e.heading,p]);let b=w.useMemo(()=>({id:u,forceMount:o}),[o]);return w.createElement($e.div,{ref:Ps(d,n),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},r&&w.createElement("div",{ref:p,"cmdk-group-heading":"","aria-hidden":!0,id:m},r),md(e,x=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?m:void 0},w.createElement(eE.Provider,{value:b},x))))}),bP=w.forwardRef((e,n)=>{let{alwaysRender:r,...i}=e,o=w.useRef(null),l=qa(u=>!u.search);return!r&&!l?null:w.createElement($e.div,{ref:Ps(o,n),...i,"cmdk-separator":"",role:"separator"})}),xP=w.forwardRef((e,n)=>{let{onValueChange:r,...i}=e,o=e.value!=null,l=gg(),u=qa(m=>m.search),d=qa(m=>m.selectedItemId),p=jl();return w.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),w.createElement($e.input,{ref:n,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":p.listId,"aria-labelledby":p.labelId,"aria-activedescendant":d,id:p.inputId,type:"text",value:o?e.value:u,onChange:m=>{o||l.setState("search",m.target.value),r?.(m.target.value)}})}),wP=w.forwardRef((e,n)=>{let{children:r,label:i="Suggestions",...o}=e,l=w.useRef(null),u=w.useRef(null),d=qa(m=>m.selectedItemId),p=jl();return w.useEffect(()=>{if(u.current&&l.current){let m=u.current,y=l.current,v,b=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let x=m.offsetHeight;y.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return b.observe(m),()=>{cancelAnimationFrame(v),b.unobserve(m)}}},[]),w.createElement($e.div,{ref:Ps(l,n),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":i,id:p.listId},md(e,m=>w.createElement("div",{ref:Ps(u,p.listInnerRef),"cmdk-list-sizer":""},m)))}),SP=w.forwardRef((e,n)=>{let{open:r,onOpenChange:i,overlayClassName:o,contentClassName:l,container:u,...d}=e;return w.createElement(hp,{open:r,onOpenChange:i},w.createElement(pp,{container:u},w.createElement(gp,{"cmdk-overlay":"",className:o}),w.createElement(vp,{"aria-label":e.label,"cmdk-dialog":"",className:l},w.createElement(tE,{ref:n,...d}))))}),_P=w.forwardRef((e,n)=>qa(r=>r.filtered.count===0)?w.createElement($e.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),CP=w.forwardRef((e,n)=>{let{progress:r,children:i,label:o="Loading...",...l}=e;return w.createElement($e.div,{ref:n,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},md(e,u=>w.createElement("div",{"aria-hidden":!0},u)))}),hd=Object.assign(tE,{List:wP,Item:vP,Input:xP,Group:yP,Separator:bP,Dialog:SP,Empty:_P,Loading:CP});function EP(e,n){let r=e.nextElementSibling;for(;r;){if(r.matches(n))return r;r=r.nextElementSibling}}function RP(e,n){let r=e.previousElementSibling;for(;r;){if(r.matches(n))return r;r=r.previousElementSibling}}function nE(e){let n=w.useRef(e);return Oi(()=>{n.current=e}),n}var Oi=typeof window>"u"?w.useEffect:w.useLayoutEffect;function As(e){let n=w.useRef();return n.current===void 0&&(n.current=e()),n}function qa(e){let n=gg(),r=()=>e(n.snapshot());return w.useSyncExternalStore(n.subscribe,r,r)}function rE(e,n,r,i=[]){let o=w.useRef(),l=jl();return Oi(()=>{var u;let d=(()=>{var m;for(let y of r){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(m=y.current.textContent)==null?void 0:m.trim():o.current}})(),p=i.map(m=>m.trim());l.value(e,d,p),(u=n.current)==null||u.setAttribute(Os,d),o.current=d}),o}var jP=()=>{let[e,n]=w.useState(),r=As(()=>new Map);return Oi(()=>{r.current.forEach(i=>i()),r.current=new Map},[e]),(i,o)=>{r.current.set(i,o),n({})}};function TP(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function md({asChild:e,children:n},r){return e&&w.isValidElement(n)?w.cloneElement(TP(n),{ref:n.ref},r(n.props.children)):r(n)}var OP={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function AP({className:e,...n}){return f.jsx(hd,{"data-slot":"command",className:Je("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n})}function MP({className:e,...n}){return f.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[f.jsx(b_,{className:"size-4 shrink-0 opacity-50"}),f.jsx(hd.Input,{"data-slot":"command-input",className:Je("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n})]})}function NP({className:e,...n}){return f.jsx(hd.List,{"data-slot":"command-list",className:Je("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...n})}function DP({className:e,...n}){return f.jsx(hd.Item,{"data-slot":"command-item",className:Je("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...n})}function pw(e,n){if(!e)return{score:0,hits:[]};const r=e.toLowerCase(),i=n.toLowerCase();let o=0,l=0,u=0;const d=[];for(let p=0;p3&&i.endsWith("ies")?o=i.slice(0,-3)+"y":i.length>3&&i.endsWith("es")?o=i.slice(0,-2):i.length>2&&i.endsWith("s")&&(o=i.slice(0,-1)),o?pw(o,n):null}function kP({text:e,hits:n}){const r=[];let i=0;return n.forEach((o,l)=>{o>i&&r.push(e.slice(i,o)),r.push(f.jsx("b",{children:e[o]},l)),i=o+1}),r.push(e.slice(i)),f.jsx("span",{className:"plabel",children:r})}function LP({open:e,onClose:n,candidates:r}){const[i,o]=w.useState(""),l=w.useMemo(()=>{if(!e)return[];const d=[];for(const p of r()){const m=zP(i,p.label);m&&d.push({...p,score:m.score,hits:m.hits})}return d.sort((p,m)=>m.score-p.score),d.slice(0,40)},[e,i,r]);w.useEffect(()=>{e&&o("")},[e]);const u=d=>{n(),d.run()};return f.jsx(Ju,{open:e,onOpenChange:d=>!d&&n(),children:f.jsxs(Wu,{id:"palette",className:"palette",showCloseButton:!1,"aria-describedby":void 0,children:[f.jsx(_l,{className:"sr-only",children:"Search and quick actions"}),f.jsxs(AP,{shouldFilter:!1,loop:!0,children:[f.jsxs("div",{id:"palette-inputwrap",children:[f.jsx(ut,{name:"search"}),f.jsx(MP,{placeholder:"Search file names, projects, actions…",autoComplete:"off",spellCheck:!1,value:i,onValueChange:o})]}),f.jsx(NP,{children:l.length===0?f.jsx("div",{className:"pempty",children:"No matches — search covers file names, projects, and actions"}):l.map(d=>f.jsxs(DP,{value:d.kind+":"+d.label,onSelect:()=>u(d),children:[f.jsx("span",{className:"picon",children:f.jsx(ut,{name:d.icon})}),f.jsx(kP,{text:d.label,hits:d.hits}),f.jsx("span",{className:"pkind",children:d.kind})]},d.kind+":"+d.label))}),f.jsx("footer",{id:"palette-hint",children:"↑↓ navigate · ⏎ select · esc close"})]})]})})}const Wo=3,Ms=30;function $P(e,n){return Pt({queryKey:["heatDevices",e],queryFn:()=>Bt(e+"heat?by=device&days=30"),enabled:n,retry:!1,staleTime:6e4}).data?.devices??null}const IP=["all","human","agent","share"],PP={all:"All reads",human:"Human reads",agent:"Agent reads",share:"Shared reads"},FP={agent:{agent:1,human:0,share:0},human:{agent:0,human:1,share:0},share:{agent:0,human:0,share:1}};function gw(e){const[n,r]=w.useState("all"),{flatFiles:i,heatMap:o,devices:l,scope:u}=e,d=S=>!u||S===u||S.startsWith(u+"/"),p=u?i.filter(S=>d(S.path)):i;if(!e.loading&&!p.length)return f.jsxs("div",{className:"insights",children:[f.jsxs("h1",{className:"in-title",children:["Knowledge insights",u?f.jsxs("span",{className:"in-scope",children:[" · ",u]}):null]}),f.jsxs("div",{className:"dl-empty in-blank",children:[f.jsx("p",{children:u?`Nothing in ${u} to chart yet.`:"Nothing to chart yet."}),f.jsx("p",{children:u?`No files under ${u} are syncing here yet.`:"This project has no files. Once a device syncs files here, the map, the reads × freshness plot and the hot path fill in on their own."}),e.installHref&&f.jsx("a",{className:"pbtn",...Bs(e.installHref),children:"Set up a device →"})]})]});const m=l&&u?l.map(S=>{const _=Object.create(null);for(const[E,R]of Object.entries(S.folders||{}))d(E)&&(_[E]=R);return{...S,folders:_}}).filter(S=>Object.keys(S.folders).length>0):l,y=Date.now(),v=p.map(S=>{const _=o&&o[S.path]||{},E=S.time?Math.max(0,(y-new Date(S.time).getTime())/864e5):0,R=n==="all"?ka(_):_[n]||0;return{path:S.path,reads:R,agent:_.agent||0,human:_.human||0,share:_.share||0,total:ka(_),days:E,danger:R>=Wo&&E>=Ms}}),b=rI(o,new Set(i.map(S=>S.path))).filter(d).map(S=>{const _=o[S];return{path:S,reads:n==="all"?ka(_):_[n]||0,agent:_.agent||0,human:_.human||0,share:_.share||0,total:ka(_),days:0,danger:!1,orphan:!0}}).filter(S=>S.reads>0),x=b.length>0?f.jsxs("p",{className:"in-legend in-orphan-note",children:[tp(b.length,"file")," with reads ",b.length===1?"is":"are"," no longer in the project — see Hot path."]}):null;return f.jsxs("div",{className:"insights",children:[f.jsxs("h1",{className:"in-title",children:["Knowledge insights",u?f.jsxs("span",{className:"in-scope",children:[" · ",u]}):null]}),f.jsx("p",{className:"dl-sub",children:u?`Reads over the last 30 days × freshness, for ${u} and everything in it.`:"Reads over the last 30 days × how long since each file changed. Hot but stale knowledge — read a lot, maintained by nobody — is the danger zone."}),f.jsx("div",{className:"in-lens",children:IP.map(S=>f.jsx("button",{className:"in-lens-btn"+(S===n?" active":""),onClick:()=>r(S),children:PP[S]},S))}),f.jsx("h3",{className:"dl-h3",children:"Map — cell size = reads, color = freshness (scale below)"}),f.jsx(UP,{pts:v,onOpenFile:e.onOpenFile,onOpenFolder:e.onOpenFolder,isFolder:e.isFolder}),x,f.jsxs("h3",{className:"dl-h3 in-h3-row",children:["Reads × freshness",f.jsx("span",{className:"in-cap",children:"dot size = agent share of reads"})]}),f.jsx(BP,{pts:v,onOpenFile:e.onOpenFile}),x,f.jsx("h3",{className:"dl-h3",children:"Hot path — top files by reads"}),f.jsx(qP,{pts:[...v,...b],lens:n,onOpenFile:e.onOpenFile,onOpenHistory:e.onOpenHistory}),m&&m.length>0&&f.jsxs(f.Fragment,{children:[f.jsx("h3",{className:"dl-h3",children:"Agent coverage — which agents read which areas"}),f.jsx(GP,{devices:m})]})]})}const VP="rgb(150,156,164)";function aE(e){const n=[[76,195,138],[232,196,84],[224,93,93]],r=Math.min(1,Math.max(0,e/300))*(n.length-1),i=Math.min(n.length-2,Math.floor(r)),o=r-i,l=n[i].map((u,d)=>Math.round(u+(n[i+1][d]-u)*o));return`rgb(${l[0]},${l[1]},${l[2]})`}function vw(e,n,r,i,o){const l=e.reduce((m,y)=>m+y.value,0);if(!l||i<=0||o<=0)return[];const u=e.slice().sort((m,y)=>y.value-m.value).map(m=>({it:m,a:m.value/l*i*o})),d=(m,y)=>{const b=m.reduce((S,_)=>S+_.a,0)/y;let x=0;for(const S of m){const _=S.a/b;x=Math.max(x,_/b,b/_)}return x},p=[];for(;u.length;){const m=i>=o,y=m?o:i,v=[u.shift()];for(;u.length&&d(v.concat(u[0]),y)<=d(v,y);)v.push(u.shift());const b=v.reduce((S,_)=>S+_.a,0)/y;let x=0;for(const S of v){const _=S.a/b;m?p.push({item:S.it,x:n,y:r+x,w:b,h:_}):p.push({item:S.it,x:n+x,y:r,w:_,h:b}),x+=_}m?(n+=b,i-=b):(r+=b,o-=b)}return p}const cm=15;function yw(e,n,r){const i=Math.floor((r-8)/6),o=`${e} · ${n}`;return o.length<=i?{label:o,fit:i}:{label:e.length>i?e.slice(0,Math.max(1,i-1))+"…":e,fit:i}}const tp=(e,n)=>`${e} ${n}${e===1?"":"s"}`;function UP({pts:e,onOpenFile:n,onOpenFolder:r,isFolder:i}){const u=iI(e.map(y=>y.days)),d=!!u&&sI(u.min,u.max),p=new Map;for(const y of e){const v=y.path.includes("/")?y.path.split("/")[0]:"/";let b=p.get(v);b||p.set(v,b={name:v,files:[],value:0,reads:0}),b.files.push(y),b.value+=y.reads+1,b.reads+=y.reads}const m=[];for(const y of vw([...p.values()],0,0,720,480)){const v=y.item,b=v.name==="/"?"":v.name,x=v.name==="/"?"(root)":v.name;if(m.push(f.jsx("rect",{x:y.x+1,y:y.y+1,width:Math.max(0,y.w-2),height:Math.max(0,y.h-2),rx:3,className:"in-tm-group","data-dir":b,children:f.jsx("title",{children:`${v.name==="/"?"(root)":v.name+"/"} — ${tp(v.reads,"read")}/30d · ${tp(v.files.length,"file")}`})},"g"+v.name)),y.w>46&&y.h>cm+10){const{label:_}=yw(x,v.reads,y.w);m.push(f.jsx("text",{x:y.x+5,y:y.y+12,className:"in-tm-glabel","data-dir":b,children:_},"gl"+v.name))}const S=vw(v.files.map(_=>({..._,name:_.path.split("/").pop(),value:_.reads+1})),y.x+2,y.y+cm,Math.max(0,y.w-4),Math.max(0,y.h-cm-2));for(const _ of S)if(m.push(f.jsx("rect",{x:_.x+.6,y:_.y+.6,width:Math.max(.4,_.w-1.2),height:Math.max(.4,_.h-1.2),rx:1.5,fill:d?VP:aE(_.item.days),className:"in-tm-cell","data-path":_.item.path,children:f.jsx("title",{children:`${_.item.path} — ${_.item.reads} read${_.item.reads===1?"":"s"}/30d · changed ${Math.round(_.item.days)}d ago`})},_.item.path)),_.w>54&&_.h>16){const{label:E,fit:R}=yw((_.item.danger?"⚠ ":"")+_.item.name,_.item.reads,_.w);R>=5&&m.push(f.jsx("text",{x:_.x+4.5,y:_.y+12.5,className:"in-tm-label","data-path":_.item.path,children:E},"l"+_.item.path))}}return f.jsxs(f.Fragment,{children:[f.jsx("svg",{viewBox:"0 0 720 480",className:"in-chart in-treemap",onClick:y=>{const v=y.target.closest("[data-path], [data-dir]");if(!v)return;const b=v.getAttribute("data-path");if(b)return n(b);const x=v.getAttribute("data-dir");x&&i(x)&&r(x)},children:m}),f.jsx(HP,{range:u,flat:d})]})}function HP({range:e,flat:n}){if(!e)return null;const r=oI(e.min,e.max);return f.jsxs("p",{className:"in-legend in-tm-legend",children:["freshness 0d",f.jsx("span",{className:"in-sw in-sw-age"+(n?" in-sw-flat":""),style:{background:`linear-gradient(to right, ${[0,60,150,300].map(aE).join(", ")})`}}),"300d+",f.jsx("span",{className:"in-tm-range",children:n?`all files here: ${r} old — colour off, not enough range to rank`:`observed: ${r} old`})]})}function BP({pts:e,onOpenFile:n}){const o={l:44,r:16,t:20,b:34},l=Math.max(Ms*2,...e.map(S=>S.days)),u=Math.max(Wo*2,...e.map(S=>S.reads)),d=S=>Math.log10(S+1)/Math.log10(l+1),p=S=>Math.log10(S+1)/Math.log10(u+1),m=S=>3+4*S,y=m(1),v=S=>o.l+y+d(S)*(720-o.l-o.r-2*y),b=S=>360-o.b-y-p(S)*(360-o.t-o.b-2*y),x=uI(e.filter(S=>S.danger).map(S=>({path:S.path,reads:S.reads,cx:v(S.days),cy:b(S.reads),r:m(S.total?(S.agent||0)/S.total:0)})),{right:720-o.r,top:o.t+8,bottom:360-o.b-4});return f.jsxs("svg",{viewBox:"0 0 720 360",className:"in-chart",children:[f.jsx("rect",{x:v(Ms),y:o.t,width:720-o.r-v(Ms),height:b(Wo)-o.t,className:"in-danger-zone"}),f.jsx("line",{x1:v(Ms),y1:o.t,x2:v(Ms),y2:360-o.b,className:"in-threshold"}),f.jsx("line",{x1:o.l,y1:b(Wo),x2:720-o.r,y2:b(Wo),className:"in-threshold"}),f.jsx("line",{x1:o.l,y1:360-o.b,x2:720-o.r,y2:360-o.b,className:"in-axis"}),f.jsx("line",{x1:o.l,y1:o.t,x2:o.l,y2:360-o.b,className:"in-axis"}),f.jsx("text",{x:(o.l+720-o.r)/2,y:352,className:"in-label",children:"days since last change →"}),f.jsx("text",{x:12,y:(o.t+360-o.b)/2,className:"in-label",transform:`rotate(-90 12 ${(o.t+360-o.b)/2})`,children:"reads / 30d →"}),f.jsx("text",{x:720-o.r-6,y:o.t+14,className:"in-quad in-quad-danger",textAnchor:"end",children:"hot + stale"}),f.jsx("text",{x:o.l+6,y:o.t+14,className:"in-quad",children:"hot + fresh"}),f.jsx("text",{x:720-o.r-6,y:360-o.b-8,className:"in-quad",textAnchor:"end",children:"cold + stale"}),f.jsx("text",{x:o.l+6,y:360-o.b-8,className:"in-quad",children:"cold + fresh"}),e.map(S=>{const _=S.total?(S.agent||0)/S.total:0;return f.jsx("circle",{cx:Number(v(S.days).toFixed(1)),cy:Number(b(S.reads).toFixed(1)),r:Number(m(_).toFixed(1)),className:"in-pt"+(S.danger?" danger":S.reads?"":" cold"),onClick:()=>n(S.path),children:f.jsx("title",{children:`${S.path} — ${S.reads} read${S.reads===1?"":"s"} / 30d · changed ${Math.round(S.days)}d ago`})},S.path)}),x.map(S=>f.jsx("text",{x:Number(S.x.toFixed(1)),y:Number(S.y.toFixed(1)),textAnchor:S.anchor,className:"in-pt-label",children:S.name},S.path))]})}function qP({pts:e,lens:n,onOpenFile:r,onOpenHistory:i}){const o=e.filter(d=>d.reads>0).sort((d,p)=>p.reads-d.reads||p.days-d.days).slice(0,20);if(!o.length)return f.jsx("div",{className:"dl-empty",children:"No reads in the window yet."});const l=o[0].reads,u=o.some(d=>d.share>0);return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"in-hotpath",children:o.map(d=>{const p=FP[n]??nI(d),m=d.reads/l*100,y=()=>d.orphan?i(d.path):r(d.path);return f.jsxs("div",{className:"in-hp-row",tabIndex:0,role:"button",title:d.orphan?`${d.reads} read${d.reads===1?"":"s"}/30d · no longer in the project — open its history`:d.danger?`${d.reads} read${d.reads===1?"":"s"}/30d · unchanged ${Math.round(d.days)}d — review this file`:d.path,onClick:y,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),y())},children:[f.jsx("span",{className:"in-hp-name"+(d.danger?" danger":""),children:d.path+(d.danger?" ⚠":"")}),d.orphan&&f.jsx("span",{className:"in-hp-gone",children:"· no longer in the project"}),f.jsxs("span",{className:"in-hp-bar",children:[f.jsx("span",{className:"in-hp-agent",style:{width:(m*p.agent).toFixed(1)+"%"}}),f.jsx("span",{className:"in-hp-human",style:{width:(m*p.human).toFixed(1)+"%"}}),f.jsx("span",{className:"in-hp-share",style:{width:(m*p.share).toFixed(1)+"%"}})]}),f.jsx("span",{className:"in-hp-count",children:d.reads})]},d.path)})}),f.jsxs("p",{className:"in-legend",children:[f.jsx("span",{className:"in-sw agent"})," agent reads ",f.jsx("span",{className:"in-sw human"})," human reads",u&&f.jsxs(f.Fragment,{children:[" ",f.jsx("span",{className:"in-sw share"})," shared reads"]})]})]})}function GP({devices:e}){const n=new Map;for(const b of e)for(const[x,S]of Object.entries(b.folders||{}))n.set(x,(n.get(x)||0)+S);const r=[...n.entries()].sort((b,x)=>x[1]-b[1]).slice(0,12).map(b=>b[0]),i=e.slice(0,12),o=140,l=6,u=Math.min(76,Math.max(34,(720-o-8)/r.length)),d=26,p=720,m=l+i.length*d+58,y=Math.max(1,...i.flatMap(b=>r.map(x=>(b.folders||{})[x]||0))),v=b=>{const x=[23,25,31],S=[245,166,35],_=x.map((E,R)=>Math.round(E+(S[R]-E)*b));return`rgb(${_[0]},${_[1]},${_[2]})`};return f.jsxs("svg",{viewBox:`0 0 ${p} ${m}`,className:"in-chart in-matrix",children:[i.map((b,x)=>{let S=b.name||b.id||"";return S.length>20&&(S=S.slice(0,19)+"…"),f.jsxs("g",{children:[f.jsx("text",{x:o-8,y:l+x*d+17,textAnchor:"end",className:"in-label",children:S}),r.map((_,E)=>{const R=(b.folders||{})[_]||0;return f.jsx("rect",{x:o+E*u,y:l+x*d,width:u-4,height:d-4,rx:3,fill:v(Math.sqrt(R/y)),children:f.jsx("title",{children:`${b.name||b.id} × ${_||"(root)"}: ${R} read${R===1?"":"s"}/30d`})},_)})]},b.id||x)}),r.map((b,x)=>{const S=o+x*u+(u-4)/2,_=l+i.length*d+14;return f.jsx("text",{x:S,y:_,className:"in-label",textAnchor:"end",transform:`rotate(-28 ${S} ${_})`,children:b||"(root)"},b)})]})}function iE(e){return new Set(e.entries.map(n=>n.path)).size}function ZP(e){const n=l=>(l.session?"s\0"+l.session:"n\0"+l.note)+"\0"+(l.device?.id??""),r=new Map;e.forEach((l,u)=>{if(!l.note&&!l.session)return;const d=r.get(n(l));if(d){d.entries.push(l),d.idx.push(u);return}r.set(n(l),{note:l.note??"",session:l.session,entries:[l],idx:[u]})});const i=[],o=new Set;return e.forEach((l,u)=>{const d=l.note||l.session?r.get(n(l)):void 0;if(!d||iE(d)<2){i.push({i:u});return}o.has(d)||(o.add(d),i.push({run:d,i:u}))}),i}function KP(e){const{filters:n,authors:r,onChange:i}=e,o=(y,v)=>i({...n,[y]:v||void 0}),[l,u]=w.useState(n?.q??""),d=w.useRef(!1);w.useEffect(()=>{d.current||u(n?.q??"")},[n?.q]),w.useEffect(()=>{if(!d.current)return;const y=setTimeout(()=>{d.current=!1,l!==(n?.q??"")&&o("q",l)},250);return()=>clearTimeout(y)},[l]);const p=n?.user&&!r.includes(n.user)?[n.user,...r]:r,m=Zp(n);return f.jsxs("div",{className:"hfilters",children:[f.jsxs("label",{className:"hf-search",children:[f.jsx(ut,{name:"search"}),f.jsx(du,{type:"search",value:l,placeholder:"path contains…","aria-label":"Filter by path",onChange:y=>{d.current=!0,u(y.target.value)}})]}),f.jsxs("select",{className:"hf-user",value:n?.user??"","aria-label":"Filter by author",onChange:y=>o("user",y.target.value),children:[f.jsx("option",{value:"",children:"Anyone"}),p.map(y=>f.jsx("option",{value:y,children:y},y))]}),f.jsxs("span",{className:"hf-dates",children:[f.jsx("span",{className:"hf-lbl",children:"UTC"}),f.jsx(du,{type:"date",className:"hf-date",value:n?.since??"","aria-label":"From date (UTC)",onChange:y=>o("since",y.target.value)}),f.jsx("span",{className:"hf-dash",children:"–"}),f.jsx(du,{type:"date",className:"hf-date",value:n?.until??"","aria-label":"To date (UTC)",onChange:y=>o("until",y.target.value)})]}),m&&f.jsx("button",{type:"button",className:"hf-clear",onClick:()=>i({}),children:"Clear"})]})}function YP(e){const n=new Set;for(const r of e)r.user&&n.add(r.user);return[...n].sort()}function QP(e){const{apiBase:n,target:r,isFolder:i,onMeta:o,onRendered:l,restore:u,remove:d,filters:p}=e,m=r?i(r)?{prefix:r+"/"}:{path:r}:{prefix:""},y=("path"in m&&m.path!==void 0?"path="+encodeURIComponent(m.path):"prefix="+encodeURIComponent(m.prefix??""))+N_(p).replace("?","&"),{data:v,error:b,fetchNextPage:x,hasNextPage:S,isFetchingNextPage:_}=fj({queryKey:["history",n,y],queryFn:({pageParam:P})=>Bt(n+"history?"+y+"&n=100"+(P?"&cursor="+encodeURIComponent(P):"")),initialPageParam:"",getNextPageParam:P=>P.next_cursor,staleTime:15e3}),E=w.useRef(new Set);w.useEffect(()=>{b&&o("History unavailable: "+b.message)},[b,o]),w.useEffect(()=>{v&&l?.()},[v,l]);const R=v?v.pages.flatMap(P=>P.entries||[]):[];for(const P of YP(R))E.current.add(P);const T=e.onFilters&&f.jsx(KP,{filters:p,authors:[...E.current].sort(),onChange:e.onFilters});if(!v)return T?f.jsx("div",{className:"history",children:T}):null;const O=P=>{for(let F=P+1;F{const F=R[P].kind==="delete"?O(P):R[P].blob;return F&&F===M.get(R[P].path)?void 0:F};return f.jsxs("div",{className:"history",children:[T,R.length===0&&(Zp(p)?f.jsxs("div",{className:"empty",children:["No changes match these filters.",f.jsx("br",{}),f.jsx("button",{type:"button",className:"btn hf-clear-empty",onClick:()=>e.onFilters?.({}),children:"Clear filters"})]}):f.jsx("div",{className:"empty",children:"No history yet."})),ZP(R).map((P,F)=>P.run?f.jsx(XP,{run:P.run,onOpen:e.onOpen,apiBase:n,prevBlob:O,restoreSha:D,restore:u,remove:d},"g"+F):f.jsx(pg,{entry:R[P.i],apiBase:n,onOpen:e.onOpen,diff:{apiBase:n,prev:O(P.i)},restore:u,restoreSha:D(P.i)},"r"+P.i)),S&&f.jsx("button",{type:"button",className:"btn hmore",onClick:()=>x(),disabled:_,children:_?"Loading…":"Load more"})]})}function XP({run:e,onOpen:n,apiBase:r,prevBlob:i,restoreSha:o,restore:l,remove:u}){const[d,p]=w.useState(!0),m=e.entries[0],y=dd(m),v=[m.device.name||m.device.id,m.device.os].filter(Boolean).join(" · "),b=m.session,x=m.device?.id,{data:S}=Pt({queryKey:["session-reads",r,b,x],queryFn:()=>Bt(r+"heat?session="+encodeURIComponent(b)+"&device="+encodeURIComponent(x)),enabled:!!b&&!!x,staleTime:3e4}),_=new Set(S?.paths??[]),E=new Set(e.entries.map(D=>D.path)),R=[..._].filter(D=>!E.has(D)).sort(),T=e.entries.map(D=>new Date(D.time).getTime()),O=JP(Math.min(...T),Math.max(...T)),M=iE(e);return f.jsxs("div",{className:"hrun"+(d?" open":""),children:[f.jsxs("div",{className:"hrun-head",children:[f.jsx("button",{type:"button",className:"hrun-toggle","aria-expanded":d,title:d?"Collapse this run":"Expand this run",onClick:()=>p(!d),children:f.jsx(ut,{name:d?"chevd":"chev"})}),f.jsx("span",{className:"hrun-note",children:f.jsx(KC,{text:e.note})}),f.jsxs("span",{className:"hrun-meta",children:[_.size>0?`read ${_.size} · changed ${M}`:`${M} file${M===1?"":"s"}`," ·"," ",y,v?" · "+v:""]}),f.jsx("span",{className:"hrun-time",children:O})]}),d&&f.jsxs("div",{className:"hrun-body",children:[e.entries.map((D,P)=>f.jsx(pg,{entry:D,apiBase:r,onOpen:n,diff:{apiBase:r,prev:i(e.idx[P])},restore:l,remove:u,restoreSha:o(e.idx[P]),inRun:!0,read:_.has(D.path)},P)),R.length>0&&f.jsxs("div",{className:"hrun-reads",children:[f.jsx("div",{className:"hrun-reads-head",children:"Read, not changed"}),R.map(D=>f.jsxs("button",{type:"button",className:"hrun-read",onClick:()=>n(D),children:[f.jsx("span",{className:"hkind",children:"read"}),f.jsx("span",{className:"hpath",children:D})]},D))]}),b&&f.jsx("div",{className:"hrun-foot",children:"Reads shown only for files the project still has."})]})]})}function JP(e,n){const r=new Date(e),i=new Date(n),o=u=>u.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});if(r.toDateString()!==i.toDateString())return r.toLocaleString()+" – "+i.toLocaleString();const l=i.toLocaleDateString();return e===n?l+" "+o(i):l+" "+o(r)+" – "+o(i)}function WP(e,n){return e?n(e)?e+"/ (folder)":e:"all changes"}function eF(e){const{apiBase:n,path:r,version:i}=e,o="path="+encodeURIComponent(r),{data:l}=Pt({queryKey:["history",n,o,200],queryFn:()=>Bt(n+"history?"+o+"&n=200"),staleTime:15e3}),u=l?.entries?.find(y=>y.blob===i),d=u?dd(u):"",p=u?.time?new Date(u.time).toLocaleString():"",m=n+"blob?sha="+i+"&name="+encodeURIComponent(r.split("/").pop()||r)+"&download=1";return f.jsxs("div",{className:"vbanner",role:"status",children:[f.jsx("span",{className:"vb-icon",children:f.jsx(ut,{name:"clock"})}),f.jsxs("div",{className:"vb-text",children:[f.jsx("b",{children:[p&&"Version from "+p,d&&"by "+d].filter(Boolean).join(" ")||"Earlier version"}),f.jsx("span",{children:"This is not the current file."})]}),f.jsxs("div",{className:"vb-actions",children:[f.jsx("button",{className:"ai-btn",onClick:e.onViewCurrent,children:"View current"}),f.jsx("a",{className:"ai-btn",download:!0,href:m,children:"Download this version"})]})]})}const tF={aws_access_key_id:"an AWS access key",openai_api_key:"an OpenAI API key",github_pat:"a GitHub token",slack_token:"a Slack token",private_key:"a private key",gitlab_pat:"a GitLab token"};function nF(e=[]){const n=e.map(i=>`${tF[i.rule]??i.rule} (line ${i.line})`);return`BearDrive found ${n.length>1?n.slice(0,-1).join(", ")+" and "+n[n.length-1]:n[0]||"something credential-shaped"} in this file. The check covers the file at the moment you share it — a link always serves the file's latest content, so later changes are never checked. Share anyway?`}function sE(e){const{config:n,apiBase:r,route:i,hub:o,project:l}=e,u=Yp(),d=Ai(),{tree:p,flatFiles:m,dirIndex:y,loaded:v}=dI(r,!o||!!l),b=fI(r,o&&!!l&&!!n.reads?.enabled),x=o&&!!l&&!i.path&&!i.view,S=i.view==="dashboard"||x,_=$P(r,S);w.useEffect(()=>{S&&d.invalidateQueries({queryKey:["heat",r]})},[S,r,d]);const E=i.path,R=i.view?void 0:i.version,T=E||(i.view==="dashboard"||i.view==="history")&&i.viewTarget||"",O=!!E&&y.has(E),M=!!E&&v&&!O&&m.some(Y=>Y.path===E),D=!!E&&v&&!O&&!M,P=O&&!i.view,{data:F}=Pt({queryKey:["resolve",r,E],queryFn:()=>Bt(r+"resolve?path="+encodeURIComponent(E)),enabled:D,retry:!1,staleTime:6e4}),[V,ve]=w.useState(null);w.useEffect(()=>{!D||!F?.to||(ve({from:E,to:F.to}),Kt(fl(F.to,l?.id),{replace:!0}))},[D,F,E,l?.id]);const[be,he]=w.useState(()=>new Set),ue=w.useRef(!0);w.useEffect(()=>{if(!p||!ue.current)return;ue.current=!1;const Y=(p.children||[]).filter(W=>W.dir);Y.length===1&&he(W=>new Set(W).add(Y[0].path))},[p]),w.useEffect(()=>{!T||!v||he(Y=>{const W=new Set(Y);for(const de of DI(T))W.add(de);return y.has(T)&&W.add(T),W})},[T,v,y]);const X=w.useCallback(Y=>{he(W=>{const de=new Set(W);return de.has(Y)?de.delete(Y):de.add(Y),de})},[]),pe=w.useRef(null),ge=w.useRef(new Map),L=w.useRef({key:"",want:0,attempts:0});w.useEffect(()=>{L.current={key:u,want:N3()==="POP"?ge.current.get(u)??0:0,attempts:0}},[u]);const Z=w.useCallback(()=>{const Y=pe.current,W=L.current;!Y||W.key!==u||W.attempts>=3||(W.attempts++,Y.scrollTo({top:W.want,behavior:"instant"}))},[u]),re=w.useCallback(()=>{pe.current&&ge.current.set(u,pe.current.scrollTop)},[u]),ee=w.useCallback((Y,W)=>{Kt(fl(Y,l?.id,W)),mr()},[l?.id]),ne=w.useCallback(Y=>Kt(Pn("history",l?.id,Y)),[l?.id]),[z,N]=w.useState(""),[B,J]=w.useState(null),[K,le]=w.useState(!1),[ae,ye]=w.useState(!1);w.useEffect(()=>VD(()=>ye(!0)),[]);const xe=w.useRef(null),Oe=e.panel??null,Ie=!Oe&&o&&!!l&&M&&wi(l.perm,"write"),{data:Ve}=j_(l?.id,o&&!!l),it=w.useCallback(()=>{d.invalidateQueries({queryKey:["shares",l?.id]})},[d,l?.id]),Qe=M?(Ve||[]).filter(Y=>Y.path===E):[],fn=!Oe&&o&&!!l,hn=!Oe&&M,Qt=!Oe&&(M||o&&!!l&&O),br=R?r+"blob?sha="+R+"&name="+encodeURIComponent(E)+"&download=1":r+"download?path="+encodeURIComponent(E),jt=w.useCallback(async()=>{const Y=W=>fetch(r+"shares",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W?{path:E,confirm:!0}:{path:E})});try{let W=await Y(!1);if(W.status===409){const{findings:_e}=await W.json();if(!await Hs("This file may contain credentials",nF(_e),"Share anyway",!0))return;W=await Y(!0)}if(!W.ok)throw new Error(await W.text());const de=await W.json();zw("share_created");const we=await qs(de.url);J({url:de.url,copied:we}),it()}catch(W){Ke("Share failed: "+W.message,!0)}},[r,E,it]),[rr,xr]=w.useState(""),Tt=o&&!!l&&wi(l?.perm,"write"),Vn=w.useCallback(async(Y,W)=>{xr(Y+W);try{await Si(r+"restore",{path:Y,sha:W}),d.invalidateQueries({queryKey:["history",r]}),d.invalidateQueries({queryKey:["tree",r]}),d.invalidateQueries({queryKey:["render",r,Y]}),d.invalidateQueries({queryKey:["text"]}),Ke("Restored "+Y+" — it syncs to every device like any other change.")}catch(de){Ke("Restore failed: "+de.message,!0)}finally{xr("")}},[r,d]),[Dt,kr]=w.useState(""),ar=w.useCallback(async Y=>{if(await Hs("Remove "+Y+"?","It disappears from every synced device. History keeps it — you can restore it from the DELETED row afterwards.","Remove file",!0)){kr(Y);try{await Si(r+"remove",{path:Y}),d.invalidateQueries({queryKey:["history",r]}),d.invalidateQueries({queryKey:["tree",r]}),d.invalidateQueries({queryKey:["render",r,Y]}),d.invalidateQueries({queryKey:["text"]}),Ke("Removed "+Y+" — it syncs to every device like any other change.")}catch(W){Ke("Remove failed: "+W.message,!0)}finally{kr("")}}},[r,d]),ir=w.useCallback(()=>{if(!E)return ne("");ne(O?E+"/":E)},[E,O,ne]);w.useEffect(()=>{const Y=W=>{(W.metaKey||W.ctrlKey)&&W.key.toLowerCase()==="k"&&(W.preventDefault(),ye(de=>!de))};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[]);const wr=w.useCallback(()=>{const Y=[],W=(de,we,_e,Xe)=>Y.push({icon:de,label:we,kind:_e,run:Xe});if(o&&l){const de=l.id,we=_e=>()=>{e.onClosePanel?.(),Kt(_e)};W("folder","Go to project root","action",we("/"+de)),W("dashboard","Dashboard","action",we(Pn("dashboard",de))),W("terminal","Installation","action",we(Pn("install",de))),W("gear","Settings","action",we(Pn("settings",de)))}if(o&&l&&E&&(M&&W("share","Share: "+E,"action",jt),W("hist","History: "+E,"action",ir),M&&W("download","Download: "+E,"action",()=>xe.current?.click())),o&&l&&W("hist","History: whole project","action",()=>ne("")),o)for(const de of e.projects||[])(!l||de.id!==l.id)&&W("folder","Switch to project: "+de.name,"project",()=>Kt("/"+de.id));n.auth?.enabled&&W("power","Sign out","action",()=>window.location.href="/auth/logout");for(const de of y.keys())W("folder",de,"folder",()=>ee(de));for(const de of m)W("doc",de.path,"file",()=>ee(de.path));return Y},[o,l,E,M,n.auth?.enabled,y,m,e.projects,e.onClosePanel,jt,ir,ne,ee]);w.useEffect(()=>{if(!K)return;const Y=()=>le(!1);return document.addEventListener("click",Y),()=>document.removeEventListener("click",Y)},[K]);const sr=w.useCallback(Y=>y.has(Y),[y]);let mn="app",A,I;Oe?I=Oe.body:i.view==="dashboard"?I=f.jsx(gw,{flatFiles:m,heatMap:b,devices:_,scope:i.viewTarget||"",loading:!v,installHref:l?Pn("install",l.id):void 0,onOpenFile:ee,onOpenFolder:ee,onOpenHistory:ne,isFolder:sr}):i.view==="history"?I=f.jsx(QP,{apiBase:r,target:i.viewTarget||"",isFolder:sr,onOpen:ee,onMeta:N,onRendered:Z,restore:Tt?{onRestore:Vn,busy:rr}:void 0,remove:Tt?{onRemove:ar,busy:Dt}:void 0,filters:i.filters,onFilters:Y=>Kt(Pn("history",l?.id,i.viewTarget||"",Y))}):E?v?D?I=f.jsxs("div",{className:"notfound",children:[f.jsx("h1",{children:"Couldn't find that"}),f.jsxs("p",{children:[f.jsx("code",{children:E})," isn't in this project right now."]}),f.jsx("p",{className:"nf-sub",children:"If it was just created, it may still be uploading or syncing from a teammate's device — this page checks again automatically every few seconds, so refresh or come back in a moment."}),f.jsx("button",{className:"pbtn",onClick:()=>d.invalidateQueries({queryKey:["tree",r]}),children:"Check again"})]}):O?I=f.jsx(qI,{node:y.get(E),heatMap:b,hub:o&&!!l,apiBase:r,onOpen:ee,onFullHistory:ne,onRendered:Z}):(mn=OC.test(E)||AC.test(E)?"wide":"read",A="markdown",I=f.jsxs(f.Fragment,{children:[R&&f.jsx(eF,{apiBase:r,path:E,version:R,onViewCurrent:()=>ee(E)}),f.jsx(KI,{apiBase:r,path:E,version:R,heatMap:b,flatFiles:m,onOpenFile:ee,onMeta:N,onRendered:Z})]})):I=f.jsx("div",{className:"empty",children:"Loading…"}):x?I=f.jsxs(f.Fragment,{children:[f.jsx(HC,{project:l,existing:i.connect==="existing"}),f.jsx("div",{className:"home-insights",children:f.jsx(gw,{flatFiles:m,heatMap:b,devices:_,loading:!v,onOpenFile:ee,onOpenFolder:ee,onOpenHistory:ne,isFolder:sr})})]}):I=f.jsx("div",{className:"empty",children:"Select a file to read it."}),V&&V.to===E&&(I=f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"vbanner",role:"status",children:[f.jsx("span",{className:"vb-icon",children:f.jsx(ut,{name:"link"})}),f.jsxs("div",{className:"vb-text",children:[f.jsxs("b",{children:["Moved from ",V.from]}),f.jsx("span",{children:"The URL has been updated."})]})]}),I]}));const U=Oe?Oe.crumb:E?f.jsx(zI,{path:E,onOpenFolder:ee}):i.view==="dashboard"?"Dashboard — "+(i.viewTarget||l?.name||""):i.view==="history"?"History — "+WP(i.viewTarget||"",sr):x?l.name:null,ce=f.jsx(dl,{crumb:U,meta:z,actions:f.jsxs(f.Fragment,{children:[Ie&&f.jsx(vt,{id:"share-btn",variant:"toolbar",className:"icon-only",title:"Share","aria-label":"Share",onClick:jt,children:f.jsx(ut,{name:"share"})}),fn&&!E&&!i.view&&f.jsxs(vt,{id:"history-btn",variant:"toolbar",onClick:ir,children:[f.jsx(ut,{name:"hist"})," ",f.jsx("span",{className:"lbl",children:"History"})]}),hn&&f.jsx("a",{id:"download",hidden:!0,download:!0,href:br,ref:xe,children:"Download"}),Qt&&f.jsx(vt,{id:"more-btn",variant:"toolbar",className:"icon-only",title:"More actions","aria-label":"More actions",onClick:Y=>{Y.stopPropagation(),le(!K)},children:f.jsx(ut,{name:"dots"})}),K&&f.jsxs("div",{id:"more-menu",role:"menu",children:[fn&&f.jsx("button",{className:"more-item",onClick:ir,children:"History"}),hn&&f.jsx("button",{className:"more-item",onClick:()=>xe.current?.click(),children:"Download"}),o&&!!l&&f.jsx("button",{className:"more-item",onClick:()=>{e.onClosePanel?.(),Kt(Pn("dashboard",l?.id,E))},children:"Dashboard"})]})]})});return f.jsxs(f.Fragment,{children:[f.jsx(ul,{vault:e.sidebar.vault,projectsNav:e.sidebar.projectsNav,orgBar:e.sidebar.orgBar,tree:f.jsx(NI,{root:p,expanded:be,onToggle:X,currentPath:T,listingShowing:P,onOpen:ee}),topbar:ce,contentRef:pe,onContentScroll:re,children:f.jsxs(Su,{width:mn,className:A,children:[!Oe&&M&&f.jsx(iP,{shares:Qe,canRevoke:!!l&&wi(l.perm,"write"),onChanged:it}),I]})}),B&&f.jsx(aP,{url:B.url,copied:B.copied,onClose:()=>{J(null),it()}}),f.jsx(LP,{open:ae,onClose:()=>ye(!1),candidates:wr})]})}function rF({config:e}){const n=Yp(),r=O_(),[i,o]=w.useState(null),[l,u]=w.useState(null);w.useEffect(()=>u(null),[n]);const d=w.useMemo(()=>{const ge=n.split("?")[0].match(/^\/join\/([0-9a-f]+)\/?$/);return ge?ge[1]:null},[n]),{data:p}=E3(!d),{data:m}=R3(!d),y=!!e.auth.admin,{data:v}=T_(y),b=w.useMemo(()=>D_(n,"hub"),[n]),[x,S]=w.useState(!1),_=e.upload.enabled,E=async(ge,L)=>{const Z=L===BC;try{const re=await Si("/api/projects",{name:ge,template:Z?"":L});S(!1),await r(),Kt("/"+re.project.id+(Z?"?connect=existing":"")),Ke(`Created “${re.project.name}”.`)}catch(re){Ke("Could not create the project: "+re.message,!0)}},R=x?f.jsx(eI,{templates:e.templates??[],onCreate:E,onClose:()=>S(!1)}):null,T=w.useMemo(()=>p&&(p.find(ge=>ge.id===b.project)||i&&p.find(ge=>ge.org===i)||p.find(ge=>ge.id===_$())||p[0])||null,[p,b.project,i]);if(w.useEffect(()=>{document.title=T?T.name+" — BearDrive":e.brand||"BearDrive",T&&C$(T.id)},[T,e]),d)return f.jsx(aF,{token:d,onDone:async ge=>{o(ge),await r(),Kt("/",{replace:!0})}});const O=e.brand||"BearDrive",M=T&&m?.find(ge=>ge.id===T.org)||null,D=f.jsx(Xu,{name:O,onHome:()=>Kt("/"),search:!!T}),P=e.me?f.jsx(q$,{me:e.me,org:M,orgActive:!!b.org,billing:e.billing,admin:y?{pending:v?.length||0,onClick:()=>{u({kind:"hub"}),mr()}}:void 0}):void 0;if(!p||!m)return f.jsx(ul,{vault:D,topbar:f.jsx(dl,{}),children:f.jsx(Su,{children:f.jsx("div",{className:"empty",children:"Loading…"})})});if(!T)return f.jsxs(ul,{vault:D,projectsNav:f.jsx(aw,{projects:p,onNew:()=>S(!0)}),orgBar:P,topbar:f.jsx(dl,{}),children:[f.jsx(Su,{children:f.jsx(W$,{onNew:()=>S(!0),canCreate:_})}),R]});const F=l?.kind==="hub"?{crumb:"Signup & access",body:f.jsx(k$,{})}:null,V=b.org?m.find(ge=>ge.id===b.org):null,be=b.org&&!V?{crumb:"Organization",body:f.jsxs("div",{className:"empty",children:[f.jsx("h3",{children:"Organization not found"}),f.jsx("p",{children:"This organization doesn't exist, or you're no longer a member."}),f.jsx("p",{children:f.jsxs("a",{...Bs("/"+T.id),children:["Back to ",T.name]})})]})}:V?{crumb:"Organization",body:f.jsx(N$,{org:V,projects:p,myEmail:e.me?.email||""})}:null,he=!!b.project&&!p.some(ge=>ge.id===b.project),ue=he?{crumb:"Project",body:f.jsxs("div",{className:"empty",children:[f.jsx("h3",{children:"Project not found"}),f.jsx("p",{children:"This project doesn't exist, or you're no longer a member."}),f.jsx("p",{children:f.jsxs("a",{...Bs("/"+T.id),children:["Back to ",T.name]})})]})}:null,X=b.billing?{crumb:"Billing",body:e.billing?f.jsx(G$,{url:e.billing.url}):f.jsxs("div",{className:"empty",children:[f.jsx("h3",{children:"No billing on this hub"}),f.jsx("p",{children:"This BearDrive hub doesn't have a billing surface."})]})}:null,pe=b.view==="settings"?{crumb:"Project settings",body:f.jsx(Y$,{project:T,org:M,onDeleted:async()=>{await r(),Kt("/")}})}:b.view==="install"?{crumb:"Installation",body:f.jsx(HC,{project:T,existing:b.connect==="existing"})}:null;if(!he){if(!b.org&&!b.billing&&b.project!==T.id)return f.jsx(Qo,{to:"/"+T.id});if(b.legacyView&&b.view)return f.jsx(Qo,{to:Pn(b.view,T.id,b.viewTarget,b.filters)});if(b.queryTarget&&b.view)return f.jsx(Qo,{to:Pn(b.view,T.id,b.viewTarget,b.filters)});if(b.trailingSlash&&b.path)return f.jsx(Qo,{to:fl(b.path,T.id,b.version)})}return f.jsxs(f.Fragment,{children:[f.jsx(sE,{config:e,apiBase:"/api/p/"+T.id+"/",route:b,hub:!0,project:T,projects:p,sidebar:{vault:D,projectsNav:f.jsx(aw,{projects:p,currentId:T.id,onNew:()=>S(!0),menu:{active:l?null:b.view==="dashboard"&&!b.viewTarget?"dashboard":b.view==="install"?"install":b.view==="history"&&!b.viewTarget?"history":b.view==="settings"?"settings":null,onDashboard:()=>{u(null),Kt(Pn("dashboard",T.id)),mr()},onInstall:()=>{u(null),Kt(Pn("install",T.id)),mr()},onHistory:()=>{u(null),Kt(Pn("history",T.id)),mr()},onSettings:()=>{u(null),Kt(Pn("settings",T.id)),mr()}}}),orgBar:P},panel:F||be||ue||X||pe,onClosePanel:()=>u(null)},T.id),R]})}function aF({token:e,onDone:n}){return w.useEffect(()=>{let r=!1;return Si("/api/invites/"+e).then(i=>{r||(Ke(`Welcome — you joined the “${i.org.name}” team. Opening its projects…`),n(i.org.id))}).catch(i=>{r||String(i.message).includes("signing in")||(Ke("Could not accept the invite: "+i.message,!0),n(null))}),()=>{r=!0}},[e]),f.jsx(ul,{vault:f.jsx(Xu,{name:"BearDrive"}),topbar:f.jsx(dl,{}),children:f.jsx(Su,{children:f.jsx("div",{className:"empty",children:"Joining…"})})})}function iF({config:e}){const n=Yp(),r=e.volume||"BearDrive";w.useEffect(()=>{document.title=e.brand||r},[e,r]);const i=w.useMemo(()=>D_(n,"volume"),[n]);return i.trailingSlash&&i.path?f.jsx(Qo,{to:fl(i.path)}):f.jsx(sE,{config:e,apiBase:"/api/",route:i,hub:!1,sidebar:{vault:f.jsx(Xu,{name:r,showSignout:e.auth.enabled,search:!0})}})}function sF(){const{data:e}=vj();return f.jsxs($D,{delayDuration:150,children:[e?e.mode==="hub"?f.jsx(rF,{config:e}):f.jsx(iF,{config:e}):f.jsx(ul,{vault:f.jsx(Xu,{name:"…",showSignout:!1}),topbar:f.jsx(dl,{}),children:f.jsx("div",{className:"empty",children:"Loading…"})}),f.jsx(v3,{}),f.jsx(S3,{})]})}class oF extends w.Component{state={error:null};static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){console.error("BearDrive: unhandled render error",n,r.componentStack)}render(){return this.state.error?f.jsxs("div",{className:"mx-auto max-w-lg p-8 text-sm",children:[f.jsx("h1",{className:"mb-2 text-lg font-semibold",children:"This page didn’t load"}),f.jsx("p",{className:"mb-4 opacity-80",children:"Something went wrong rendering this view. The rest of BearDrive is fine."}),f.jsx("p",{className:"mb-4",children:f.jsx("a",{className:"underline",href:"/",children:"Go to the project list"})}),f.jsx("pre",{className:"overflow-x-auto rounded bg-black/5 p-3 text-xs dark:bg-white/10",children:String(this.state.error)})]}):this.props.children}}const lF=new ej({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});j2.createRoot(document.getElementById("root")).render(f.jsx(w.StrictMode,{children:f.jsx(oF,{children:f.jsx(tj,{client:lF,children:f.jsx(sF,{})})})})); +`)continue;l+=y}}return u||((l!==""||o.length)&&p(),!i.length)||i[0].length<2?null:{rows:i,truncated:d}}function QI(e){const{apiBase:n,path:r,version:i,onMeta:o}=e,l=i?n+"blob?sha="+i+"&name="+encodeURIComponent(r):n+"file?path="+encodeURIComponent(r);return S.useEffect(()=>()=>o(""),[r,o]),w$.test(r)?f.jsx(WI,{...e}):OC.test(r)?f.jsx("iframe",{className:"htmlview",sandbox:"allow-scripts",src:l,title:r,onLoad:e.onRendered}):AC.test(r)?f.jsx("iframe",{className:"pdfview",src:l,title:r,onLoad:e.onRendered}):S$.test(r)?f.jsx(nP,{src:l,alt:r,version:i,onRendered:e.onRendered}):_$.test(r)?f.jsx(dw,{...e,fileURL:l,delim:/\.tsv$/i.test(r)?" ":","}):C$.test(r)?f.jsx(dw,{...e,fileURL:l}):f.jsx(XI,{...e,fileURL:l})}function XI(e){const{apiBase:n,path:r,version:i,fileURL:o,onRendered:l}=e,{data:u,error:d}=ZC(o,["text",o],!0,!!i);return S.useEffect(()=>{u&&l?.()},[u,l]),d?f.jsx(fd,{version:i,err:d}):u?u.kind==="text"?f.jsx("pre",{className:"plain",children:u.text},r):f.jsx(JI,{apiBase:n,path:r,version:i,fileURL:o,children:u.kind==="too-large"?`Too large to preview (${mg(u.size)}).`:"No preview for this file type."}):null}function JI(e){const{apiBase:n,path:r,version:i,fileURL:o}=e;return f.jsxs("div",{className:"filecard",children:[f.jsx("div",{className:"name",children:r.split("/").pop()}),f.jsx("p",{children:e.children}),f.jsx("a",{className:"btn",download:!0,href:i?o+"&download=1":n+"download?path="+encodeURIComponent(r),children:"Download"})]})}function WI(e){const{apiBase:n,path:r,version:i,heatMap:o,flatFiles:l,onOpenFile:u,onMeta:d,onRendered:p}=e,{data:m,error:y}=Pt({queryKey:["render",n,r,i||""],queryFn:()=>Bt(n+"render?path="+encodeURIComponent(r)+(i?"&sha="+i:"")),retry:i?!1:void 0}),v=S.useMemo(()=>m?tP(m.html,r,n):"",[m,r,n]),[b,x]=S.useState(null);return S.useEffect(()=>{if(x(null),!y2(v))return;let w=!1;return b2(v).then(_=>{w||x(_)}),()=>{w=!0}},[v]),S.useEffect(()=>{if(!m)return;const w=[];(m.user_name||m.user||m.author)&&w.push(dd(m)+(m.device?" on "+m.device:"")),m.time&&w.push(new Date(m.time).toLocaleString());const _=i?null:o&&o[m.path];_&&ka(_)&&w.push(Jo(_)+" / 30d"),d(w.join(" · ")),p?.()},[m,i,o,d,p]),y?f.jsx(fd,{version:i,err:y}):m?f.jsx("div",{dangerouslySetInnerHTML:{__html:b??v},onClick:w=>eP(w,r,l,u)}):null}function eP(e,n,r,i){const o=e.target.closest("a");if(!o||!e.currentTarget.contains(o))return;const l=o.getAttribute("href")||"",u=n.includes("/")?n.slice(0,n.lastIndexOf("/")):"";l.startsWith("wiki:")?(e.preventDefault(),aP(decodeURIComponent(l.slice(5)),r,i)):/^([a-z]+:|\/|#)/i.test(l)||(e.preventDefault(),i(MC(u,decodeURIComponent(l))))}function tP(e,n,r){const i=n.includes("/")?n.slice(0,n.lastIndexOf("/")):"",o=u=>r+"file?path="+encodeURIComponent(u),l=new DOMParser().parseFromString(e,"text/html");for(const u of l.querySelectorAll("img")){const d=u.getAttribute("src")||"";/^\s*data:image\/svg/i.test(d)?u.removeAttribute("src"):/^([a-z]+:|\/)/i.test(d)||u.setAttribute("src",o(MC(i,d)))}for(const u of l.querySelectorAll("a")){const d=u.getAttribute("href")||"";/^\s*data:/i.test(d)?u.removeAttribute("href"):/^https?:/i.test(d)&&(u.setAttribute("target","_blank"),u.setAttribute("rel","noopener"))}return l.body.innerHTML}function nP(e){const[n,r]=S.useState(!1);return n?f.jsx(fd,{version:e.version,err:new Error("could not be loaded")}):f.jsx("img",{src:e.src,alt:e.alt,onLoad:e.onRendered,onError:()=>r(!0)})}function fd({version:e,err:n}){return f.jsx("div",{className:"empty",children:e?"That version isn't available.":"Could not load file: "+n.message})}function dw(e){const{path:n,version:r,fileURL:i,delim:o,onRendered:l}=e,{data:u,error:d}=Pt({queryKey:["text",i],queryFn:async()=>{const m=await fetch(i);if(!m.ok)throw new Error(await m.text());return m.text()},retry:r?!1:void 0});S.useEffect(()=>{u!=null&&l?.()},[u,l]);const p=S.useMemo(()=>o&&u!=null?YI(u,o,YC):null,[u,o]);return d?f.jsx(fd,{version:r,err:d}):u==null?null:p?f.jsx(rP,{csv:p},n):f.jsx("pre",{className:"plain",children:u},n)}function rP({csv:e}){const[n,...r]=e.rows,i=e.rows.reduce((l,u)=>Math.max(l,u.length),0),o=Array.from({length:i},(l,u)=>u);return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"csvbox",children:f.jsxs("table",{className:"csvview",children:[f.jsx("thead",{children:f.jsx("tr",{children:o.map(l=>f.jsx("th",{children:n[l]??""},l))})}),f.jsx("tbody",{children:r.map((l,u)=>f.jsx("tr",{children:o.map(d=>f.jsx("td",{children:l[d]??""},d))},u))})]})}),e.truncated>0&&f.jsxs("p",{className:"csvnote",children:["showing ",e.rows.length.toLocaleString()," of"," ",(e.rows.length+e.truncated).toLocaleString()," rows — Download for the rest"]})]})}function aP(e,n,r){const i=e.toLowerCase(),o=n.find(l=>l.path.toLowerCase()===i||l.path.toLowerCase()===i+".md")||n.find(l=>{const u=l.name.toLowerCase();return u===i||u===i+".md"});o&&r(o.path)}const iP=[{value:"",label:"Never"},{value:"24h",label:"In 24 hours"},{value:"168h",label:"In 7 days"},{value:"720h",label:"In 30 days"}];function sP({url:e,copied:n,onClose:r}){const i=e.split("/s/")[1],[o,l]=S.useState(""),[u,d]=S.useState(),[p,m]=S.useState(!1),y=S.useRef(null);async function v(b){const x=o;l(b),m(!0);try{const w=await Wn("PATCH","/api/shares/"+i,{expires_in:b});d(w.expires)}catch(w){Ke(w.message,!0),l(x)}finally{m(!1)}}return f.jsx(Ju,{open:!0,onOpenChange:b=>!b&&r(),children:f.jsxs(Wu,{className:"modal",showCloseButton:!1,onOpenAutoFocus:b=>{b.preventDefault(),y.current?.focus()},children:[f.jsx(_l,{asChild:!0,children:f.jsx("h3",{children:"Public link"})}),f.jsxs("p",{children:[f.jsx("b",{children:"Anyone with this link can view this file"})," — no account needed. It always shows the latest version until it expires or you revoke it."]}),f.jsx("div",{className:"modal-url",children:e}),f.jsxs("div",{className:"modal-expiry",children:[f.jsx("label",{htmlFor:"share-expiry",children:"Expires"}),f.jsx("select",{id:"share-expiry",value:o,disabled:p,onChange:b=>v(b.target.value),children:iP.map(b=>f.jsx("option",{value:b.value,children:b.label},b.value))}),f.jsx("span",{className:"modal-expiry-note",children:zC(u)})]}),f.jsxs("div",{className:"modal-actions",children:[f.jsx(vt,{ref:y,variant:"primary",onClick:()=>qs(e).then(b=>Ke(b?"Copied.":"Select and copy the link above.")),children:n?"Copied ✓":"Copy link"}),f.jsx(vt,{variant:"subtle",onClick:()=>window.open(e,"_blank"),children:"Open"}),f.jsx(vt,{variant:"subtle",onClick:r,children:"Done"})]})]})})}function oP({shares:e,canRevoke:n,onChanged:r}){return e.length===0?null:f.jsxs("div",{className:"share-banner",role:"status",children:[f.jsxs("div",{className:"sb-head",children:[f.jsx(ut,{name:"share"}),f.jsx("b",{children:"Publicly shared"}),f.jsxs("span",{className:"sb-count",children:[e.length," active link",e.length>1?"s":""]})]}),f.jsxs("p",{className:"sb-note",children:[f.jsx("b",{children:"Anyone with this link can view this file"})," — no account needed. It always shows the latest version until you revoke it.",e.some(i=>i.opens!==void 0)&&f.jsxs(f.Fragment,{children:[" ",LC]})]}),e.map(i=>f.jsxs("div",{className:"sb-link",children:[f.jsx("span",{className:"sb-url mono",title:i.url,children:i.url}),f.jsx("span",{className:"sb-meta",children:kC(i,!1)}),f.jsxs("span",{className:"sb-actions",children:[f.jsx(vt,{variant:"subtle",onClick:()=>qs(i.url).then(o=>Ke(o?"Copied.":"Select and copy the link.")),children:"Copy link"}),f.jsx(vt,{variant:"subtle",onClick:()=>window.open(i.url,"_blank"),children:"Open"}),n&&f.jsx("button",{className:"ai-del","aria-label":`Revoke the share of ${i.path}`,onClick:()=>IC(i,r),children:"Revoke"})]})]},i.token))]})}var fw=1,lP=.9,cP=.8,uP=.17,sm=.1,om=.999,dP=.9999,fP=.99,hP=/[\\\/_+.#"@\[\(\{&]/,mP=/[\\\/_+.#"@\[\(\{&]/g,pP=/[\s-]/,QC=/[\s-]/g;function Wm(e,n,r,i,o,l,u){if(l===n.length)return o===e.length?fw:fP;var d=`${o},${l}`;if(u[d]!==void 0)return u[d];for(var p=i.charAt(l),m=r.indexOf(p,o),y=0,v,b,x,w;m>=0;)v=Wm(e,n,r,i,m+1,l+1,u),v>y&&(m===o?v*=fw:hP.test(e.charAt(m-1))?(v*=cP,x=e.slice(o,m-1).match(mP),x&&o>0&&(v*=Math.pow(om,x.length))):pP.test(e.charAt(m-1))?(v*=lP,w=e.slice(o,m-1).match(QC),w&&o>0&&(v*=Math.pow(om,w.length))):(v*=uP,o>0&&(v*=Math.pow(om,m-o))),e.charAt(m)!==n.charAt(l)&&(v*=dP)),(vv&&(v=b*sm)),v>y&&(y=v),m=r.indexOf(p,m+1);return u[d]=y,y}function hw(e){return e.toLowerCase().replace(QC," ")}function gP(e,n,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Wm(e,n,hw(e),hw(n),0,0,{})}var Zo='[cmdk-group=""]',lm='[cmdk-group-items=""]',vP='[cmdk-group-heading=""]',XC='[cmdk-item=""]',mw=`${XC}:not([aria-disabled="true"])`,ep="cmdk-item-select",Os="data-value",yP=(e,n,r)=>gP(e,n,r),JC=S.createContext(void 0),jl=()=>S.useContext(JC),WC=S.createContext(void 0),gg=()=>S.useContext(WC),eE=S.createContext(void 0),tE=S.forwardRef((e,n)=>{let r=As(()=>{var N,B;return{search:"",value:(B=(N=e.value)!=null?N:e.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=As(()=>new Set),o=As(()=>new Map),l=As(()=>new Map),u=As(()=>new Set),d=nE(e),{label:p,children:m,value:y,onValueChange:v,filter:b,shouldFilter:x,loop:w,disablePointerSelection:_=!1,vimBindings:E=!0,...R}=e,T=dn(),O=dn(),M=dn(),D=S.useRef(null),P=OP();Oi(()=>{if(y!==void 0){let N=y.trim();r.current.value=N,F.emit()}},[y]),Oi(()=>{P(6,X)},[]);let F=S.useMemo(()=>({subscribe:N=>(u.current.add(N),()=>u.current.delete(N)),snapshot:()=>r.current,setState:(N,B,J)=>{var K,le,ae,ye;if(!Object.is(r.current[N],B)){if(r.current[N]=B,N==="search")ue(),be(),P(1,he);else if(N==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let xe=document.getElementById(M);xe?xe.focus():(K=document.getElementById(T))==null||K.focus()}if(P(7,()=>{var xe;r.current.selectedItemId=(xe=pe())==null?void 0:xe.id,F.emit()}),J||P(5,X),((le=d.current)==null?void 0:le.value)!==void 0){let xe=B??"";(ye=(ae=d.current).onValueChange)==null||ye.call(ae,xe);return}}F.emit()}},emit:()=>{u.current.forEach(N=>N())}}),[]),V=S.useMemo(()=>({value:(N,B,J)=>{var K;B!==((K=l.current.get(N))==null?void 0:K.value)&&(l.current.set(N,{value:B,keywords:J}),r.current.filtered.items.set(N,ve(B,J)),P(2,()=>{be(),F.emit()}))},item:(N,B)=>(i.current.add(N),B&&(o.current.has(B)?o.current.get(B).add(N):o.current.set(B,new Set([N]))),P(3,()=>{ue(),be(),r.current.value||he(),F.emit()}),()=>{l.current.delete(N),i.current.delete(N),r.current.filtered.items.delete(N);let J=pe();P(4,()=>{ue(),J?.getAttribute("id")===N&&he(),F.emit()})}),group:N=>(o.current.has(N)||o.current.set(N,new Set),()=>{l.current.delete(N),o.current.delete(N)}),filter:()=>d.current.shouldFilter,label:p||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:T,inputId:M,labelId:O,listInnerRef:D}),[]);function ve(N,B){var J,K;let le=(K=(J=d.current)==null?void 0:J.filter)!=null?K:yP;return N?le(N,r.current.search,B):0}function be(){if(!r.current.search||d.current.shouldFilter===!1)return;let N=r.current.filtered.items,B=[];r.current.filtered.groups.forEach(K=>{let le=o.current.get(K),ae=0;le.forEach(ye=>{let xe=N.get(ye);ae=Math.max(xe,ae)}),B.push([K,ae])});let J=D.current;ge().sort((K,le)=>{var ae,ye;let xe=K.getAttribute("id"),Oe=le.getAttribute("id");return((ae=N.get(Oe))!=null?ae:0)-((ye=N.get(xe))!=null?ye:0)}).forEach(K=>{let le=K.closest(lm);le?le.appendChild(K.parentElement===le?K:K.closest(`${lm} > *`)):J.appendChild(K.parentElement===J?K:K.closest(`${lm} > *`))}),B.sort((K,le)=>le[1]-K[1]).forEach(K=>{var le;let ae=(le=D.current)==null?void 0:le.querySelector(`${Zo}[${Os}="${encodeURIComponent(K[0])}"]`);ae?.parentElement.appendChild(ae)})}function he(){let N=ge().find(J=>J.getAttribute("aria-disabled")!=="true"),B=N?.getAttribute(Os);F.setState("value",B||void 0)}function ue(){var N,B,J,K;if(!r.current.search||d.current.shouldFilter===!1){r.current.filtered.count=i.current.size;return}r.current.filtered.groups=new Set;let le=0;for(let ae of i.current){let ye=(B=(N=l.current.get(ae))==null?void 0:N.value)!=null?B:"",xe=(K=(J=l.current.get(ae))==null?void 0:J.keywords)!=null?K:[],Oe=ve(ye,xe);r.current.filtered.items.set(ae,Oe),Oe>0&&le++}for(let[ae,ye]of o.current)for(let xe of ye)if(r.current.filtered.items.get(xe)>0){r.current.filtered.groups.add(ae);break}r.current.filtered.count=le}function X(){var N,B,J;let K=pe();K&&(((N=K.parentElement)==null?void 0:N.firstChild)===K&&((J=(B=K.closest(Zo))==null?void 0:B.querySelector(vP))==null||J.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function pe(){var N;return(N=D.current)==null?void 0:N.querySelector(`${XC}[aria-selected="true"]`)}function ge(){var N;return Array.from(((N=D.current)==null?void 0:N.querySelectorAll(mw))||[])}function L(N){let B=ge()[N];B&&F.setState("value",B.getAttribute(Os))}function Z(N){var B;let J=pe(),K=ge(),le=K.findIndex(ye=>ye===J),ae=K[le+N];(B=d.current)!=null&&B.loop&&(ae=le+N<0?K[K.length-1]:le+N===K.length?K[0]:K[le+N]),ae&&F.setState("value",ae.getAttribute(Os))}function re(N){let B=pe(),J=B?.closest(Zo),K;for(;J&&!K;)J=N>0?jP(J,Zo):TP(J,Zo),K=J?.querySelector(mw);K?F.setState("value",K.getAttribute(Os)):Z(N)}let ee=()=>L(ge().length-1),ne=N=>{N.preventDefault(),N.metaKey?ee():N.altKey?re(1):Z(1)},z=N=>{N.preventDefault(),N.metaKey?L(0):N.altKey?re(-1):Z(-1)};return S.createElement($e.div,{ref:n,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:N=>{var B;(B=R.onKeyDown)==null||B.call(R,N);let J=N.nativeEvent.isComposing||N.keyCode===229;if(!(N.defaultPrevented||J))switch(N.key){case"n":case"j":{E&&N.ctrlKey&&ne(N);break}case"ArrowDown":{ne(N);break}case"p":case"k":{E&&N.ctrlKey&&z(N);break}case"ArrowUp":{z(N);break}case"Home":{N.preventDefault(),L(0);break}case"End":{N.preventDefault(),ee();break}case"Enter":{N.preventDefault();let K=pe();if(K){let le=new Event(ep);K.dispatchEvent(le)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:V.inputId,id:V.labelId,style:MP},p),md(e,N=>S.createElement(WC.Provider,{value:F},S.createElement(JC.Provider,{value:V},N))))}),bP=S.forwardRef((e,n)=>{var r,i;let o=dn(),l=S.useRef(null),u=S.useContext(eE),d=jl(),p=nE(e),m=(i=(r=p.current)==null?void 0:r.forceMount)!=null?i:u?.forceMount;Oi(()=>{if(!m)return d.item(o,u?.id)},[m]);let y=rE(o,l,[e.value,e.children,l],e.keywords),v=gg(),b=qa(P=>P.value&&P.value===y.current),x=qa(P=>m||d.filter()===!1?!0:P.search?P.filtered.items.get(o)>0:!0);S.useEffect(()=>{let P=l.current;if(!(!P||e.disabled))return P.addEventListener(ep,w),()=>P.removeEventListener(ep,w)},[x,e.onSelect,e.disabled]);function w(){var P,F;_(),(F=(P=p.current).onSelect)==null||F.call(P,y.current)}function _(){v.setState("value",y.current,!0)}if(!x)return null;let{disabled:E,value:R,onSelect:T,forceMount:O,keywords:M,...D}=e;return S.createElement($e.div,{ref:Ps(l,n),...D,id:o,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!b,"data-disabled":!!E,"data-selected":!!b,onPointerMove:E||d.getDisablePointerSelection()?void 0:_,onClick:E?void 0:w},e.children)}),xP=S.forwardRef((e,n)=>{let{heading:r,children:i,forceMount:o,...l}=e,u=dn(),d=S.useRef(null),p=S.useRef(null),m=dn(),y=jl(),v=qa(x=>o||y.filter()===!1?!0:x.search?x.filtered.groups.has(u):!0);Oi(()=>y.group(u),[]),rE(u,d,[e.value,e.heading,p]);let b=S.useMemo(()=>({id:u,forceMount:o}),[o]);return S.createElement($e.div,{ref:Ps(d,n),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},r&&S.createElement("div",{ref:p,"cmdk-group-heading":"","aria-hidden":!0,id:m},r),md(e,x=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?m:void 0},S.createElement(eE.Provider,{value:b},x))))}),wP=S.forwardRef((e,n)=>{let{alwaysRender:r,...i}=e,o=S.useRef(null),l=qa(u=>!u.search);return!r&&!l?null:S.createElement($e.div,{ref:Ps(o,n),...i,"cmdk-separator":"",role:"separator"})}),SP=S.forwardRef((e,n)=>{let{onValueChange:r,...i}=e,o=e.value!=null,l=gg(),u=qa(m=>m.search),d=qa(m=>m.selectedItemId),p=jl();return S.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),S.createElement($e.input,{ref:n,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":p.listId,"aria-labelledby":p.labelId,"aria-activedescendant":d,id:p.inputId,type:"text",value:o?e.value:u,onChange:m=>{o||l.setState("search",m.target.value),r?.(m.target.value)}})}),_P=S.forwardRef((e,n)=>{let{children:r,label:i="Suggestions",...o}=e,l=S.useRef(null),u=S.useRef(null),d=qa(m=>m.selectedItemId),p=jl();return S.useEffect(()=>{if(u.current&&l.current){let m=u.current,y=l.current,v,b=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let x=m.offsetHeight;y.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return b.observe(m),()=>{cancelAnimationFrame(v),b.unobserve(m)}}},[]),S.createElement($e.div,{ref:Ps(l,n),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":i,id:p.listId},md(e,m=>S.createElement("div",{ref:Ps(u,p.listInnerRef),"cmdk-list-sizer":""},m)))}),CP=S.forwardRef((e,n)=>{let{open:r,onOpenChange:i,overlayClassName:o,contentClassName:l,container:u,...d}=e;return S.createElement(hp,{open:r,onOpenChange:i},S.createElement(pp,{container:u},S.createElement(gp,{"cmdk-overlay":"",className:o}),S.createElement(vp,{"aria-label":e.label,"cmdk-dialog":"",className:l},S.createElement(tE,{ref:n,...d}))))}),EP=S.forwardRef((e,n)=>qa(r=>r.filtered.count===0)?S.createElement($e.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),RP=S.forwardRef((e,n)=>{let{progress:r,children:i,label:o="Loading...",...l}=e;return S.createElement($e.div,{ref:n,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},md(e,u=>S.createElement("div",{"aria-hidden":!0},u)))}),hd=Object.assign(tE,{List:_P,Item:bP,Input:SP,Group:xP,Separator:wP,Dialog:CP,Empty:EP,Loading:RP});function jP(e,n){let r=e.nextElementSibling;for(;r;){if(r.matches(n))return r;r=r.nextElementSibling}}function TP(e,n){let r=e.previousElementSibling;for(;r;){if(r.matches(n))return r;r=r.previousElementSibling}}function nE(e){let n=S.useRef(e);return Oi(()=>{n.current=e}),n}var Oi=typeof window>"u"?S.useEffect:S.useLayoutEffect;function As(e){let n=S.useRef();return n.current===void 0&&(n.current=e()),n}function qa(e){let n=gg(),r=()=>e(n.snapshot());return S.useSyncExternalStore(n.subscribe,r,r)}function rE(e,n,r,i=[]){let o=S.useRef(),l=jl();return Oi(()=>{var u;let d=(()=>{var m;for(let y of r){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(m=y.current.textContent)==null?void 0:m.trim():o.current}})(),p=i.map(m=>m.trim());l.value(e,d,p),(u=n.current)==null||u.setAttribute(Os,d),o.current=d}),o}var OP=()=>{let[e,n]=S.useState(),r=As(()=>new Map);return Oi(()=>{r.current.forEach(i=>i()),r.current=new Map},[e]),(i,o)=>{r.current.set(i,o),n({})}};function AP(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function md({asChild:e,children:n},r){return e&&S.isValidElement(n)?S.cloneElement(AP(n),{ref:n.ref},r(n.props.children)):r(n)}var MP={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function NP({className:e,...n}){return f.jsx(hd,{"data-slot":"command",className:Je("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n})}function DP({className:e,...n}){return f.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[f.jsx(b_,{className:"size-4 shrink-0 opacity-50"}),f.jsx(hd.Input,{"data-slot":"command-input",className:Je("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n})]})}function zP({className:e,...n}){return f.jsx(hd.List,{"data-slot":"command-list",className:Je("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...n})}function kP({className:e,...n}){return f.jsx(hd.Item,{"data-slot":"command-item",className:Je("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...n})}function pw(e,n){if(!e)return{score:0,hits:[]};const r=e.toLowerCase(),i=n.toLowerCase();let o=0,l=0,u=0;const d=[];for(let p=0;p3&&i.endsWith("ies")?o=i.slice(0,-3)+"y":i.length>3&&i.endsWith("es")?o=i.slice(0,-2):i.length>2&&i.endsWith("s")&&(o=i.slice(0,-1)),o?pw(o,n):null}function $P({text:e,hits:n}){const r=[];let i=0;return n.forEach((o,l)=>{o>i&&r.push(e.slice(i,o)),r.push(f.jsx("b",{children:e[o]},l)),i=o+1}),r.push(e.slice(i)),f.jsx("span",{className:"plabel",children:r})}function IP({open:e,onClose:n,candidates:r}){const[i,o]=S.useState(""),l=S.useMemo(()=>{if(!e)return[];const d=[];for(const p of r()){const m=LP(i,p.label);m&&d.push({...p,score:m.score,hits:m.hits})}return d.sort((p,m)=>m.score-p.score),d.slice(0,40)},[e,i,r]);S.useEffect(()=>{e&&o("")},[e]);const u=d=>{n(),d.run()};return f.jsx(Ju,{open:e,onOpenChange:d=>!d&&n(),children:f.jsxs(Wu,{id:"palette",className:"palette",showCloseButton:!1,"aria-describedby":void 0,children:[f.jsx(_l,{className:"sr-only",children:"Search and quick actions"}),f.jsxs(NP,{shouldFilter:!1,loop:!0,children:[f.jsxs("div",{id:"palette-inputwrap",children:[f.jsx(ut,{name:"search"}),f.jsx(DP,{placeholder:"Search file names, projects, actions…",autoComplete:"off",spellCheck:!1,value:i,onValueChange:o})]}),f.jsx(zP,{children:l.length===0?f.jsx("div",{className:"pempty",children:"No matches — search covers file names, projects, and actions"}):l.map(d=>f.jsxs(kP,{value:d.kind+":"+d.label,onSelect:()=>u(d),children:[f.jsx("span",{className:"picon",children:f.jsx(ut,{name:d.icon})}),f.jsx($P,{text:d.label,hits:d.hits}),f.jsx("span",{className:"pkind",children:d.kind})]},d.kind+":"+d.label))}),f.jsx("footer",{id:"palette-hint",children:"↑↓ navigate · ⏎ select · esc close"})]})]})})}const Wo=3,Ms=30;function PP(e,n){return Pt({queryKey:["heatDevices",e],queryFn:()=>Bt(e+"heat?by=device&days=30"),enabled:n,retry:!1,staleTime:6e4}).data?.devices??null}const FP=["all","human","agent","share"],VP={all:"All reads",human:"Human reads",agent:"Agent reads",share:"Shared reads"},UP={agent:{agent:1,human:0,share:0},human:{agent:0,human:1,share:0},share:{agent:0,human:0,share:1}};function gw(e){const[n,r]=S.useState("all"),{flatFiles:i,heatMap:o,devices:l,scope:u}=e,d=w=>!u||w===u||w.startsWith(u+"/"),p=u?i.filter(w=>d(w.path)):i;if(!e.loading&&!p.length)return f.jsxs("div",{className:"insights",children:[f.jsxs("h1",{className:"in-title",children:["Knowledge insights",u?f.jsxs("span",{className:"in-scope",children:[" · ",u]}):null]}),f.jsxs("div",{className:"dl-empty in-blank",children:[f.jsx("p",{children:u?`Nothing in ${u} to chart yet.`:"Nothing to chart yet."}),f.jsx("p",{children:u?`No files under ${u} are syncing here yet.`:"This project has no files. Once a device syncs files here, the map, the reads × freshness plot and the hot path fill in on their own."}),e.installHref&&f.jsx("a",{className:"pbtn",...Bs(e.installHref),children:"Set up a device →"})]})]});const m=l&&u?l.map(w=>{const _=Object.create(null);for(const[E,R]of Object.entries(w.folders||{}))d(E)&&(_[E]=R);return{...w,folders:_}}).filter(w=>Object.keys(w.folders).length>0):l,y=Date.now(),v=p.map(w=>{const _=o&&o[w.path]||{},E=w.time?Math.max(0,(y-new Date(w.time).getTime())/864e5):0,R=n==="all"?ka(_):_[n]||0;return{path:w.path,reads:R,agent:_.agent||0,human:_.human||0,share:_.share||0,total:ka(_),days:E,danger:R>=Wo&&E>=Ms}}),b=iI(o,new Set(i.map(w=>w.path))).filter(d).map(w=>{const _=o[w];return{path:w,reads:n==="all"?ka(_):_[n]||0,agent:_.agent||0,human:_.human||0,share:_.share||0,total:ka(_),days:0,danger:!1,orphan:!0}}).filter(w=>w.reads>0),x=b.length>0?f.jsxs("p",{className:"in-legend in-orphan-note",children:[tp(b.length,"file")," with reads ",b.length===1?"is":"are"," no longer in the project — see Hot path."]}):null;return f.jsxs("div",{className:"insights",children:[f.jsxs("h1",{className:"in-title",children:["Knowledge insights",u?f.jsxs("span",{className:"in-scope",children:[" · ",u]}):null]}),f.jsx("p",{className:"dl-sub",children:u?`Reads over the last 30 days × freshness, for ${u} and everything in it.`:"Reads over the last 30 days × how long since each file changed. Hot but stale knowledge — read a lot, maintained by nobody — is the danger zone."}),f.jsx("div",{className:"in-lens",children:FP.map(w=>f.jsx("button",{className:"in-lens-btn"+(w===n?" active":""),onClick:()=>r(w),children:VP[w]},w))}),f.jsx("h3",{className:"dl-h3",children:"Map — cell size = reads, color = freshness (scale below)"}),f.jsx(BP,{pts:v,onOpenFile:e.onOpenFile,onOpenFolder:e.onOpenFolder,isFolder:e.isFolder}),x,f.jsxs("h3",{className:"dl-h3 in-h3-row",children:["Reads × freshness",f.jsx("span",{className:"in-cap",children:"dot size = agent share of reads"})]}),f.jsx(GP,{pts:v,onOpenFile:e.onOpenFile}),x,f.jsx("h3",{className:"dl-h3",children:"Hot path — top files by reads"}),f.jsx(ZP,{pts:[...v,...b],lens:n,onOpenFile:e.onOpenFile,onOpenHistory:e.onOpenHistory}),m&&m.length>0&&f.jsxs(f.Fragment,{children:[f.jsx("h3",{className:"dl-h3",children:"Agent coverage — which agents read which areas"}),f.jsx(KP,{devices:m})]})]})}const HP="rgb(150,156,164)";function aE(e){const n=[[76,195,138],[232,196,84],[224,93,93]],r=Math.min(1,Math.max(0,e/300))*(n.length-1),i=Math.min(n.length-2,Math.floor(r)),o=r-i,l=n[i].map((u,d)=>Math.round(u+(n[i+1][d]-u)*o));return`rgb(${l[0]},${l[1]},${l[2]})`}function vw(e,n,r,i,o){const l=e.reduce((m,y)=>m+y.value,0);if(!l||i<=0||o<=0)return[];const u=e.slice().sort((m,y)=>y.value-m.value).map(m=>({it:m,a:m.value/l*i*o})),d=(m,y)=>{const b=m.reduce((w,_)=>w+_.a,0)/y;let x=0;for(const w of m){const _=w.a/b;x=Math.max(x,_/b,b/_)}return x},p=[];for(;u.length;){const m=i>=o,y=m?o:i,v=[u.shift()];for(;u.length&&d(v.concat(u[0]),y)<=d(v,y);)v.push(u.shift());const b=v.reduce((w,_)=>w+_.a,0)/y;let x=0;for(const w of v){const _=w.a/b;m?p.push({item:w.it,x:n,y:r+x,w:b,h:_}):p.push({item:w.it,x:n+x,y:r,w:_,h:b}),x+=_}m?(n+=b,i-=b):(r+=b,o-=b)}return p}const cm=15;function yw(e,n,r){const i=Math.floor((r-8)/6),o=`${e} · ${n}`;return o.length<=i?{label:o,fit:i}:{label:e.length>i?e.slice(0,Math.max(1,i-1))+"…":e,fit:i}}const tp=(e,n)=>`${e} ${n}${e===1?"":"s"}`;function BP({pts:e,onOpenFile:n,onOpenFolder:r,isFolder:i}){const u=oI(e.map(y=>y.days)),d=!!u&&lI(u.min,u.max),p=new Map;for(const y of e){const v=y.path.includes("/")?y.path.split("/")[0]:"/";let b=p.get(v);b||p.set(v,b={name:v,files:[],value:0,reads:0}),b.files.push(y),b.value+=y.reads+1,b.reads+=y.reads}const m=[];for(const y of vw([...p.values()],0,0,720,480)){const v=y.item,b=v.name==="/"?"":v.name,x=v.name==="/"?"(root)":v.name;if(m.push(f.jsx("rect",{x:y.x+1,y:y.y+1,width:Math.max(0,y.w-2),height:Math.max(0,y.h-2),rx:3,className:"in-tm-group","data-dir":b,children:f.jsx("title",{children:`${v.name==="/"?"(root)":v.name+"/"} — ${tp(v.reads,"read")}/30d · ${tp(v.files.length,"file")}`})},"g"+v.name)),y.w>46&&y.h>cm+10){const{label:_}=yw(x,v.reads,y.w);m.push(f.jsx("text",{x:y.x+5,y:y.y+12,className:"in-tm-glabel","data-dir":b,children:_},"gl"+v.name))}const w=vw(v.files.map(_=>({..._,name:_.path.split("/").pop(),value:_.reads+1})),y.x+2,y.y+cm,Math.max(0,y.w-4),Math.max(0,y.h-cm-2));for(const _ of w)if(m.push(f.jsx("rect",{x:_.x+.6,y:_.y+.6,width:Math.max(.4,_.w-1.2),height:Math.max(.4,_.h-1.2),rx:1.5,fill:d?HP:aE(_.item.days),className:"in-tm-cell","data-path":_.item.path,children:f.jsx("title",{children:`${_.item.path} — ${_.item.reads} read${_.item.reads===1?"":"s"}/30d · changed ${Math.round(_.item.days)}d ago`})},_.item.path)),_.w>54&&_.h>16){const{label:E,fit:R}=yw((_.item.danger?"⚠ ":"")+_.item.name,_.item.reads,_.w);R>=5&&m.push(f.jsx("text",{x:_.x+4.5,y:_.y+12.5,className:"in-tm-label","data-path":_.item.path,children:E},"l"+_.item.path))}}return f.jsxs(f.Fragment,{children:[f.jsx("svg",{viewBox:"0 0 720 480",className:"in-chart in-treemap",onClick:y=>{const v=y.target.closest("[data-path], [data-dir]");if(!v)return;const b=v.getAttribute("data-path");if(b)return n(b);const x=v.getAttribute("data-dir");x&&i(x)&&r(x)},children:m}),f.jsx(qP,{range:u,flat:d})]})}function qP({range:e,flat:n}){if(!e)return null;const r=cI(e.min,e.max);return f.jsxs("p",{className:"in-legend in-tm-legend",children:["freshness 0d",f.jsx("span",{className:"in-sw in-sw-age"+(n?" in-sw-flat":""),style:{background:`linear-gradient(to right, ${[0,60,150,300].map(aE).join(", ")})`}}),"300d+",f.jsx("span",{className:"in-tm-range",children:n?`all files here: ${r} old — colour off, not enough range to rank`:`observed: ${r} old`})]})}function GP({pts:e,onOpenFile:n}){const o={l:44,r:16,t:20,b:34},l=Math.max(Ms*2,...e.map(w=>w.days)),u=Math.max(Wo*2,...e.map(w=>w.reads)),d=w=>Math.log10(w+1)/Math.log10(l+1),p=w=>Math.log10(w+1)/Math.log10(u+1),m=w=>3+4*w,y=m(1),v=w=>o.l+y+d(w)*(720-o.l-o.r-2*y),b=w=>360-o.b-y-p(w)*(360-o.t-o.b-2*y),x=fI(e.filter(w=>w.danger).map(w=>({path:w.path,reads:w.reads,cx:v(w.days),cy:b(w.reads),r:m(w.total?(w.agent||0)/w.total:0)})),{right:720-o.r,top:o.t+8,bottom:360-o.b-4});return f.jsxs("svg",{viewBox:"0 0 720 360",className:"in-chart",children:[f.jsx("rect",{x:v(Ms),y:o.t,width:720-o.r-v(Ms),height:b(Wo)-o.t,className:"in-danger-zone"}),f.jsx("line",{x1:v(Ms),y1:o.t,x2:v(Ms),y2:360-o.b,className:"in-threshold"}),f.jsx("line",{x1:o.l,y1:b(Wo),x2:720-o.r,y2:b(Wo),className:"in-threshold"}),f.jsx("line",{x1:o.l,y1:360-o.b,x2:720-o.r,y2:360-o.b,className:"in-axis"}),f.jsx("line",{x1:o.l,y1:o.t,x2:o.l,y2:360-o.b,className:"in-axis"}),f.jsx("text",{x:(o.l+720-o.r)/2,y:352,className:"in-label",children:"days since last change →"}),f.jsx("text",{x:12,y:(o.t+360-o.b)/2,className:"in-label",transform:`rotate(-90 12 ${(o.t+360-o.b)/2})`,children:"reads / 30d →"}),f.jsx("text",{x:720-o.r-6,y:o.t+14,className:"in-quad in-quad-danger",textAnchor:"end",children:"hot + stale"}),f.jsx("text",{x:o.l+6,y:o.t+14,className:"in-quad",children:"hot + fresh"}),f.jsx("text",{x:720-o.r-6,y:360-o.b-8,className:"in-quad",textAnchor:"end",children:"cold + stale"}),f.jsx("text",{x:o.l+6,y:360-o.b-8,className:"in-quad",children:"cold + fresh"}),e.map(w=>{const _=w.total?(w.agent||0)/w.total:0;return f.jsx("circle",{cx:Number(v(w.days).toFixed(1)),cy:Number(b(w.reads).toFixed(1)),r:Number(m(_).toFixed(1)),className:"in-pt"+(w.danger?" danger":w.reads?"":" cold"),onClick:()=>n(w.path),children:f.jsx("title",{children:`${w.path} — ${w.reads} read${w.reads===1?"":"s"} / 30d · changed ${Math.round(w.days)}d ago`})},w.path)}),x.map(w=>f.jsx("text",{x:Number(w.x.toFixed(1)),y:Number(w.y.toFixed(1)),textAnchor:w.anchor,className:"in-pt-label",children:w.name},w.path))]})}function ZP({pts:e,lens:n,onOpenFile:r,onOpenHistory:i}){const o=e.filter(d=>d.reads>0).sort((d,p)=>p.reads-d.reads||p.days-d.days).slice(0,20);if(!o.length)return f.jsx("div",{className:"dl-empty",children:"No reads in the window yet."});const l=o[0].reads,u=o.some(d=>d.share>0);return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"in-hotpath",children:o.map(d=>{const p=UP[n]??aI(d),m=d.reads/l*100,y=()=>d.orphan?i(d.path):r(d.path);return f.jsxs("div",{className:"in-hp-row",tabIndex:0,role:"button",title:d.orphan?`${d.reads} read${d.reads===1?"":"s"}/30d · no longer in the project — open its history`:d.danger?`${d.reads} read${d.reads===1?"":"s"}/30d · unchanged ${Math.round(d.days)}d — review this file`:d.path,onClick:y,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),y())},children:[f.jsx("span",{className:"in-hp-name"+(d.danger?" danger":""),children:d.path+(d.danger?" ⚠":"")}),d.orphan&&f.jsx("span",{className:"in-hp-gone",children:"· no longer in the project"}),f.jsxs("span",{className:"in-hp-bar",children:[f.jsx("span",{className:"in-hp-agent",style:{width:(m*p.agent).toFixed(1)+"%"}}),f.jsx("span",{className:"in-hp-human",style:{width:(m*p.human).toFixed(1)+"%"}}),f.jsx("span",{className:"in-hp-share",style:{width:(m*p.share).toFixed(1)+"%"}})]}),f.jsx("span",{className:"in-hp-count",children:d.reads})]},d.path)})}),f.jsxs("p",{className:"in-legend",children:[f.jsx("span",{className:"in-sw agent"})," agent reads ",f.jsx("span",{className:"in-sw human"})," human reads",u&&f.jsxs(f.Fragment,{children:[" ",f.jsx("span",{className:"in-sw share"})," shared reads"]})]})]})}function KP({devices:e}){const n=new Map;for(const b of e)for(const[x,w]of Object.entries(b.folders||{}))n.set(x,(n.get(x)||0)+w);const r=[...n.entries()].sort((b,x)=>x[1]-b[1]).slice(0,12).map(b=>b[0]),i=e.slice(0,12),o=140,l=6,u=Math.min(76,Math.max(34,(720-o-8)/r.length)),d=26,p=720,m=l+i.length*d+58,y=Math.max(1,...i.flatMap(b=>r.map(x=>(b.folders||{})[x]||0))),v=b=>{const x=[23,25,31],w=[245,166,35],_=x.map((E,R)=>Math.round(E+(w[R]-E)*b));return`rgb(${_[0]},${_[1]},${_[2]})`};return f.jsxs("svg",{viewBox:`0 0 ${p} ${m}`,className:"in-chart in-matrix",children:[i.map((b,x)=>{let w=b.name||b.id||"";return w.length>20&&(w=w.slice(0,19)+"…"),f.jsxs("g",{children:[f.jsx("text",{x:o-8,y:l+x*d+17,textAnchor:"end",className:"in-label",children:w}),r.map((_,E)=>{const R=(b.folders||{})[_]||0;return f.jsx("rect",{x:o+E*u,y:l+x*d,width:u-4,height:d-4,rx:3,fill:v(Math.sqrt(R/y)),children:f.jsx("title",{children:`${b.name||b.id} × ${_||"(root)"}: ${R} read${R===1?"":"s"}/30d`})},_)})]},b.id||x)}),r.map((b,x)=>{const w=o+x*u+(u-4)/2,_=l+i.length*d+14;return f.jsx("text",{x:w,y:_,className:"in-label",textAnchor:"end",transform:`rotate(-28 ${w} ${_})`,children:b||"(root)"},b)})]})}function iE(e){return new Set(e.entries.map(n=>n.path)).size}function YP(e){const n=l=>(l.session?"s\0"+l.session:"n\0"+l.note)+"\0"+(l.device?.id??""),r=new Map;e.forEach((l,u)=>{if(!l.note&&!l.session)return;const d=r.get(n(l));if(d){d.entries.push(l),d.idx.push(u);return}r.set(n(l),{note:l.note??"",session:l.session,entries:[l],idx:[u]})});const i=[],o=new Set;return e.forEach((l,u)=>{const d=l.note||l.session?r.get(n(l)):void 0;if(!d||iE(d)<2){i.push({i:u});return}o.has(d)||(o.add(d),i.push({run:d,i:u}))}),i}function QP(e){const{filters:n,authors:r,onChange:i}=e,o=(y,v)=>i({...n,[y]:v||void 0}),[l,u]=S.useState(n?.q??""),d=S.useRef(!1);S.useEffect(()=>{d.current||u(n?.q??"")},[n?.q]),S.useEffect(()=>{if(!d.current)return;const y=setTimeout(()=>{d.current=!1,l!==(n?.q??"")&&o("q",l)},250);return()=>clearTimeout(y)},[l]);const p=n?.user&&!r.includes(n.user)?[n.user,...r]:r,m=Zp(n);return f.jsxs("div",{className:"hfilters",children:[f.jsxs("label",{className:"hf-search",children:[f.jsx(ut,{name:"search"}),f.jsx(du,{type:"search",value:l,placeholder:"path contains…","aria-label":"Filter by path",onChange:y=>{d.current=!0,u(y.target.value)}})]}),f.jsxs("select",{className:"hf-user",value:n?.user??"","aria-label":"Filter by author",onChange:y=>o("user",y.target.value),children:[f.jsx("option",{value:"",children:"Anyone"}),p.map(y=>f.jsx("option",{value:y,children:y},y))]}),f.jsxs("span",{className:"hf-dates",children:[f.jsx("span",{className:"hf-lbl",children:"UTC"}),f.jsx(du,{type:"date",className:"hf-date",value:n?.since??"","aria-label":"From date (UTC)",onChange:y=>o("since",y.target.value)}),f.jsx("span",{className:"hf-dash",children:"–"}),f.jsx(du,{type:"date",className:"hf-date",value:n?.until??"","aria-label":"To date (UTC)",onChange:y=>o("until",y.target.value)})]}),m&&f.jsx("button",{type:"button",className:"hf-clear",onClick:()=>i({}),children:"Clear"})]})}function XP(e){const n=new Set;for(const r of e)r.user&&n.add(r.user);return[...n].sort()}function JP(e){const{apiBase:n,target:r,isFolder:i,onMeta:o,onRendered:l,restore:u,remove:d,filters:p}=e,m=r?i(r)?{prefix:r+"/"}:{path:r}:{prefix:""},y=("path"in m&&m.path!==void 0?"path="+encodeURIComponent(m.path):"prefix="+encodeURIComponent(m.prefix??""))+N_(p).replace("?","&"),{data:v,error:b,fetchNextPage:x,hasNextPage:w,isFetchingNextPage:_}=mj({queryKey:["history",n,y],queryFn:({pageParam:P})=>Bt(n+"history?"+y+"&n=100"+(P?"&cursor="+encodeURIComponent(P):"")),initialPageParam:"",getNextPageParam:P=>P.next_cursor,staleTime:15e3}),E=S.useRef(new Set);S.useEffect(()=>{b&&o("History unavailable: "+b.message)},[b,o]),S.useEffect(()=>{v&&l?.()},[v,l]);const R=v?v.pages.flatMap(P=>P.entries||[]):[];for(const P of XP(R))E.current.add(P);const T=e.onFilters&&f.jsx(QP,{filters:p,authors:[...E.current].sort(),onChange:e.onFilters});if(!v)return T?f.jsx("div",{className:"history",children:T}):null;const O=P=>{for(let F=P+1;F{const F=R[P].kind==="delete"?O(P):R[P].blob;return F&&F===M.get(R[P].path)?void 0:F};return f.jsxs("div",{className:"history",children:[T,R.length===0&&(Zp(p)?f.jsxs("div",{className:"empty",children:["No changes match these filters.",f.jsx("br",{}),f.jsx("button",{type:"button",className:"btn hf-clear-empty",onClick:()=>e.onFilters?.({}),children:"Clear filters"})]}):f.jsx("div",{className:"empty",children:"No history yet."})),YP(R).map((P,F)=>P.run?f.jsx(WP,{run:P.run,onOpen:e.onOpen,apiBase:n,prevBlob:O,restoreSha:D,restore:u,remove:d},"g"+F):f.jsx(pg,{entry:R[P.i],apiBase:n,onOpen:e.onOpen,diff:{apiBase:n,prev:O(P.i)},restore:u,restoreSha:D(P.i)},"r"+P.i)),w&&f.jsx("button",{type:"button",className:"btn hmore",onClick:()=>x(),disabled:_,children:_?"Loading…":"Load more"})]})}function WP({run:e,onOpen:n,apiBase:r,prevBlob:i,restoreSha:o,restore:l,remove:u}){const[d,p]=S.useState(!0),m=e.entries[0],y=dd(m),v=[m.device.name||m.device.id,m.device.os].filter(Boolean).join(" · "),b=m.session,x=m.device?.id,{data:w}=Pt({queryKey:["session-reads",r,b,x],queryFn:()=>Bt(r+"heat?session="+encodeURIComponent(b)+"&device="+encodeURIComponent(x)),enabled:!!b&&!!x,staleTime:3e4}),_=new Set(w?.paths??[]),E=new Set(e.entries.map(D=>D.path)),R=[..._].filter(D=>!E.has(D)).sort(),T=e.entries.map(D=>new Date(D.time).getTime()),O=eF(Math.min(...T),Math.max(...T)),M=iE(e);return f.jsxs("div",{className:"hrun"+(d?" open":""),children:[f.jsxs("div",{className:"hrun-head",children:[f.jsx("button",{type:"button",className:"hrun-toggle","aria-expanded":d,title:d?"Collapse this run":"Expand this run",onClick:()=>p(!d),children:f.jsx(ut,{name:d?"chevd":"chev"})}),f.jsx("span",{className:"hrun-note",children:f.jsx(KC,{text:e.note})}),f.jsxs("span",{className:"hrun-meta",children:[_.size>0?`read ${_.size} · changed ${M}`:`${M} file${M===1?"":"s"}`," ·"," ",y,v?" · "+v:""]}),f.jsx("span",{className:"hrun-time",children:O})]}),d&&f.jsxs("div",{className:"hrun-body",children:[e.entries.map((D,P)=>f.jsx(pg,{entry:D,apiBase:r,onOpen:n,diff:{apiBase:r,prev:i(e.idx[P])},restore:l,remove:u,restoreSha:o(e.idx[P]),inRun:!0,read:_.has(D.path)},P)),R.length>0&&f.jsxs("div",{className:"hrun-reads",children:[f.jsx("div",{className:"hrun-reads-head",children:"Read, not changed"}),R.map(D=>f.jsxs("button",{type:"button",className:"hrun-read",onClick:()=>n(D),children:[f.jsx("span",{className:"hkind",children:"read"}),f.jsx("span",{className:"hpath",children:D})]},D))]}),b&&f.jsx("div",{className:"hrun-foot",children:"Reads shown only for files the project still has."})]})]})}function eF(e,n){const r=new Date(e),i=new Date(n),o=u=>u.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});if(r.toDateString()!==i.toDateString())return r.toLocaleString()+" – "+i.toLocaleString();const l=i.toLocaleDateString();return e===n?l+" "+o(i):l+" "+o(r)+" – "+o(i)}function tF(e,n){return e?n(e)?e+"/ (folder)":e:"all changes"}function nF(e){const{apiBase:n,path:r,version:i}=e,o="path="+encodeURIComponent(r),{data:l}=Pt({queryKey:["history",n,o,200],queryFn:()=>Bt(n+"history?"+o+"&n=200"),staleTime:15e3}),u=l?.entries?.find(y=>y.blob===i),d=u?dd(u):"",p=u?.time?new Date(u.time).toLocaleString():"",m=n+"blob?sha="+i+"&name="+encodeURIComponent(r.split("/").pop()||r)+"&download=1";return f.jsxs("div",{className:"vbanner",role:"status",children:[f.jsx("span",{className:"vb-icon",children:f.jsx(ut,{name:"clock"})}),f.jsxs("div",{className:"vb-text",children:[f.jsx("b",{children:[p&&"Version from "+p,d&&"by "+d].filter(Boolean).join(" ")||"Earlier version"}),f.jsx("span",{children:"This is not the current file."})]}),f.jsxs("div",{className:"vb-actions",children:[f.jsx("button",{className:"ai-btn",onClick:e.onViewCurrent,children:"View current"}),f.jsx("a",{className:"ai-btn",download:!0,href:m,children:"Download this version"})]})]})}const rF={aws_access_key_id:"an AWS access key",openai_api_key:"an OpenAI API key",github_pat:"a GitHub token",slack_token:"a Slack token",private_key:"a private key",gitlab_pat:"a GitLab token"};function aF(e=[]){const n=e.map(i=>`${rF[i.rule]??i.rule} (line ${i.line})`);return`BearDrive found ${n.length>1?n.slice(0,-1).join(", ")+" and "+n[n.length-1]:n[0]||"something credential-shaped"} in this file. The check covers the file at the moment you share it — a link always serves the file's latest content, so later changes are never checked. Share anyway?`}function sE(e){const{config:n,apiBase:r,route:i,hub:o,project:l}=e,u=Yp(),d=Ai(),{tree:p,flatFiles:m,dirIndex:y,loaded:v}=hI(r,!o||!!l),b=mI(r,o&&!!l&&!!n.reads?.enabled),x=o&&!!l&&!i.path&&!i.view,w=i.view==="dashboard"||x,_=PP(r,w);S.useEffect(()=>{w&&d.invalidateQueries({queryKey:["heat",r]})},[w,r,d]);const E=i.path,R=i.view?void 0:i.version,T=E||(i.view==="dashboard"||i.view==="history")&&i.viewTarget||"",O=!!E&&y.has(E),M=!!E&&v&&!O&&m.some(Y=>Y.path===E),D=!!E&&v&&!O&&!M,P=O&&!i.view,{data:F}=Pt({queryKey:["resolve",r,E],queryFn:()=>Bt(r+"resolve?path="+encodeURIComponent(E)),enabled:D,retry:!1,staleTime:6e4}),[V,ve]=S.useState(null);S.useEffect(()=>{!D||!F?.to||(ve({from:E,to:F.to}),Kt(fl(F.to,l?.id),{replace:!0}))},[D,F,E,l?.id]);const[be,he]=S.useState(()=>new Set),ue=S.useRef(!0);S.useEffect(()=>{if(!p||!ue.current)return;ue.current=!1;const Y=(p.children||[]).filter(W=>W.dir);Y.length===1&&he(W=>new Set(W).add(Y[0].path))},[p]),S.useEffect(()=>{!T||!v||he(Y=>{const W=new Set(Y);for(const de of kI(T))W.add(de);return y.has(T)&&W.add(T),W})},[T,v,y]);const X=S.useCallback(Y=>{he(W=>{const de=new Set(W);return de.has(Y)?de.delete(Y):de.add(Y),de})},[]),pe=S.useRef(null),ge=S.useRef(new Map),L=S.useRef({key:"",want:0,attempts:0});S.useEffect(()=>{L.current={key:u,want:z3()==="POP"?ge.current.get(u)??0:0,attempts:0}},[u]);const Z=S.useCallback(()=>{const Y=pe.current,W=L.current;!Y||W.key!==u||W.attempts>=3||(W.attempts++,Y.scrollTo({top:W.want,behavior:"instant"}))},[u]),re=S.useCallback(()=>{pe.current&&ge.current.set(u,pe.current.scrollTop)},[u]),ee=S.useCallback((Y,W)=>{Kt(fl(Y,l?.id,W)),mr()},[l?.id]),ne=S.useCallback(Y=>Kt(Pn("history",l?.id,Y)),[l?.id]),[z,N]=S.useState(""),[B,J]=S.useState(null),[K,le]=S.useState(!1),[ae,ye]=S.useState(!1);S.useEffect(()=>HD(()=>ye(!0)),[]);const xe=S.useRef(null),Oe=e.panel??null,Ie=!Oe&&o&&!!l&&M&&wi(l.perm,"write"),{data:Ve}=j_(l?.id,o&&!!l),it=S.useCallback(()=>{d.invalidateQueries({queryKey:["shares",l?.id]})},[d,l?.id]),Qe=M?(Ve||[]).filter(Y=>Y.path===E):[],fn=!Oe&&o&&!!l,hn=!Oe&&M,Qt=!Oe&&(M||o&&!!l&&O),br=R?r+"blob?sha="+R+"&name="+encodeURIComponent(E)+"&download=1":r+"download?path="+encodeURIComponent(E),jt=S.useCallback(async()=>{const Y=W=>fetch(r+"shares",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W?{path:E,confirm:!0}:{path:E})});try{let W=await Y(!1);if(W.status===409){const{findings:_e}=await W.json();if(!await Hs("This file may contain credentials",aF(_e),"Share anyway",!0))return;W=await Y(!0)}if(!W.ok)throw new Error(await W.text());const de=await W.json();zw("share_created");const we=await qs(de.url);J({url:de.url,copied:we}),it()}catch(W){Ke("Share failed: "+W.message,!0)}},[r,E,it]),[rr,xr]=S.useState(""),Tt=o&&!!l&&wi(l?.perm,"write"),Vn=S.useCallback(async(Y,W)=>{xr(Y+W);try{await Si(r+"restore",{path:Y,sha:W}),d.invalidateQueries({queryKey:["history",r]}),d.invalidateQueries({queryKey:["tree",r]}),d.invalidateQueries({queryKey:["render",r,Y]}),d.invalidateQueries({queryKey:["text"]}),Ke("Restored "+Y+" — it syncs to every device like any other change.")}catch(de){Ke("Restore failed: "+de.message,!0)}finally{xr("")}},[r,d]),[Dt,kr]=S.useState(""),ar=S.useCallback(async Y=>{if(await Hs("Remove "+Y+"?","It disappears from every synced device. History keeps it — you can restore it from the DELETED row afterwards.","Remove file",!0)){kr(Y);try{await Si(r+"remove",{path:Y}),d.invalidateQueries({queryKey:["history",r]}),d.invalidateQueries({queryKey:["tree",r]}),d.invalidateQueries({queryKey:["render",r,Y]}),d.invalidateQueries({queryKey:["text"]}),Ke("Removed "+Y+" — it syncs to every device like any other change.")}catch(W){Ke("Remove failed: "+W.message,!0)}finally{kr("")}}},[r,d]),ir=S.useCallback(()=>{if(!E)return ne("");ne(O?E+"/":E)},[E,O,ne]);S.useEffect(()=>{const Y=W=>{(W.metaKey||W.ctrlKey)&&W.key.toLowerCase()==="k"&&(W.preventDefault(),ye(de=>!de))};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[]);const wr=S.useCallback(()=>{const Y=[],W=(de,we,_e,Xe)=>Y.push({icon:de,label:we,kind:_e,run:Xe});if(o&&l){const de=l.id,we=_e=>()=>{e.onClosePanel?.(),Kt(_e)};W("folder","Go to project root","action",we("/"+de)),W("dashboard","Dashboard","action",we(Pn("dashboard",de))),W("terminal","Installation","action",we(Pn("install",de))),W("gear","Settings","action",we(Pn("settings",de)))}if(o&&l&&E&&(M&&W("share","Share: "+E,"action",jt),W("hist","History: "+E,"action",ir),M&&W("download","Download: "+E,"action",()=>xe.current?.click())),o&&l&&W("hist","History: whole project","action",()=>ne("")),o)for(const de of e.projects||[])(!l||de.id!==l.id)&&W("folder","Switch to project: "+de.name,"project",()=>Kt("/"+de.id));n.auth?.enabled&&W("power","Sign out","action",()=>window.location.href="/auth/logout");for(const de of y.keys())W("folder",de,"folder",()=>ee(de));for(const de of m)W("doc",de.path,"file",()=>ee(de.path));return Y},[o,l,E,M,n.auth?.enabled,y,m,e.projects,e.onClosePanel,jt,ir,ne,ee]);S.useEffect(()=>{if(!K)return;const Y=()=>le(!1);return document.addEventListener("click",Y),()=>document.removeEventListener("click",Y)},[K]);const sr=S.useCallback(Y=>y.has(Y),[y]);let mn="app",A,I;Oe?I=Oe.body:i.view==="dashboard"?I=f.jsx(gw,{flatFiles:m,heatMap:b,devices:_,scope:i.viewTarget||"",loading:!v,installHref:l?Pn("install",l.id):void 0,onOpenFile:ee,onOpenFolder:ee,onOpenHistory:ne,isFolder:sr}):i.view==="history"?I=f.jsx(JP,{apiBase:r,target:i.viewTarget||"",isFolder:sr,onOpen:ee,onMeta:N,onRendered:Z,restore:Tt?{onRestore:Vn,busy:rr}:void 0,remove:Tt?{onRemove:ar,busy:Dt}:void 0,filters:i.filters,onFilters:Y=>Kt(Pn("history",l?.id,i.viewTarget||"",Y))}):E?v?D?I=f.jsxs("div",{className:"notfound",children:[f.jsx("h1",{children:"Couldn't find that"}),f.jsxs("p",{children:[f.jsx("code",{children:E})," isn't in this project right now."]}),f.jsx("p",{className:"nf-sub",children:"If it was just created, it may still be uploading or syncing from a teammate's device — this page checks again automatically every few seconds, so refresh or come back in a moment."}),f.jsx("button",{className:"pbtn",onClick:()=>d.invalidateQueries({queryKey:["tree",r]}),children:"Check again"})]}):O?I=f.jsx(ZI,{node:y.get(E),heatMap:b,hub:o&&!!l,apiBase:r,onOpen:ee,onFullHistory:ne,onRendered:Z}):(mn=OC.test(E)||AC.test(E)?"wide":"read",A="markdown",I=f.jsxs(f.Fragment,{children:[R&&f.jsx(nF,{apiBase:r,path:E,version:R,onViewCurrent:()=>ee(E)}),f.jsx(QI,{apiBase:r,path:E,version:R,heatMap:b,flatFiles:m,onOpenFile:ee,onMeta:N,onRendered:Z})]})):I=f.jsx("div",{className:"empty",children:"Loading…"}):x?I=f.jsxs(f.Fragment,{children:[f.jsx(HC,{project:l,existing:i.connect==="existing"}),f.jsx("div",{className:"home-insights",children:f.jsx(gw,{flatFiles:m,heatMap:b,devices:_,loading:!v,onOpenFile:ee,onOpenFolder:ee,onOpenHistory:ne,isFolder:sr})})]}):I=f.jsx("div",{className:"empty",children:"Select a file to read it."}),V&&V.to===E&&(I=f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"vbanner",role:"status",children:[f.jsx("span",{className:"vb-icon",children:f.jsx(ut,{name:"link"})}),f.jsxs("div",{className:"vb-text",children:[f.jsxs("b",{children:["Moved from ",V.from]}),f.jsx("span",{children:"The URL has been updated."})]})]}),I]}));const U=Oe?Oe.crumb:E?f.jsx(LI,{path:E,onOpenFolder:ee}):i.view==="dashboard"?"Dashboard — "+(i.viewTarget||l?.name||""):i.view==="history"?"History — "+tF(i.viewTarget||"",sr):x?l.name:null,ce=f.jsx(dl,{crumb:U,meta:z,actions:f.jsxs(f.Fragment,{children:[Ie&&f.jsx(vt,{id:"share-btn",variant:"toolbar",className:"icon-only",title:"Share","aria-label":"Share",onClick:jt,children:f.jsx(ut,{name:"share"})}),fn&&!E&&!i.view&&f.jsxs(vt,{id:"history-btn",variant:"toolbar",onClick:ir,children:[f.jsx(ut,{name:"hist"})," ",f.jsx("span",{className:"lbl",children:"History"})]}),hn&&f.jsx("a",{id:"download",hidden:!0,download:!0,href:br,ref:xe,children:"Download"}),Qt&&f.jsx(vt,{id:"more-btn",variant:"toolbar",className:"icon-only",title:"More actions","aria-label":"More actions",onClick:Y=>{Y.stopPropagation(),le(!K)},children:f.jsx(ut,{name:"dots"})}),K&&f.jsxs("div",{id:"more-menu",role:"menu",children:[fn&&f.jsx("button",{className:"more-item",onClick:ir,children:"History"}),hn&&f.jsx("button",{className:"more-item",onClick:()=>xe.current?.click(),children:"Download"}),o&&!!l&&f.jsx("button",{className:"more-item",onClick:()=>{e.onClosePanel?.(),Kt(Pn("dashboard",l?.id,E))},children:"Dashboard"})]})]})});return f.jsxs(f.Fragment,{children:[f.jsx(ul,{vault:e.sidebar.vault,projectsNav:e.sidebar.projectsNav,orgBar:e.sidebar.orgBar,tree:f.jsx(zI,{root:p,expanded:be,onToggle:X,currentPath:T,listingShowing:P,onOpen:ee}),topbar:ce,contentRef:pe,onContentScroll:re,children:f.jsxs(Su,{width:mn,className:A,children:[!Oe&&M&&f.jsx(oP,{shares:Qe,canRevoke:!!l&&wi(l.perm,"write"),onChanged:it}),I]})}),B&&f.jsx(sP,{url:B.url,copied:B.copied,onClose:()=>{J(null),it()}}),f.jsx(IP,{open:ae,onClose:()=>ye(!1),candidates:wr})]})}function iF({config:e}){const n=Yp(),r=O_(),[i,o]=S.useState(null),[l,u]=S.useState(null);S.useEffect(()=>u(null),[n]);const d=S.useMemo(()=>{const ge=n.split("?")[0].match(/^\/join\/([0-9a-f]+)\/?$/);return ge?ge[1]:null},[n]),{data:p}=j3(!d),{data:m}=T3(!d),y=!!e.auth.admin,{data:v}=T_(y),b=S.useMemo(()=>D_(n,"hub"),[n]),[x,w]=S.useState(!1),_=e.upload.enabled,E=async(ge,L)=>{const Z=L===BC;try{const re=await Si("/api/projects",{name:ge,template:Z?"":L});w(!1),await r(),Kt("/"+re.project.id+(Z?"?connect=existing":"")),Ke(`Created “${re.project.name}”.`)}catch(re){Ke("Could not create the project: "+re.message,!0)}},R=x?f.jsx(nI,{templates:e.templates??[],onCreate:E,onClose:()=>w(!1)}):null,T=S.useMemo(()=>p&&(p.find(ge=>ge.id===b.project)||i&&p.find(ge=>ge.org===i)||p.find(ge=>ge.id===E$())||p[0])||null,[p,b.project,i]);if(S.useEffect(()=>{document.title=T?T.name+" — BearDrive":e.brand||"BearDrive",T&&R$(T.id)},[T,e]),d)return f.jsx(sF,{token:d,onDone:async ge=>{o(ge),await r(),Kt("/",{replace:!0})}});const O=e.brand||"BearDrive",M=T&&m?.find(ge=>ge.id===T.org)||null,D=f.jsx(Xu,{name:O,onHome:()=>Kt("/"),search:!!T}),P=e.me?f.jsx(Z$,{me:e.me,org:M,orgActive:!!b.org,billing:e.billing,admin:y?{pending:v?.length||0,onClick:()=>{u({kind:"hub"}),mr()}}:void 0}):void 0;if(!p||!m)return f.jsx(ul,{vault:D,topbar:f.jsx(dl,{}),children:f.jsx(Su,{children:f.jsx("div",{className:"empty",children:"Loading…"})})});if(!T)return f.jsxs(ul,{vault:D,projectsNav:f.jsx(aw,{projects:p,onNew:()=>w(!0)}),orgBar:P,topbar:f.jsx(dl,{}),children:[f.jsx(Su,{children:f.jsx(tI,{onNew:()=>w(!0),canCreate:_})}),R]});const F=l?.kind==="hub"?{crumb:"Signup & access",body:f.jsx($$,{})}:null,V=b.org?m.find(ge=>ge.id===b.org):null,be=b.org&&!V?{crumb:"Organization",body:f.jsxs("div",{className:"empty",children:[f.jsx("h3",{children:"Organization not found"}),f.jsx("p",{children:"This organization doesn't exist, or you're no longer a member."}),f.jsx("p",{children:f.jsxs("a",{...Bs("/"+T.id),children:["Back to ",T.name]})})]})}:V?{crumb:"Organization",body:f.jsx(z$,{org:V,projects:p,myEmail:e.me?.email||""})}:null,he=!!b.project&&!p.some(ge=>ge.id===b.project),ue=he?{crumb:"Project",body:f.jsxs("div",{className:"empty",children:[f.jsx("h3",{children:"Project not found"}),f.jsx("p",{children:"This project doesn't exist, or you're no longer a member."}),f.jsx("p",{children:f.jsxs("a",{...Bs("/"+T.id),children:["Back to ",T.name]})})]})}:null,X=b.billing?{crumb:"Billing",body:e.billing?f.jsx(K$,{url:e.billing.url}):f.jsxs("div",{className:"empty",children:[f.jsx("h3",{children:"No billing on this hub"}),f.jsx("p",{children:"This BearDrive hub doesn't have a billing surface."})]})}:null,pe=b.view==="settings"?{crumb:"Project settings",body:f.jsx(X$,{project:T,org:M,onDeleted:async()=>{await r(),Kt("/")}})}:b.view==="install"?{crumb:"Installation",body:f.jsx(HC,{project:T,existing:b.connect==="existing"})}:null;if(!he){if(!b.org&&!b.billing&&b.project!==T.id)return f.jsx(Qo,{to:"/"+T.id});if(b.legacyView&&b.view)return f.jsx(Qo,{to:Pn(b.view,T.id,b.viewTarget,b.filters)});if(b.queryTarget&&b.view)return f.jsx(Qo,{to:Pn(b.view,T.id,b.viewTarget,b.filters)});if(b.trailingSlash&&b.path)return f.jsx(Qo,{to:fl(b.path,T.id,b.version)})}return f.jsxs(f.Fragment,{children:[f.jsx(sE,{config:e,apiBase:"/api/p/"+T.id+"/",route:b,hub:!0,project:T,projects:p,sidebar:{vault:D,projectsNav:f.jsx(aw,{projects:p,currentId:T.id,onNew:()=>w(!0),menu:{active:l?null:b.view==="dashboard"&&!b.viewTarget?"dashboard":b.view==="install"?"install":b.view==="history"&&!b.viewTarget?"history":b.view==="settings"?"settings":null,onDashboard:()=>{u(null),Kt(Pn("dashboard",T.id)),mr()},onInstall:()=>{u(null),Kt(Pn("install",T.id)),mr()},onHistory:()=>{u(null),Kt(Pn("history",T.id)),mr()},onSettings:()=>{u(null),Kt(Pn("settings",T.id)),mr()}}}),orgBar:P},panel:F||be||ue||X||pe,onClosePanel:()=>u(null)},T.id),R]})}function sF({token:e,onDone:n}){return S.useEffect(()=>{let r=!1;return Si("/api/invites/"+e).then(i=>{r||(Ke(`Welcome — you joined the “${i.org.name}” team. Opening its projects…`),n(i.org.id))}).catch(i=>{r||String(i.message).includes("signing in")||(Ke("Could not accept the invite: "+i.message,!0),n(null))}),()=>{r=!0}},[e]),f.jsx(ul,{vault:f.jsx(Xu,{name:"BearDrive"}),topbar:f.jsx(dl,{}),children:f.jsx(Su,{children:f.jsx("div",{className:"empty",children:"Joining…"})})})}function oF({config:e}){const n=Yp(),r=e.volume||"BearDrive";S.useEffect(()=>{document.title=e.brand||r},[e,r]);const i=S.useMemo(()=>D_(n,"volume"),[n]);return i.trailingSlash&&i.path?f.jsx(Qo,{to:fl(i.path)}):f.jsx(sE,{config:e,apiBase:"/api/",route:i,hub:!1,sidebar:{vault:f.jsx(Xu,{name:r,showSignout:e.auth.enabled,search:!0})}})}function lF(){const{data:e}=bj();return f.jsxs(PD,{delayDuration:150,children:[e?e.mode==="hub"?f.jsx(iF,{config:e}):f.jsx(oF,{config:e}):f.jsx(ul,{vault:f.jsx(Xu,{name:"…",showSignout:!1}),topbar:f.jsx(dl,{}),children:f.jsx("div",{className:"empty",children:"Loading…"})}),f.jsx(b3,{}),f.jsx(C3,{})]})}class cF extends S.Component{state={error:null};static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){console.error("BearDrive: unhandled render error",n,r.componentStack)}render(){return this.state.error?f.jsxs("div",{className:"mx-auto max-w-lg p-8 text-sm",children:[f.jsx("h1",{className:"mb-2 text-lg font-semibold",children:"This page didn’t load"}),f.jsx("p",{className:"mb-4 opacity-80",children:"Something went wrong rendering this view. The rest of BearDrive is fine."}),f.jsx("p",{className:"mb-4",children:f.jsx("a",{className:"underline",href:"/",children:"Go to the project list"})}),f.jsx("pre",{className:"overflow-x-auto rounded bg-black/5 p-3 text-xs dark:bg-white/10",children:String(this.state.error)})]}):this.props.children}}const uF=new nj({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});O2.createRoot(document.getElementById("root")).render(f.jsx(S.StrictMode,{children:f.jsx(cF,{children:f.jsx(rj,{client:uF,children:f.jsx(lF,{})})})})); diff --git a/internal/webapp/static/assets/infoDiagram-6WML65LV-DQHnLHTt.js b/internal/webapp/static/assets/infoDiagram-6WML65LV-DQHnLHTt.js new file mode 100644 index 0000000..e3a47f2 --- /dev/null +++ b/internal/webapp/static/assets/infoDiagram-6WML65LV-DQHnLHTt.js @@ -0,0 +1,2 @@ +import{_ as a,l as s,D as n,e as i}from"./mermaid.core-B7WVQkyL.js";import{p}from"./cynefin-VYW2F7L2-CdOzebfq.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var g={parse:a(async r=>{const e=await p("info",r);s.debug(e)},"parse")},v={version:"11.16.1"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,o)=>{s.debug(`rendering info diagram +`+r);const t=n(e);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),l={draw:c},w={parser:g,db:m,renderer:l};export{w as diagram}; diff --git a/internal/webapp/static/assets/init-Gi6I4Gst.js b/internal/webapp/static/assets/init-Gi6I4Gst.js new file mode 100644 index 0000000..d44de94 --- /dev/null +++ b/internal/webapp/static/assets/init-Gi6I4Gst.js @@ -0,0 +1 @@ +function t(e,a){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(a).domain(e);break}return this}export{t as i}; diff --git a/internal/webapp/static/assets/ishikawaDiagram-WSZJBQD7-BmYBJRyL.js b/internal/webapp/static/assets/ishikawaDiagram-WSZJBQD7-BmYBJRyL.js new file mode 100644 index 0000000..c6a7bd1 --- /dev/null +++ b/internal/webapp/static/assets/ishikawaDiagram-WSZJBQD7-BmYBJRyL.js @@ -0,0 +1,70 @@ +import{_ as o,c as ot,K as ut,D as dt,al as yt,p as ft,k as pt,n as it,a as gt,b as kt,g as mt,s as wt,o as _t,e as bt}from"./mermaid.core-B7WVQkyL.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var J=(function(){var e=o(function(T,t,s,i){for(s=s||{},i=T.length;i--;s[T[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],u=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,c,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return c;case 15:c.addNode(n[w-1].length,n[w].trim());break;case 16:c.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(u,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],c=[],p=[null],n=[],v=this.table,w="",I=0,$=0,L=2,A=1,C=n.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(S.yy[P]=this.yy[P]);b.setInput(t,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;n.push(R);var G=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(B){i.length=i.length-2*B,p.length=p.length-B,n.length=n.length-B}o(X,"popStack");function tt(){var B;return B=c.pop()||b.lex()||A,typeof B!="number"&&(B instanceof Array&&(c=B,B=c.pop()),B=s.symbols_[B]||B),B}o(tt,"lex");for(var M,W,N,Y,F={},U,V,et,Z;;){if(W=i[i.length-1],this.defaultActions[W]?N=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=tt()),N=v[W]&&v[W][M]),typeof N>"u"||!N.length||!N[0]){var q="";Z=[];for(U in v[W])this.terminals_[U]&&U>L&&Z.push("'"+this.terminals_[U]+"'");b.showPosition?q="Parse error on line "+(I+1)+`: +`+b.showPosition()+` +Expecting `+Z.join(", ")+", got '"+(this.terminals_[M]||M)+"'":q="Parse error on line "+(I+1)+": Unexpected "+(M==A?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(q,{text:b.match,token:this.terminals_[M]||M,line:b.yylineno,loc:R,expected:Z})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+M);switch(N[0]){case 1:i.push(M),p.push(b.yytext),n.push(b.yylloc),i.push(N[1]),M=null,$=b.yyleng,w=b.yytext,I=b.yylineno,R=b.yylloc;break;case 2:if(V=this.productions_[N[1]][1],F.$=p[p.length-V],F._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},G&&(F._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),Y=this.performAction.apply(F,[w,$,I,S.yy,N[1],p,n].concat(C)),typeof Y<"u")return Y;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[N[1]][0]),p.push(F.$),n.push(F._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var T={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===c.length?this.yylloc.first_column:0)+c[c.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+` +`+s+"^"},"showPosition"),test_match:o(function(t,s){var i,c,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),c=t[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var n in p)this[n]=p[n];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,s,i,c;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),n=0;ns[0].length)){if(s=i,c=n,this.options.backtrack_lexer){if(t=this.test_match(i,p[n]),t!==!1)return t;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(t=this.test_match(s,p[c]),t!==!1?t:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var s=this.next();return s||this.lex()},"lex"),begin:o(function(s){this.conditionStack.push(s)},"begin"),popState:o(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:o(function(s){this.begin(s)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(s,i,c,p){switch(c){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return T})();D.lexer=O;function E(){this.yy={}}return o(E,"Parser"),E.prototype=D,D.Parser=E,new E})();J.parser=J;var xt=J,H,vt=(H=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,ft()}getRoot(){return this.root}addNode(h,r){const a=pt.sanitizeText(r,ot());if(!this.root){this.root={text:a,children:[]},this.stack=[{level:0,node:this.root}],it(a);return}this.baseLevel??=h;let l=h-this.baseLevel+1;for(l<=0&&(l=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=l;)this.stack.pop();const y=this.stack[this.stack.length-1].node,f={text:a,children:[]};y.children.push(f),this.stack.push({level:l,node:f})}getAccTitle(){return gt()}setAccTitle(h){kt(h)}getAccDescription(){return mt()}setAccDescription(h){wt(h)}getDiagramTitle(){return _t()}setDiagramTitle(h){it(h)}},o(H,"IshikawaDB"),H),St=14,j=250,$t=30,Et=60,At=5,ht=82*Math.PI/180,st=Math.cos(ht),nt=Math.sin(ht),at=o((e,h,r)=>{const a=e.node().getBBox(),l=a.width+h*2,y=a.height+h*2;bt(e,y,l,r),e.attr("viewBox",`${a.x-h} ${a.y-h} ${l} ${y}`)},"applyPaddedViewBox"),It=o((e,h,r,a)=>{const y=a.db.getRoot();if(!y)return;const f=ot(),{look:d,handDrawnSeed:m,themeVariables:u}=f,k=ut(f.fontSize)[0]??St,g=d==="handDrawn",_=y.children??[],x=f.ishikawa?.diagramPadding??20,D=f.ishikawa?.useMaxWidth??!1,O=dt(h),E=O.append("g").attr("class","ishikawa"),T=g?yt.svg(O.node()):void 0,t=T?{roughSvg:T,seed:m??0,lineColor:u?.lineColor??"#333",fillColor:u?.mainBkg??"#fff"}:void 0,s=`ishikawa-arrow-${h}`;g||E.append("defs").append("marker").attr("id",s).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let i=0,c=j;const p=g?void 0:z(E,i,c,i,c,"ishikawa-spine");if(Lt(E,i,c,y.text,k,t),!_.length){g&&z(E,i,c,i,c,"ishikawa-spine",t),at(O,x,D);return}i-=20;const n=_.filter((S,P)=>P%2===0),v=_.filter((S,P)=>P%2===1),w=rt(n),I=rt(v),$=w.total+I.total;let L=j,A=j;if($>0){const S=j*2,P=j*.3;L=Math.max(P,S*(w.total/$)),A=Math.max(P,S*(I.total/$))}const C=k*2;L=Math.max(L,w.max*C),A=Math.max(A,I.max*C),c=Math.max(L,j),p&&p.attr("y1",c).attr("y2",c),E.select(".ishikawa-head-group").attr("transform",`translate(0,${c})`);const b=Math.ceil(_.length/2);for(let S=0;SMath.min(R,G.getBBox().x),1/0)}if(g)z(E,i,c,0,c,"ishikawa-spine",t);else{p.attr("x1",i);const S=`url(#${s})`;E.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",S)}at(O,x,D)},"draw"),rt=o(e=>{const h=o(r=>r.children.reduce((a,l)=>a+1+h(l),0),"countDescendants");return e.reduce((r,a)=>{const l=h(a);return r.total+=l,r.max=Math.max(r.max,l),r},{total:0,max:0})},"sideStats"),Lt=o((e,h,r,a,l,y)=>{const f=Math.max(6,Math.floor(110/(l*.6))),d=e.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${h},${r})`),m=K(d,ct(a,f),0,0,"ishikawa-head-label","start",l),u=m.node().getBBox(),k=Math.max(60,u.width+6),g=Math.max(40,u.height*2+40),_=`M 0 ${-g/2} L 0 ${g/2} Q ${k*2.4} 0 0 ${-g/2} Z`;if(y){const x=y.roughSvg.path(_,{roughness:1.5,seed:y.seed,fill:y.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:y.lineColor,strokeWidth:2});d.insert(()=>x,":first-child").attr("class","ishikawa-head")}else d.insert("path",":first-child").attr("class","ishikawa-head").attr("d",_);m.attr("transform",`translate(${(k-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),Tt=o((e,h)=>{const r=[],a=[],l=o((y,f,d)=>{const m=h===-1?[...y].reverse():y;for(const u of m){const k=r.length,g=u.children??[];r.push({depth:d,text:ct(u.text,15),parentIndex:f,childCount:g.length}),d%2===0?(a.push(k),g.length&&l(g,k,d+1)):(g.length&&l(g,k,d+1),a.push(k))}},"walk");return l(e,-1,2),{entries:r,yOrder:a}},"flattenTree"),Mt=o((e,h,r,a,l,y,f)=>{const d=e.append("g").attr("class","ishikawa-label-group"),u=K(d,h,r,a+11*l,"ishikawa-label cause","middle",y).node().getBBox();if(f){const k=f.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:f.seed,fill:f.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:f.lineColor,strokeWidth:2});d.insert(()=>k,":first-child").attr("class","ishikawa-label-box")}else d.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),Q=o((e,h,r,a,l,y)=>{const f=Math.sqrt(a*a+l*l);if(f===0)return;const d=a/f,m=l/f,u=6,k=-m*u,g=d*u,_=h,x=r,D=`M ${_} ${x} L ${_-d*u*2+k} ${x-m*u*2+g} L ${_-d*u*2-k} ${x-m*u*2-g} Z`,O=y.roughSvg.path(D,{roughness:1,seed:y.seed,fill:y.lineColor,fillStyle:"solid",stroke:y.lineColor,strokeWidth:1});e.append(()=>O)},"drawArrowMarker"),Pt=o((e,h,r,a,l,y,f,d)=>{const m=h.children??[],u=y*(m.length?1:.2),k=-st*u,g=nt*u*l,_=r+k,x=a+g;if(z(e,r,a,_,x,"ishikawa-branch",d),d&&Q(e,r,a,r-_,a-x,d),Mt(e,h.text,_,x,l,f,d),!m.length)return;const{entries:D,yOrder:O}=Tt(m,l),E=D.length,T=new Array(E);for(const[p,n]of O.entries())T[n]=a+g*((p+1)/(E+1));const t=new Map;t.set(-1,{x0:r,y0:a,x1:_,y1:x,childCount:m.length,childrenDrawn:0});const s=-st,i=nt*l,c=l<0?"ishikawa-label up":"ishikawa-label down";for(const[p,n]of D.entries()){const v=T[p],w=t.get(n.parentIndex),I=e.append("g").attr("class","ishikawa-sub-group");let $=0,L=0,A=0;if(n.depth%2===0){const C=w.y1-w.y0;$=lt(w.x0,w.x1,C?(v-w.y0)/C:.5),L=v,A=$-(n.childCount>0?Et+n.childCount*At:$t),z(I,$,v,A,v,"ishikawa-sub-branch",d),d&&Q(I,$,v,1,0,d),K(I,n.text,A,v,"ishikawa-label align","end",f)}else{const C=w.childrenDrawn++;$=lt(w.x0,w.x1,(w.childCount-C)/(w.childCount+1)),L=w.y0,A=$+s*((v-L)/i),z(I,$,L,A,v,"ishikawa-sub-branch",d),d&&Q(I,$,L,$-A,L-v,d),K(I,n.text,A,v,c,"end",f)}n.childCount>0&&t.set(p,{x0:$,y0:L,x1:A,y1:v,childCount:n.childCount,childrenDrawn:0})}},"drawBranch"),Bt=o(e=>e.split(/|\n/),"splitLines"),ct=o((e,h)=>{if(e.length<=h)return e;const r=[];for(const a of e.split(/\s+/)){const l=r.length-1;l>=0&&r[l].length+1+a.length<=h?r[l]+=" "+a:r.push(a)}return r.join(` +`)},"wrapText"),K=o((e,h,r,a,l,y,f)=>{const d=Bt(h),m=f*1.05,u=e.append("text").attr("class",l).attr("text-anchor",y).attr("x",r).attr("y",a-(d.length-1)*m/2);for(const[k,g]of d.entries())u.append("tspan").attr("x",r).attr("dy",k===0?0:m).text(g);return u},"drawMultilineText"),lt=o((e,h,r)=>e+(h-e)*r,"lerp"),z=o((e,h,r,a,l,y,f)=>{if(f){const d=f.roughSvg.line(h,r,a,l,{roughness:1.5,seed:f.seed,stroke:f.lineColor,strokeWidth:2});e.append(()=>d).attr("class",y);return}return e.append("line").attr("class",y).attr("x1",h).attr("y1",r).attr("x2",a).attr("y2",l)},"drawLine"),Nt={draw:It},Dt=o(e=>` +.ishikawa .ishikawa-spine, +.ishikawa .ishikawa-branch, +.ishikawa .ishikawa-sub-branch { + stroke: ${e.lineColor}; + stroke-width: 2; + fill: none; +} + +.ishikawa .ishikawa-sub-branch { + stroke-width: 1; +} + +.ishikawa .ishikawa-arrow { + fill: ${e.lineColor}; +} + +.ishikawa .ishikawa-head { + fill: ${e.mainBkg}; + stroke: ${e.lineColor}; + stroke-width: 2; +} + +.ishikawa .ishikawa-label-box { + fill: ${e.mainBkg}; + stroke: ${e.lineColor}; + stroke-width: 2; +} + +.ishikawa text { + font-family: ${e.fontFamily}; + font-size: ${e.fontSize}; + fill: ${e.textColor}; +} + +.ishikawa .ishikawa-head-label { + font-weight: 600; + text-anchor: middle; + dominant-baseline: middle; + font-size: 14px; +} + +.ishikawa .ishikawa-label { + text-anchor: end; +} + +.ishikawa .ishikawa-label.cause { + text-anchor: middle; + dominant-baseline: middle; +} + +.ishikawa .ishikawa-label.align { + text-anchor: end; + dominant-baseline: middle; +} + +.ishikawa .ishikawa-label.up { + dominant-baseline: baseline; +} + +.ishikawa .ishikawa-label.down { + dominant-baseline: hanging; +} +`,"getStyles"),Ot=Dt,Wt={parser:xt,get db(){return new vt},renderer:Nt,styles:Ot};export{Wt as diagram}; diff --git a/internal/webapp/static/assets/journeyDiagram-NVQOT4AX-B8O8DORL.js b/internal/webapp/static/assets/journeyDiagram-NVQOT4AX-B8O8DORL.js new file mode 100644 index 0000000..5724b9b --- /dev/null +++ b/internal/webapp/static/assets/journeyDiagram-NVQOT4AX-B8O8DORL.js @@ -0,0 +1,139 @@ +import{g as gt}from"./chunk-5VM5RSS4-DJhOL3Lj.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-2GRJ4B5K-Bng47RDF.js";import{g as _t,s as vt,a as bt,b as wt,o as Tt,n as St,_ as s,c as R,d as X,e as $t,p as Mt}from"./mermaid.core-B7WVQkyL.js";import{d as it}from"./arc-DQmUyXqg.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`: +`+_.showPosition()+` +Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+` +`+n+"^"},"showPosition"),test_match:s(function(r,n){var l,y,d;if(this.options.backtrack_lexer&&(d={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(d.yylloc.range=this.yylloc.range.slice(0))),y=r[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],l=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var c in d)this[c]=d[c];return!1}return!1},"test_match"),next:s(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,n,l,y;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),c=0;cn[0].length)){if(n=l,y=c,this.options.backtrack_lexer){if(r=this.test_match(l,d[c]),r!==!1)return r;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(r=this.test_match(n,d[y]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:s(function(){var n=this.next();return n||this.lex()},"lex"),begin:s(function(n){this.conditionStack.push(n)},"begin"),popState:s(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:s(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:s(function(n){this.begin(n)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:s(function(n,l,y,d){switch(y){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return h})();g.lexer=m;function x(){this.yy={}}return s(x,"Parser"),x.prototype=g,g.Parser=x,new x})();U.parser=U;var Et=U,V="",J=[],L=[],B=[],Ct=s(function(){J.length=0,L.length=0,V="",B.length=0,Mt()},"clear"),Pt=s(function(t){V=t,J.push(t)},"addSection"),It=s(function(){return J},"getSections"),At=s(function(){let t=rt();const e=100;let a=0;for(;!t&&a{a.people&&t.push(...a.people)}),[...new Set(t)].sort()},"updateActors"),Vt=s(function(t,e){const a=e.substr(1).split(":");let f=0,i=[];a.length===1?(f=Number(a[0]),i=[]):(f=Number(a[0]),i=a[1].split(","));const u=i.map(o=>o.trim()),p={section:V,type:V,people:u,task:t,score:f};B.push(p)},"addTask"),Rt=s(function(t){const e={section:V,type:V,description:t,task:t,classes:[]};L.push(e)},"addTaskOrg"),rt=s(function(){const t=s(function(a){return B[a].processed},"compileTask");let e=!0;for(const[a,f]of B.entries())t(a),e=e&&f.processed;return e},"compileTasks"),Lt=s(function(){return Ft()},"getActors"),nt={getConfig:s(()=>R().journey,"getConfig"),clear:Ct,setDiagramTitle:St,getDiagramTitle:Tt,setAccTitle:wt,getAccTitle:bt,setAccDescription:vt,getAccDescription:_t,addSection:Pt,getSections:It,getTasks:At,addTask:Vt,addTaskOrg:Rt,getActors:Lt},Bt=s(t=>`.label { + font-family: ${t.fontFamily}; + color: ${t.textColor}; + } + .mouth { + stroke: #666; + } + + line { + stroke: ${t.textColor} + } + + .legend { + fill: ${t.textColor}; + font-family: ${t.fontFamily}; + } + + .label text { + fill: #333; + } + .label { + color: ${t.textColor} + } + + .face { + ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"}; + stroke: #999; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; + stroke-width: 1px; + } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${t.arrowheadColor}; + } + + .edgePath .path { + stroke: ${t.lineColor}; + stroke-width: 1.5px; + } + + .flowchart-link { + stroke: ${t.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${t.edgeLabelBackground}; + rect { + opacity: 0.5; + } + text-align: center; + } + + .cluster rect { + } + + .cluster text { + fill: ${t.titleColor}; + } + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${t.fontFamily}; + font-size: 12px; + background: ${t.tertiaryColor}; + border: 1px solid ${t.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .task-type-0, .section-type-0 { + ${t.fillType0?`fill: ${t.fillType0}`:""}; + } + .task-type-1, .section-type-1 { + ${t.fillType0?`fill: ${t.fillType1}`:""}; + } + .task-type-2, .section-type-2 { + ${t.fillType0?`fill: ${t.fillType2}`:""}; + } + .task-type-3, .section-type-3 { + ${t.fillType0?`fill: ${t.fillType3}`:""}; + } + .task-type-4, .section-type-4 { + ${t.fillType0?`fill: ${t.fillType4}`:""}; + } + .task-type-5, .section-type-5 { + ${t.fillType0?`fill: ${t.fillType5}`:""}; + } + .task-type-6, .section-type-6 { + ${t.fillType0?`fill: ${t.fillType6}`:""}; + } + .task-type-7, .section-type-7 { + ${t.fillType0?`fill: ${t.fillType7}`:""}; + } + + .actor-0 { + ${t.actor0?`fill: ${t.actor0}`:""}; + } + .actor-1 { + ${t.actor1?`fill: ${t.actor1}`:""}; + } + .actor-2 { + ${t.actor2?`fill: ${t.actor2}`:""}; + } + .actor-3 { + ${t.actor3?`fill: ${t.actor3}`:""}; + } + .actor-4 { + ${t.actor4?`fill: ${t.actor4}`:""}; + } + .actor-5 { + ${t.actor5?`fill: ${t.actor5}`:""}; + } + ${gt()} +`,"getStyles"),jt=Bt,K=s(function(t,e){return kt(t,e)},"drawRect"),Nt=s(function(t,e){const f=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function u(g){const m=it().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}s(u,"smile");function p(g){const m=it().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}s(p,"sad");function o(g){g.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return s(o,"ambivalent"),e.score>3?u(i):e.score<3?p(i):o(i),f},"drawFace"),ot=s(function(t,e){const a=t.append("circle");return a.attr("cx",e.cx),a.attr("cy",e.cy),a.attr("class","actor-"+e.pos),a.attr("fill",e.fill),a.attr("stroke",e.stroke),a.attr("r",e.r),a.class!==void 0&&a.attr("class",a.class),e.title!==void 0&&a.append("title").text(e.title),a},"drawCircle"),ct=s(function(t,e){return xt(t,e)},"drawText"),zt=s(function(t,e){function a(i,u,p,o,g){return i+","+u+" "+(i+p)+","+u+" "+(i+p)+","+(u+o-g)+" "+(i+p-g*1.2)+","+(u+o)+" "+i+","+(u+o)}s(a,"genPoints");const f=t.append("polygon");f.attr("points",a(e.x,e.y,50,20,7)),f.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,ct(t,e)},"drawLabel"),Wt=s(function(t,e,a){const f=t.append("g"),i=lt();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=a.width*e.taskCount+a.diagramMarginX*(e.taskCount-1),i.height=a.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,K(f,i),ht(a)(e.text,f,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},a,e.colour)},"drawSection"),Z=-1,Ot=s(function(t,e,a,f){const i=e.x+a.width/2,u=t.append("g");Z++,u.append("line").attr("id",f+"-task"+Z).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Nt(u,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=lt();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=a.width,o.height=a.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,K(u,o);let g=e.x+14;e.people.forEach(m=>{const x=e.actors[m].color,h={cx:g,cy:e.y,r:7,fill:x,stroke:"#000",title:m,pos:e.actors[m].position};ot(u,h),g+=10}),ht(a)(e.task,u,o.x,o.y,o.width,o.height,{class:"task"},a,e.colour)},"drawTask"),Yt=s(function(t,e){mt(t,e)},"drawBackgroundRect"),ht=(function(){function t(i,u,p,o,g,m,x,h){const r=u.append("text").attr("x",p+g/2).attr("y",o+m/2+5).style("font-color",h).style("text-anchor","middle").text(i);f(r,x)}s(t,"byText");function e(i,u,p,o,g,m,x,h,r){const{taskFontSize:n,taskFontFamily:l}=h,y=i.split(//gi);for(let d=0;d{const u=E[i].color,p={cx:20,cy:f,r:7,fill:u,stroke:"#000",pos:E[i].position};j.drawCircle(t,p);let o=t.append("text").attr("visibility","hidden").text(i);const g=o.node().getBoundingClientRect().width;o.remove();let m=[];if(g<=a)m=[i];else{const x=i.split(" ");let h="";o=t.append("text").attr("visibility","hidden"),x.forEach(r=>{const n=h?`${h} ${r}`:r;if(o.text(n),o.node().getBoundingClientRect().width>a){if(h&&m.push(h),h=r,o.text(r),o.node().getBoundingClientRect().width>a){let y="";for(const d of r)y+=d,o.text(y+"-"),o.node().getBoundingClientRect().width>a&&(m.push(y.slice(0,-1)+"-"),y=d);h=y}}else h=n}),h&&m.push(h),o.remove()}m.forEach((x,h)=>{const r={x:40,y:f+7+h*20,fill:"#666",text:x,textMargin:e.boxTextMargin??5},l=j.drawText(t,r).node().getBoundingClientRect().width;l>W&&l>e.leftMargin-l&&(W=l)}),f+=Math.max(20,m.length*20)})}s(ut,"drawActorLegend");var $=R().journey,P=0,Xt=s(function(t,e,a,f){const i=R(),u=i.journey.titleColor,p=i.journey.titleFontSize,o=i.journey.titleFontFamily,g=i.securityLevel;let m;g==="sandbox"&&(m=X("#i"+e));const x=g==="sandbox"?X(m.nodes()[0].contentDocument.body):X("body");S.init();const h=x.select("#"+e);j.initGraphics(h,e);const r=f.db.getTasks(),n=f.db.getDiagramTitle(),l=f.db.getActors();for(const C in E)delete E[C];let y=0;l.forEach(C=>{E[C]={color:$.actorColours[y%$.actorColours.length],position:y},y++}),ut(h),P=$.leftMargin+W,S.insert(0,0,P,Object.keys(E).length*50),Gt(h,r,0,e);const d=S.getBounds();n&&h.append("text").text(n).attr("x",P).attr("font-size",p).attr("font-weight","bold").attr("y",25).attr("fill",u).attr("font-family",o);const c=d.stopy-d.starty+2*$.diagramMarginY,v=P+d.stopx+2*$.diagramMarginX;$t(h,c,v,$.useMaxWidth),h.append("line").attr("x1",P).attr("y1",$.height*4).attr("x2",v-P-4).attr("y2",$.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const k=n?70:0;h.attr("viewBox",`${d.startx} -25 ${v} ${c+k}`),h.attr("preserveAspectRatio","xMinYMin meet"),h.attr("height",c+k+25)},"draw"),S={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:s(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:s(function(t,e,a,f){t[e]===void 0?t[e]=a:t[e]=f(a,t[e])},"updateVal"),updateBounds:s(function(t,e,a,f){const i=R().journey,u=this;let p=0;function o(g){return s(function(x){p++;const h=u.sequenceItems.length-p+1;u.updateVal(x,"starty",e-h*i.boxMargin,Math.min),u.updateVal(x,"stopy",f+h*i.boxMargin,Math.max),u.updateVal(S.data,"startx",t-h*i.boxMargin,Math.min),u.updateVal(S.data,"stopx",a+h*i.boxMargin,Math.max),g!=="activation"&&(u.updateVal(x,"startx",t-h*i.boxMargin,Math.min),u.updateVal(x,"stopx",a+h*i.boxMargin,Math.max),u.updateVal(S.data,"starty",e-h*i.boxMargin,Math.min),u.updateVal(S.data,"stopy",f+h*i.boxMargin,Math.max))},"updateItemBounds")}s(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:s(function(t,e,a,f){const i=Math.min(t,a),u=Math.max(t,a),p=Math.min(e,f),o=Math.max(e,f);this.updateVal(S.data,"startx",i,Math.min),this.updateVal(S.data,"starty",p,Math.min),this.updateVal(S.data,"stopx",u,Math.max),this.updateVal(S.data,"stopy",o,Math.max),this.updateBounds(i,p,u,o)},"insert"),bumpVerticalPos:s(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:s(function(){return this.verticalPos},"getVerticalPos"),getBounds:s(function(){return this.data},"getBounds")},G=$.sectionFills,st=$.sectionColours,Gt=s(function(t,e,a,f){const i=R().journey;let u="";const p=i.height*2+i.diagramMarginY,o=a+p;let g=0,m="#CCC",x="black",h=0;for(const[r,n]of e.entries()){if(u!==n.section){m=G[g%G.length],h=g%G.length,x=st[g%st.length];let y=0;const d=n.section;for(let v=r;v(E[d]&&(y[d]=E[d]),y),{});n.x=r*i.taskMargin+r*i.width+P,n.y=o,n.width=i.diagramMarginX,n.height=i.diagramMarginY,n.colour=x,n.fill=m,n.num=h,n.actors=l,j.drawTask(t,n,i,f),S.insert(n.x,n.y,n.x+n.width+i.taskMargin,450)}},"drawTasks"),at={setConf:Ht,draw:Xt},te={parser:Et,db:nt,renderer:at,styles:jt,init:s(t=>{at.setConf(t.journey),nt.clear()},"init")};export{te as diagram}; diff --git a/internal/webapp/static/assets/kanban-definition-27J2QSJJ-BMVnCc0h.js b/internal/webapp/static/assets/kanban-definition-27J2QSJJ-BMVnCc0h.js new file mode 100644 index 0000000..ced43da --- /dev/null +++ b/internal/webapp/static/assets/kanban-definition-27J2QSJJ-BMVnCc0h.js @@ -0,0 +1,89 @@ +import{_ as o,l as te,c as H,D as fe,ad as ye,ae as me,af as be,W as _e,B as K,i as j,G as ke,J as Ee,T as Se,U as ce,V as le}from"./mermaid.core-B7WVQkyL.js";import{g as Ne}from"./chunk-5VM5RSS4-DJhOL3Lj.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var $=(function(){var e=o(function(O,i,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=i);return n},"o"),h=[1,4],p=[1,13],s=[1,12],d=[1,15],_=[1,16],b=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],k=[6,7,11],F=[1,31],N=[6,7,11,24],V=[1,6,13,16,17,20,23],f=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],U=[1,38],T={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:o(function(i,n,r,a,u,t,M){var c=t.length-1;switch(u){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:p,7:[1,10],9:9,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:b,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:b,23:l},{6:p,9:22,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:b,23:l},{6:I,7:g,10:23,11:w},e(k,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:b,23:l}),e(k,[2,19]),e(k,[2,21],{15:30,24:F}),e(k,[2,22]),e(k,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:b,23:l},e(V,[2,14],{7:f,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(k,[2,16],{15:37,24:F}),e(k,[2,17]),e(k,[2,18]),e(k,[2,20],{24:U}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(V,[2,13],{7:f,11:A}),e(L,[2,11]),e(L,[2,12]),e(k,[2,15],{24:U}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(i,n){if(n.recoverable)this.trace(i);else{var r=new Error(i);throw r.hash=n,r}},"parseError"),parse:o(function(i){var n=this,r=[0],a=[],u=[null],t=[],M=this.table,c="",W=0,se=0,ue=2,re=1,ge=t.slice.call(arguments,1),m=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);m.setInput(i,R.yy),R.yy.lexer=m,R.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;t.push(q);var de=m.options&&m.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,u.length=u.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var E,P,x,Q,G={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=ae()),x=M[P]&&M[P][E]),typeof x>"u"||!x.length||!x[0]){var Z="";X=[];for(z in M[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");m.showPosition?Z="Parse error on line "+(W+1)+`: +`+m.showPosition()+` +Expecting `+X.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(W+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:q,expected:X})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(x[0]){case 1:r.push(E),u.push(m.yytext),t.push(m.yylloc),r.push(x[1]),E=null,se=m.yyleng,c=m.yytext,W=m.yylineno,q=m.yylloc;break;case 2:if(C=this.productions_[x[1]][1],G.$=u[u.length-C],G._$={first_line:t[t.length-(C||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(C||1)].first_column,last_column:t[t.length-1].last_column},de&&(G._$.range=[t[t.length-(C||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(G,[c,se,W,R.yy,x[1],u,t].concat(ge)),typeof Q<"u")return Q;C&&(r=r.slice(0,-1*C*2),u=u.slice(0,-1*C),t=t.slice(0,-1*C)),r.push(this.productions_[x[1]][0]),u.push(G.$),t.push(G._$),oe=M[r[r.length-2]][r[r.length-1]],r.push(oe);break;case 3:return!0}}return!0},"parse")},Y=(function(){var O={EOF:1,parseError:o(function(n,r){if(this.yy.parser)this.yy.parser.parseError(n,r);else throw new Error(n)},"parseError"),setInput:o(function(i,n){return this.yy=n||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:o(function(i){var n=i.length,r=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var a=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(i){this.unput(this.match.slice(i))},"less"),pastInput:o(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var i=this.pastInput(),n=new Array(i.length+1).join("-");return i+this.upcomingInput()+` +`+n+"^"},"showPosition"),test_match:o(function(i,n){var r,a,u;if(this.options.backtrack_lexer&&(u={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(u.yylloc.range=this.yylloc.range.slice(0))),a=i[0].match(/(?:\r\n?|\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],r=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var t in u)this[t]=u[t];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,n,r,a;this._more||(this.yytext="",this.match="");for(var u=this._currentRules(),t=0;tn[0].length)){if(n=r,a=t,this.options.backtrack_lexer){if(i=this.test_match(r,u[t]),i!==!1)return i;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(i=this.test_match(n,u[a]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var n=this.next();return n||this.lex()},"lex"),begin:o(function(n){this.conditionStack.push(n)},"begin"),popState:o(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:o(function(n){this.begin(n)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(n,r,a,u){switch(a){case 0:return this.pushState("shapeData"),r.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const t=/\n\s*/g;return r.yytext=r.yytext.replace(t,"
"),24;case 4:return 24;case 5:this.popState();break;case 6:return n.getLogger().trace("Found comment",r.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return n.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:n.getLogger().trace("end icon"),this.popState();break;case 16:return n.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return n.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return n.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return n.getLogger().trace("description:",r.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),n.getLogger().trace("node end ...",r.yytext),"NODE_DEND";case 36:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 41:return n.getLogger().trace("Long description:",r.yytext),21;case 42:return n.getLogger().trace("Long description:",r.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return O})();T.lexer=Y;function B(){this.yy={}}return o(B,"Parser"),B.prototype=T,T.Parser=B,new B})();$.parser=$;var xe=$,v=[],ne=[],ee=0,ie={},ve=o(()=>{v=[],ne=[],ee=0,ie={}},"clear"),De=o(e=>{if(v.length===0)return null;const h=v[0].level;let p=null;for(let s=v.length-1;s>=0;s--)if(v[s].level===h&&!p&&(p=v[s]),v[s].levell.parentId===d.id);for(const l of b){const D={id:l.id,parentId:d.id,label:j(l.label??"",s),labelType:"markdown",isGroup:!1,ticket:l?.ticket,priority:l?.priority,assigned:l?.assigned,icon:l?.icon,shape:"kanbanItem",level:l.level,rx:5,ry:5,cssStyles:["text-align: left"]};h.push(D)}}return{nodes:h,edges:e,other:{},config:H()}},"getData"),Oe=o((e,h,p,s,d)=>{const _=H();let b=_.mindmap?.padding??K.mindmap.padding;switch(s){case y.ROUNDED_RECT:case y.RECT:case y.HEXAGON:b*=2}const l={id:j(h,_)||"kbn"+ee++,level:e,label:j(p,_),width:_.mindmap?.maxNodeWidth??K.mindmap.maxNodeWidth,padding:b,isGroup:!1};if(d!==void 0){let I;d.includes(` +`)?I=d+` +`:I=`{ +`+d+` +}`;const g=ke(I,{schema:Ee});if(g.shape&&(g.shape!==g.shape.toLowerCase()||g.shape.includes("_")))throw new Error(`No such shape: ${g.shape}. Shape names should be lowercase.`);g?.shape&&g.shape==="kanbanItem"&&(l.shape=g?.shape),g?.label&&(l.label=g?.label),g?.icon&&(l.icon=g?.icon.toString()),g?.assigned&&(l.assigned=g?.assigned.toString()),g?.ticket&&(l.ticket=g?.ticket.toString()),g?.priority&&(l.priority=g?.priority)}const D=De(e);D?l.parentId=D.id||"kbn"+ee++:ne.push(l),v.push(l)},"addNode"),y={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ie=o((e,h)=>{switch(te.debug("In get type",e,h),e){case"[":return y.RECT;case"(":return h===")"?y.ROUNDED_RECT:y.CLOUD;case"((":return y.CIRCLE;case")":return y.CLOUD;case"))":return y.BANG;case"{{":return y.HEXAGON;default:return y.DEFAULT}},"getType"),Ce=o((e,h)=>{ie[e]=h},"setElementForId"),we=o(e=>{if(!e)return;const h=H(),p=v[v.length-1];e.icon&&(p.icon=j(e.icon,h)),e.class&&(p.cssClasses=j(e.class,h))},"decorateNode"),Ae=o(e=>{switch(e){case y.DEFAULT:return"no-border";case y.RECT:return"rect";case y.ROUNDED_RECT:return"rounded-rect";case y.CIRCLE:return"circle";case y.CLOUD:return"cloud";case y.BANG:return"bang";case y.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Te=o(()=>te,"getLogger"),Re=o(e=>ie[e],"getElementById"),Pe={clear:ve,addNode:Oe,getSections:he,getData:Le,nodeType:y,getType:Ie,setElementForId:Ce,decorateNode:we,type2Str:Ae,getLogger:Te,getElementById:Re},Ve=Pe,Be=o(async(e,h,p,s)=>{te.debug(`Rendering kanban diagram +`+e);const _=s.db.getData(),b=H();b.htmlLabels=!1;const l=fe(h);for(const f of _.nodes)f.domId=`${h}-${f.id}`;const D=l.append("g");D.attr("class","sections");const I=l.append("g");I.attr("class","items");const g=_.nodes.filter(f=>f.isGroup);let w=0;const k=10,F=[];let N=25;for(const f of g){const A=b?.kanban?.sectionWidth||200;w=w+1,f.x=A*w+(w-1)*k/2,f.width=A,f.y=0,f.height=A*3,f.rx=5,f.ry=5,f.cssClasses=f.cssClasses+" section-"+w;const L=await ye(D,f);N=Math.max(N,L?.labelBBox?.height),F.push(L)}let V=0;for(const f of g){const A=F[V];V=V+1;const L=b?.kanban?.sectionWidth||200,U=-L*3/2+N;let T=U;const Y=_.nodes.filter(i=>i.parentId===f.id);for(const i of Y){if(i.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");i.x=f.x,i.width=L-1.5*k;const r=(await me(I,i,{config:b})).node().getBBox();i.y=T+r.height/2,await be(i),T=i.y+r.height/2+k/2}const B=A.cluster.select("rect"),O=Math.max(T-U+3*k,50)+(N-25);B.attr("height",O)}_e(void 0,l,b.mindmap?.padding??K.kanban.padding,b.mindmap?.useMaxWidth??K.kanban.useMaxWidth)},"draw"),Ge={draw:Be},je=o(e=>{let h="";for(let s=0;se.darkMode?le(s,d):ce(s,d),"adjuster");for(let s=0;s` + .edge { + stroke-width: 3; + } + ${je(e)} + .section-root rect, .section-root path, .section-root circle, .section-root polygon { + fill: ${e.git0}; + } + .section-root text { + fill: ${e.gitBranchLabel0}; + } + .icon-container { + height:100%; + display: flex; + justify-content: center; + align-items: center; + } + .edge { + fill: none; + } + .cluster-label, .label { + color: ${e.textColor}; + fill: ${e.textColor}; + } + .kanban-label { + dy: 1em; + alignment-baseline: middle; + text-anchor: middle; + dominant-baseline: middle; + text-align: center; + } + ${Ne()} +`,"getStyles"),Ue=Fe,Xe={db:Ve,renderer:Ge,parser:xe,styles:Ue};export{Xe as diagram}; diff --git a/internal/webapp/static/assets/katex-HP8lGamR.js b/internal/webapp/static/assets/katex-HP8lGamR.js new file mode 100644 index 0000000..baa1bbe --- /dev/null +++ b/internal/webapp/static/assets/katex-HP8lGamR.js @@ -0,0 +1,257 @@ +class S extends Error{constructor(e,t){var a="KaTeX parse error: "+e,i,s,u=t&&t.loc;if(u&&u.start<=u.end){var h=u.lexer.input;i=u.start,s=u.end,i===h.length?a+=" at end of input: ":a+=" at position "+(i+1)+": ";var c=h.slice(i,s).replace(/[^]/g,"$&̲"),v;i>15?v="…"+h.slice(i-15,i):v=h.slice(0,i);var p;s+15r.replace(Y1,"-$1").toLowerCase(),W1={"&":"&",">":">","<":"<",'"':""","'":"'"},j1=/[&><"']/g,i0=r=>String(r).replace(j1,e=>W1[e]),Ce=r=>r.type==="ordgroup"||r.type==="color"?r.body.length===1?Ce(r.body[0]):r:r.type==="font"?Ce(r.body):r,Z1=new Set(["mathord","textord","atom"]),D0=r=>Z1.has(Ce(r).type),K1=r=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(r);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},dt={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:r=>Math.max(0,r),cli:"-e, --max-expand ",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function J1(r){if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function Q1(r){if(r.default!==void 0)return r.default;var e=Array.isArray(r.type)?r.type[0]:r.type;return J1(e)}function _1(r,e,t,a){var i=t[e];r[e]=i!==void 0?a.processor?a.processor(i):i:Q1(a)}class Et{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var t of Object.keys(dt)){var a=dt[t];a&&_1(this,t,e,a)}}reportNonstrict(e,t,a){var i=this.strict;if(typeof i=="function"&&(i=i(e,t,a)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new S("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),a);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,a){var i=this.strict;if(typeof i=="function")try{i=i(e,t,a)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var t=K1(e.url);if(t==null)return!1;e.protocol=t}var a=typeof this.trust=="function"?this.trust(e):this.trust;return!!a}}class F0{constructor(e,t,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=a}sup(){return w0[ea[this.id]]}sub(){return w0[ta[this.id]]}fracNum(){return w0[ra[this.id]]}fracDen(){return w0[aa[this.id]]}cramp(){return w0[ia[this.id]]}text(){return w0[na[this.id]]}isTight(){return this.size>=2}}var Rt=0,qe=1,_0=2,B0=3,me=4,p0=5,ee=6,l0=7,w0=[new F0(Rt,0,!1),new F0(qe,0,!0),new F0(_0,1,!1),new F0(B0,1,!0),new F0(me,2,!1),new F0(p0,2,!0),new F0(ee,3,!1),new F0(l0,3,!0)],ea=[me,p0,me,p0,ee,l0,ee,l0],ta=[p0,p0,p0,p0,l0,l0,l0,l0],ra=[_0,B0,me,p0,ee,l0,ee,l0],aa=[B0,B0,p0,p0,l0,l0,l0,l0],ia=[qe,qe,B0,B0,p0,p0,l0,l0],na=[Rt,qe,_0,B0,_0,B0,_0,B0],N={DISPLAY:w0[Rt],TEXT:w0[_0],SCRIPT:w0[me],SCRIPTSCRIPT:w0[ee]},ft=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function sa(r){for(var e=0;e=i[0]&&r<=i[1])return t.name}return null}var De=[];ft.forEach(r=>r.blocks.forEach(e=>De.push(...e)));function Gr(r){for(var e=0;e=De[e]&&r<=De[e+1])return!0;return!1}var r0=r=>r+" "+r,Q0=80,la=function(e,t){return"M95,"+(622+e+t)+` +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l`+e/2.075+" -"+e+` +c5.3,-9.3,12,-14,20,-14 +H400000v`+(40+e)+`H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M`+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},ua=function(e,t){return"M263,"+(601+e+t)+`c0.7,0,18,39.7,52,119 +c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 +c340,-704.7,510.7,-1060.3,512,-1067 +l`+e/2.084+" -"+e+` +c4.7,-7.3,11,-11,19,-11 +H40000v`+(40+e)+`H1012.3 +s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 +c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 +s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 +c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z +M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},oa=function(e,t){return"M983 "+(10+e+t)+` +l`+e/3.13+" -"+e+` +c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` +H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 +s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 +c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 +c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 +c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 +c53.7,-170.3,84.5,-266.8,92.5,-289.5z +M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},ha=function(e,t){return"M424,"+(2398+e+t)+` +c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 +c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 +s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 +s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 +l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000 +v`+(40+e)+`H1014.6 +s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 +c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+t+` +h400000v`+(40+e)+"h-400000z"},ma=function(e,t){return"M473,"+(2713+e+t)+` +c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+` +c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 +s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 +c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 +s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, +606zM`+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},ca=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},da=function(e,t,a){var i=a-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+` +H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 +h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 +c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 +219 661 l218 661zM702 `+t+"H400000v"+(40+e)+"H742z"},fa=function(e,t,a){t=1e3*t;var i="";switch(e){case"sqrtMain":i=la(t,Q0);break;case"sqrtSize1":i=ua(t,Q0);break;case"sqrtSize2":i=oa(t,Q0);break;case"sqrtSize3":i=ha(t,Q0);break;case"sqrtSize4":i=ma(t,Q0);break;case"sqrtTall":i=da(t,Q0,a)}return i},va=function(e,t){switch(e){case"⎜":return r0("M291 0 H417 V"+t+" H291z");case"∣":return r0("M145 0 H188 V"+t+" H145z");case"∥":return r0("M145 0 H188 V"+t+" H145z")+r0("M367 0 H410 V"+t+" H367z");case"⎟":return r0("M457 0 H583 V"+t+" H457z");case"⎢":return r0("M319 0 H403 V"+t+" H319z");case"⎥":return r0("M263 0 H347 V"+t+" H263z");case"⎪":return r0("M384 0 H504 V"+t+" H384z");case"⏐":return r0("M312 0 H355 V"+t+" H312z");case"‖":return r0("M257 0 H300 V"+t+" H257z")+r0("M478 0 H521 V"+t+" H478z");default:return""}},ar={doubleleftarrow:`M262 157 +l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 + 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 + 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 +c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 + 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 +-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 +-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z +m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l +-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 + 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 +-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 +-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 +-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 +c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 +-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 + 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 +-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 +c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 + 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 + 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 + l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 +-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 + 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 + 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 + 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 +-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 +H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 + 435 0h399565z`,leftgroupunder:`M400000 262 +H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 + 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 +-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 +-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 +-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 + 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 +-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 +-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z +m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 + 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 + 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 +-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 + 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 +-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 +v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 +-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 +-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:r0("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:r0("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:r0("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:r0("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 +-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 +c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:r0("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 +c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 +-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 + 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 + 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 +c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 + 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 + 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 +-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 +-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z +m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 +60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 +-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z +m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 +c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 +-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z +m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 +85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 +-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z +m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 +c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 +-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 + 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 + 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 +-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 + 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l +-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 +s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 +c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 + 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 +-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 + 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 + 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 +-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 +-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 + 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 +-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 + 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z +m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 + 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 +-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 +-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 + 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 + 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 +-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z +m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 + 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 +-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 + 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:r0("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:r0("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:r0("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 + 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 +-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 +-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 + 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 +-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 +-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 +-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 + 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 +c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 + 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 + 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 +-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 + 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 +-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 + 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 + 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 +-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 +-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 + 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 +c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 + 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 +-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 + 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 + 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 + -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 +-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 + 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 + 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 + -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 +3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 +10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 +-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 +-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 +H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 +c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 +c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, +-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 +c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 +c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 +s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 +121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 +s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 +c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z +M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 +-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 +13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 +-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 +-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 +151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 +c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 +c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 +c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z +M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, +1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, +-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z +M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},pa=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 v84 h347 v-84 +H403z M403 1759 V0 H319 V1759 v`+t+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z +M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z +M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z +MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z +MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z +M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z +M347 1759 V0 h-84 V1759 v`+t+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 +c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, +-36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, +949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 +c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, +-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 +l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, +-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, +63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 +c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+` +c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 +c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 +c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 +c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 +l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function ga(r){return"toText"in r}class ae{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t{if(ga(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var vt={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},ba={ex:!0,em:!0,mu:!0},Ur=function(e){return typeof e!="string"&&(e=e.unit),e in vt||e in ba||e==="ex"},K=function(e,t){var a;if(e.unit in vt)a=vt[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")a=t.fontMetrics().cssEmPerMu;else{var i;if(t.style.isTight()?i=t.havingStyle(t.style.text()):i=t,e.unit==="ex")a=i.fontMetrics().xHeight;else if(e.unit==="em")a=i.fontMetrics().quad;else throw new S("Invalid unit: '"+e.unit+"'");i!==t&&(a*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*a,t.maxSize)},A=function(e){return+e.toFixed(4)+"em"},L0=function(e){return e.filter(t=>t).join(" ")},It=function(e){var t="";for(var a of Object.keys(e)){var i=e[a];i!==void 0&&(t+=$1(a)+":"+i+";")}return t},Vr=function(e,t,a){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},Xr=function(e){var t=document.createElement(e);t.className=L0(this.classes),Object.assign(t.style,this.style);for(var a of Object.keys(this.attributes))t.setAttribute(a,this.attributes[a]);for(var i=0;i/=\x00-\x1f]/,Yr=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+i0(L0(this.classes))+'"');var a=It(this.style);a&&(t+=' style="'+i0(a)+'"');for(var i of Object.keys(this.attributes)){if(ya.test(i))throw new S("Invalid attribute name '"+i+"'");t+=" "+i+'="'+i0(this.attributes[i])+'"'}t+=">";for(var s=0;s",t};class ie{constructor(e,t,a,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,Vr.call(this,e,a,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Xr.call(this,"span")}toMarkup(){return Yr.call(this,"span")}}class Fe{constructor(e,t,a,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Vr.call(this,t,i),this.children=a||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Xr.call(this,"a")}toMarkup(){return Yr.call(this,"a")}}class xa{constructor(e,t,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=a}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e=''+i0(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=A(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=L0(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="0&&(a+="margin-right:"+A(this.italic)+";"),a+=It(this.style),a&&(e=!0,t+=' style="'+i0(a)+'"');var i=i0(this.text);return e?(t+=">",t+=i,t+="",t):i}}class C0{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var a of Object.keys(this.attributes))t.setAttribute(a,this.attributes[a]);for(var i=0;i':''}}class pt{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var a of Object.keys(this.attributes))t.setAttribute(a,this.attributes[a]);return t}toMarkup(){var e=" but got "+String(r)+".")}var za=r=>r instanceof ie||r instanceof Fe||r instanceof ae,k0={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},we={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},ir={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function Aa(r,e){k0[r]=e}function Nt(r,e,t){if(!k0[e])throw new Error("Font metrics not found for font: "+e+".");var a=r.charCodeAt(0),i=k0[e][a];if(!i&&r[0]in ir&&(a=ir[r[0]].charCodeAt(0),i=k0[e][a]),!i&&t==="text"&&Gr(a)&&(i=k0[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Je={};function Ma(r){var e;if(r>=5?e=0:r>=3?e=1:e=2,!Je[e]){var t=Je[e]={cssEmPerMu:we.quad[e]/18};for(var a in we)we.hasOwnProperty(a)&&(t[a]=we[a][e])}return Je[e]}var W={math:{},text:{}};function n(r,e,t,a,i,s){W[r][i]={font:e,group:t,replace:a},s&&a&&(W[r][a]=W[r][i])}var l="math",w="text",o="main",d="ams",j="accent-token",D="bin",u0="close",ne="inner",E="mathord",t0="op-token",f0="open",de="punct",f="rel",q0="spacing",g="textord";n(l,o,f,"≡","\\equiv",!0);n(l,o,f,"≺","\\prec",!0);n(l,o,f,"≻","\\succ",!0);n(l,o,f,"∼","\\sim",!0);n(l,o,f,"⊥","\\perp");n(l,o,f,"⪯","\\preceq",!0);n(l,o,f,"⪰","\\succeq",!0);n(l,o,f,"≃","\\simeq",!0);n(l,o,f,"∣","\\mid",!0);n(l,o,f,"≪","\\ll",!0);n(l,o,f,"≫","\\gg",!0);n(l,o,f,"≍","\\asymp",!0);n(l,o,f,"∥","\\parallel");n(l,o,f,"⋈","\\bowtie",!0);n(l,o,f,"⌣","\\smile",!0);n(l,o,f,"⊑","\\sqsubseteq",!0);n(l,o,f,"⊒","\\sqsupseteq",!0);n(l,o,f,"≐","\\doteq",!0);n(l,o,f,"⌢","\\frown",!0);n(l,o,f,"∋","\\ni",!0);n(l,o,f,"∝","\\propto",!0);n(l,o,f,"⊢","\\vdash",!0);n(l,o,f,"⊣","\\dashv",!0);n(l,o,f,"∋","\\owns");n(l,o,de,".","\\ldotp");n(l,o,de,"⋅","\\cdotp");n(l,o,de,"⋅","·");n(w,o,g,"⋅","·");n(l,o,g,"#","\\#");n(w,o,g,"#","\\#");n(l,o,g,"&","\\&");n(w,o,g,"&","\\&");n(l,o,g,"ℵ","\\aleph",!0);n(l,o,g,"∀","\\forall",!0);n(l,o,g,"ℏ","\\hbar",!0);n(l,o,g,"∃","\\exists",!0);n(l,o,g,"∇","\\nabla",!0);n(l,o,g,"♭","\\flat",!0);n(l,o,g,"ℓ","\\ell",!0);n(l,o,g,"♮","\\natural",!0);n(l,o,g,"♣","\\clubsuit",!0);n(l,o,g,"℘","\\wp",!0);n(l,o,g,"♯","\\sharp",!0);n(l,o,g,"♢","\\diamondsuit",!0);n(l,o,g,"ℜ","\\Re",!0);n(l,o,g,"♡","\\heartsuit",!0);n(l,o,g,"ℑ","\\Im",!0);n(l,o,g,"♠","\\spadesuit",!0);n(l,o,g,"§","\\S",!0);n(w,o,g,"§","\\S");n(l,o,g,"¶","\\P",!0);n(w,o,g,"¶","\\P");n(l,o,g,"†","\\dag");n(w,o,g,"†","\\dag");n(w,o,g,"†","\\textdagger");n(l,o,g,"‡","\\ddag");n(w,o,g,"‡","\\ddag");n(w,o,g,"‡","\\textdaggerdbl");n(l,o,u0,"⎱","\\rmoustache",!0);n(l,o,f0,"⎰","\\lmoustache",!0);n(l,o,u0,"⟯","\\rgroup",!0);n(l,o,f0,"⟮","\\lgroup",!0);n(l,o,D,"∓","\\mp",!0);n(l,o,D,"⊖","\\ominus",!0);n(l,o,D,"⊎","\\uplus",!0);n(l,o,D,"⊓","\\sqcap",!0);n(l,o,D,"∗","\\ast");n(l,o,D,"⊔","\\sqcup",!0);n(l,o,D,"◯","\\bigcirc",!0);n(l,o,D,"∙","\\bullet",!0);n(l,o,D,"‡","\\ddagger");n(l,o,D,"≀","\\wr",!0);n(l,o,D,"⨿","\\amalg");n(l,o,D,"&","\\And");n(l,o,f,"⟵","\\longleftarrow",!0);n(l,o,f,"⇐","\\Leftarrow",!0);n(l,o,f,"⟸","\\Longleftarrow",!0);n(l,o,f,"⟶","\\longrightarrow",!0);n(l,o,f,"⇒","\\Rightarrow",!0);n(l,o,f,"⟹","\\Longrightarrow",!0);n(l,o,f,"↔","\\leftrightarrow",!0);n(l,o,f,"⟷","\\longleftrightarrow",!0);n(l,o,f,"⇔","\\Leftrightarrow",!0);n(l,o,f,"⟺","\\Longleftrightarrow",!0);n(l,o,f,"↦","\\mapsto",!0);n(l,o,f,"⟼","\\longmapsto",!0);n(l,o,f,"↗","\\nearrow",!0);n(l,o,f,"↩","\\hookleftarrow",!0);n(l,o,f,"↪","\\hookrightarrow",!0);n(l,o,f,"↘","\\searrow",!0);n(l,o,f,"↼","\\leftharpoonup",!0);n(l,o,f,"⇀","\\rightharpoonup",!0);n(l,o,f,"↙","\\swarrow",!0);n(l,o,f,"↽","\\leftharpoondown",!0);n(l,o,f,"⇁","\\rightharpoondown",!0);n(l,o,f,"↖","\\nwarrow",!0);n(l,o,f,"⇌","\\rightleftharpoons",!0);n(l,d,f,"≮","\\nless",!0);n(l,d,f,"","\\@nleqslant");n(l,d,f,"","\\@nleqq");n(l,d,f,"⪇","\\lneq",!0);n(l,d,f,"≨","\\lneqq",!0);n(l,d,f,"","\\@lvertneqq");n(l,d,f,"⋦","\\lnsim",!0);n(l,d,f,"⪉","\\lnapprox",!0);n(l,d,f,"⊀","\\nprec",!0);n(l,d,f,"⋠","\\npreceq",!0);n(l,d,f,"⋨","\\precnsim",!0);n(l,d,f,"⪹","\\precnapprox",!0);n(l,d,f,"≁","\\nsim",!0);n(l,d,f,"","\\@nshortmid");n(l,d,f,"∤","\\nmid",!0);n(l,d,f,"⊬","\\nvdash",!0);n(l,d,f,"⊭","\\nvDash",!0);n(l,d,f,"⋪","\\ntriangleleft");n(l,d,f,"⋬","\\ntrianglelefteq",!0);n(l,d,f,"⊊","\\subsetneq",!0);n(l,d,f,"","\\@varsubsetneq");n(l,d,f,"⫋","\\subsetneqq",!0);n(l,d,f,"","\\@varsubsetneqq");n(l,d,f,"≯","\\ngtr",!0);n(l,d,f,"","\\@ngeqslant");n(l,d,f,"","\\@ngeqq");n(l,d,f,"⪈","\\gneq",!0);n(l,d,f,"≩","\\gneqq",!0);n(l,d,f,"","\\@gvertneqq");n(l,d,f,"⋧","\\gnsim",!0);n(l,d,f,"⪊","\\gnapprox",!0);n(l,d,f,"⊁","\\nsucc",!0);n(l,d,f,"⋡","\\nsucceq",!0);n(l,d,f,"⋩","\\succnsim",!0);n(l,d,f,"⪺","\\succnapprox",!0);n(l,d,f,"≆","\\ncong",!0);n(l,d,f,"","\\@nshortparallel");n(l,d,f,"∦","\\nparallel",!0);n(l,d,f,"⊯","\\nVDash",!0);n(l,d,f,"⋫","\\ntriangleright");n(l,d,f,"⋭","\\ntrianglerighteq",!0);n(l,d,f,"","\\@nsupseteqq");n(l,d,f,"⊋","\\supsetneq",!0);n(l,d,f,"","\\@varsupsetneq");n(l,d,f,"⫌","\\supsetneqq",!0);n(l,d,f,"","\\@varsupsetneqq");n(l,d,f,"⊮","\\nVdash",!0);n(l,d,f,"⪵","\\precneqq",!0);n(l,d,f,"⪶","\\succneqq",!0);n(l,d,f,"","\\@nsubseteqq");n(l,d,D,"⊴","\\unlhd");n(l,d,D,"⊵","\\unrhd");n(l,d,f,"↚","\\nleftarrow",!0);n(l,d,f,"↛","\\nrightarrow",!0);n(l,d,f,"⇍","\\nLeftarrow",!0);n(l,d,f,"⇏","\\nRightarrow",!0);n(l,d,f,"↮","\\nleftrightarrow",!0);n(l,d,f,"⇎","\\nLeftrightarrow",!0);n(l,d,f,"△","\\vartriangle");n(l,d,g,"ℏ","\\hslash");n(l,d,g,"▽","\\triangledown");n(l,d,g,"◊","\\lozenge");n(l,d,g,"Ⓢ","\\circledS");n(l,d,g,"®","\\circledR");n(w,d,g,"®","\\circledR");n(l,d,g,"∡","\\measuredangle",!0);n(l,d,g,"∄","\\nexists");n(l,d,g,"℧","\\mho");n(l,d,g,"Ⅎ","\\Finv",!0);n(l,d,g,"⅁","\\Game",!0);n(l,d,g,"‵","\\backprime");n(l,d,g,"▲","\\blacktriangle");n(l,d,g,"▼","\\blacktriangledown");n(l,d,g,"■","\\blacksquare");n(l,d,g,"⧫","\\blacklozenge");n(l,d,g,"★","\\bigstar");n(l,d,g,"∢","\\sphericalangle",!0);n(l,d,g,"∁","\\complement",!0);n(l,d,g,"ð","\\eth",!0);n(w,o,g,"ð","ð");n(l,d,g,"╱","\\diagup");n(l,d,g,"╲","\\diagdown");n(l,d,g,"□","\\square");n(l,d,g,"□","\\Box");n(l,d,g,"◊","\\Diamond");n(l,d,g,"¥","\\yen",!0);n(w,d,g,"¥","\\yen",!0);n(l,d,g,"✓","\\checkmark",!0);n(w,d,g,"✓","\\checkmark");n(l,d,g,"ℶ","\\beth",!0);n(l,d,g,"ℸ","\\daleth",!0);n(l,d,g,"ℷ","\\gimel",!0);n(l,d,g,"ϝ","\\digamma",!0);n(l,d,g,"ϰ","\\varkappa");n(l,d,f0,"┌","\\@ulcorner",!0);n(l,d,u0,"┐","\\@urcorner",!0);n(l,d,f0,"└","\\@llcorner",!0);n(l,d,u0,"┘","\\@lrcorner",!0);n(l,d,f,"≦","\\leqq",!0);n(l,d,f,"⩽","\\leqslant",!0);n(l,d,f,"⪕","\\eqslantless",!0);n(l,d,f,"≲","\\lesssim",!0);n(l,d,f,"⪅","\\lessapprox",!0);n(l,d,f,"≊","\\approxeq",!0);n(l,d,D,"⋖","\\lessdot");n(l,d,f,"⋘","\\lll",!0);n(l,d,f,"≶","\\lessgtr",!0);n(l,d,f,"⋚","\\lesseqgtr",!0);n(l,d,f,"⪋","\\lesseqqgtr",!0);n(l,d,f,"≑","\\doteqdot");n(l,d,f,"≓","\\risingdotseq",!0);n(l,d,f,"≒","\\fallingdotseq",!0);n(l,d,f,"∽","\\backsim",!0);n(l,d,f,"⋍","\\backsimeq",!0);n(l,d,f,"⫅","\\subseteqq",!0);n(l,d,f,"⋐","\\Subset",!0);n(l,d,f,"⊏","\\sqsubset",!0);n(l,d,f,"≼","\\preccurlyeq",!0);n(l,d,f,"⋞","\\curlyeqprec",!0);n(l,d,f,"≾","\\precsim",!0);n(l,d,f,"⪷","\\precapprox",!0);n(l,d,f,"⊲","\\vartriangleleft");n(l,d,f,"⊴","\\trianglelefteq");n(l,d,f,"⊨","\\vDash",!0);n(l,d,f,"⊪","\\Vvdash",!0);n(l,d,f,"⌣","\\smallsmile");n(l,d,f,"⌢","\\smallfrown");n(l,d,f,"≏","\\bumpeq",!0);n(l,d,f,"≎","\\Bumpeq",!0);n(l,d,f,"≧","\\geqq",!0);n(l,d,f,"⩾","\\geqslant",!0);n(l,d,f,"⪖","\\eqslantgtr",!0);n(l,d,f,"≳","\\gtrsim",!0);n(l,d,f,"⪆","\\gtrapprox",!0);n(l,d,D,"⋗","\\gtrdot");n(l,d,f,"⋙","\\ggg",!0);n(l,d,f,"≷","\\gtrless",!0);n(l,d,f,"⋛","\\gtreqless",!0);n(l,d,f,"⪌","\\gtreqqless",!0);n(l,d,f,"≖","\\eqcirc",!0);n(l,d,f,"≗","\\circeq",!0);n(l,d,f,"≜","\\triangleq",!0);n(l,d,f,"∼","\\thicksim");n(l,d,f,"≈","\\thickapprox");n(l,d,f,"⫆","\\supseteqq",!0);n(l,d,f,"⋑","\\Supset",!0);n(l,d,f,"⊐","\\sqsupset",!0);n(l,d,f,"≽","\\succcurlyeq",!0);n(l,d,f,"⋟","\\curlyeqsucc",!0);n(l,d,f,"≿","\\succsim",!0);n(l,d,f,"⪸","\\succapprox",!0);n(l,d,f,"⊳","\\vartriangleright");n(l,d,f,"⊵","\\trianglerighteq");n(l,d,f,"⊩","\\Vdash",!0);n(l,d,f,"∣","\\shortmid");n(l,d,f,"∥","\\shortparallel");n(l,d,f,"≬","\\between",!0);n(l,d,f,"⋔","\\pitchfork",!0);n(l,d,f,"∝","\\varpropto");n(l,d,f,"◀","\\blacktriangleleft");n(l,d,f,"∴","\\therefore",!0);n(l,d,f,"∍","\\backepsilon");n(l,d,f,"▶","\\blacktriangleright");n(l,d,f,"∵","\\because",!0);n(l,d,f,"⋘","\\llless");n(l,d,f,"⋙","\\gggtr");n(l,d,D,"⊲","\\lhd");n(l,d,D,"⊳","\\rhd");n(l,d,f,"≂","\\eqsim",!0);n(l,o,f,"⋈","\\Join");n(l,d,f,"≑","\\Doteq",!0);n(l,d,D,"∔","\\dotplus",!0);n(l,d,D,"∖","\\smallsetminus");n(l,d,D,"⋒","\\Cap",!0);n(l,d,D,"⋓","\\Cup",!0);n(l,d,D,"⩞","\\doublebarwedge",!0);n(l,d,D,"⊟","\\boxminus",!0);n(l,d,D,"⊞","\\boxplus",!0);n(l,d,D,"⋇","\\divideontimes",!0);n(l,d,D,"⋉","\\ltimes",!0);n(l,d,D,"⋊","\\rtimes",!0);n(l,d,D,"⋋","\\leftthreetimes",!0);n(l,d,D,"⋌","\\rightthreetimes",!0);n(l,d,D,"⋏","\\curlywedge",!0);n(l,d,D,"⋎","\\curlyvee",!0);n(l,d,D,"⊝","\\circleddash",!0);n(l,d,D,"⊛","\\circledast",!0);n(l,d,D,"⋅","\\centerdot");n(l,d,D,"⊺","\\intercal",!0);n(l,d,D,"⋒","\\doublecap");n(l,d,D,"⋓","\\doublecup");n(l,d,D,"⊠","\\boxtimes",!0);n(l,d,f,"⇢","\\dashrightarrow",!0);n(l,d,f,"⇠","\\dashleftarrow",!0);n(l,d,f,"⇇","\\leftleftarrows",!0);n(l,d,f,"⇆","\\leftrightarrows",!0);n(l,d,f,"⇚","\\Lleftarrow",!0);n(l,d,f,"↞","\\twoheadleftarrow",!0);n(l,d,f,"↢","\\leftarrowtail",!0);n(l,d,f,"↫","\\looparrowleft",!0);n(l,d,f,"⇋","\\leftrightharpoons",!0);n(l,d,f,"↶","\\curvearrowleft",!0);n(l,d,f,"↺","\\circlearrowleft",!0);n(l,d,f,"↰","\\Lsh",!0);n(l,d,f,"⇈","\\upuparrows",!0);n(l,d,f,"↿","\\upharpoonleft",!0);n(l,d,f,"⇃","\\downharpoonleft",!0);n(l,o,f,"⊶","\\origof",!0);n(l,o,f,"⊷","\\imageof",!0);n(l,d,f,"⊸","\\multimap",!0);n(l,d,f,"↭","\\leftrightsquigarrow",!0);n(l,d,f,"⇉","\\rightrightarrows",!0);n(l,d,f,"⇄","\\rightleftarrows",!0);n(l,d,f,"↠","\\twoheadrightarrow",!0);n(l,d,f,"↣","\\rightarrowtail",!0);n(l,d,f,"↬","\\looparrowright",!0);n(l,d,f,"↷","\\curvearrowright",!0);n(l,d,f,"↻","\\circlearrowright",!0);n(l,d,f,"↱","\\Rsh",!0);n(l,d,f,"⇊","\\downdownarrows",!0);n(l,d,f,"↾","\\upharpoonright",!0);n(l,d,f,"⇂","\\downharpoonright",!0);n(l,d,f,"⇝","\\rightsquigarrow",!0);n(l,d,f,"⇝","\\leadsto");n(l,d,f,"⇛","\\Rrightarrow",!0);n(l,d,f,"↾","\\restriction");n(l,o,g,"‘","`");n(l,o,g,"$","\\$");n(w,o,g,"$","\\$");n(w,o,g,"$","\\textdollar");n(l,o,g,"%","\\%");n(w,o,g,"%","\\%");n(l,o,g,"_","\\_");n(w,o,g,"_","\\_");n(w,o,g,"_","\\textunderscore");n(l,o,g,"∠","\\angle",!0);n(l,o,g,"∞","\\infty",!0);n(l,o,g,"′","\\prime");n(l,o,g,"△","\\triangle");n(l,o,g,"Γ","\\Gamma",!0);n(l,o,g,"Δ","\\Delta",!0);n(l,o,g,"Θ","\\Theta",!0);n(l,o,g,"Λ","\\Lambda",!0);n(l,o,g,"Ξ","\\Xi",!0);n(l,o,g,"Π","\\Pi",!0);n(l,o,g,"Σ","\\Sigma",!0);n(l,o,g,"Υ","\\Upsilon",!0);n(l,o,g,"Φ","\\Phi",!0);n(l,o,g,"Ψ","\\Psi",!0);n(l,o,g,"Ω","\\Omega",!0);n(l,o,g,"A","Α");n(l,o,g,"B","Β");n(l,o,g,"E","Ε");n(l,o,g,"Z","Ζ");n(l,o,g,"H","Η");n(l,o,g,"I","Ι");n(l,o,g,"K","Κ");n(l,o,g,"M","Μ");n(l,o,g,"N","Ν");n(l,o,g,"O","Ο");n(l,o,g,"P","Ρ");n(l,o,g,"T","Τ");n(l,o,g,"X","Χ");n(l,o,g,"¬","\\neg",!0);n(l,o,g,"¬","\\lnot");n(l,o,g,"⊤","\\top");n(l,o,g,"⊥","\\bot");n(l,o,g,"∅","\\emptyset");n(l,d,g,"∅","\\varnothing");n(l,o,E,"α","\\alpha",!0);n(l,o,E,"β","\\beta",!0);n(l,o,E,"γ","\\gamma",!0);n(l,o,E,"δ","\\delta",!0);n(l,o,E,"ϵ","\\epsilon",!0);n(l,o,E,"ζ","\\zeta",!0);n(l,o,E,"η","\\eta",!0);n(l,o,E,"θ","\\theta",!0);n(l,o,E,"ι","\\iota",!0);n(l,o,E,"κ","\\kappa",!0);n(l,o,E,"λ","\\lambda",!0);n(l,o,E,"μ","\\mu",!0);n(l,o,E,"ν","\\nu",!0);n(l,o,E,"ξ","\\xi",!0);n(l,o,E,"ο","\\omicron",!0);n(l,o,E,"π","\\pi",!0);n(l,o,E,"ρ","\\rho",!0);n(l,o,E,"σ","\\sigma",!0);n(l,o,E,"τ","\\tau",!0);n(l,o,E,"υ","\\upsilon",!0);n(l,o,E,"ϕ","\\phi",!0);n(l,o,E,"χ","\\chi",!0);n(l,o,E,"ψ","\\psi",!0);n(l,o,E,"ω","\\omega",!0);n(l,o,E,"ε","\\varepsilon",!0);n(l,o,E,"ϑ","\\vartheta",!0);n(l,o,E,"ϖ","\\varpi",!0);n(l,o,E,"ϱ","\\varrho",!0);n(l,o,E,"ς","\\varsigma",!0);n(l,o,E,"φ","\\varphi",!0);n(l,o,D,"∗","*",!0);n(l,o,D,"+","+");n(l,o,D,"−","-",!0);n(l,o,D,"⋅","\\cdot",!0);n(l,o,D,"∘","\\circ",!0);n(l,o,D,"÷","\\div",!0);n(l,o,D,"±","\\pm",!0);n(l,o,D,"×","\\times",!0);n(l,o,D,"∩","\\cap",!0);n(l,o,D,"∪","\\cup",!0);n(l,o,D,"∖","\\setminus",!0);n(l,o,D,"∧","\\land");n(l,o,D,"∨","\\lor");n(l,o,D,"∧","\\wedge",!0);n(l,o,D,"∨","\\vee",!0);n(l,o,g,"√","\\surd");n(l,o,f0,"⟨","\\langle",!0);n(l,o,f0,"∣","\\lvert");n(l,o,f0,"∥","\\lVert");n(l,o,u0,"?","?");n(l,o,u0,"!","!");n(l,o,u0,"⟩","\\rangle",!0);n(l,o,u0,"∣","\\rvert");n(l,o,u0,"∥","\\rVert");n(l,o,f,"=","=");n(l,o,f,":",":");n(l,o,f,"≈","\\approx",!0);n(l,o,f,"≅","\\cong",!0);n(l,o,f,"≥","\\ge");n(l,o,f,"≥","\\geq",!0);n(l,o,f,"←","\\gets");n(l,o,f,">","\\gt",!0);n(l,o,f,"∈","\\in",!0);n(l,o,f,"","\\@not");n(l,o,f,"⊂","\\subset",!0);n(l,o,f,"⊃","\\supset",!0);n(l,o,f,"⊆","\\subseteq",!0);n(l,o,f,"⊇","\\supseteq",!0);n(l,d,f,"⊈","\\nsubseteq",!0);n(l,d,f,"⊉","\\nsupseteq",!0);n(l,o,f,"⊨","\\models");n(l,o,f,"←","\\leftarrow",!0);n(l,o,f,"≤","\\le");n(l,o,f,"≤","\\leq",!0);n(l,o,f,"<","\\lt",!0);n(l,o,f,"→","\\rightarrow",!0);n(l,o,f,"→","\\to");n(l,d,f,"≱","\\ngeq",!0);n(l,d,f,"≰","\\nleq",!0);n(l,o,q0," ","\\ ");n(l,o,q0," ","\\space");n(l,o,q0," ","\\nobreakspace");n(w,o,q0," ","\\ ");n(w,o,q0," "," ");n(w,o,q0," ","\\space");n(w,o,q0," ","\\nobreakspace");n(l,o,q0,"","\\nobreak");n(l,o,q0,"","\\allowbreak");n(l,o,de,",",",");n(l,o,de,";",";");n(l,d,D,"⊼","\\barwedge",!0);n(l,d,D,"⊻","\\veebar",!0);n(l,o,D,"⊙","\\odot",!0);n(l,o,D,"⊕","\\oplus",!0);n(l,o,D,"⊗","\\otimes",!0);n(l,o,g,"∂","\\partial",!0);n(l,o,D,"⊘","\\oslash",!0);n(l,d,D,"⊚","\\circledcirc",!0);n(l,d,D,"⊡","\\boxdot",!0);n(l,o,D,"△","\\bigtriangleup");n(l,o,D,"▽","\\bigtriangledown");n(l,o,D,"†","\\dagger");n(l,o,D,"⋄","\\diamond");n(l,o,D,"⋆","\\star");n(l,o,D,"◃","\\triangleleft");n(l,o,D,"▹","\\triangleright");n(l,o,f0,"{","\\{");n(w,o,g,"{","\\{");n(w,o,g,"{","\\textbraceleft");n(l,o,u0,"}","\\}");n(w,o,g,"}","\\}");n(w,o,g,"}","\\textbraceright");n(l,o,f0,"{","\\lbrace");n(l,o,u0,"}","\\rbrace");n(l,o,f0,"[","\\lbrack",!0);n(w,o,g,"[","\\lbrack",!0);n(l,o,u0,"]","\\rbrack",!0);n(w,o,g,"]","\\rbrack",!0);n(l,o,f0,"(","\\lparen",!0);n(l,o,u0,")","\\rparen",!0);n(w,o,g,"<","\\textless",!0);n(w,o,g,">","\\textgreater",!0);n(l,o,f0,"⌊","\\lfloor",!0);n(l,o,u0,"⌋","\\rfloor",!0);n(l,o,f0,"⌈","\\lceil",!0);n(l,o,u0,"⌉","\\rceil",!0);n(l,o,g,"\\","\\backslash");n(l,o,g,"∣","|");n(l,o,g,"∣","\\vert");n(w,o,g,"|","\\textbar",!0);n(l,o,g,"∥","\\|");n(l,o,g,"∥","\\Vert");n(w,o,g,"∥","\\textbardbl");n(w,o,g,"~","\\textasciitilde");n(w,o,g,"\\","\\textbackslash");n(w,o,g,"^","\\textasciicircum");n(l,o,f,"↑","\\uparrow",!0);n(l,o,f,"⇑","\\Uparrow",!0);n(l,o,f,"↓","\\downarrow",!0);n(l,o,f,"⇓","\\Downarrow",!0);n(l,o,f,"↕","\\updownarrow",!0);n(l,o,f,"⇕","\\Updownarrow",!0);n(l,o,t0,"∐","\\coprod");n(l,o,t0,"⋁","\\bigvee");n(l,o,t0,"⋀","\\bigwedge");n(l,o,t0,"⨄","\\biguplus");n(l,o,t0,"⋂","\\bigcap");n(l,o,t0,"⋃","\\bigcup");n(l,o,t0,"∫","\\int");n(l,o,t0,"∫","\\intop");n(l,o,t0,"∬","\\iint");n(l,o,t0,"∭","\\iiint");n(l,o,t0,"∏","\\prod");n(l,o,t0,"∑","\\sum");n(l,o,t0,"⨂","\\bigotimes");n(l,o,t0,"⨁","\\bigoplus");n(l,o,t0,"⨀","\\bigodot");n(l,o,t0,"∮","\\oint");n(l,o,t0,"∯","\\oiint");n(l,o,t0,"∰","\\oiiint");n(l,o,t0,"⨆","\\bigsqcup");n(l,o,t0,"∫","\\smallint");n(w,o,ne,"…","\\textellipsis");n(l,o,ne,"…","\\mathellipsis");n(w,o,ne,"…","\\ldots",!0);n(l,o,ne,"…","\\ldots",!0);n(l,o,ne,"⋯","\\@cdots",!0);n(l,o,ne,"⋱","\\ddots",!0);n(l,o,g,"⋮","\\varvdots");n(w,o,g,"⋮","\\varvdots");n(l,o,j,"ˊ","\\acute");n(l,o,j,"ˋ","\\grave");n(l,o,j,"¨","\\ddot");n(l,o,j,"~","\\tilde");n(l,o,j,"ˉ","\\bar");n(l,o,j,"˘","\\breve");n(l,o,j,"ˇ","\\check");n(l,o,j,"^","\\hat");n(l,o,j,"⃗","\\vec");n(l,o,j,"˙","\\dot");n(l,o,j,"˚","\\mathring");n(l,o,E,"","\\@imath");n(l,o,E,"","\\@jmath");n(l,o,g,"ı","ı");n(l,o,g,"ȷ","ȷ");n(w,o,g,"ı","\\i",!0);n(w,o,g,"ȷ","\\j",!0);n(w,o,g,"ß","\\ss",!0);n(w,o,g,"æ","\\ae",!0);n(w,o,g,"œ","\\oe",!0);n(w,o,g,"ø","\\o",!0);n(w,o,g,"Æ","\\AE",!0);n(w,o,g,"Œ","\\OE",!0);n(w,o,g,"Ø","\\O",!0);n(w,o,j,"ˊ","\\'");n(w,o,j,"ˋ","\\`");n(w,o,j,"ˆ","\\^");n(w,o,j,"˜","\\~");n(w,o,j,"ˉ","\\=");n(w,o,j,"˘","\\u");n(w,o,j,"˙","\\.");n(w,o,j,"¸","\\c");n(w,o,j,"˚","\\r");n(w,o,j,"ˇ","\\v");n(w,o,j,"¨",'\\"');n(w,o,j,"˝","\\H");n(w,o,j,"◯","\\textcircled");var $r={"--":!0,"---":!0,"``":!0,"''":!0};n(w,o,g,"–","--",!0);n(w,o,g,"–","\\textendash");n(w,o,g,"—","---",!0);n(w,o,g,"—","\\textemdash");n(w,o,g,"‘","`",!0);n(w,o,g,"‘","\\textquoteleft");n(w,o,g,"’","'",!0);n(w,o,g,"’","\\textquoteright");n(w,o,g,"“","``",!0);n(w,o,g,"“","\\textquotedblleft");n(w,o,g,"”","''",!0);n(w,o,g,"”","\\textquotedblright");n(l,o,g,"°","\\degree",!0);n(w,o,g,"°","\\degree");n(w,o,g,"°","\\textdegree",!0);n(l,o,g,"£","\\pounds");n(l,o,g,"£","\\mathsterling",!0);n(w,o,g,"£","\\pounds");n(w,o,g,"£","\\textsterling",!0);n(l,d,g,"✠","\\maltese");n(w,d,g,"✠","\\maltese");var nr='0123456789/@."';for(var Qe=0;Qe{var e=r.charCodeAt(0),t=r.charCodeAt(1),a=(e-55296)*1024+(t-56320)+65536;if(119808<=a&&a<120484){var i=Math.floor((a-119808)/26);return vr[i]}else if(120782<=a&&a<=120831){var s=Math.floor((a-120782)/10);return Ba[s]}else{if(a===120485||a===120486)return vr[0];if(120486{if(L0(r.classes)!==L0(e.classes)||r.skew!==e.skew||r.maxFontSize!==e.maxFontSize||r.italic!==0&&r.hasClass("mathnormal"))return!1;if(r.classes.length===1){var t=r.classes[0];if(t==="mbin"||t==="mord")return!1}for(var a of Object.keys(r.style))if(r.style[a]!==e.style[a])return!1;for(var i of Object.keys(e.style))if(r.style[i]!==e.style[i])return!1;return!0},Wr=r=>{for(var e=0;et&&(t=u.height),u.depth>a&&(a=u.depth),u.maxFontSize>i&&(i=u.maxFontSize)}e.height=t,e.depth=a,e.maxFontSize=i},k=function(e,t,a,i){var s=new ie(e,t,a,i);return Ht(s),s},G0=(r,e,t,a)=>new ie(r,e,t,a),te=function(e,t,a){var i=k([e],[],t);return i.height=Math.max(a||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i.style.borderBottomWidth=A(i.height),i.maxFontSize=1,i},Ea=function(e,t,a,i){var s=new Fe(e,t,a,i);return Ht(s),s},E0=function(e){var t=new ae(e);return Ht(t),t},re=function(e,t){return e instanceof ae?k([],[e],t):e},Ra=function(e){if(e.positionType==="individualShift"){for(var t=e.children,a=[t[0]],i=-t[0].shift-t[0].elem.depth,s=i,u=1;u{var t=k(["mspace"],[],e),a=K(r,e);return t.style.marginRight=A(a),t},ze=(r,e,t)=>{var a,i;switch(r){case"amsrm":a="AMS";break;case"textrm":a="Main";break;case"textsf":a="SansSerif";break;case"texttt":a="Typewriter";break;default:a=r}return e==="textbf"&&t==="textit"?i="BoldItalic":e==="textbf"?i="Bold":t==="textit"?i="Italic":i="Regular",a+"-"+i},kt={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Zr={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Kr=function(e,t){var[a,i,s]=Zr[e],u=new P0(a),h=new C0([u],{width:A(i),height:A(s),style:"width:"+A(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),c=G0(["overlay"],[h],t);return c.height=s,c.style.height=A(s),c.style.width=A(i),c},Z={number:3,unit:"mu"},Y0={number:4,unit:"mu"},M0={number:5,unit:"mu"},Ia={mord:{mop:Z,mbin:Y0,mrel:M0,minner:Z},mop:{mord:Z,mop:Z,mrel:M0,minner:Z},mbin:{mord:Y0,mop:Y0,mopen:Y0,minner:Y0},mrel:{mord:M0,mop:M0,mopen:M0,minner:M0},mopen:{},mclose:{mop:Z,mbin:Y0,mrel:M0,minner:Z},mpunct:{mord:Z,mop:Z,mrel:M0,mopen:Z,mclose:Z,mpunct:Z,minner:Z},minner:{mord:Z,mop:Z,mbin:Y0,mrel:M0,mopen:Z,mpunct:Z,minner:Z}},Na={mord:{mop:Z},mop:{mord:Z,mop:Z},mbin:{},mrel:{},mopen:{},mclose:{mop:Z},mpunct:{},minner:{mop:Z}},Jr={},Re={},Ie={};function B(r){for(var{type:e,names:t,props:a,handler:i,htmlBuilder:s,mathmlBuilder:u}=r,h={type:e,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:i},c=0;c{var q=M.classes[0],C=T.classes[0];q==="mbin"&&Ha.has(C)?M.classes[0]="mord":C==="mbin"&&Fa.has(q)&&(T.classes[0]="mord")},{node:b},x,y),St(s,(T,M)=>{var q,C,R=At(M),F=At(T),L=R&&F?T.hasClass("mtight")?(q=Na[R])==null?void 0:q[F]:(C=Ia[R])==null?void 0:C[F]:null;if(L)return jr(L,v)},{node:b},x,y),s},St=function(e,t,a,i,s){i&&e.push(i);for(var u=0;ux=>{e.splice(b+1,0,x),u++})(u)}i&&e.pop()},Qr=function(e){return e instanceof ae||e instanceof Fe||e instanceof ie&&e.hasClass("enclosing")?e:null},zt=function(e,t){var a=Qr(e);if(a){var i=a.children;if(i.length){if(t==="right")return zt(i[i.length-1],"right");if(t==="left")return zt(i[0],"left")}}return e},At=function(e,t){if(!e)return null;t&&(e=zt(e,t));var a=e.classes[0];return La[a]||null},ce=function(e,t){var a=["nulldelimiter"].concat(e.baseSizingClasses());return k(t.concat(a))},X=function(e,t,a){if(!e)return k();if(Re[e.type]){var i=Re[e.type](e,t);if(a&&t.size!==a.size){i=k(t.sizingClasses(a),[i],t);var s=t.sizeMultiplier/a.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new S("Got group of unknown type: '"+e.type+"'")};function Ae(r,e){var t=k(["base"],r,e),a=k(["strut"]);return a.style.height=A(t.height+t.depth),t.depth&&(a.style.verticalAlign=A(-t.depth)),t.children.unshift(a),t}function Mt(r,e){var t=null;r.length===1&&r[0].type==="tag"&&(t=r[0].tag,r=r[0].body);var a=a0(r,e,"root"),i;a.length===2&&a[1].hasClass("tag")&&(i=a.pop());for(var s=[],u=[],h=0;h0&&(s.push(Ae(u,e)),u=[]),s.push(a[h]));u.length>0&&s.push(Ae(u,e));var v;t?(v=Ae(a0(t,e,!0),e),v.classes=["tag"],s.push(v)):i&&s.push(i);var p=k(["katex-html"],s);if(p.setAttribute("aria-hidden","true"),v){var b=v.children[0];b.style.height=A(p.height+p.depth),p.depth&&(b.style.verticalAlign=A(-p.depth))}return p}function _r(r){return new ae(r)}class z{constructor(e,t,a){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=a||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=L0(this.classes));for(var a=0;a0&&(e+=' class ="'+i0(L0(this.classes))+'"'),e+=">";for(var a=0;a",e}toText(){return this.children.map(e=>e.toText()).join("")}}class e0{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return i0(this.toText())}toText(){return this.text}}class e1{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",A(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var Pa=new Set(["\\imath","\\jmath"]),Ga=new Set(["mrow","mtable"]),g0=function(e,t,a){return W[t][e]&&W[t][e].replace&&e.charCodeAt(0)!==55349&&!($r.hasOwnProperty(e)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(e=W[t][e].replace),new e0(e)},Ot=function(e){return e.length===1?e[0]:new z("mrow",e)},Ua={mathit:"italic",boldsymbol:r=>r.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},Lt=(r,e)=>{if(r.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var t=e.font;if(!t||t==="mathnormal")return null;var a=r.mode,i=Ua[t];if(i)return typeof i=="function"?i(r):i;var s=r.text;if(Pa.has(s))return null;if(W[a][s]){var u=W[a][s].replace;u&&(s=u)}var h=kt[t].fontName;return Nt(s,h,a)?kt[t].variant:null};function rt(r){if(!r)return!1;if(r.type==="mi"&&r.children.length===1){var e=r.children[0];return e instanceof e0&&e.text==="."}else if(r.type==="mo"&&r.children.length===1&&r.getAttribute("separator")==="true"&&r.getAttribute("lspace")==="0em"&&r.getAttribute("rspace")==="0em"){var t=r.children[0];return t instanceof e0&&t.text===","}else return!1}var v0=function(e,t,a){if(e.length===1){var i=$(e[0],t);return a&&i instanceof z&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],u,h=0;h=1&&(u.type==="mn"||rt(u))){var v=c.children[0];v instanceof z&&v.type==="mn"&&(v.children=[...u.children,...v.children],s.pop())}else if(u.type==="mi"&&u.children.length===1){var p=u.children[0];if(p instanceof e0&&p.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var b=c.children[0];b instanceof e0&&b.text.length>0&&(b.text=b.text.slice(0,1)+"̸"+b.text.slice(1),s.pop())}}}s.push(c),u=c}return s},U0=function(e,t,a){return Ot(v0(e,t,a))},$=function(e,t){if(!e)return new z("mrow");if(Ie[e.type])return Ie[e.type](e,t);throw new S("Got group of unknown type: '"+e.type+"'")};function pr(r,e,t,a,i){var s=v0(r,t),u;s.length===1&&s[0]instanceof z&&Ga.has(s[0].type)?u=s[0]:u=new z("mrow",s);var h=new z("annotation",[new e0(e)]);h.setAttribute("encoding","application/x-tex");var c=new z("semantics",[u,h]),v=new z("math",[c]);v.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&v.setAttribute("display","block");var p=i?"katex":"katex-mathml";return k([p],[v])}var Va=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],gr=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],br=function(e,t){return t.size<2?e:Va[e-1][t.size-1]};class T0{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||T0.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=gr[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,e),new T0(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:br(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:gr[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=br(T0.BASESIZE,e);return this.size===t&&this.textSize===T0.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==T0.BASESIZE?["sizing","reset-size"+this.size,"size"+T0.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=Ma(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}T0.BASESIZE=6;var t1=function(e){return new T0({style:e.displayMode?N.DISPLAY:N.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},r1=function(e,t){if(t.displayMode){var a=["katex-display"];t.leqno&&a.push("leqno"),t.fleqn&&a.push("fleqn"),e=k(a,[e])}return e},Xa=function(e,t,a){var i=t1(a),s;if(a.output==="mathml")return pr(e,t,i,a.displayMode,!0);if(a.output==="html"){var u=Mt(e,i);s=k(["katex"],[u])}else{var h=pr(e,t,i,a.displayMode,!1),c=Mt(e,i);s=k(["katex"],[h,c])}return r1(s,a)},Ya=function(e,t,a){var i=t1(a),s=Mt(e,i),u=k(["katex"],[s]);return r1(u,a)},$a={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Le=function(e){var t=new z("mo",[new e0($a[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Wa={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},ja=new Set(["widehat","widecheck","widetilde","utilde"]),Pe=function(e,t){function a(){var h=4e5,c=e.label.slice(1);if(ja.has(c)&&"base"in e){var v=e.base.type==="ordgroup"?e.base.body.length:1,p,b,x;if(v>5)c==="widehat"||c==="widecheck"?(p=420,h=2364,x=.42,b=c+"4"):(p=312,h=2340,x=.34,b="tilde4");else{var y=[1,1,2,2,3,3][v];c==="widehat"||c==="widecheck"?(h=[0,1062,2364,2364,2364][y],p=[0,239,300,360,420][y],x=[0,.24,.3,.3,.36,.42][y],b=c+y):(h=[0,600,1033,2339,2340][y],p=[0,260,286,306,312][y],x=[0,.26,.286,.3,.306,.34][y],b="tilde"+y)}var T=new P0(b),M=new C0([T],{width:"100%",height:A(x),viewBox:"0 0 "+h+" "+p,preserveAspectRatio:"none"});return{span:G0([],[M],t),minWidth:0,height:x}}else{var q=[],C=Wa[c];if(!C)throw new Error('No SVG data for "'+c+'".');var[R,F,L]=C,O=L/1e3,P=R.length,G,Y;if(P===1){if(C.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+c+'".');G=["hide-tail"],Y=[C[3]]}else if(P===2)G=["halfarrow-left","halfarrow-right"],Y=["xMinYMin","xMaxYMin"];else if(P===3)G=["brace-left","brace-center","brace-right"],Y=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+P+" children.");for(var U=0;U0&&(i.style.minWidth=A(s)),i},Za=function(e,t,a,i,s){var u,h=e.height+e.depth+a+i;if(/fbox|color|angl/.test(t)){if(u=k(["stretchy",t],[],s),t==="fbox"){var c=s.color&&s.getColor();c&&(u.style.borderColor=c)}}else{var v=[];/^[bx]cancel$/.test(t)&&v.push(new pt({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&v.push(new pt({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var p=new C0(v,{width:"100%",height:A(h)});u=G0([],[p],s)}return u.height=h,u.style.height=A(h),u},Ka={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Ja={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Qa(r){return r in Ka}function H(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function Ge(r){var e=Ue(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function Ue(r){return r&&(r.type==="atom"||Ja.hasOwnProperty(r.type))?r:null}var a1=r=>{if(r instanceof d0)return r;if(za(r)&&r.children.length===1)return a1(r.children[0])},Pt=(r,e)=>{var t,a,i;r&&r.type==="supsub"?(a=H(r.base,"accent"),t=a.base,r.base=t,i=Sa(X(r,e)),r.base=a):(a=H(r,"accent"),t=a.base);var s=X(t,e.havingCrampedStyle()),u=a.isShifty&&D0(t),h=0;if(u){var c,v;h=(c=(v=a1(s))==null?void 0:v.skew)!=null?c:0}var p=a.label==="\\c",b=p?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),x;if(a.isStretchy)x=Pe(a,e),x=V({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:x,wrapperClasses:["svg-align"],wrapperStyle:h>0?{width:"calc(100% - "+A(2*h)+")",marginLeft:A(2*h)}:void 0}]});else{var y,T;a.label==="\\vec"?(y=Kr("vec",e),T=Zr.vec[1]):(y=Oe({mode:a.mode,text:a.label},e,"textord"),y=ka(y),y.italic=0,T=y.width,p&&(b+=y.depth)),x=k(["accent-body"],[y]);var M=a.label==="\\textcircled";M&&(x.classes.push("accent-full"),b=s.height);var q=h;M||(q-=T/2),x.style.left=A(q),a.label==="\\textcircled"&&(x.style.top=".2em"),x=V({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-b},{type:"elem",elem:x}]})}var C=k(["mord","accent"],[x],e);return i?(i.children[0]=C,i.height=Math.max(C.height,i.height),i.classes[0]="mord",i):C},i1=(r,e)=>{var t=r.isStretchy?Le(r.label):new z("mo",[g0(r.label,r.mode)]),a=new z("mover",[$(r.base,e),t]);return a.setAttribute("accent","true"),a},_a=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));B({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=Ne(e[0]),a=!_a.test(r.funcName),i=!a||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:a,isShifty:i,base:t}},htmlBuilder:Pt,mathmlBuilder:i1});B({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],a=r.parser.mode;return a==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:Pt,mathmlBuilder:i1});B({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:a}=r,i=e[0];return{type:"accentUnder",mode:t.mode,label:a,base:i}},htmlBuilder:(r,e)=>{var t=X(r.base,e),a=Pe(r,e),i=r.label==="\\utilde"?.12:0,s=V({positionType:"top",positionData:t.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:t}]});return k(["mord","accentunder"],[s],e)},mathmlBuilder:(r,e)=>{var t=Le(r.label),a=new z("munder",[$(r.base,e),t]);return a.setAttribute("accentunder","true"),a}});var Me=r=>{var e=new z("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};B({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:a,funcName:i}=r;return{type:"xArrow",mode:a.mode,label:i,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,a=e.havingStyle(t.sup()),i=re(X(r.body,a,e),e),s=r.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var u;r.below&&(a=e.havingStyle(t.sub()),u=re(X(r.below,a,e),e),u.classes.push(s+"-arrow-pad"));var h=Pe(r,e),c=-e.fontMetrics().axisHeight+.5*h.height,v=-e.fontMetrics().axisHeight-.5*h.height-.111;(i.depth>.25||r.label==="\\xleftequilibrium")&&(v-=i.depth);var p;if(u){var b=-e.fontMetrics().axisHeight+u.height+.5*h.height+.111;p=V({positionType:"individualShift",children:[{type:"elem",elem:i,shift:v},{type:"elem",elem:h,shift:c,wrapperClasses:["svg-align"]},{type:"elem",elem:u,shift:b}]})}else p=V({positionType:"individualShift",children:[{type:"elem",elem:i,shift:v},{type:"elem",elem:h,shift:c,wrapperClasses:["svg-align"]}]});return k(["mrel","x-arrow"],[p],e)},mathmlBuilder(r,e){var t=Le(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(r.body){var i=Me($(r.body,e));if(r.below){var s=Me($(r.below,e));a=new z("munderover",[t,s,i])}else a=new z("mover",[t,i])}else if(r.below){var u=Me($(r.below,e));a=new z("munder",[t,u])}else a=Me(),a=new z("mover",[t,a]);return a}});function n1(r,e){var t=a0(r.body,e,!0);return k([r.mclass],t,e)}function s1(r,e){var t,a=v0(r.body,e);return r.mclass==="minner"?t=new z("mpadded",a):r.mclass==="mord"?r.isCharacterBox?(t=a[0],t.type="mi"):t=new z("mi",a):(r.isCharacterBox?(t=a[0],t.type="mo"):t=new z("mo",a),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):r.mclass==="mopen"||r.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):r.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}B({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,e){var{parser:t,funcName:a}=r,i=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+a.slice(5),body:_(i),isCharacterBox:D0(i)}},htmlBuilder:n1,mathmlBuilder:s1});var Ve=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};B({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:Ve(e[0]),body:_(e[1]),isCharacterBox:D0(e[1])}}});B({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,e){var{parser:t,funcName:a}=r,i=e[1],s=e[0],u;a!=="\\stackrel"?u=Ve(i):u="mrel";var h={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:_(i)},c={type:"supsub",mode:s.mode,base:h,sup:a==="\\underset"?null:s,sub:a==="\\underset"?s:null};return{type:"mclass",mode:t.mode,mclass:u,body:[c],isCharacterBox:D0(c)}},htmlBuilder:n1,mathmlBuilder:s1});B({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:Ve(e[0]),body:_(e[0])}},htmlBuilder(r,e){var t=a0(r.body,e,!0),a=k([r.mclass],t,e);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(r,e){var t=v0(r.body,e),a=new z("mstyle",t);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var e4={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},yr=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),xr=r=>r.type==="textord"&&r.text==="@",t4=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function r4(r,e,t){var a=e4[r];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(a,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=t.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:a,mode:"math",family:"rel"},u=t.callFunction("\\Big",[s],[]),h=t.callFunction("\\\\cdright",[e[1]],[]),c={type:"ordgroup",mode:"math",body:[i,u,h]};return t.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var v={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[v],[])}default:return{type:"textord",text:" ",mode:"math"}}}function a4(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new S("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var a=[],i=[a],s=0;sAV".includes(v))for(var b=0;b<2;b++){for(var x=!0,y=c+1;yAV=|." after @',u[c]);var T=r4(v,p,r),M={type:"styling",body:[T],mode:"math",style:"display",resetFont:!0};a.push(M),h=yr()}s%2===0?a.push(h):a.shift(),a=[],i.push(a)}r.gullet.endGroup(),r.gullet.endGroup();var q=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:q,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}B({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:a}=r;return{type:"cdlabel",mode:t.mode,side:a.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),a=re(X(r.label,t,e),e);return a.classes.push("cd-label-"+r.side),a.style.bottom=A(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(r,e){var t=new z("mrow",[$(r.label,e)]);return t=new z("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new z("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});B({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=re(X(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new z("mrow",[$(r.fragment,e)])}});B({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,e){for(var{parser:t}=r,a=H(e[0],"ordgroup"),i=a.body,s="",u=0;u=1114111)throw new S("\\@char with invalid code point "+s);return c<=65535?v=String.fromCharCode(c):(c-=65536,v=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:t.mode,text:v}}});var l1=(r,e)=>{var t=a0(r.body,e.withColor(r.color),!1);return E0(t)},u1=(r,e)=>{var t=v0(r.body,e.withColor(r.color)),a=new z("mstyle",t);return a.setAttribute("mathcolor",r.color),a};B({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(r,e){var{parser:t}=r,a=H(e[0],"color-token").color,i=e[1];return{type:"color",mode:t.mode,color:a,body:_(i)}},htmlBuilder:l1,mathmlBuilder:u1});B({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(r,e){var{parser:t,breakOnTokenText:a}=r,i=H(e[0],"color-token").color;t.gullet.macros.set("\\current@color",i);var s=t.parseExpression(!0,a);return{type:"color",mode:t.mode,color:i,body:s}},htmlBuilder:l1,mathmlBuilder:u1});B({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(r,e,t){var{parser:a}=r,i=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,s=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:s,size:i&&H(i,"size").value}},htmlBuilder(r,e){var t=k(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=A(K(r.size,e)))),t},mathmlBuilder(r,e){var t=new z("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",A(K(r.size,e)))),t}});var Tt={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},o1=r=>{var e=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new S("Expected a control sequence",r);return e},i4=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},h1=(r,e,t,a)=>{var i=r.gullet.macros.get(t.text);i==null&&(t.noexpand=!0,i={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,i,a)};B({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var a=e.fetch();if(Tt[a.text])return(t==="\\global"||t==="\\\\globallong")&&(a.text=Tt[a.text]),H(e.parseFunction(),"internal");throw new S("Invalid token after macro prefix",a)}});B({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,a=e.gullet.popToken(),i=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new S("Expected a control sequence",a);for(var s=0,u,h=[[]];e.gullet.future().text!=="{";)if(a=e.gullet.popToken(),a.text==="#"){if(e.gullet.future().text==="{"){u=e.gullet.future(),h[s].push("{");break}if(a=e.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new S('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==s+1)throw new S('Argument number "'+a.text+'" out of order');s++,h.push([])}else{if(a.text==="EOF")throw new S("Expected a macro definition");h[s].push(a.text)}var{tokens:c}=e.gullet.consumeArg();return u&&c.unshift(u),(t==="\\edef"||t==="\\xdef")&&(c=e.gullet.expandTokens(c),c.reverse()),e.gullet.macros.set(i,{tokens:c,numArgs:s,delimiters:h},t===Tt[t]),{type:"internal",mode:e.mode}}});B({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,a=o1(e.gullet.popToken());e.gullet.consumeSpaces();var i=i4(e);return h1(e,a,i,t==="\\\\globallet"),{type:"internal",mode:e.mode}}});B({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,a=o1(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return h1(e,a,s,t==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var oe=function(e,t,a){var i=W.math[e]&&W.math[e].replace,s=Nt(i||e,t,a);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return s},Gt=function(e,t,a,i){var s=a.havingBaseStyle(t),u=k(i.concat(s.sizingClasses(a)),[e],a),h=s.sizeMultiplier/a.sizeMultiplier;return u.height*=h,u.depth*=h,u.maxFontSize=s.sizeMultiplier,u},m1=function(e,t,a){var i=t.havingBaseStyle(a),s=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=A(s),e.height-=s,e.depth+=s},n4=function(e,t,a,i,s,u){var h=s0(e,"Main-Regular",s,i),c=Gt(h,t,i,u);return m1(c,i,t),c},s4=function(e,t,a,i){return s0(e,"Size"+t+"-Regular",a,i)},c1=function(e,t,a,i,s,u){var h=s4(e,t,s,i),c=Gt(k(["delimsizing","size"+t],[h],i),N.TEXT,i,u);return a&&m1(c,i,N.TEXT),c},at=function(e,t,a){var i;t==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=k(["delimsizinginner",i],[k([],[s0(e,t,a)])]);return{type:"elem",elem:s}},it=function(e,t,a){var i=k0["Size4-Regular"][e.charCodeAt(0)]?k0["Size4-Regular"][e.charCodeAt(0)][4]:k0["Size1-Regular"][e.charCodeAt(0)][4],s=new P0("inner",va(e,Math.round(1e3*t))),u=new C0([s],{width:A(i),height:A(t),style:"width:"+A(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),h=G0([],[u],a);return h.height=t,h.style.height=A(t),h.style.width=A(i),{type:"elem",elem:h}},Bt=.008,Te={type:"kern",size:-1*Bt},l4=new Set(["|","\\lvert","\\rvert","\\vert"]),u4=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),d1=function(e,t,a,i,s,u){var h,c,v,p,b="",x=0;h=v=p=e,c=null;var y="Size1-Regular";e==="\\uparrow"?v=p="⏐":e==="\\Uparrow"?v=p="‖":e==="\\downarrow"?h=v="⏐":e==="\\Downarrow"?h=v="‖":e==="\\updownarrow"?(h="\\uparrow",v="⏐",p="\\downarrow"):e==="\\Updownarrow"?(h="\\Uparrow",v="‖",p="\\Downarrow"):l4.has(e)?(v="∣",b="vert",x=333):u4.has(e)?(v="∥",b="doublevert",x=556):e==="["||e==="\\lbrack"?(h="⎡",v="⎢",p="⎣",y="Size4-Regular",b="lbrack",x=667):e==="]"||e==="\\rbrack"?(h="⎤",v="⎥",p="⎦",y="Size4-Regular",b="rbrack",x=667):e==="\\lfloor"||e==="⌊"?(v=h="⎢",p="⎣",y="Size4-Regular",b="lfloor",x=667):e==="\\lceil"||e==="⌈"?(h="⎡",v=p="⎢",y="Size4-Regular",b="lceil",x=667):e==="\\rfloor"||e==="⌋"?(v=h="⎥",p="⎦",y="Size4-Regular",b="rfloor",x=667):e==="\\rceil"||e==="⌉"?(h="⎤",v=p="⎥",y="Size4-Regular",b="rceil",x=667):e==="("||e==="\\lparen"?(h="⎛",v="⎜",p="⎝",y="Size4-Regular",b="lparen",x=875):e===")"||e==="\\rparen"?(h="⎞",v="⎟",p="⎠",y="Size4-Regular",b="rparen",x=875):e==="\\{"||e==="\\lbrace"?(h="⎧",c="⎨",p="⎩",v="⎪",y="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(h="⎫",c="⎬",p="⎭",v="⎪",y="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(h="⎧",p="⎩",v="⎪",y="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(h="⎫",p="⎭",v="⎪",y="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(h="⎧",p="⎭",v="⎪",y="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(h="⎫",p="⎩",v="⎪",y="Size4-Regular");var T=oe(h,y,s),M=T.height+T.depth,q=oe(v,y,s),C=q.height+q.depth,R=oe(p,y,s),F=R.height+R.depth,L=0,O=1;if(c!==null){var P=oe(c,y,s);L=P.height+P.depth,O=2}var G=M+F+L,Y=Math.max(0,Math.ceil((t-G)/(O*C))),U=G+Y*O*C,o0=i.fontMetrics().axisHeight;a&&(o0*=i.sizeMultiplier);var m0=U/2-o0,Q=[];if(b.length>0){var le=U-M-F,x0=Math.round(U*1e3),b0=pa(b,Math.round(le*1e3)),R0=new P0(b,b0),j0=A(x/1e3),Z0=A(x0/1e3),Ze=new C0([R0],{width:j0,height:Z0,viewBox:"0 0 "+x+" "+x0}),I0=G0([],[Ze],i);I0.height=x0/1e3,I0.style.width=j0,I0.style.height=Z0,Q.push({type:"elem",elem:I0})}else{if(Q.push(at(p,y,s)),Q.push(Te),c===null){var N0=U-M-F+2*Bt;Q.push(it(v,N0,i))}else{var ue=(U-M-F-L)/2+2*Bt;Q.push(it(v,ue,i)),Q.push(Te),Q.push(at(c,y,s)),Q.push(Te),Q.push(it(v,ue,i))}Q.push(Te),Q.push(at(h,y,s))}var y0=i.havingBaseStyle(N.TEXT),ve=V({positionType:"bottom",positionData:m0,children:Q});return Gt(k(["delimsizing","mult"],[ve],y0),N.TEXT,i,u)},nt=80,st=.08,lt=function(e,t,a,i,s){var u=fa(e,i,a),h=new P0(e,u),c=new C0([h],{width:"400em",height:A(t),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return G0(["hide-tail"],[c],s)},o4=function(e,t){var a=t.havingBaseSizing(),i=b1("\\surd",e*a.sizeMultiplier,g1,a),s=a.sizeMultiplier,u=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),h,c,v,p,b;return i.type==="small"?(p=1e3+1e3*u+nt,e<1?s=1:e<1.4&&(s=.7),c=(1+u+st)/s,v=(1+u)/s,h=lt("sqrtMain",c,p,u,t),h.style.minWidth="0.853em",b=.833/s):i.type==="large"?(p=(1e3+nt)*he[i.size],v=(he[i.size]+u)/s,c=(he[i.size]+u+st)/s,h=lt("sqrtSize"+i.size,c,p,u,t),h.style.minWidth="1.02em",b=1/s):(c=e+u+st,v=e+u,p=Math.floor(1e3*e+u)+nt,h=lt("sqrtTall",c,p,u,t),h.style.minWidth="0.742em",b=1.056),h.height=v,h.style.height=A(c),{span:h,advanceWidth:b,ruleWidth:(t.fontMetrics().sqrtRuleThickness+u)*s}},f1=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),h4=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),v1=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),he=[0,1.2,1.8,2.4,3],p1=function(e,t,a,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),f1.has(e)||v1.has(e))return c1(e,t,!1,a,i,s);if(h4.has(e))return d1(e,he[t],!1,a,i,s);throw new S("Illegal delimiter: '"+e+"'")},m4=[{type:"small",style:N.SCRIPTSCRIPT},{type:"small",style:N.SCRIPT},{type:"small",style:N.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],c4=[{type:"small",style:N.SCRIPTSCRIPT},{type:"small",style:N.SCRIPT},{type:"small",style:N.TEXT},{type:"stack"}],g1=[{type:"small",style:N.SCRIPTSCRIPT},{type:"small",style:N.SCRIPT},{type:"small",style:N.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],d4=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var t=e.type;throw new Error("Add support for delim type '"+t+"' here.")},b1=function(e,t,a,i){for(var s=Math.min(2,3-i.style.size),u=s;ut)return h}return a[a.length-1]},Ct=function(e,t,a,i,s,u){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var h;v1.has(e)?h=m4:f1.has(e)?h=g1:h=c4;var c=b1(e,t,h,i);return c.type==="small"?n4(e,c.style,a,i,s,u):c.type==="large"?c1(e,c.size,a,i,s,u):d1(e,t,a,i,s,u)},ut=function(e,t,a,i,s,u){var h=i.fontMetrics().axisHeight*i.sizeMultiplier,c=901,v=5/i.fontMetrics().ptPerEm,p=Math.max(t-h,a+h),b=Math.max(p/500*c,2*p-v);return Ct(e,b,!0,i,s,u)},wr={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},f4=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function kr(r){return"isMiddle"in r}function Xe(r,e){var t=Ue(r);if(t&&f4.has(t.text))return t;throw t?new S("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new S("Invalid delimiter type '"+r.type+"'",r)}B({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(r,e)=>{var t=Xe(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:wr[r.funcName].size,mclass:wr[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?k([r.mclass]):p1(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(g0(r.delim,r.mode));var t=new z("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var a=A(he[r.size]);return t.setAttribute("minsize",a),t.setAttribute("maxsize",a),t}});function Sr(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}B({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new S("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:Xe(e[0],r).text,color:t}}});B({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=Xe(e[0],r),a=r.parser;++a.leftrightDepth;var i=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var s=H(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:i,left:t.text,right:s.delim,rightColor:s.color}},htmlBuilder:(r,e)=>{Sr(r);for(var t=a0(r.body,e,!0,["mopen","mclose"]),a=0,i=0,s=!1,u=0;u{Sr(r);var t=v0(r.body,e);if(r.left!=="."){var a=new z("mo",[g0(r.left,r.mode)]);a.setAttribute("fence","true"),t.unshift(a)}if(r.right!=="."){var i=new z("mo",[g0(r.right,r.mode)]);i.setAttribute("fence","true"),r.rightColor&&i.setAttribute("mathcolor",r.rightColor),t.push(i)}return Ot(t)}});B({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=Xe(e[0],r);if(!r.parser.leftrightDepth)throw new S("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;return r.delim==="."?t=ce(e,[]):(t=p1(r.delim,1,e,r.mode,[]),t.isMiddle={delim:r.delim,options:e}),t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?g0("|","text"):g0(r.delim,r.mode),a=new z("mo",[t]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var Ye=(r,e)=>{var t=re(X(r.body,e),e),a=r.label.slice(1),i=e.sizeMultiplier,s,u,h=D0(r.body);if(a==="sout")s=k(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,u=-.5*e.fontMetrics().xHeight;else if(a==="phase"){var c=K({number:.6,unit:"pt"},e),v=K({number:.35,unit:"ex"},e),p=e.havingBaseSizing();i=i/p.sizeMultiplier;var b=t.height+t.depth+c+v;t.style.paddingLeft=A(b/2+c);var x=Math.floor(1e3*b*i),y=ca(x),T=new C0([new P0("phase",y)],{width:"400em",height:A(x/1e3),viewBox:"0 0 400000 "+x,preserveAspectRatio:"xMinYMin slice"});s=G0(["hide-tail"],[T],e),s.style.height=A(b),u=t.depth+c+v}else{/cancel/.test(a)?h||t.classes.push("cancel-pad"):a==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var M,q,C=0;/box/.test(a)?(C=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),M=e.fontMetrics().fboxsep+(a==="colorbox"?0:C),q=M):a==="angl"?(C=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),M=4*C,q=Math.max(0,.25-t.depth)):(M=h?.2:0,q=M),s=Za(t,a,M,q,e),/fbox|boxed|fcolorbox/.test(a)?(s.style.borderStyle="solid",s.style.borderWidth=A(C)):a==="angl"&&C!==.049&&(s.style.borderTopWidth=A(C),s.style.borderRightWidth=A(C)),u=t.depth+q,r.backgroundColor&&(s.style.backgroundColor=r.backgroundColor,r.borderColor&&(s.style.borderColor=r.borderColor))}var R;if(r.backgroundColor)R=V({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:t,shift:0}]});else{var F=/cancel|phase/.test(a)?["svg-align"]:[];R=V({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:s,shift:u,wrapperClasses:F}]})}return/cancel/.test(a)&&(R.height=t.height,R.depth=t.depth),/cancel/.test(a)&&!h?k(["mord","cancel-lap"],[R],e):k(["mord"],[R],e)},$e=(r,e)=>{var t,a=new z(r.label.includes("colorbox")?"mpadded":"menclose",[$(r.body,e)]);switch(r.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*t+"pt"),a.setAttribute("height","+"+2*t+"pt"),a.setAttribute("lspace",t+"pt"),a.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);a.setAttribute("style","border: "+A(i)+" solid "+r.borderColor)}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&a.setAttribute("mathbackground",r.backgroundColor),a};B({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(r,e,t){var{parser:a,funcName:i}=r,s=H(e[0],"color-token").color,u=e[1];return{type:"enclose",mode:a.mode,label:i,backgroundColor:s,body:u}},htmlBuilder:Ye,mathmlBuilder:$e});B({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(r,e,t){var{parser:a,funcName:i}=r,s=H(e[0],"color-token").color,u=H(e[1],"color-token").color,h=e[2];return{type:"enclose",mode:a.mode,label:i,backgroundColor:u,borderColor:s,body:h}},htmlBuilder:Ye,mathmlBuilder:$e});B({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}});B({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:a}=r,i=e[0];return{type:"enclose",mode:t.mode,label:a,body:i}},htmlBuilder:Ye,mathmlBuilder:$e});B({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t,funcName:a}=r;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:t.mode,label:a,body:i}},htmlBuilder:Ye,mathmlBuilder:$e});B({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var y1={};function S0(r){for(var{type:e,names:t,props:a,handler:i,htmlBuilder:s,mathmlBuilder:u}=r,h={type:e,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c{var e=r.parser.settings;if(!e.displayMode)throw new S("{"+r.envName+"} can be used only in display mode.")},v4=new Set(["gather","gather*"]);function Ut(r){if(!r.includes("ed"))return!r.includes("*")}function V0(r,e,t){var{hskipBeforeAndAfter:a,addJot:i,cols:s,arraystretch:u,colSeparationType:h,autoTag:c,singleRow:v,emptySingleRow:p,maxNumCols:b,leqno:x}=e;if(r.gullet.beginGroup(),v||r.gullet.macros.set("\\cr","\\\\\\relax"),!u){var y=r.gullet.expandMacroAsText("\\arraystretch");if(y==null)u=1;else if(u=parseFloat(y),!u||u<0)throw new S("Invalid \\arraystretch: "+y)}r.gullet.beginGroup();var T=[],M=[T],q=[],C=[],R=c!=null?[]:void 0;function F(){c&&r.gullet.macros.set("\\@eqnsw","1",!0)}function L(){R&&(r.gullet.macros.get("\\df@tag")?(R.push(r.subparse([new c0("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):R.push(!!c&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(F(),C.push(zr(r));;){var O=r.parseExpression(!1,v?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup();var P={type:"ordgroup",mode:r.mode,body:O};t&&(P={type:"styling",mode:r.mode,style:t,resetFont:!0,body:[P]}),T.push(P);var G=r.fetch().text;if(G==="&"){if(b&&T.length===b){if(v||h)throw new S("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(G==="\\end"){L(),T.length===1&&P.type==="styling"&&P.body.length===1&&P.body[0].type==="ordgroup"&&P.body[0].body.length===0&&(M.length>1||!p)&&M.pop(),C.length0&&(F+=.25),v.push({pos:F,isDashed:ye[xe]})}for(L(u[0]),a=0;a0&&(m0+=R,Gye))for(a=0;a=h)){var J0=void 0;if(i>0||e.hskipBeforeAndAfter){var Kt,Jt;J0=(Kt=(Jt=y0)==null?void 0:Jt.pregap)!=null?Kt:x,J0!==0&&(b0=k(["arraycolsep"],[]),b0.style.width=A(J0),x0.push(b0))}var Qt=[];for(a=0;a0){for(var G1=te("hline",t,p),U1=te("hdashline",t,p),Ke=[{type:"elem",elem:be,shift:0}];v.length>0;){var tr=v.pop(),rr=tr.pos-Q;tr.isDashed?Ke.push({type:"elem",elem:U1,shift:rr}):Ke.push({type:"elem",elem:G1,shift:rr})}be=V({positionType:"individualShift",children:Ke})}if(j0.length===0)return k(["mord"],[be],t);var V1=V({positionType:"individualShift",children:j0}),X1=k(["tag"],[V1],t);return E0([be,X1])},p4={c:"center ",l:"left ",r:"right "},A0=function(e,t){for(var a=[],i=new z("mtd",[],["mtr-glue"]),s=new z("mtd",[],["mml-eqn-num"]),u=0;u0){var T=e.cols,M="",q=!1,C=0,R=T.length;T[0].type==="separator"&&(x+="top ",C=1),T[T.length-1].type==="separator"&&(x+="bottom ",R-=1);for(var F=C;F0?"left ":"",x+=U[U.length-1].length>0?"right ":"";for(var o0=1;o00&&y&&(q=1),a[T]={type:"align",align:M,pregap:q,postgap:0}}return u.colSeparationType=y?"align":"alignat",u};S0({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=Ue(e[0]),a=t?[e[0]]:H(e[0],"ordgroup").body,i=a.map(function(u){var h=Ge(u),c=h.text;if("lcr".includes(c))return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new S("Unknown column alignment: "+c,u)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return V0(r.parser,s,Vt(r.envName))},htmlBuilder:z0,mathmlBuilder:A0});S0({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var i=r.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),t=i.fetch().text,!"lcr".includes(t))throw new S("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),a.cols=[{type:"align",align:t}]}}var s=V0(r.parser,a,Vt(r.envName)),u=Math.max(0,...s.body.map(h=>h.length));return s.cols=new Array(u).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:z0,mathmlBuilder:A0});S0({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=V0(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:z0,mathmlBuilder:A0});S0({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=Ue(e[0]),a=t?[e[0]]:H(e[0],"ordgroup").body,i=a.map(function(h){var c=Ge(h),v=c.text;if("lc".includes(v))return{type:"align",align:v};throw new S("Unknown column alignment: "+v,h)});if(i.length>1)throw new S("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},u=V0(r.parser,s,"script");if(u.body.length>0&&u.body[0].length>1)throw new S("{subarray} can contain only one column");return u},htmlBuilder:z0,mathmlBuilder:A0});S0({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=V0(r.parser,e,Vt(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.includes("r")?".":"\\{",right:r.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:z0,mathmlBuilder:A0});S0({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:w1,htmlBuilder:z0,mathmlBuilder:A0});S0({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){v4.has(r.envName)&&We(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Ut(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return V0(r.parser,e,"display")},htmlBuilder:z0,mathmlBuilder:A0});S0({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:w1,htmlBuilder:z0,mathmlBuilder:A0});S0({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){We(r);var e={autoTag:Ut(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return V0(r.parser,e,"display")},htmlBuilder:z0,mathmlBuilder:A0});S0({type:"array",names:["CD"],props:{numArgs:0},handler(r){return We(r),a4(r.parser)},htmlBuilder:z0,mathmlBuilder:A0});m("\\nonumber","\\gdef\\@eqnsw{0}");m("\\notag","\\nonumber");B({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(r,e){throw new S(r.funcName+" valid only within array environment")}});var Ar=y1;B({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(r,e){var{parser:t,funcName:a}=r,i=e[0];if(i.type!=="ordgroup")throw new S("Invalid environment name",i);for(var s="",u=0;u{var t=r.font,a=e.withFont(t);return X(r.body,a)},S1=(r,e)=>{var t=r.font,a=e.withFont(t);return $(r.body,a)},Mr={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};B({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:a}=r,i=Ne(e[0]),s=a;return s in Mr&&(s=Mr[s]),{type:"font",mode:t.mode,font:s.slice(1),body:i}},htmlBuilder:k1,mathmlBuilder:S1});B({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"mclass",mode:t.mode,mclass:Ve(a),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:a}],isCharacterBox:D0(a)}}});B({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:a,breakOnTokenText:i}=r,{mode:s}=t,u=t.parseExpression(!0,i);return{type:"font",mode:s,font:"math"+a.slice(1),body:{type:"ordgroup",mode:t.mode,body:u}}},htmlBuilder:k1,mathmlBuilder:S1});var g4=(r,e)=>{var t=e.style,a=t.fracNum(),i=t.fracDen(),s;s=e.havingStyle(a);var u=X(r.numer,s,e);if(r.continued){var h=8.5/e.fontMetrics().ptPerEm,c=3.5/e.fontMetrics().ptPerEm;u.height=u.height0?T=3*x:T=7*x,M=e.fontMetrics().denom1):(b>0?(y=e.fontMetrics().num2,T=x):(y=e.fontMetrics().num3,T=3*x),M=e.fontMetrics().denom2);var q;if(p){var R=e.fontMetrics().axisHeight;y-u.depth-(R+.5*b){var t=new z("mfrac",[$(r.numer,e),$(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var a=K(r.barSize,e);t.setAttribute("linethickness",A(a))}if(r.leftDelim!=null||r.rightDelim!=null){var i=[];if(r.leftDelim!=null){var s=new z("mo",[new e0(r.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}if(i.push(t),r.rightDelim!=null){var u=new z("mo",[new e0(r.rightDelim.replace("\\",""))]);u.setAttribute("fence","true"),i.push(u)}return Ot(i)}return t},z1=(r,e)=>{if(!e)return r;var t={type:"styling",mode:r.mode,style:e,body:[r]};return t};B({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:a}=r,i=e[0],s=e[1],u,h=null,c=null;switch(a){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":u=!0;break;case"\\\\atopfrac":u=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":u=!1,h="(",c=")";break;case"\\\\bracefrac":u=!1,h="\\{",c="\\}";break;case"\\\\brackfrac":u=!1,h="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}var v=a==="\\cfrac",p=null;return v||a.startsWith("\\d")?p="display":a.startsWith("\\t")&&(p="text"),z1({type:"genfrac",mode:t.mode,numer:i,denom:s,continued:v,hasBarLine:u,leftDelim:h,rightDelim:c,barSize:null},p)},htmlBuilder:g4,mathmlBuilder:b4});B({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:e,funcName:t,token:a}=r,i;switch(t){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:a}}});var Tr=["display","text","script","scriptscript"],Br=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};B({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,e){var{parser:t}=r,a=e[4],i=e[5],s=Ne(e[0]),u=s.type==="atom"&&s.family==="open"?Br(s.text):null,h=Ne(e[1]),c=h.type==="atom"&&h.family==="close"?Br(h.text):null,v=H(e[2],"size"),p,b=null;v.isBlank?p=!0:(b=v.value,p=b.number>0);var x=null,y=e[3];if(y.type==="ordgroup"){if(y.body.length>0){var T=H(y.body[0],"textord");x=Tr[Number(T.text)]}}else y=H(y,"textord"),x=Tr[Number(y.text)];return z1({type:"genfrac",mode:t.mode,numer:a,denom:i,continued:!1,hasBarLine:p,barSize:b,leftDelim:u,rightDelim:c},x)}});B({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,e){var{parser:t,funcName:a,token:i}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:H(e[0],"size").value,token:i}}});B({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(r,e)=>{var{parser:t,funcName:a}=r,i=e[0],s=H(e[1],"infix").size;if(!s)throw new Error("\\\\abovefrac expected size, but got "+String(s));var u=e[2],h=s.number>0;return{type:"genfrac",mode:t.mode,numer:i,denom:u,continued:!1,hasBarLine:h,barSize:s,leftDelim:null,rightDelim:null}}});var A1=(r,e)=>{var t=e.style,a,i;r.type==="supsub"?(a=r.sup?X(r.sup,e.havingStyle(t.sup()),e):X(r.sub,e.havingStyle(t.sub()),e),i=H(r.base,"horizBrace")):i=H(r,"horizBrace");var s=X(i.base,e.havingBaseStyle(N.DISPLAY)),u=Pe(i,e),h;if(i.isOver?h=V({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:u,wrapperClasses:["svg-align"]}]}):h=V({positionType:"bottom",positionData:s.depth+.1+u.height,children:[{type:"elem",elem:u,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:s}]}),a){var c=k(["minner",i.isOver?"mover":"munder"],[h],e);i.isOver?h=V({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:a}]}):h=V({positionType:"bottom",positionData:c.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:c}]})}return k(["minner",i.isOver?"mover":"munder"],[h],e)},y4=(r,e)=>{var t=Le(r.label);return new z(r.isOver?"mover":"munder",[$(r.base,e),t])};B({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:a}=r;return{type:"horizBrace",mode:t.mode,label:a,isOver:a.includes("\\over"),base:e[0]}},htmlBuilder:A1,mathmlBuilder:y4});B({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[1],i=H(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:t.mode,href:i,body:_(a)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=a0(r.body,e,!1);return Ea(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=U0(r.body,e);return t instanceof z||(t=new z("mrow",[t])),t.setAttribute("href",r.href),t}});B({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=H(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:a}))return t.formatUnsupportedCmd("\\url");for(var i=[],s=0;s{var{parser:t,funcName:a,token:i}=r,s=H(e[0],"raw").string,u=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var h,c={};switch(a){case"\\htmlClass":c.class=s,h={command:"\\htmlClass",class:s};break;case"\\htmlId":c.id=s,h={command:"\\htmlId",id:s};break;case"\\htmlStyle":c.style=s,h={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var v=s.split(","),p=0;p{var t=a0(r.body,e,!1),a=["enclosing"];r.attributes.class&&a.push(...r.attributes.class.trim().split(/\s+/));var i=k(a,t,e);for(var s in r.attributes)s!=="class"&&r.attributes.hasOwnProperty(s)&&i.setAttribute(s,r.attributes[s]);return i},mathmlBuilder:(r,e)=>U0(r.body,e)});B({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:_(e[0]),mathml:_(e[1])}},htmlBuilder:(r,e)=>{var t=a0(r.html,e,!1);return E0(t)},mathmlBuilder:(r,e)=>U0(r.mathml,e)});var ot=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new S("Invalid size: '"+e+"' in \\includegraphics");var a={number:+(t[1]+t[2]),unit:t[3]};if(!Ur(a))throw new S("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};B({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(r,e,t)=>{var{parser:a}=r,i={number:0,unit:"em"},s={number:.9,unit:"em"},u={number:0,unit:"em"},h="";if(t[0])for(var c=H(t[0],"raw").string,v=c.split(","),p=0;p{var t=K(r.height,e),a=0;r.totalheight.number>0&&(a=K(r.totalheight,e)-t);var i=0;r.width.number>0&&(i=K(r.width,e));var s={height:A(t+a)};i>0&&(s.width=A(i)),a>0&&(s.verticalAlign=A(-a));var u=new xa(r.src,r.alt,s);return u.height=t,u.depth=a,u},mathmlBuilder:(r,e)=>{var t=new z("mglyph",[]);t.setAttribute("alt",r.alt);var a=K(r.height,e),i=0;if(r.totalheight.number>0&&(i=K(r.totalheight,e)-a,t.setAttribute("valign",A(-i))),t.setAttribute("height",A(a+i)),r.width.number>0){var s=K(r.width,e);t.setAttribute("width",A(s))}return t.setAttribute("src",r.src),t}});B({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:a}=r,i=H(e[0],"size");if(t.settings.strict){var s=a[1]==="m",u=i.value.unit==="mu";s?(u||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+i.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):u&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:i.value}},htmlBuilder(r,e){return jr(r.dimension,e)},mathmlBuilder(r,e){var t=K(r.dimension,e);return new e1(t)}});B({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:a}=r,i=e[0];return{type:"lap",mode:t.mode,alignment:a.slice(5),body:i}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=k([],[X(r.body,e)]),t=k(["inner"],[t],e)):t=k(["inner"],[X(r.body,e)]);var a=k(["fix"],[]),i=k([r.alignment],[t,a],e),s=k(["strut"]);return s.style.height=A(i.height+i.depth),i.depth&&(s.style.verticalAlign=A(-i.depth)),i.children.unshift(s),i=k(["thinbox"],[i],e),k(["mord","vbox"],[i],e)},mathmlBuilder:(r,e)=>{var t=new z("mpadded",[$(r.body,e)]);if(r.alignment!=="rlap"){var a=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",a+"width")}return t.setAttribute("width","0px"),t}});B({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){var{funcName:t,parser:a}=r,i=a.mode;a.switchMode("math");var s=t==="\\("?"\\)":"$",u=a.parseExpression(!1,s);return a.expect(s),a.switchMode(i),{type:"styling",mode:a.mode,style:"text",resetFont:!0,body:u}}});B({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){throw new S("Mismatched "+r.funcName)}});var Cr=(r,e)=>{switch(e.style.size){case N.DISPLAY.size:return r.display;case N.TEXT.size:return r.text;case N.SCRIPT.size:return r.script;case N.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};B({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:_(e[0]),text:_(e[1]),script:_(e[2]),scriptscript:_(e[3])}},htmlBuilder:(r,e)=>{var t=Cr(r,e),a=a0(t,e,!1);return E0(a)},mathmlBuilder:(r,e)=>{var t=Cr(r,e);return U0(t,e)}});var M1=(r,e,t,a,i,s,u)=>{r=k([],[r]);var h=t&&D0(t),c,v;if(e){var p=X(e,a.havingStyle(i.sup()),a);v={elem:p,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-p.depth)}}if(t){var b=X(t,a.havingStyle(i.sub()),a);c={elem:b,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-b.height)}}var x;if(v&&c){var y=a.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+r.depth+u;x=V({positionType:"bottom",positionData:y,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:A(-s)},{type:"kern",size:c.kern},{type:"elem",elem:r},{type:"kern",size:v.kern},{type:"elem",elem:v.elem,marginLeft:A(s)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else if(c){var T=r.height-u;x=V({positionType:"top",positionData:T,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:A(-s)},{type:"kern",size:c.kern},{type:"elem",elem:r}]})}else if(v){var M=r.depth+u;x=V({positionType:"bottom",positionData:M,children:[{type:"elem",elem:r},{type:"kern",size:v.kern},{type:"elem",elem:v.elem,marginLeft:A(s)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else return r;var q=[x];if(c&&s!==0&&!h){var C=k(["mspace"],[],a);C.style.marginRight=A(s),q.unshift(C)}return k(["mop","op-limits"],q,a)},T1=new Set(["\\smallint"]),se=(r,e)=>{var t,a,i=!1,s;r.type==="supsub"?(t=r.sup,a=r.sub,s=H(r.base,"op"),i=!0):s=H(r,"op");var u=e.style,h=!1;u.size===N.DISPLAY.size&&s.symbol&&!T1.has(s.name)&&(h=!0);var c,v;if(s.symbol){var p=h?"Size2-Regular":"Size1-Regular",b="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(b=s.name.slice(1),s.name=b==="oiint"?"\\iint":"\\iiint"),c=s0(s.name,p,"math",e,["mop","op-symbol",h?"large-op":"small-op"]),v=c.italic,b.length>0){var x=Kr(b+"Size"+(h?"2":"1"),e);c=V({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:x,shift:h?.08:0}]}),s.name="\\"+b,c.classes.unshift("mop"),c.italic=v}}else if(s.body){var y=a0(s.body,e,!0);y.length===1&&y[0]instanceof d0?(c=y[0],c.classes[0]="mop"):c=k(["mop"],y,e)}else{for(var T=[],M=1;M{var t;if(r.symbol)t=new z("mo",[g0(r.name,r.mode)]),T1.has(r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new z("mo",v0(r.body,e));else{t=new z("mi",[new e0(r.name.slice(1))]);var a=new z("mo",[g0("⁡","text")]);r.parentIsSupSub?t=new z("mrow",[t,a]):t=_r([t,a])}return t},x4={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};B({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(r,e)=>{var{parser:t,funcName:a}=r,i=a;return i.length===1&&(i=x4[i]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:se,mathmlBuilder:fe});B({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:_(a)}},htmlBuilder:se,mathmlBuilder:fe});var w4={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};B({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:se,mathmlBuilder:fe});B({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:se,mathmlBuilder:fe});B({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(r){var{parser:e,funcName:t}=r,a=t;return a.length===1&&(a=w4[a]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:se,mathmlBuilder:fe});var B1=(r,e)=>{var t,a,i=!1,s;r.type==="supsub"?(t=r.sup,a=r.sub,s=H(r.base,"operatorname"),i=!0):s=H(r,"operatorname");var u;if(s.body.length>0){for(var h=s.body.map(b=>{var x="text"in b?b.text:void 0;return typeof x=="string"?{type:"textord",mode:b.mode,text:x}:b}),c=a0(h,e.withFont("mathrm"),!0),v=0;v{for(var t=v0(r.body,e.withFont("mathrm")),a=!0,i=0;ip.toText()).join("");t=[new e0(h)]}var c=new z("mi",t);c.setAttribute("mathvariant","normal");var v=new z("mo",[g0("⁡","text")]);return r.parentIsSupSub?new z("mrow",[c,v]):_r([c,v])};B({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:a}=r,i=e[0];return{type:"operatorname",mode:t.mode,body:_(i),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:B1,mathmlBuilder:k4});m("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");W0({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?E0(a0(r.body,e,!1)):k(["mord"],a0(r.body,e,!0),e)},mathmlBuilder(r,e){return U0(r.body,e,!0)}});B({type:"overline",names:["\\overline"],props:{numArgs:1},handler(r,e){var{parser:t}=r,a=e[0];return{type:"overline",mode:t.mode,body:a}},htmlBuilder(r,e){var t=X(r.body,e.havingCrampedStyle()),a=te("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=V({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*i},{type:"elem",elem:a},{type:"kern",size:i}]});return k(["mord","overline"],[s],e)},mathmlBuilder(r,e){var t=new z("mo",[new e0("‾")]);t.setAttribute("stretchy","true");var a=new z("mover",[$(r.body,e),t]);return a.setAttribute("accent","true"),a}});B({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"phantom",mode:t.mode,body:_(a)}},htmlBuilder:(r,e)=>{var t=a0(r.body,e.withPhantom(),!1);return E0(t)},mathmlBuilder:(r,e)=>{var t=v0(r.body,e);return new z("mphantom",t)}});m("\\hphantom","\\smash{\\phantom{#1}}");B({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"vphantom",mode:t.mode,body:a}},htmlBuilder:(r,e)=>{var t=k(["inner"],[X(r.body,e.withPhantom())]),a=k(["fix"],[]);return k(["mord","rlap"],[t,a],e)},mathmlBuilder:(r,e)=>{var t=v0(_(r.body),e),a=new z("mphantom",t),i=new z("mpadded",[a]);return i.setAttribute("width","0px"),i}});B({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r,a=H(e[0],"size").value,i=e[1];return{type:"raisebox",mode:t.mode,dy:a,body:i}},htmlBuilder(r,e){var t=X(r.body,e),a=K(r.dy,e);return V({positionType:"shift",positionData:-a,children:[{type:"elem",elem:t}]})},mathmlBuilder(r,e){var t=new z("mpadded",[$(r.body,e)]),a=r.dy.number+r.dy.unit;return t.setAttribute("voffset",a),t}});B({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}});B({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(r,e,t){var{parser:a}=r,i=t[0],s=H(e[0],"size"),u=H(e[1],"size");return{type:"rule",mode:a.mode,shift:i&&H(i,"size").value,width:s.value,height:u.value}},htmlBuilder(r,e){var t=k(["mord","rule"],[],e),a=K(r.width,e),i=K(r.height,e),s=r.shift?K(r.shift,e):0;return t.style.borderRightWidth=A(a),t.style.borderTopWidth=A(i),t.style.bottom=A(s),t.width=a,t.height=i+s,t.depth=-s,t.maxFontSize=i*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=K(r.width,e),a=K(r.height,e),i=r.shift?K(r.shift,e):0,s=e.color&&e.getColor()||"black",u=new z("mspace");u.setAttribute("mathbackground",s),u.setAttribute("width",A(t)),u.setAttribute("height",A(a));var h=new z("mpadded",[u]);return i>=0?h.setAttribute("height",A(i)):(h.setAttribute("height",A(i)),h.setAttribute("depth",A(-i))),h.setAttribute("voffset",A(i)),h}});function C1(r,e,t){for(var a=a0(r,e,!1),i=e.sizeMultiplier/t.sizeMultiplier,s=0;s{var t=e.havingSize(r.size);return C1(r.body,t,e)};B({type:"sizing",names:Dr,props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{breakOnTokenText:t,funcName:a,parser:i}=r,s=i.parseExpression(!1,t);return{type:"sizing",mode:i.mode,size:Dr.indexOf(a)+1,body:s}},htmlBuilder:S4,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),a=v0(r.body,t),i=new z("mstyle",a);return i.setAttribute("mathsize",A(t.sizeMultiplier)),i}});B({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(r,e,t)=>{var{parser:a}=r,i=!1,s=!1,u=t[0]&&H(t[0],"ordgroup");if(u)for(var h,c=0;c{var t=k([],[X(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0),r.smashDepth&&(t.depth=0),r.smashHeight&&r.smashDepth)return k(["mord","smash"],[t],e);if(t.children)for(var a=0;a{var t=new z("mpadded",[$(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}});B({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:a}=r,i=t[0],s=e[0];return{type:"sqrt",mode:a.mode,body:s,index:i}},htmlBuilder(r,e){var t=X(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=re(t,e);var a=e.fontMetrics(),i=a.defaultRuleThickness,s=i;e.style.idt.height+t.depth+u&&(u=(u+b-t.height-t.depth)/2);var x=c.height-t.height-u-v;t.style.paddingLeft=A(p);var y=V({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+x)},{type:"elem",elem:c},{type:"kern",size:v}]});if(r.index){var T=e.havingStyle(N.SCRIPTSCRIPT),M=X(r.index,T,e),q=.6*(y.height-y.depth),C=V({positionType:"shift",positionData:-q,children:[{type:"elem",elem:M}]}),R=k(["root"],[C]);return k(["mord","sqrt"],[R,y],e)}else return k(["mord","sqrt"],[y],e)},mathmlBuilder(r,e){var{body:t,index:a}=r;return a?new z("mroot",[$(t,e),$(a,e)]):new z("msqrt",[$(t,e)])}});var Dt={display:N.DISPLAY,text:N.TEXT,script:N.SCRIPT,scriptscript:N.SCRIPTSCRIPT};function z4(r){return r in Dt}B({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r,e){var{breakOnTokenText:t,funcName:a,parser:i}=r,s=i.parseExpression(!0,t),u=a.slice(1,a.length-5);if(!z4(u))throw new Error("Unknown style: "+u);return{type:"styling",mode:i.mode,style:u,body:s}},htmlBuilder(r,e){var t=Dt[r.style],a=e.havingStyle(t);return r.resetFont&&(a=a.withFont("")),C1(r.body,a,e)},mathmlBuilder(r,e){var t=Dt[r.style],a=e.havingStyle(t);r.resetFont&&(a=a.withFont(""));var i=v0(r.body,a),s=new z("mstyle",i),u={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},h=u[r.style];return s.setAttribute("scriptlevel",h[0]),s.setAttribute("displaystyle",h[1]),s}});var A4=function(e,t){var a=e.base;if(a)if(a.type==="op"){var i=a.limits&&(t.style.size===N.DISPLAY.size||a.alwaysHandleSupSub);return i?se:null}else if(a.type==="operatorname"){var s=a.alwaysHandleSupSub&&(t.style.size===N.DISPLAY.size||a.limits);return s?B1:null}else{if(a.type==="accent")return D0(a.base)?Pt:null;if(a.type==="horizBrace"){var u=!e.sub;return u===a.isOver?A1:null}else return null}else return null};W0({type:"supsub",htmlBuilder(r,e){var t=A4(r,e);if(t)return t(r,e);var{base:a,sup:i,sub:s}=r,u=X(a,e),h,c,v=e.fontMetrics(),p=0,b=0,x=a&&D0(a);if(i){var y=e.havingStyle(e.style.sup());h=X(i,y,e),x||(p=u.height-y.fontMetrics().supDrop*y.sizeMultiplier/e.sizeMultiplier)}if(s){var T=e.havingStyle(e.style.sub());c=X(s,T,e),x||(b=u.depth+T.fontMetrics().subDrop*T.sizeMultiplier/e.sizeMultiplier)}var M;e.style===N.DISPLAY?M=v.sup1:e.style.cramped?M=v.sup3:M=v.sup2;var q=e.sizeMultiplier,C=A(.5/v.ptPerEm/q),R=null;if(c){var F=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");if(u instanceof d0||F){var L;R=A(-((L=u.italic)!=null?L:0))}}var O;if(h&&c){p=Math.max(p,M,h.depth+.25*v.xHeight),b=Math.max(b,v.sub2);var P=v.defaultRuleThickness,G=4*P;if(p-h.depth-(c.height-b)0&&(p+=Y,b-=Y)}var U=[{type:"elem",elem:c,shift:b,marginRight:C,marginLeft:R},{type:"elem",elem:h,shift:-p,marginRight:C}];O=V({positionType:"individualShift",children:U})}else if(c){b=Math.max(b,v.sub1,c.height-.8*v.xHeight);var o0=[{type:"elem",elem:c,marginLeft:R,marginRight:C}];O=V({positionType:"shift",positionData:b,children:o0})}else if(h)p=Math.max(p,M,h.depth+.25*v.xHeight),O=V({positionType:"shift",positionData:-p,children:[{type:"elem",elem:h,marginRight:C}]});else throw new Error("supsub must have either sup or sub.");var m0=At(u,"right")||"mord";return k([m0],[u,k(["msupsub"],[O])],e)},mathmlBuilder(r,e){var t=!1,a,i;r.base&&r.base.type==="horizBrace"&&(i=!!r.sup,i===r.base.isOver&&(t=!0,a=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var s=[$(r.base,e)];r.sub&&s.push($(r.sub,e)),r.sup&&s.push($(r.sup,e));var u;if(t)u=a?"mover":"munder";else if(r.sub)if(r.sup){var v=r.base;v&&v.type==="op"&&v.limits&&e.style===N.DISPLAY||v&&v.type==="operatorname"&&v.alwaysHandleSupSub&&(e.style===N.DISPLAY||v.limits)?u="munderover":u="msubsup"}else{var c=r.base;c&&c.type==="op"&&c.limits&&(e.style===N.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||e.style===N.DISPLAY)?u="munder":u="msub"}else{var h=r.base;h&&h.type==="op"&&h.limits&&(e.style===N.DISPLAY||h.alwaysHandleSupSub)||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(h.limits||e.style===N.DISPLAY)?u="mover":u="msup"}return new z(u,s)}});W0({type:"atom",htmlBuilder(r,e){return Ft(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new z("mo",[g0(r.text,r.mode)]);if(r.family==="bin"){var a=Lt(r,e);a==="bold-italic"&&t.setAttribute("mathvariant",a)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var D1={mi:"italic",mn:"normal",mtext:"normal"};W0({type:"mathord",htmlBuilder(r,e){return Oe(r,e,"mathord")},mathmlBuilder(r,e){var t=new z("mi",[g0(r.text,r.mode,e)]),a=Lt(r,e)||"italic";return a!==D1[t.type]&&t.setAttribute("mathvariant",a),t}});W0({type:"textord",htmlBuilder(r,e){return Oe(r,e,"textord")},mathmlBuilder(r,e){var t=g0(r.text,r.mode,e),a=Lt(r,e)||"normal",i;return r.mode==="text"?i=new z("mtext",[t]):/[0-9]/.test(r.text)?i=new z("mn",[t]):r.text==="\\prime"?i=new z("mo",[t]):i=new z("mi",[t]),a!==D1[i.type]&&i.setAttribute("mathvariant",a),i}});var ht={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},mt={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};W0({type:"spacing",htmlBuilder(r,e){if(mt.hasOwnProperty(r.text)){var t=mt[r.text].className||"";if(r.mode==="text"){var a=Oe(r,e,"textord");return a.classes.push(t),a}else return k(["mspace",t],[Ft(r.text,r.mode,e)],e)}else{if(ht.hasOwnProperty(r.text))return k(["mspace",ht[r.text]],[],e);throw new S('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(mt.hasOwnProperty(r.text))t=new z("mtext",[new e0(" ")]);else{if(ht.hasOwnProperty(r.text))return new z("mspace");throw new S('Unknown type of space "'+r.text+'"')}return t}});var qr=()=>{var r=new z("mtd",[]);return r.setAttribute("width","50%"),r};W0({type:"tag",mathmlBuilder(r,e){var t=new z("mtable",[new z("mtr",[qr(),new z("mtd",[U0(r.body,e)]),qr(),new z("mtd",[U0(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var Er={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Rr={"\\textbf":"textbf","\\textmd":"textmd"},M4={"\\textit":"textit","\\textup":"textup"},Ir=(r,e)=>{var t=r.font;if(t){if(Er[t])return e.withTextFontFamily(Er[t]);if(Rr[t])return e.withTextFontWeight(Rr[t]);if(t==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(M4[t])};B({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:a}=r,i=e[0];return{type:"text",mode:t.mode,body:_(i),font:a}},htmlBuilder(r,e){var t=Ir(r,e),a=a0(r.body,t,!0);return k(["mord","text"],a,t)},mathmlBuilder(r,e){var t=Ir(r,e);return U0(r.body,t)}});B({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=X(r.body,e),a=te("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=V({positionType:"top",positionData:t.height,children:[{type:"kern",size:i},{type:"elem",elem:a},{type:"kern",size:3*i},{type:"elem",elem:t}]});return k(["mord","underline"],[s],e)},mathmlBuilder(r,e){var t=new z("mo",[new e0("‾")]);t.setAttribute("stretchy","true");var a=new z("munder",[$(r.body,e),t]);return a.setAttribute("accentunder","true"),a}});B({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=X(r.body,e),a=e.fontMetrics().axisHeight,i=.5*(t.height-a-(t.depth+a));return V({positionType:"shift",positionData:i,children:[{type:"elem",elem:t}]})},mathmlBuilder(r,e){var t=new z("mpadded",[$(r.body,e)],["vcenter"]);return new z("mrow",[t])}});B({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(r,e,t){throw new S("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=Nr(r),a=[],i=e.havingStyle(e.style.text()),s=0;sr.body.replace(/ /g,r.star?"␣":" "),O0=Jr,q1=`[ \r + ]`,T4="\\\\[a-zA-Z@]+",B4="\\\\[^\uD800-\uDFFF]",C4="("+T4+")"+q1+"*",D4=`\\\\( +|[ \r ]+ +?)[ \r ]*`,qt="[̀-ͯ]",q4=new RegExp(qt+"+$"),E4="("+q1+"+)|"+(D4+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(qt+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(qt+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+C4)+("|"+B4+")");class Fr{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(E4,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new c0("EOF",new h0(this,t,t));var a=this.tokenRegex.exec(e);if(a===null||a.index!==t)throw new S("Unexpected character: '"+e[t]+"'",new c0(e[t],new h0(this,t,t+1)));var i=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf(` +`,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new c0(i,new h0(this,t,this.tokenRegex.lastIndex))}}class R4{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new S("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,a){if(a===void 0&&(a=!1),a){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var I4=x1;m("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});m("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});m("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});m("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});m("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});m("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");m("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Hr={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};m("\\char",function(r){var e=r.popToken(),t,a=0;if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")a=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new S("\\char` missing argument");a=e.text.charCodeAt(0)}else t=10;if(t){if(a=Hr[e.text],a==null||a>=t)throw new S("Invalid base-"+t+" digit "+e.text);for(var i;(i=Hr[r.future().text])!=null&&i{var i=r.consumeArg().tokens;if(i.length!==1)throw new S("\\newcommand's first argument must be a macro name");var s=i[0].text,u=r.isDefined(s);if(u&&!e)throw new S("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!u&&!t)throw new S("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var h=0;if(i=r.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var c="",v=r.expandNextToken();v.text!=="]"&&v.text!=="EOF";)c+=v.text,v=r.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new S("Invalid number of arguments: "+c);h=parseInt(c),i=r.consumeArg().tokens}return u&&a||r.macros.set(s,{tokens:i,numArgs:h}),""};m("\\newcommand",r=>Xt(r,!1,!0,!1));m("\\renewcommand",r=>Xt(r,!0,!1,!1));m("\\providecommand",r=>Xt(r,!0,!0,!0));m("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});m("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});m("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),O0[t],W.math[t],W.text[t]),""});m("\\bgroup","{");m("\\egroup","}");m("~","\\nobreakspace");m("\\lq","`");m("\\rq","'");m("\\aa","\\r a");m("\\AA","\\r A");m("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");m("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");m("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");m("ℬ","\\mathscr{B}");m("ℰ","\\mathscr{E}");m("ℱ","\\mathscr{F}");m("ℋ","\\mathscr{H}");m("ℐ","\\mathscr{I}");m("ℒ","\\mathscr{L}");m("ℳ","\\mathscr{M}");m("ℛ","\\mathscr{R}");m("ℭ","\\mathfrak{C}");m("ℌ","\\mathfrak{H}");m("ℨ","\\mathfrak{Z}");m("\\Bbbk","\\Bbb{k}");m("\\llap","\\mathllap{\\textrm{#1}}");m("\\rlap","\\mathrlap{\\textrm{#1}}");m("\\clap","\\mathclap{\\textrm{#1}}");m("\\mathstrut","\\vphantom{(}");m("\\underbar","\\underline{\\text{#1}}");m("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');m("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");m("\\ne","\\neq");m("≠","\\neq");m("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");m("∉","\\notin");m("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");m("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");m("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");m("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");m("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");m("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");m("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");m("⟂","\\perp");m("‼","\\mathclose{!\\mkern-0.8mu!}");m("∌","\\notni");m("⌜","\\ulcorner");m("⌝","\\urcorner");m("⌞","\\llcorner");m("⌟","\\lrcorner");m("©","\\copyright");m("®","\\textregistered");m("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');m("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');m("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');m("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');m("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");m("⋮","\\vdots");m("\\varGamma","\\mathit{\\Gamma}");m("\\varDelta","\\mathit{\\Delta}");m("\\varTheta","\\mathit{\\Theta}");m("\\varLambda","\\mathit{\\Lambda}");m("\\varXi","\\mathit{\\Xi}");m("\\varPi","\\mathit{\\Pi}");m("\\varSigma","\\mathit{\\Sigma}");m("\\varUpsilon","\\mathit{\\Upsilon}");m("\\varPhi","\\mathit{\\Phi}");m("\\varPsi","\\mathit{\\Psi}");m("\\varOmega","\\mathit{\\Omega}");m("\\substack","\\begin{subarray}{c}#1\\end{subarray}");m("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");m("\\boxed","\\fbox{$\\displaystyle{#1}$}");m("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");m("\\implies","\\DOTSB\\;\\Longrightarrow\\;");m("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");m("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");m("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Or={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},N4=new Set(["bin","rel"]);m("\\dots",function(r){var e="\\dotso",t=r.expandAfterFuture().text;return t in Or?e=Or[t]:(t.slice(0,4)==="\\not"||t in W.math&&N4.has(W.math[t].group))&&(e="\\dotsb"),e});var Yt={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};m("\\dotso",function(r){var e=r.future().text;return e in Yt?"\\ldots\\,":"\\ldots"});m("\\dotsc",function(r){var e=r.future().text;return e in Yt&&e!==","?"\\ldots\\,":"\\ldots"});m("\\cdots",function(r){var e=r.future().text;return e in Yt?"\\@cdots\\,":"\\@cdots"});m("\\dotsb","\\cdots");m("\\dotsm","\\cdots");m("\\dotsi","\\!\\cdots");m("\\dotsx","\\ldots\\,");m("\\DOTSI","\\relax");m("\\DOTSB","\\relax");m("\\DOTSX","\\relax");m("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");m("\\,","\\tmspace+{3mu}{.1667em}");m("\\thinspace","\\,");m("\\>","\\mskip{4mu}");m("\\:","\\tmspace+{4mu}{.2222em}");m("\\medspace","\\:");m("\\;","\\tmspace+{5mu}{.2777em}");m("\\thickspace","\\;");m("\\!","\\tmspace-{3mu}{.1667em}");m("\\negthinspace","\\!");m("\\negmedspace","\\tmspace-{4mu}{.2222em}");m("\\negthickspace","\\tmspace-{5mu}{.277em}");m("\\enspace","\\kern.5em ");m("\\enskip","\\hskip.5em\\relax");m("\\quad","\\hskip1em\\relax");m("\\qquad","\\hskip2em\\relax");m("\\tag","\\@ifstar\\tag@literal\\tag@paren");m("\\tag@paren","\\tag@literal{({#1})}");m("\\tag@literal",r=>{if(r.macros.get("\\df@tag"))throw new S("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});m("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");m("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");m("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");m("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");m("\\newline","\\\\\\relax");m("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var E1=A(k0["Main-Regular"][84][1]-.7*k0["Main-Regular"][65][1]);m("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+E1+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");m("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+E1+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");m("\\hspace","\\@ifstar\\@hspacer\\@hspace");m("\\@hspace","\\hskip #1\\relax");m("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");m("\\ordinarycolon",":");m("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");m("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');m("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');m("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');m("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');m("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');m("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');m("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');m("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');m("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');m("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');m("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');m("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');m("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');m("∷","\\dblcolon");m("∹","\\eqcolon");m("≔","\\coloneqq");m("≕","\\eqqcolon");m("⩴","\\Coloneqq");m("\\ratio","\\vcentcolon");m("\\coloncolon","\\dblcolon");m("\\colonequals","\\coloneqq");m("\\coloncolonequals","\\Coloneqq");m("\\equalscolon","\\eqqcolon");m("\\equalscoloncolon","\\Eqqcolon");m("\\colonminus","\\coloneq");m("\\coloncolonminus","\\Coloneq");m("\\minuscolon","\\eqcolon");m("\\minuscoloncolon","\\Eqcolon");m("\\coloncolonapprox","\\Colonapprox");m("\\coloncolonsim","\\Colonsim");m("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");m("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");m("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");m("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");m("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");m("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");m("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");m("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");m("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");m("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");m("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");m("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");m("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");m("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");m("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");m("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");m("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");m("\\nleqq","\\html@mathml{\\@nleqq}{≰}");m("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");m("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");m("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");m("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");m("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");m("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");m("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");m("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");m("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");m("\\imath","\\html@mathml{\\@imath}{ı}");m("\\jmath","\\html@mathml{\\@jmath}{ȷ}");m("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");m("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");m("⟦","\\llbracket");m("⟧","\\rrbracket");m("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");m("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");m("⦃","\\lBrace");m("⦄","\\rBrace");m("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");m("⦵","\\minuso");m("\\darr","\\downarrow");m("\\dArr","\\Downarrow");m("\\Darr","\\Downarrow");m("\\lang","\\langle");m("\\rang","\\rangle");m("\\uarr","\\uparrow");m("\\uArr","\\Uparrow");m("\\Uarr","\\Uparrow");m("\\N","\\mathbb{N}");m("\\R","\\mathbb{R}");m("\\Z","\\mathbb{Z}");m("\\alef","\\aleph");m("\\alefsym","\\aleph");m("\\Alpha","\\mathrm{A}");m("\\Beta","\\mathrm{B}");m("\\bull","\\bullet");m("\\Chi","\\mathrm{X}");m("\\clubs","\\clubsuit");m("\\cnums","\\mathbb{C}");m("\\Complex","\\mathbb{C}");m("\\Dagger","\\ddagger");m("\\diamonds","\\diamondsuit");m("\\empty","\\emptyset");m("\\Epsilon","\\mathrm{E}");m("\\Eta","\\mathrm{H}");m("\\exist","\\exists");m("\\harr","\\leftrightarrow");m("\\hArr","\\Leftrightarrow");m("\\Harr","\\Leftrightarrow");m("\\hearts","\\heartsuit");m("\\image","\\Im");m("\\infin","\\infty");m("\\Iota","\\mathrm{I}");m("\\isin","\\in");m("\\Kappa","\\mathrm{K}");m("\\larr","\\leftarrow");m("\\lArr","\\Leftarrow");m("\\Larr","\\Leftarrow");m("\\lrarr","\\leftrightarrow");m("\\lrArr","\\Leftrightarrow");m("\\Lrarr","\\Leftrightarrow");m("\\Mu","\\mathrm{M}");m("\\natnums","\\mathbb{N}");m("\\Nu","\\mathrm{N}");m("\\Omicron","\\mathrm{O}");m("\\plusmn","\\pm");m("\\rarr","\\rightarrow");m("\\rArr","\\Rightarrow");m("\\Rarr","\\Rightarrow");m("\\real","\\Re");m("\\reals","\\mathbb{R}");m("\\Reals","\\mathbb{R}");m("\\Rho","\\mathrm{P}");m("\\sdot","\\cdot");m("\\sect","\\S");m("\\spades","\\spadesuit");m("\\sub","\\subset");m("\\sube","\\subseteq");m("\\supe","\\supseteq");m("\\Tau","\\mathrm{T}");m("\\thetasym","\\vartheta");m("\\weierp","\\wp");m("\\Zeta","\\mathrm{Z}");m("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");m("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");m("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");m("\\bra","\\mathinner{\\langle{#1}|}");m("\\ket","\\mathinner{|{#1}\\rangle}");m("\\braket","\\mathinner{\\langle{#1}\\rangle}");m("\\Bra","\\left\\langle#1\\right|");m("\\Ket","\\left|#1\\right\\rangle");var R1=r=>e=>{var t=e.consumeArg().tokens,a=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,u=e.macros.get("|"),h=e.macros.get("\\|");e.macros.beginGroup();var c=b=>x=>{r&&(x.macros.set("|",u),i.length&&x.macros.set("\\|",h));var y=b;if(!b&&i.length){var T=x.future();T.text==="|"&&(x.popToken(),y=!0)}return{tokens:y?i:a,numArgs:0}};e.macros.set("|",c(!1)),i.length&&e.macros.set("\\|",c(!0));var v=e.consumeArg().tokens,p=e.expandTokens([...s,...v,...t]);return e.macros.endGroup(),{tokens:p.reverse(),numArgs:0}};m("\\bra@ket",R1(!1));m("\\bra@set",R1(!0));m("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");m("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");m("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");m("\\angln","{\\angl n}");m("\\blue","\\textcolor{##6495ed}{#1}");m("\\orange","\\textcolor{##ffa500}{#1}");m("\\pink","\\textcolor{##ff00af}{#1}");m("\\red","\\textcolor{##df0030}{#1}");m("\\green","\\textcolor{##28ae7b}{#1}");m("\\gray","\\textcolor{gray}{#1}");m("\\purple","\\textcolor{##9d38bd}{#1}");m("\\blueA","\\textcolor{##ccfaff}{#1}");m("\\blueB","\\textcolor{##80f6ff}{#1}");m("\\blueC","\\textcolor{##63d9ea}{#1}");m("\\blueD","\\textcolor{##11accd}{#1}");m("\\blueE","\\textcolor{##0c7f99}{#1}");m("\\tealA","\\textcolor{##94fff5}{#1}");m("\\tealB","\\textcolor{##26edd5}{#1}");m("\\tealC","\\textcolor{##01d1c1}{#1}");m("\\tealD","\\textcolor{##01a995}{#1}");m("\\tealE","\\textcolor{##208170}{#1}");m("\\greenA","\\textcolor{##b6ffb0}{#1}");m("\\greenB","\\textcolor{##8af281}{#1}");m("\\greenC","\\textcolor{##74cf70}{#1}");m("\\greenD","\\textcolor{##1fab54}{#1}");m("\\greenE","\\textcolor{##0d923f}{#1}");m("\\goldA","\\textcolor{##ffd0a9}{#1}");m("\\goldB","\\textcolor{##ffbb71}{#1}");m("\\goldC","\\textcolor{##ff9c39}{#1}");m("\\goldD","\\textcolor{##e07d10}{#1}");m("\\goldE","\\textcolor{##a75a05}{#1}");m("\\redA","\\textcolor{##fca9a9}{#1}");m("\\redB","\\textcolor{##ff8482}{#1}");m("\\redC","\\textcolor{##f9685d}{#1}");m("\\redD","\\textcolor{##e84d39}{#1}");m("\\redE","\\textcolor{##bc2612}{#1}");m("\\maroonA","\\textcolor{##ffbde0}{#1}");m("\\maroonB","\\textcolor{##ff92c6}{#1}");m("\\maroonC","\\textcolor{##ed5fa6}{#1}");m("\\maroonD","\\textcolor{##ca337c}{#1}");m("\\maroonE","\\textcolor{##9e034e}{#1}");m("\\purpleA","\\textcolor{##ddd7ff}{#1}");m("\\purpleB","\\textcolor{##c6b9fc}{#1}");m("\\purpleC","\\textcolor{##aa87ff}{#1}");m("\\purpleD","\\textcolor{##7854ab}{#1}");m("\\purpleE","\\textcolor{##543b78}{#1}");m("\\mintA","\\textcolor{##f5f9e8}{#1}");m("\\mintB","\\textcolor{##edf2df}{#1}");m("\\mintC","\\textcolor{##e0e5cc}{#1}");m("\\grayA","\\textcolor{##f6f7f7}{#1}");m("\\grayB","\\textcolor{##f0f1f2}{#1}");m("\\grayC","\\textcolor{##e3e5e6}{#1}");m("\\grayD","\\textcolor{##d6d8da}{#1}");m("\\grayE","\\textcolor{##babec2}{#1}");m("\\grayF","\\textcolor{##888d93}{#1}");m("\\grayG","\\textcolor{##626569}{#1}");m("\\grayH","\\textcolor{##3b3e40}{#1}");m("\\grayI","\\textcolor{##21242c}{#1}");m("\\kaBlue","\\textcolor{##314453}{#1}");m("\\kaGreen","\\textcolor{##71B307}{#1}");var I1={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class F4{constructor(e,t,a){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new R4(I4,t.macros),this.mode=a,this.stack=[]}feed(e){this.lexer=new Fr(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,a,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:i,end:a}=this.consumeArg(["]"])}else({tokens:i,start:t,end:a}=this.consumeArg());return this.pushToken(new c0("EOF",a.loc)),this.pushTokens(i),new c0("",h0.range(t,a))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],a=e&&e.length>0;a||this.consumeSpaces();var i=this.future(),s,u=0,h=0;do{if(s=this.popToken(),t.push(s),s.text==="{")++u;else if(s.text==="}"){if(--u,u===-1)throw new S("Extra }",s)}else if(s.text==="EOF")throw new S("Unexpected end of input in a macro argument, expected '"+(e&&a?e[h]:"}")+"'",s);if(e&&a)if((u===0||u===1&&e[h]==="{")&&s.text===e[h]){if(++h,h===e.length){t.splice(-h,h);break}}else h=0}while(u!==0||a);return i.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:s}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new S("The length of delimiters doesn't match the number of args!");for(var a=t[0],i=0;ithis.settings.maxExpand)throw new S("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),a=t.text,i=t.noexpand?null:this._getExpansion(a);if(i==null||e&&i.unexpandable){if(e&&i==null&&a[0]==="\\"&&!this.isDefined(a))throw new S("Undefined control sequence: "+a);return this.pushToken(t),!1}this.countExpansion(1);var s=i.tokens,u=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var h=s.length-1;h>=0;--h){var c=s[h];if(c.text==="#"){if(h===0)throw new S("Incomplete placeholder at end of macro body",c);if(c=s[--h],c.text==="#")s.splice(h+1,1);else if(/^[1-9]$/.test(c.text))s.splice(h,2,...u[+c.text-1]);else throw new S("Not a valid argument number",c)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new c0(e)]):void 0}expandTokens(e){var t=[],a=this.stack.length;for(this.pushTokens(e);this.stack.length>a;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),t.push(i)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(a=>a.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var a=this.lexer.catcodes[e];if(a!=null&&a!==13)return}var i=typeof t=="function"?t(this):t;if(typeof i=="string"){var s=0;if(i.includes("#"))for(var u=i.replace(/##/g,"");u.includes("#"+(s+1));)++s;for(var h=new Fr(i,this.settings),c=[],v=h.lex();v.text!=="EOF";)c.push(v),v=h.lex();c.reverse();var p={tokens:c,numArgs:s};return p}return i}isDefined(e){return this.macros.has(e)||O0.hasOwnProperty(e)||W.math.hasOwnProperty(e)||W.text.hasOwnProperty(e)||I1.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:O0.hasOwnProperty(e)&&!O0[e].primitive}}var Lr=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Be=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),ct={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Pr={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class je{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new F4(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new S("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new c0("}")),this.gullet.pushTokens(e);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,a}parseExpression(e,t){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(je.endOfExpression.has(i.text)||t&&i.text===t||e&&O0[i.text]&&O0[i.text].infix)break;var s=this.parseAtom(t);if(s){if(s.type==="internal")continue}else break;a.push(s)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(e){for(var t=-1,a,i=0;i=128)this.settings.strict&&(Gr(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),u={type:"textord",mode:"text",loc:h0.range(e),text:t};else return null;if(this.consume(),s)for(var p=0;p1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=n.length>3&&typeof o=="function"?(i--,o):void 0,a&&_(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++t2?e[2]:void 0;for(i&&_(e[0],e[1],i)&&(t=1);++r-1?i[o?e[a]:a]:void 0}}var Ke=Math.max;function Ze(n,e,r){var t=n==null?0:n.length;if(!t)return-1;var i=r==null?0:Se(r);return i<0&&(i=Ke(t+i,0)),fe(n,R(e),i)}var rn=Je(Ze);function Qe(n,e){return n==null?n:Ln(n,_n(e),V)}function nr(n,e){return n&&Cn(n,_n(e))}function er(n,e){return n>e}var rr=Object.prototype,tr=rr.hasOwnProperty;function ir(n,e){return n!=null&&tr.call(n,e)}function Bn(n,e){return n!=null&&se(n,e,ir)}function jn(n,e){return ne||o&&a&&d&&!u&&!f||t&&a&&d||!r&&d||!i)return 1;if(!t&&!o&&!f&&n=u)return d;var f=r[t];return d*(f=="desc"?-1:1)}}return n.index-e.index}function sr(n,e,r){e.length?e=D(e,function(o){return A(o)?function(a){return Rn(a,o.length===1?o[0]:o)}:o}):e=[en];var t=-1;e=D(e,le(R));var i=Oe(n,function(o,a,u){var d=D(e,function(f){return f(o)});return{criteria:d,index:++t,value:o}});return ur(i,function(o,a){return fr(o,a,r)})}function cr(n,e){return or(n,e,function(r,t){return he(n,t)})}var j=Ae(function(n,e){return n==null?{}:cr(n,e)}),lr=Math.ceil,hr=Math.max;function vr(n,e,r,t){for(var i=-1,o=hr(lr((e-n)/(r||1)),0),a=Array(o);o--;)a[++i]=n,n+=r;return a}function pr(n){return function(e,r,t){return t&&typeof t!="number"&&_(e,r,t)&&(r=t=void 0),e=S(e),r===void 0?(r=e,e=0):r=S(r),t=t===void 0?e1&&_(n,e[0],e[1])?e=[]:r>2&&_(e[0],e[1],e[2])&&(e=[e[0]]),sr(n,Nn(e),[])}),wr=0;function on(n){var e=++wr;return ve(n)+e}function br(n,e,r){for(var t=-1,i=n.length,o=e.length,a={};++t0;--u)if(a=e[u].dequeue(),a){t=t.concat(q(n,e,r,a,!0));break}}}return t}function q(n,e,r,t,i){var o=i?[]:void 0;return c(n.inEdges(t.v),function(a){var u=n.edge(a),d=n.node(a.v);i&&o.push({v:a.v,w:a.w}),d.out-=u,Z(e,r,d)}),c(n.outEdges(t.v),function(a){var u=n.edge(a),d=a.w,f=n.node(d);f.in-=u,Z(e,r,f)}),n.removeNode(t.v),o}function kr(n,e){var r=new g,t=0,i=0;c(n.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),c(n.edges(),function(u){var d=r.edge(u.v,u.w)||0,f=e(u),s=d+f;r.setEdge(u.v,u.w,s),i=Math.max(i,r.node(u.v).out+=f),t=Math.max(t,r.node(u.w).in+=f)});var o=k(i+t+3).map(function(){return new gr}),a=t+1;return c(r.nodes(),function(u){Z(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function Z(n,e,r){r.out?r.in?n[r.out-r.in+e].enqueue(r):n[n.length-1].enqueue(r):n[0].enqueue(r)}function Pr(n){var e=n.graph().acyclicer==="greedy"?Er(n,r(n)):Nr(n);c(e,function(t){var i=n.edge(t);n.removeEdge(t),i.forwardName=t.name,i.reversed=!0,n.setEdge(t.w,t.v,i,on("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function Nr(n){var e=[],r={},t={};function i(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,c(n.outEdges(o),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?e.push(a):i(a.w)}),delete r[o])}return c(n.nodes(),i),e}function Lr(n){c(n.edges(),function(e){var r=n.edge(e);if(r.reversed){n.removeEdge(e);var t=r.forwardName;delete r.reversed,delete r.forwardName,n.setEdge(e.w,e.v,r,t)}})}function N(n,e,r,t){var i;do i=on(t);while(n.hasNode(i));return r.dummy=e,n.setNode(i,r),i}function _r(n){var e=new g().setGraph(n.graph());return c(n.nodes(),function(r){e.setNode(r,n.node(r))}),c(n.edges(),function(r){var t=e.edge(r.v,r.w)||{weight:0,minlen:1},i=n.edge(r);e.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),e}function Gn(n){var e=new g({multigraph:n.isMultigraph()}).setGraph(n.graph());return c(n.nodes(),function(r){n.children(r).length||e.setNode(r,n.node(r))}),c(n.edges(),function(r){e.setEdge(r,n.edge(r))}),e}function pn(n,e){var r=n.x,t=n.y,i=e.x-r,o=e.y-t,a=n.width/2,u=n.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var d,f;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),d=u*i/o,f=u):(i<0&&(a=-a),d=a,f=a*o/i),{x:r+d,y:t+f}}function $(n){var e=w(k(Vn(n)+1),function(){return[]});return c(n.nodes(),function(r){var t=n.node(r),i=t.rank;m(i)||(e[i][t.order]=r)}),e}function Cr(n){var e=C(w(n.nodes(),function(r){return n.node(r).rank}));c(n.nodes(),function(r){var t=n.node(r);Bn(t,"rank")&&(t.rank-=e)})}function Ir(n){var e=C(w(n.nodes(),function(o){return n.node(o).rank})),r=[];c(n.nodes(),function(o){var a=n.node(o).rank-e;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=n.graph().nodeRankFactor;c(r,function(o,a){m(o)&&a%i!==0?--t:t&&c(o,function(u){n.node(u).rank+=t})})}function wn(n,e,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),N(n,"border",i,e)}function Vn(n){return x(w(n.nodes(),function(e){var r=n.node(e).rank;if(!m(r))return r}))}function Rr(n,e){var r={lhs:[],rhs:[]};return c(n,function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r}function Tr(n,e){return e()}function Mr(n){function e(r){var t=n.children(r),i=n.node(r);if(t.length&&c(t,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;oa.lim&&(u=a,d=!0);var f=T(e.edges(),function(s){return d===gn(n,n.node(s.v),u)&&d!==gn(n,n.node(s.w),u)});return an(f,function(s){return I(e,s)})}function Un(n,e,r,t){var i=r.v,o=r.w;n.removeEdge(i,o),n.setEdge(t.v,t.w,{}),fn(n),dn(n,e),zr(n,e)}function zr(n,e){var r=rn(n.nodes(),function(i){return!e.node(i).parent}),t=Xr(n,r);t=t.slice(1),c(t,function(i){var o=n.node(i).parent,a=e.edge(i,o),u=!1;a||(a=e.edge(o,i),u=!0),e.node(i).rank=e.node(o).rank+(u?a.minlen:-a.minlen)})}function Ur(n,e,r){return n.hasEdge(e,r)}function gn(n,e,r){return r.low<=e.lim&&e.lim<=r.lim}function Jr(n){switch(n.graph().ranker){case"network-simplex":yn(n);break;case"tight-tree":Zr(n);break;case"longest-path":Kr(n);break;default:yn(n)}}var Kr=un;function Zr(n){un(n),$n(n)}function yn(n){E(n)}function Qr(n){var e=N(n,"root",{},"_root"),r=nt(n),t=x(O(r))-1,i=2*t+1;n.graph().nestingRoot=e,c(n.edges(),function(a){n.edge(a).minlen*=i});var o=et(n)+1;c(n.children(),function(a){Jn(n,e,i,o,t,r,a)}),n.graph().nodeRankFactor=i}function Jn(n,e,r,t,i,o,a){var u=n.children(a);if(!u.length){a!==e&&n.setEdge(e,a,{weight:0,minlen:r});return}var d=wn(n,"_bt"),f=wn(n,"_bb"),s=n.node(a);n.setParent(d,a),s.borderTop=d,n.setParent(f,a),s.borderBottom=f,c(u,function(l){Jn(n,e,r,t,i,o,l);var h=n.node(l),v=h.borderTop?h.borderTop:l,p=h.borderBottom?h.borderBottom:l,b=h.borderTop?t:2*t,L=v!==p?1:i-o[a]+1;n.setEdge(d,v,{weight:b,minlen:L,nestingEdge:!0}),n.setEdge(p,f,{weight:b,minlen:L,nestingEdge:!0})}),n.parent(a)||n.setEdge(e,d,{weight:0,minlen:i+o[a]})}function nt(n){var e={};function r(t,i){var o=n.children(t);o&&o.length&&c(o,function(a){r(a,i+1)}),e[t]=i}return c(n.children(),function(t){r(t,1)}),e}function et(n){return G(n.edges(),function(e,r){return e+n.edge(r).weight},0)}function rt(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,c(n.edges(),function(r){var t=n.edge(r);t.nestingEdge&&n.removeEdge(r)})}function tt(n,e,r){var t={},i;c(r,function(o){for(var a=n.parent(o),u,d;a;){if(u=n.parent(a),u?(d=t[u],t[u]=a):(d=i,i=a),d&&d!==a){e.setEdge(d,a);return}a=u}})}function it(n,e,r){var t=at(n),i=new g({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return n.node(o)});return c(n.nodes(),function(o){var a=n.node(o),u=n.parent(o);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),c(n[r](o),function(d){var f=d.v===o?d.w:d.v,s=i.edge(f,o),l=m(s)?0:s.weight;i.setEdge(f,o,{weight:n.edge(d).weight+l})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),i}function at(n){for(var e;n.hasNode(e=on("_root")););return e}function ot(n,e){for(var r=0,t=1;t0;)s%2&&(l+=u[s+1]),s=s-1>>1,u[s]+=f.weight;d+=f.weight*l})),d}function dt(n){var e={},r=T(n.nodes(),function(u){return!n.children(u).length}),t=x(w(r,function(u){return n.node(u).rank})),i=w(k(t+1),function(){return[]});function o(u){if(!Bn(e,u)){e[u]=!0;var d=n.node(u);i[d.rank].push(u),c(n.successors(u),o)}}var a=M(r,function(u){return n.node(u).rank});return c(a,o),i}function ft(n,e){return w(e,function(r){var t=n.inEdges(r);if(t.length){var i=G(t,function(o,a){var u=n.edge(a),d=n.node(a.v);return{sum:o.sum+u.weight*d.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function st(n,e){var r={};c(n,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};m(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),c(e.edges(),function(i){var o=r[i.v],a=r[i.w];!m(o)&&!m(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=T(r,function(i){return!i.indegree});return ct(t)}function ct(n){var e=[];function r(o){return function(a){a.merged||(m(a.barycenter)||m(o.barycenter)||a.barycenter>=o.barycenter)&<(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&n.push(a)}}for(;n.length;){var i=n.pop();e.push(i),c(i.in.reverse(),r(i)),c(i.out,t(i))}return w(T(e,function(o){return!o.merged}),function(o){return j(o,["vs","i","barycenter","weight"])})}function lt(n,e){var r=0,t=0;n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.vs=e.vs.concat(n.vs),n.barycenter=r/t,n.weight=t,n.i=Math.min(e.i,n.i),e.merged=!0}function ht(n,e){var r=Rr(n,function(s){return Object.prototype.hasOwnProperty.call(s,"barycenter")}),t=r.lhs,i=M(r.rhs,function(s){return-s.i}),o=[],a=0,u=0,d=0;t.sort(vt(!!e)),d=xn(o,i,d),c(t,function(s){d+=s.vs.length,o.push(s.vs),a+=s.barycenter*s.weight,u+=s.weight,d=xn(o,i,d)});var f={vs:P(o)};return u&&(f.barycenter=a/u,f.weight=u),f}function xn(n,e,r){for(var t;e.length&&(t=B(e)).i<=r;)e.pop(),n.push(t.vs),r++;return r}function vt(n){return function(e,r){return e.barycenterr.barycenter?1:n?r.i-e.i:e.i-r.i}}function Kn(n,e,r,t){var i=n.children(e),o=n.node(e),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,d={};a&&(i=T(i,function(p){return p!==a&&p!==u}));var f=ft(n,i);c(f,function(p){if(n.children(p.v).length){var b=Kn(n,p.v,r,t);d[p.v]=b,Object.prototype.hasOwnProperty.call(b,"barycenter")&&wt(p,b)}});var s=st(f,r);pt(s,d);var l=ht(s,t);if(a&&(l.vs=P([a,l.vs,u]),n.predecessors(a).length)){var h=n.node(n.predecessors(a)[0]),v=n.node(n.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+v.order)/(l.weight+2),l.weight+=2}return l}function pt(n,e){c(n,function(r){r.vs=P(r.vs.map(function(t){return e[t]?e[t].vs:t}))})}function wt(n,e){m(n.barycenter)?(n.barycenter=e.barycenter,n.weight=e.weight):(n.barycenter=(n.barycenter*n.weight+e.barycenter*e.weight)/(n.weight+e.weight),n.weight+=e.weight)}function bt(n){var e=Vn(n),r=En(n,k(1,e+1),"inEdges"),t=En(n,k(e-1,-1,-1),"outEdges"),i=dt(n);On(n,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,d=0;d<4;++u,++d){mt(u%2?r:t,u%4>=2),i=$(n);var f=ot(n,i);fa||u>e[d].lim));for(f=d,d=t;(d=n.parent(d))!==f;)o.push(d);return{path:i.concat(o.reverse()),lca:f}}function xt(n){var e={},r=0;function t(i){var o=r;c(n.children(i),t),e[i]={low:o,lim:r++}}return c(n.children(),t),e}function Et(n,e){var r={};function t(i,o){var a=0,u=0,d=i.length,f=B(o);return c(o,function(s,l){var h=kt(n,s),v=h?n.node(h).order:d;(h||s===f)&&(c(o.slice(u,l+1),function(p){c(n.predecessors(p),function(b){var L=n.node(b),sn=L.order;(snf)&&Zn(r,h,s)})})}function i(o,a){var u=-1,d,f=0;return c(a,function(s,l){if(n.node(s).dummy==="border"){var h=n.predecessors(s);h.length&&(d=n.node(h[0]).order,t(a,f,l,u,d),f=l,u=d)}t(a,f,a.length,d,o.length)}),a}return G(e,i),r}function kt(n,e){if(n.node(e).dummy)return rn(n.predecessors(e),function(r){return n.node(r).dummy})}function Zn(n,e,r){if(e>r){var t=e;e=r,r=t}Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=n[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Pt(n,e,r){if(e>r){var t=e;e=r,r=t}return!!n[e]&&Object.prototype.hasOwnProperty.call(n[e],r)}function Nt(n,e,r,t){var i={},o={},a={};return c(e,function(u){c(u,function(d,f){i[d]=d,o[d]=d,a[d]=f})}),c(e,function(u){var d=-1;c(u,function(f){var s=t(f);if(s.length){s=M(s,function(b){return a[b]});for(var l=(s.length-1)/2,h=Math.floor(l),v=Math.ceil(l);h<=v;++h){var p=s[h];o[f]===f&&d{var t=r(" buildLayoutGraph",()=>Ht(n));r(" runLayout",()=>Bt(t,r)),r(" updateInputGraph",()=>jt(n,t))})}function Bt(n,e){e(" makeSpaceForEdgeLabels",()=>zt(n)),e(" removeSelfEdges",()=>ti(n)),e(" acyclic",()=>Pr(n)),e(" nestingGraph.run",()=>Qr(n)),e(" rank",()=>Jr(Gn(n))),e(" injectEdgeLabelProxies",()=>Ut(n)),e(" removeEmptyRanks",()=>Ir(n)),e(" nestingGraph.cleanup",()=>rt(n)),e(" normalizeRanks",()=>Cr(n)),e(" assignRankMinMax",()=>Jt(n)),e(" removeEdgeLabelProxies",()=>Kt(n)),e(" normalize.run",()=>jr(n)),e(" parentDummyChains",()=>gt(n)),e(" addBorderSegments",()=>Mr(n)),e(" order",()=>bt(n)),e(" insertSelfEdges",()=>ii(n)),e(" adjustCoordinateSystem",()=>Sr(n)),e(" position",()=>Ft(n)),e(" positionSelfEdges",()=>ai(n)),e(" removeBorderNodes",()=>ri(n)),e(" normalize.undo",()=>Vr(n)),e(" fixupEdgeLabelCoords",()=>ni(n)),e(" undoCoordinateSystem",()=>Fr(n)),e(" translateGraph",()=>Zt(n)),e(" assignNodeIntersects",()=>Qt(n)),e(" reversePoints",()=>ei(n)),e(" acyclic.undo",()=>Lr(n))}function jt(n,e){c(n.nodes(),function(r){var t=n.node(r),i=e.node(r);t&&(t.x=i.x,t.y=i.y,e.children(r).length&&(t.width=i.width,t.height=i.height))}),c(n.edges(),function(r){var t=n.edge(r),i=e.edge(r);t.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(t.x=i.x,t.y=i.y)}),n.graph().width=e.graph().width,n.graph().height=e.graph().height}var Gt=["nodesep","edgesep","ranksep","marginx","marginy"],Vt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Yt=["acyclicer","ranker","rankdir","align"],$t=["width","height"],Dt={width:0,height:0},qt=["minlen","weight","width","height","labeloffset"],Wt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Xt=["labelpos"];function Ht(n){var e=new g({multigraph:!0,compound:!0}),r=z(n.graph());return e.setGraph(K({},Vt,H(r,Gt),j(r,Yt))),c(n.nodes(),function(t){var i=z(n.node(t));e.setNode(t,He(H(i,$t),Dt)),e.setParent(t,n.parent(t))}),c(n.edges(),function(t){var i=z(n.edge(t));e.setEdge(t,K({},Wt,H(i,qt),j(i,Xt)))}),e}function zt(n){var e=n.graph();e.ranksep/=2,c(n.edges(),function(r){var t=n.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Ut(n){c(n.edges(),function(e){var r=n.edge(e);if(r.width&&r.height){var t=n.node(e.v),i=n.node(e.w),o={rank:(i.rank-t.rank)/2+t.rank,e};N(n,"edge-proxy",o,"_ep")}})}function Jt(n){var e=0;c(n.nodes(),function(r){var t=n.node(r);t.borderTop&&(t.minRank=n.node(t.borderTop).rank,t.maxRank=n.node(t.borderBottom).rank,e=x(e,t.maxRank))}),n.graph().maxRank=e}function Kt(n){c(n.nodes(),function(e){var r=n.node(e);r.dummy==="edge-proxy"&&(n.edge(r.e).labelRank=r.rank,n.removeNode(e))})}function Zt(n){var e=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=n.graph(),a=o.marginx||0,u=o.marginy||0;function d(f){var s=f.x,l=f.y,h=f.width,v=f.height;e=Math.min(e,s-h/2),r=Math.max(r,s+h/2),t=Math.min(t,l-v/2),i=Math.max(i,l+v/2)}c(n.nodes(),function(f){d(n.node(f))}),c(n.edges(),function(f){var s=n.edge(f);Object.prototype.hasOwnProperty.call(s,"x")&&d(s)}),e-=a,t-=u,c(n.nodes(),function(f){var s=n.node(f);s.x-=e,s.y-=t}),c(n.edges(),function(f){var s=n.edge(f);c(s.points,function(l){l.x-=e,l.y-=t}),Object.prototype.hasOwnProperty.call(s,"x")&&(s.x-=e),Object.prototype.hasOwnProperty.call(s,"y")&&(s.y-=t)}),o.width=r-e+a,o.height=i-t+u}function Qt(n){c(n.edges(),function(e){var r=n.edge(e),t=n.node(e.v),i=n.node(e.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=i,a=t),r.points.unshift(pn(t,o)),r.points.push(pn(i,a))})}function ni(n){c(n.edges(),function(e){var r=n.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function ei(n){c(n.edges(),function(e){var r=n.edge(e);r.reversed&&r.points.reverse()})}function ri(n){c(n.nodes(),function(e){if(n.children(e).length){var r=n.node(e),t=n.node(r.borderTop),i=n.node(r.borderBottom),o=n.node(B(r.borderLeft)),a=n.node(B(r.borderRight));r.width=Math.abs(a.x-o.x),r.height=Math.abs(i.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),c(n.nodes(),function(e){n.node(e).dummy==="border"&&n.removeNode(e)})}function ti(n){c(n.edges(),function(e){if(e.v===e.w){var r=n.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:n.edge(e)}),n.removeEdge(e)}})}function ii(n){var e=$(n);c(e,function(r){var t=0;c(r,function(i,o){var a=n.node(i);a.order=o+t,c(a.selfEdges,function(u){N(n,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:o+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function ai(n){c(n.nodes(),function(e){var r=n.node(e);if(r.dummy==="selfedge"){var t=n.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;n.setEdge(r.e,r.label),n.removeNode(e),r.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],r.label.x=r.x,r.label.y=r.y}})}function H(n,e){return Y(j(n,e),Number)}function z(n){var e={};return c(n,function(r,t){e[t.toLowerCase()]=r}),e}export{di as l}; diff --git a/internal/webapp/static/assets/linear-DIpgEtso.js b/internal/webapp/static/assets/linear-DIpgEtso.js new file mode 100644 index 0000000..44bfb65 --- /dev/null +++ b/internal/webapp/static/assets/linear-DIpgEtso.js @@ -0,0 +1 @@ +import{b9 as j,ba as p,bb as w,bc as k,bd as q}from"./mermaid.core-B7WVQkyL.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:nr?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:rn?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i>>1;t(o[l],c)<0?i=l+1:h=l}while(i>>1;t(o[l],c)<=0?i=l+1:h=l}while(ii&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/ir&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*ir&&--c),c0))return[];if(n===r)return[n];const e=r=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;ir&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t}; diff --git a/internal/webapp/static/assets/map-DxJ2ADlA.js b/internal/webapp/static/assets/map-DxJ2ADlA.js new file mode 100644 index 0000000..d505275 --- /dev/null +++ b/internal/webapp/static/assets/map-DxJ2ADlA.js @@ -0,0 +1 @@ +import{a as T,d as w,e as V,b as M,c as B,f as k,o as rr,k as _,r as er,g as D,s as tr,h as nr,j as ar,U as $,S,l as G,m as d,n as K,p as l,q as or,t as sr,u as ir,v as N,w as cr,x as ur,y as fr,z as gr}from"./graph-DOmOIIwC.js";var x=Object.create,br=(function(){function r(){}return function(e){if(!T(e))return{};if(x)return x(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}})();function lr(r,e){var t=-1,a=r.length;for(e||(e=Array(a));++ti.map(i=>d[i]); +const y="modulepreload",b=function(o){return"/"+o},f={},v=function(e,s,m){let d=Promise.resolve();if(s&&s.length>0){let l=function(n){return Promise.all(n.map(a=>Promise.resolve(a).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),t=r?.nonce||r?.getAttribute("nonce");d=l(s.map(n=>{if(n=b(n),n in f)return;f[n]=!0;const a=n.endsWith(".css"),u=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${u}`))return;const c=document.createElement("link");if(c.rel=a?"stylesheet":y,a||(c.as="script"),c.crossOrigin="",c.href=n,t&&c.setAttribute("nonce",t),document.head.appendChild(c),a)return new Promise((g,h)=>{c.addEventListener("load",g),c.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${n}`)))})}))}function i(r){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=r,window.dispatchEvent(t),!t.defaultPrevented)throw r}return d.then(r=>{for(const t of r||[])t.status==="rejected"&&i(t.reason);return e().catch(i)})},E="pre > code.language-mermaid",C={bg:"#15171b",line:"#9aa0a9",text:"#eef0f3",accent:"#f5a623"},_={bg:"#f6f8fa",line:"#57606a",text:"#24292f",accent:"#b26a00"};function p(o){return o.includes('class="language-mermaid"')}async function L(o,e=C){if(!p(o))return o;const s=new DOMParser().parseFromString(o,"text/html"),m=[...s.querySelectorAll(E)];if(!m.length)return o;let d;try{d=(await v(async()=>{const{default:i}=await import("./mermaid.core-B7WVQkyL.js").then(r=>r.bp);return{default:i}},__vite__mapDeps([0,1]))).default,d.initialize({startOnLoad:!1,securityLevel:"strict",theme:"base",fontFamily:"inherit",themeVariables:{background:"transparent",primaryColor:e.bg,primaryTextColor:e.text,primaryBorderColor:e.line,secondaryColor:e.bg,tertiaryColor:e.bg,lineColor:e.line,textColor:e.text,mainBkg:e.bg,nodeBorder:e.line,clusterBkg:"transparent",clusterBorder:e.accent,titleColor:e.text,edgeLabelBackground:e.bg}})}catch{return o}for(const[i,r]of m.entries()){const t=r.parentElement;try{const l="mmd-"+Math.random().toString(36).slice(2)+"-"+i,{svg:n}=await d.render(l,r.textContent||""),a=s.createElement("div");a.className="mermaid-diagram",a.innerHTML=n,t.replaceWith(a)}catch{const l=s.createElement("div");l.className="mermaid-err",l.textContent="Couldn't render this diagram.",t.after(l)}}for(const i of document.querySelectorAll("[id^='dmmd-']"))i.remove();return s.body.innerHTML}export{C as D,_ as L,v as _,p as h,L as r}; diff --git a/internal/webapp/static/assets/mermaid.core-B7WVQkyL.js b/internal/webapp/static/assets/mermaid.core-B7WVQkyL.js new file mode 100644 index 0000000..c286e05 --- /dev/null +++ b/internal/webapp/static/assets/mermaid.core-B7WVQkyL.js @@ -0,0 +1,308 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dagre-VZM6K2ZE-Cu6_Xdm1.js","assets/chunk-RYQCIY6F-xkrp9DIm.js","assets/graph-DOmOIIwC.js","assets/map-DxJ2ADlA.js","assets/layout-D-LzfAck.js","assets/mermaid-CP2pUOT9.js","assets/_commonjsHelpers-CqkleIqs.js","assets/swimlanes-SLNWSIFB-ZiI1XT9U.js","assets/cose-bilkent-JH36ORCC-BZgxHURk.js","assets/cytoscape.esm-D3_iZ_3b.js","assets/c4Diagram-5PPSVZJV-oXGTev51.js","assets/chunk-2GRJ4B5K-Bng47RDF.js","assets/flowDiagram-UKHOOZJN-XwdembEj.js","assets/chunk-5VM5RSS4-DJhOL3Lj.js","assets/chunk-XXDRQBXY-BXTWinaX.js","assets/chunk-KBJHAD2P-CHI3y1em.js","assets/channel-BphRH4Sr.js","assets/swimlanesDiagram-ULZ7WXOC-Bgk3ILUh.js","assets/erDiagram-JOGREHBK-BkNwaUcA.js","assets/gitGraphDiagram-DS77QQ5N-BAf_Q-WY.js","assets/chunk-2Q5K7J3B-Krb_H4ce.js","assets/chunk-JWPE2WC7-Czg53Rx5.js","assets/cynefin-VYW2F7L2-CdOzebfq.js","assets/ganttDiagram-PKOTCBZU-lpLvMD-8.js","assets/linear-DIpgEtso.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-6WML65LV-DQHnLHTt.js","assets/pieDiagram-7S7Q4E2Y-BqNckD7-.js","assets/arc-DQmUyXqg.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-CIZ2JOQS-D_d0CTwl.js","assets/xychartDiagram-ELKLHX3M-Bj9wLhGR.js","assets/requirementDiagram-LRYGKXZP-CG2rrsXg.js","assets/sequenceDiagram-SI44F4Z6-Bu_K6Hei.js","assets/classDiagram-JCYQIIEL-Bca3rNfW.js","assets/chunk-GF5L2VYU-DJ222bgi.js","assets/classDiagram-v2-OCEON4UE-Bca3rNfW.js","assets/stateDiagram-OKZ733FA-BZDeXRMs.js","assets/chunk-5RXB4S5H-D-7tWSyr.js","assets/stateDiagram-v2-UEYNNEHI-DDDMcBM_.js","assets/journeyDiagram-NVQOT4AX-B8O8DORL.js","assets/timeline-definition-Z64GVDOM-CIeFn7nE.js","assets/mindmap-definition-FAOFIHXS-Oe0Lo_1t.js","assets/kanban-definition-27J2QSJJ-BMVnCc0h.js","assets/sankeyDiagram-W5VNT64P-C-79o6vc.js","assets/diagram-LBJQPF4R-Cj_6Wlkl.js","assets/diagram-UB23O5K3-BjKBIl7q.js","assets/blockDiagram-VBNYF7ZC-Cp8Mn4lx.js","assets/diagram-7IWD3JNH-CsOlUumf.js","assets/architectureDiagram-T3A2C74G-CcMONCBR.js","assets/diagram-B4RE2ZJO-D1KNNV8U.js","assets/ishikawaDiagram-WSZJBQD7-BmYBJRyL.js","assets/vennDiagram-T6HMQDX7-bdo599Ik.js","assets/diagram-Q27KOJAE-CveaUqzz.js","assets/wardleyDiagram-T6FBY63Y-B_l7B-CB.js","assets/cynefinDiagram-MW4NZA55-DzpNWex9.js","assets/railroadDiagram-AXF67PYL-DH5n6ePI.js","assets/chunk-6Q2QTUOP-C7qNvbCj.js","assets/ebnfDiagram-BXEA7PRR-DV-beFnC.js","assets/abnfDiagram-N423BO3Z-CQHRlmDB.js","assets/pegDiagram-VL7TDLO6-DgoYitu3.js"])))=>i.map(i=>d[i]); +import{_ as ct}from"./mermaid-CP2pUOT9.js";import{g as My}from"./_commonjsHelpers-CqkleIqs.js";var Yc=Object.defineProperty,p=(e,t)=>Yc(e,"name",{value:t,configurable:!0}),$y=(e,t)=>{for(var r in t)Yc(e,r,{get:t[r],enumerable:!0})},Uo={exports:{}},Oy=Uo.exports,ah;function Iy(){return ah||(ah=1,(function(e,t){(function(r,i){e.exports=i()})(Oy,(function(){var r=1e3,i=6e4,o=36e5,s="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",f="quarter",u="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var E=["th","st","nd","rd"],A=$%100;return"["+$+(E[(A-20)%10]||E[A]||E[0])+"]"}},k=function($,E,A){var P=String($);return!P||P.length>=E?$:""+Array(E+1-P.length).join(A)+$},T={s:k,z:function($){var E=-$.utcOffset(),A=Math.abs(E),P=Math.floor(A/60),M=A%60;return(E<=0?"+":"-")+k(P,2,"0")+":"+k(M,2,"0")},m:function $(E,A){if(E.date()1)return $(Y[0])}else{var ot=E.name;B[ot]=E,M=ot}return!P&&M&&(S=M),M||!P&&S},R=function($,E){if(L($))return $.clone();var A=typeof E=="object"?E:{};return A.date=$,A.args=arguments,new U(A)},D=T;D.l=N,D.i=L,D.w=function($,E){return R($,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var U=(function(){function $(A){this.$L=N(A.locale,null,!0),this.parse(A),this.$x=this.$x||A.x||{},this[v]=!0}var E=$.prototype;return E.parse=function(A){this.$d=(function(P){var M=P.date,H=P.utc;if(M===null)return new Date(NaN);if(D.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var Y=M.match(y);if(Y){var ot=Y[2]-1||0,Z=(Y[7]||"0").substring(0,3);return H?new Date(Date.UTC(Y[1],ot,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,Z)):new Date(Y[1],ot,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,Z)}}return new Date(M)})(A),this.init()},E.init=function(){var A=this.$d;this.$y=A.getFullYear(),this.$M=A.getMonth(),this.$D=A.getDate(),this.$W=A.getDay(),this.$H=A.getHours(),this.$m=A.getMinutes(),this.$s=A.getSeconds(),this.$ms=A.getMilliseconds()},E.$utils=function(){return D},E.isValid=function(){return this.$d.toString()!==m},E.isSame=function(A,P){var M=R(A);return this.startOf(P)<=M&&M<=this.endOf(P)},E.isAfter=function(A,P){return R(A){},"trace"),debug:p((...e)=>{},"debug"),info:p((...e)=>{},"info"),warn:p((...e)=>{},"warn"),error:p((...e)=>{},"error"),fatal:p((...e)=>{},"fatal")},Dn=p(function(e="fatal"){let t=qe.fatal;typeof e=="string"?e.toLowerCase()in qe&&(t=qe[e]):typeof e=="number"&&(t=e),W.trace=()=>{},W.debug=()=>{},W.info=()=>{},W.warn=()=>{},W.error=()=>{},W.fatal=()=>{},t<=qe.fatal&&(W.fatal=console.error?console.error.bind(console,ue("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",ue("FATAL"))),t<=qe.error&&(W.error=console.error?console.error.bind(console,ue("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",ue("ERROR"))),t<=qe.warn&&(W.warn=console.warn?console.warn.bind(console,ue("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",ue("WARN"))),t<=qe.info&&(W.info=console.info?console.info.bind(console,ue("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",ue("INFO"))),t<=qe.debug&&(W.debug=console.debug?console.debug.bind(console,ue("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ue("DEBUG"))),t<=qe.trace&&(W.trace=console.debug?console.debug.bind(console,ue("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ue("TRACE")))},"setLogLevel"),ue=p(e=>`%c${Py().format("ss.SSS")} : ${e} : `,"format");const jo={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const o=r<.5?r*(1+t):r+t-r*t,s=2*r-o;switch(i){case"r":return jo.hue2rgb(s,o,e+1/3)*255;case"g":return jo.hue2rgb(s,o,e)*255;case"b":return jo.hue2rgb(s,o,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const o=Math.max(e,t,r),s=Math.min(e,t,r),a=(o+s)/2;if(i==="l")return a*100;if(o===s)return 0;const n=o-s,l=a>.5?n/(2-o-s):n/(o+s);if(i==="s")return l*100;switch(o){case e:return((t-r)/n+(tt>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},Ny={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},lt={channel:jo,lang:Ry,unit:Ny},er={};for(let e=0;e<=255;e++)er[e]=lt.unit.dec2hex(e);const Vt={ALL:0,RGB:1,HSL:2};class qy{constructor(){this.type=Vt.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Vt.ALL}is(t){return this.type===t}}class Wy{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new qy}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Vt.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=lt.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=lt.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=lt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=lt.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=lt.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=lt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Vt.HSL)&&r!==void 0?r:(this._ensureHSL(),lt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Vt.HSL)&&r!==void 0?r:(this._ensureHSL(),lt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Vt.HSL)&&r!==void 0?r:(this._ensureHSL(),lt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Vt.RGB)&&r!==void 0?r:(this._ensureRGB(),lt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Vt.RGB)&&r!==void 0?r:(this._ensureRGB(),lt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Vt.RGB)&&r!==void 0?r:(this._ensureRGB(),lt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Vt.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Vt.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Vt.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Vt.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Vt.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Vt.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Ds=new Wy({r:0,g:0,b:0,a:0},"transparent"),Kr={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Kr.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,s=o%4===0,a=o>4,n=a?1:17,l=a?8:4,c=s?0:-1,h=a?255:15;return Ds.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:s?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${er[Math.round(t)]}${er[Math.round(r)]}${er[Math.round(i)]}${er[Math.round(o*255)]}`:`#${er[Math.round(t)]}${er[Math.round(r)]}${er[Math.round(i)]}`}},br={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(br.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return lt.channel.clamp.h(parseFloat(r)*.9);case"rad":return lt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return lt.channel.clamp.h(parseFloat(r)*360)}}return lt.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(br.re);if(!r)return;const[,i,o,s,a,n]=r;return Ds.set({h:br._hue2deg(i),s:lt.channel.clamp.s(parseFloat(o)),l:lt.channel.clamp.l(parseFloat(s)),a:a?lt.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${lt.lang.round(t)}, ${lt.lang.round(r)}%, ${lt.lang.round(i)}%, ${o})`:`hsl(${lt.lang.round(t)}, ${lt.lang.round(r)}%, ${lt.lang.round(i)}%)`}},Gi={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=Gi.colors[e];if(t)return Kr.parse(t)},stringify:e=>{const t=Kr.stringify(e);for(const r in Gi.colors)if(Gi.colors[r]===t)return r}},Ri={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(Ri.re);if(!r)return;const[,i,o,s,a,n,l,c,h]=r;return Ds.set({r:lt.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:lt.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:lt.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?lt.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`rgba(${lt.lang.round(t)}, ${lt.lang.round(r)}, ${lt.lang.round(i)}, ${lt.lang.round(o)})`:`rgb(${lt.lang.round(t)}, ${lt.lang.round(r)}, ${lt.lang.round(i)})`}},Me={format:{keyword:Gi,hex:Kr,rgb:Ri,rgba:Ri,hsl:br,hsla:br},parse:e=>{if(typeof e!="string")return e;const t=Kr.parse(e)||Ri.parse(e)||br.parse(e)||Gi.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Vt.HSL)||e.data.r===void 0?br.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Ri.stringify(e):Kr.stringify(e)},Uc=(e,t)=>{const r=Me.parse(e);for(const i in t)r[i]=lt.channel.clamp[i](t[i]);return Me.stringify(r)},ar=(e,t,r=0,i=1)=>{if(typeof e!="number")return Uc(e,{a:t});const o=Ds.set({r:lt.channel.clamp.r(e),g:lt.channel.clamp.g(t),b:lt.channel.clamp.b(r),a:lt.channel.clamp.a(i)});return Me.stringify(o)},zy=e=>{const{r:t,g:r,b:i}=Me.parse(e),o=.2126*lt.channel.toLinear(t)+.7152*lt.channel.toLinear(r)+.0722*lt.channel.toLinear(i);return lt.lang.round(o)},Hy=e=>zy(e)>=.5,Te=e=>!Hy(e),jc=(e,t,r)=>{const i=Me.parse(e),o=i[t],s=lt.channel.clamp[t](o+r);return o!==s&&(i[t]=s),Me.stringify(i)},O=(e,t)=>jc(e,"l",t),I=(e,t)=>jc(e,"l",-t),x=(e,t)=>{const r=Me.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return Uc(e,i)},Yy=(e,t,r=50)=>{const{r:i,g:o,b:s,a}=Me.parse(e),{r:n,g:l,b:c,a:h}=Me.parse(t),d=r/100,f=d*2-1,u=a-h,m=((f*u===-1?f:(f+u)/(1+f*u))+1)/2,y=1-m,C=i*m+n*y,b=o*m+l*y,k=s*m+c*y,T=a*d+h*(1-d);return ar(C,b,k,T)},_=(e,t=100)=>{const r=Me.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,Yy(r,e,t)};function nh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r2?i-2:0),s=2;s1?r-1:0),o=1;o"u"?null:Dt(BigInt.prototype.toString),fh=typeof Symbol>"u"?null:Dt(Symbol.prototype.toString),qt=Dt(Object.prototype.hasOwnProperty),Ai=Dt(Object.prototype.toString),Nt=Dt(RegExp.prototype.test),gr=o0(TypeError);function Dt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:Ni;if(lh&&lh(e,null),!ir(t))return e;let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){const s=r(o);s!==o&&(Zy(t)||(t[i]=s),o=s)}e[o]=!0}return e}function s0(e){for(let t=0;t/g),u0=Gt(/\${[\w\W]*/g),f0=Gt(/^data-[\-\w.\u00B7-\uFFFF]+$/),p0=Gt(/^aria-[\-\w]+$/),Ch=Gt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),g0=Gt(/^(?:\w+script|data):/i),m0=Gt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),y0=Gt(/^html$/i),C0=Gt(/^[a-z][.\w]*(-[.\w]+)+$/i),xh=Gt(/<[/\w!]/g),bh=Gt(/<[/\w]/g),x0=Gt(/<\/no(script|embed|frames)/i),b0=Gt(/\/>/i),he={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},k0=function(){return typeof window>"u"?null:window},w0=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(i=r.getAttribute(o));const s="dompurify"+(i?"#"+i:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},kh=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},tr=function(t,r,i,o){return qt(t,r)&&ir(t[r])?mt(o.base?Xt(o.base):{},t[r],o.transform):i};function Vc(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:k0();const t=j=>Vc(j);if(t.version="3.4.13",t.removed=[],!e||!e.document||e.document.nodeType!==he.document||!e.Element)return t.isSupported=!1,t;let r=e.document;const i=r,o=i.currentScript;e.DocumentFragment;const s=e.HTMLTemplateElement,a=e.Node,n=e.Element,l=e.NodeFilter,c=e.NamedNodeMap;c===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const h=e.DOMParser,d=e.trustedTypes,f=n.prototype,u=pe(f,"cloneNode"),g=pe(f,"remove"),m=pe(f,"nextSibling"),y=pe(f,"childNodes"),C=pe(f,"parentNode"),b=pe(f,"shadowRoot"),k=pe(f,"attributes"),T=a&&a.prototype?pe(a.prototype,"nodeType"):null,S=a&&a.prototype?pe(a.prototype,"nodeName"):null,B=a&&a.prototype?pe(a.prototype,"ownerDocument"):null;if(typeof s=="function"){const j=r.createElement("template");j.content&&j.content.ownerDocument&&(r=j.content.ownerDocument)}let v,L="",N,R=!1,D=0;const U=function(){if(D>0)throw gr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},q=function(w){U(),D++;try{return v.createHTML(w)}finally{D--}},$=function(w){U(),D++;try{return v.createScriptURL(w)}finally{D--}},E=function(){return R||(N=w0(d,o),R=!0),N},A=r,P=A.implementation,M=A.createNodeIterator,H=A.createDocumentFragment,Y=A.getElementsByTagName,ot=i.importNode;let Z=kh();t.isSupported=typeof Gc=="function"&&typeof C=="function"&&P&&P.createHTMLDocument!==void 0;const dt=c0,ft=d0,bt=u0,et=f0,pt=p0,wt=g0,_t=m0,Bt=C0;let Ot=Ch,yt=null;const Ne=mt({},[...ph,...ma,...ya,...Ca,...gh]);let Tt=null;const ta=mt({},[...mh,...xa,...yh,...$o]);let Et=Object.seal(Ur(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_i=null,Rl=null;const Ze=Object.seal(Ur(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Nl=!0,ea=!0,ql=!1,Wl=!0,Ke=!1,Qe=!0,fr=!1,ra=!1,wo=null,To=null,ia=!1,Ir=!1,So=!1,_o=!1,zl=!0,Hl=!1;const Yl="user-content-";let oa=!0,Bo=!1,Dr={},_e=null;const sa=mt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ul=null;const jl=mt({},["audio","video","img","source","image","track"]);let aa=null;const Gl=mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vo="http://www.w3.org/1998/Math/MathML",Lo="http://www.w3.org/2000/svg",Be="http://www.w3.org/1999/xhtml";let Pr=Be,na=!1,la=null;const my=mt({},[vo,Lo,Be],ga),Xl=jt(["mi","mo","mn","ms","mtext"]);let ha=mt({},Xl);const Vl=jt(["annotation-xml"]);let ca=mt({},Vl);const yy=mt({},["title","style","font","a","script"]);let Bi=null;const Cy=["application/xhtml+xml","text/html"],xy="text/html";let Lt=null,Rr=null;const by=r.createElement("form"),Zl=function(w){return w instanceof RegExp||w instanceof Function},da=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Rr&&Rr===w)return;(!w||typeof w!="object")&&(w={}),w=Xt(w),Bi=Cy.indexOf(w.PARSER_MEDIA_TYPE)===-1?xy:w.PARSER_MEDIA_TYPE,Lt=Bi==="application/xhtml+xml"?ga:Ni,yt=tr(w,"ALLOWED_TAGS",Ne,{transform:Lt}),Tt=tr(w,"ALLOWED_ATTR",ta,{transform:Lt}),la=tr(w,"ALLOWED_NAMESPACES",my,{transform:ga}),aa=tr(w,"ADD_URI_SAFE_ATTR",Gl,{transform:Lt,base:Gl}),Ul=tr(w,"ADD_DATA_URI_TAGS",jl,{transform:Lt,base:jl}),_e=tr(w,"FORBID_CONTENTS",sa,{transform:Lt}),_i=tr(w,"FORBID_TAGS",Xt({}),{transform:Lt}),Rl=tr(w,"FORBID_ATTR",Xt({}),{transform:Lt}),Dr=qt(w,"USE_PROFILES")?w.USE_PROFILES&&typeof w.USE_PROFILES=="object"?Xt(w.USE_PROFILES):w.USE_PROFILES:!1,Nl=w.ALLOW_ARIA_ATTR!==!1,ea=w.ALLOW_DATA_ATTR!==!1,ql=w.ALLOW_UNKNOWN_PROTOCOLS||!1,Wl=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ke=w.SAFE_FOR_TEMPLATES||!1,Qe=w.SAFE_FOR_XML!==!1,fr=w.WHOLE_DOCUMENT||!1,Ir=w.RETURN_DOM||!1,So=w.RETURN_DOM_FRAGMENT||!1,_o=w.RETURN_TRUSTED_TYPE||!1,ia=w.FORCE_BODY||!1,zl=w.SANITIZE_DOM!==!1,Hl=w.SANITIZE_NAMED_PROPS||!1,oa=w.KEEP_CONTENT!==!1,Bo=w.IN_PLACE||!1,Ot=n0(w.ALLOWED_URI_REGEXP)?w.ALLOWED_URI_REGEXP:Ch,Pr=typeof w.NAMESPACE=="string"?w.NAMESPACE:Be,ha=qt(w,"MATHML_TEXT_INTEGRATION_POINTS")&&w.MATHML_TEXT_INTEGRATION_POINTS&&typeof w.MATHML_TEXT_INTEGRATION_POINTS=="object"?Xt(w.MATHML_TEXT_INTEGRATION_POINTS):mt({},Xl),ca=qt(w,"HTML_INTEGRATION_POINTS")&&w.HTML_INTEGRATION_POINTS&&typeof w.HTML_INTEGRATION_POINTS=="object"?Xt(w.HTML_INTEGRATION_POINTS):mt({},Vl);const F=qt(w,"CUSTOM_ELEMENT_HANDLING")&&w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING=="object"?Xt(w.CUSTOM_ELEMENT_HANDLING):Ur(null);if(Et=Ur(null),qt(F,"tagNameCheck")&&Zl(F.tagNameCheck)&&(Et.tagNameCheck=F.tagNameCheck),qt(F,"attributeNameCheck")&&Zl(F.attributeNameCheck)&&(Et.attributeNameCheck=F.attributeNameCheck),qt(F,"allowCustomizedBuiltInElements")&&typeof F.allowCustomizedBuiltInElements=="boolean"&&(Et.allowCustomizedBuiltInElements=F.allowCustomizedBuiltInElements),Gt(Et),Ke&&(ea=!1),So&&(Ir=!0),Dr&&(yt=mt({},gh),Tt=Ur(null),Dr.html===!0&&(mt(yt,ph),mt(Tt,mh)),Dr.svg===!0&&(mt(yt,ma),mt(Tt,xa),mt(Tt,$o)),Dr.svgFilters===!0&&(mt(yt,ya),mt(Tt,xa),mt(Tt,$o)),Dr.mathMl===!0&&(mt(yt,Ca),mt(Tt,yh),mt(Tt,$o))),Ze.tagCheck=null,Ze.attributeCheck=null,qt(w,"ADD_TAGS")&&(typeof w.ADD_TAGS=="function"?Ze.tagCheck=w.ADD_TAGS:ir(w.ADD_TAGS)&&(yt===Ne&&(yt=Xt(yt)),mt(yt,w.ADD_TAGS,Lt))),qt(w,"ADD_ATTR")&&(typeof w.ADD_ATTR=="function"?Ze.attributeCheck=w.ADD_ATTR:ir(w.ADD_ATTR)&&(Tt===ta&&(Tt=Xt(Tt)),mt(Tt,w.ADD_ATTR,Lt))),qt(w,"ADD_URI_SAFE_ATTR")&&ir(w.ADD_URI_SAFE_ATTR)&&mt(aa,w.ADD_URI_SAFE_ATTR,Lt),qt(w,"FORBID_CONTENTS")&&ir(w.FORBID_CONTENTS)&&(_e===sa&&(_e=Xt(_e)),mt(_e,w.FORBID_CONTENTS,Lt)),qt(w,"ADD_FORBID_CONTENTS")&&ir(w.ADD_FORBID_CONTENTS)&&(_e===sa&&(_e=Xt(_e)),mt(_e,w.ADD_FORBID_CONTENTS,Lt)),oa&&(yt["#text"]=!0),fr&&mt(yt,["html","head","body"]),yt.table&&(mt(yt,["tbody"]),delete _i.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw gr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw gr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const z=v;v=w.TRUSTED_TYPES_POLICY;try{L=q("")}catch(J){throw v=z,J}}else w.TRUSTED_TYPES_POLICY===null?(v=void 0,L=""):(v===void 0&&(v=E()),v&&typeof L=="string"&&(L=q("")));jt&&jt(w),Rr=w},Kl=mt({},[...ma,...ya,...l0]),Ql=mt({},[...Ca,...h0]),ky=function(w,F,z){return F.namespaceURI===Be?w==="svg":F.namespaceURI===vo?w==="svg"&&(z==="annotation-xml"||ha[z]):!!Kl[w]},wy=function(w,F,z){return F.namespaceURI===Be?w==="math":F.namespaceURI===Lo?w==="math"&&ca[z]:!!Ql[w]},Ty=function(w,F,z){return F.namespaceURI===Lo&&!ca[z]||F.namespaceURI===vo&&!ha[z]?!1:!Ql[w]&&(yy[w]||!Kl[w])},Sy=function(w){let F=C(w);(!F||!F.tagName)&&(F={namespaceURI:Pr,tagName:"template"});const z=Ni(w.tagName),J=Ni(F.tagName);return la[w.namespaceURI]?w.namespaceURI===Lo?ky(z,F,J):w.namespaceURI===vo?wy(z,F,J):w.namespaceURI===Be?Ty(z,F,J):!!(Bi==="application/xhtml+xml"&&la[w.namespaceURI]):!1},Je=function(w){Wr(t.removed,{element:w});try{C(w).removeChild(w)}catch{if(g(w),!C(w))throw gr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Fo=function(w){vi(w);const F=y(w);if(F){const J=[];qr(F,rt=>{Wr(J,rt)}),qr(J,rt=>{try{g(rt)}catch{}})}const z=k(w);if(z)for(let J=z.length-1;J>=0;--J){const rt=z[J],ht=rt&&rt.name;if(typeof ht=="string")try{w.removeAttribute(ht)}catch{}}},pr=function(w,F){try{Wr(t.removed,{attribute:F.getAttributeNode(w),from:F})}catch{Wr(t.removed,{attribute:null,from:F})}if(F.removeAttribute(w),w==="is")if(Ir||So)try{Je(F)}catch{}else try{F.setAttribute(w,"")}catch{}},_y=function(w){const F=k(w);if(F)for(let z=F.length-1;z>=0;--z){const J=F[z],rt=J&&J.name;if(!(typeof rt!="string"||Tt[Lt(rt)]))try{w.removeAttribute(rt)}catch{}}},vi=function(w){const F=[w];for(;F.length>0;){const z=F.pop();(T?T(z):z.nodeType)===he.element&&_y(z);const rt=y(z);if(rt)for(let ht=rt.length-1;ht>=0;--ht)F.push(rt[ht])}},By=function(w){if(!Qe)return;const F=[w];for(;F.length>0;){const z=F.pop(),J=T?T(z):z.nodeType;if(J===he.processingInstruction||J===he.comment&&Nt(bh,z.data)){try{g(z)}catch{}continue}if(J===he.element){const ht=z,St=Lt(S?S(z):z.nodeName);try{ht.hasAttribute&&ht.hasAttribute("patchsrc")&&ht.removeAttribute("patchsrc"),ht.hasAttribute&&ht.hasAttribute("for")&&St!=="label"&&St!=="output"&&ht.removeAttribute("for")}catch{}}const rt=y(z);if(rt)for(let ht=rt.length-1;ht>=0;--ht)F.push(rt[ht])}},Jl=function(w){let F=null,z=null;if(ia)w=""+w;else{const ht=ch(w,/^[\r\n\t ]+/);z=ht&&ht[0]}Bi==="application/xhtml+xml"&&Pr===Be&&(w=''+w+"");const J=v?q(w):w;if(Pr===Be)try{F=new h().parseFromString(J,Bi)}catch{}if(!F||!F.documentElement){F=P.createDocument(Pr,"template",null);try{F.documentElement.innerHTML=na?L:J}catch{}}const rt=F.body||F.documentElement;return w&&z&&rt.insertBefore(r.createTextNode(z),rt.childNodes[0]||null),Pr===Be?Y.call(F,fr?"html":"body")[0]:fr?F.documentElement:rt},th=function(w){const F=B?B(w):w.ownerDocument;return M.call(F||w,w,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Ao=function(w){return w=Fi(w,dt," "),w=Fi(w,ft," "),w=Fi(w,bt," "),w},ua=function(w){var F;w.normalize();const z=B?B(w):w.ownerDocument,J=M.call(z||w,w,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let rt=J.nextNode();for(;rt;)rt.data=Ao(rt.data),rt=J.nextNode();const ht=(F=w.querySelectorAll)===null||F===void 0?void 0:F.call(w,"template");ht&&qr(ht,St=>{Nr(St.content)&&ua(St.content)})},Eo=function(w){const F=S?S(w):null;return typeof F!="string"||Lt(F)!=="form"?!1:typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||w.attributes!==k(w)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function"||w.nodeType!==T(w)||w.childNodes!==y(w)},Nr=function(w){if(!T||typeof w!="object"||w===null)return!1;try{return T(w)===he.documentFragment}catch{return!1}},Li=function(w){if(!T||typeof w!="object"||w===null)return!1;try{return typeof T(w)=="number"}catch{return!1}};function ve(j,w,F){j.length!==0&&qr(j,z=>{z.call(t,w,F,Rr)})}const vy=function(w,F){return!!(Qe&&w.hasChildNodes()&&!Li(w.firstElementChild)&&Nt(xh,w.textContent)&&Nt(xh,w.innerHTML)||Qe&&w.namespaceURI===Be&&F==="style"&&Li(w.firstElementChild)||w.nodeType===he.processingInstruction||Qe&&w.nodeType===he.comment&&Nt(bh,w.data))},Ly=function(w,F,z){if(!_i[F]&&oh(F)&&(Et.tagNameCheck instanceof RegExp&&Nt(Et.tagNameCheck,F)||Et.tagNameCheck instanceof Function&&Et.tagNameCheck(F)))return!1;if(oa&&!_e[F]){const J=C(w),rt=y(w);if(rt&&J){const ht=rt.length;for(let St=ht-1;St>=0;--St){const Ft=w===z?u(rt[St],!0):rt[St];J.insertBefore(Ft,m(w))}}}return Je(w),!0},eh=function(w,F,z,J){return w.length===0?F:F===z||F===J?Xt(F):F},rh=function(w,F){if(ve(Z.beforeSanitizeElements,w,null),w!==F&&C(w)===null)return Bo&&vi(w),!0;if(Eo(w))return Je(w),!0;const z=Lt(S?S(w):w.nodeName);if(yt=eh(Z.uponSanitizeElement,yt,Ne,wo),ve(Z.uponSanitizeElement,w,{tagName:z,allowedTags:yt}),w!==F&&C(w)===null)return Bo&&vi(w),!0;if(vy(w,z))return Je(w),!0;if(_i[z]||!(Ze.tagCheck instanceof Function&&Ze.tagCheck(z))&&!yt[z]){const rt=Ly(w,z,F);return rt===!1&&ve(Z.afterSanitizeElements,w,null),rt}if((T?T(w):w.nodeType)===he.element&&!Sy(w)||(z==="noscript"||z==="noembed"||z==="noframes")&&Nt(x0,w.innerHTML))return Je(w),!0;if(Ke&&w.nodeType===he.text){const rt=Ao(w.textContent);w.textContent!==rt&&(Wr(t.removed,{element:w.cloneNode()}),w.textContent=rt)}return ve(Z.afterSanitizeElements,w,null),!1},ih=function(w,F,z){if(Rl[F]||Qe&&F==="patchsrc"||Qe&&F==="for"&&w!=="label"&&w!=="output"||zl&&(F==="id"||F==="name")&&(z in r||z in by))return!1;const J=Tt[F]||Ze.attributeCheck instanceof Function&&Ze.attributeCheck(F,w);if(!(ea&&Nt(et,F))){if(!(Nl&&Nt(pt,F))){if(J){if(!aa[F]){if(!Nt(Ot,Fi(z,_t,""))){if(!((F==="src"||F==="xlink:href"||F==="href")&&w!=="script"&&dh(z,"data:")===0&&Ul[w])){if(!(ql&&!Nt(wt,Fi(z,_t,"")))){if(z)return!1}}}}}else if(!(oh(w)&&(Et.tagNameCheck instanceof RegExp&&Nt(Et.tagNameCheck,w)||Et.tagNameCheck instanceof Function&&Et.tagNameCheck(w))&&(Et.attributeNameCheck instanceof RegExp&&Nt(Et.attributeNameCheck,F)||Et.attributeNameCheck instanceof Function&&Et.attributeNameCheck(F,w))||F==="is"&&Et.allowCustomizedBuiltInElements&&(Et.tagNameCheck instanceof RegExp&&Nt(Et.tagNameCheck,z)||Et.tagNameCheck instanceof Function&&Et.tagNameCheck(z))))return!1}}return!0},Fy=mt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),oh=function(w){return!Fy[Ni(w)]&&Nt(Bt,w)},Ay=function(w,F,z,J){if(v&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!z)switch(d.getAttributeType(w,F)){case"TrustedHTML":return q(J);case"TrustedScriptURL":return $(J)}return J},Ey=function(w,F,z,J){try{z?w.setAttributeNS(z,F,J):w.setAttribute(F,J),Eo(w)?Je(w):hh(t.removed)}catch{pr(F,w)}},sh=function(w){ve(Z.beforeSanitizeAttributes,w,null);const F=w.attributes;if(!F||Eo(w))return;Tt=eh(Z.uponSanitizeAttribute,Tt,ta,To);const z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Tt,forceKeepAttr:void 0};let J=F.length;const rt=Lt(w.nodeName);for(;J--;){const ht=F[J],St=ht.name,Ft=ht.namespaceURI,ie=ht.value,oe=Lt(St),pa=ie;let Jt=St==="value"?pa:e0(pa);if(z.attrName=oe,z.attrValue=Jt,z.keepAttr=!0,z.forceKeepAttr=void 0,ve(Z.uponSanitizeAttribute,w,z),Jt=z.attrValue,Hl&&(oe==="id"||oe==="name")&&dh(Jt,Yl)!==0&&(pr(St,w),Jt=Yl+Jt),Qe&&Nt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Jt)){pr(St,w);continue}if(oe==="attributename"&&ch(Jt,"href")){pr(St,w);continue}if(!z.forceKeepAttr){if(!z.keepAttr){pr(St,w);continue}if(!Wl&&Nt(b0,Jt)){pr(St,w);continue}if(Ke&&(Jt=Ao(Jt)),!ih(rt,oe,Jt)){pr(St,w);continue}Jt=Ay(rt,oe,Ft,Jt),Jt!==pa&&Ey(w,St,Ft,Jt)}}ve(Z.afterSanitizeAttributes,w,null)},Mo=function(w){let F=null;const z=th(w);for(ve(Z.beforeSanitizeShadowDOM,w,null);F=z.nextNode();)if(ve(Z.uponSanitizeShadowNode,F,null),rh(F,w),sh(F),Nr(F.content)&&Mo(F.content),(T?T(F):F.nodeType)===he.element){const rt=b(F);Nr(rt)&&(fa(rt),Mo(rt))}ve(Z.afterSanitizeShadowDOM,w,null)},fa=function(w){const F=[{node:w,shadow:null}];for(;F.length>0;){const z=F.pop();if(z.shadow){Mo(z.shadow);continue}const J=z.node,ht=(T?T(J):J.nodeType)===he.element,St=y(J);if(St)for(let Ft=St.length-1;Ft>=0;--Ft)F.push({node:St[Ft],shadow:null});if(ht){const Ft=S?S(J):null;if(typeof Ft=="string"&&Lt(Ft)==="template"){const ie=J.content;Nr(ie)&&F.push({node:ie,shadow:null})}}if(ht){const Ft=b(J);Nr(Ft)&&F.push({node:null,shadow:Ft},{node:Ft,shadow:null})}}};return t.sanitize=function(j){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F=null,z=null,J=null,rt=null;if(na=!j,na&&(j=""),typeof j!="string"&&!Li(j)&&(j=a0(j),typeof j!="string"))throw gr("dirty is not a string, aborting");if(!t.isSupported)return j;ra?(yt=wo,Tt=To):da(w),(Z.uponSanitizeElement.length>0||Z.uponSanitizeAttribute.length>0)&&(yt=Xt(yt)),Z.uponSanitizeAttribute.length>0&&(Tt=Xt(Tt)),t.removed=[];const ht=Bo&&typeof j!="string"&&Li(j);if(ht){By(j);const ie=S?S(j):j.nodeName;if(typeof ie=="string"){const oe=Lt(ie);if(!yt[oe]||_i[oe])throw Fo(j),gr("root node is forbidden and cannot be sanitized in-place")}if(Eo(j))throw Fo(j),gr("root node is clobbered and cannot be sanitized in-place");try{fa(j)}catch(oe){throw Fo(j),oe}}else if(Li(j))F=Jl(""),z=F.ownerDocument.importNode(j,!0),z.nodeType===he.element&&z.nodeName==="BODY"||z.nodeName==="HTML"?F=z:F.appendChild(z),fa(z);else{if(!Ir&&!Ke&&!fr&&j.indexOf("<")===-1)return v&&_o?q(j):j;if(F=Jl(j),!F)return Ir?null:_o?L:""}F&&ia&&Je(F.firstChild);const St=ht?j:F;try{const ie=th(St);for(;J=ie.nextNode();)rh(J,St),sh(J),Nr(J.content)&&Mo(J.content)}catch(ie){throw ht&&(Fo(j),qr(t.removed,oe=>{oe.element&&vi(oe.element)})),ie}if(ht)return qr(t.removed,ie=>{ie.element&&vi(ie.element)}),Ke&&ua(j),j;if(Ir){if(Ke&&ua(F),So)for(rt=H.call(F.ownerDocument);F.firstChild;)rt.appendChild(F.firstChild);else rt=F;return(Tt.shadowroot||Tt.shadowrootmode)&&(rt=ot.call(i,rt,!0)),rt}let Ft=fr?F.outerHTML:F.innerHTML;return fr&&yt["!doctype"]&&F.ownerDocument&&F.ownerDocument.doctype&&F.ownerDocument.doctype.name&&Nt(y0,F.ownerDocument.doctype.name)&&(Ft=" +`+Ft),Ke&&(Ft=Ao(Ft)),v&&_o?q(Ft):Ft},t.setConfig=function(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};da(j),ra=!0,wo=yt,To=Tt},t.clearConfig=function(){Rr=null,ra=!1,wo=null,To=null,v=N,L=""},t.isValidAttribute=function(j,w,F){Rr||da({});const z=Lt(j),J=Lt(w);return ih(z,J,F)},t.addHook=function(j,w){typeof w=="function"&&qt(Z,j)&&Wr(Z[j],w)},t.removeHook=function(j,w){if(qt(Z,j)){if(w!==void 0){const F=Jy(Z[j],w);return F===-1?void 0:t0(Z[j],F,1)[0]}return hh(Z[j])}},t.removeHooks=function(j){qt(Z,j)&&(Z[j]=[])},t.removeAllHooks=function(){Z=kh()},t}var pi=Vc(),Pa=p((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(o=>Pa(e,o,i)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(o=>{e.includes(o)||e.push(o)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const o=e;Object.entries(t).forEach(([s,a])=>{if(typeof a=="object"){if(a===null)return;Object.hasOwn(e,s)||Object.defineProperty(e,s,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),o[s]===void 0&&(o[s]=Array.isArray(a)?[]:{}),typeof o[s]=="object"&&(o[s]=Pa(o[s],a,{depth:r-1}))}else typeof o[s]!="object"&&(Object.hasOwn(e,s)?o[s]=a:Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),Wt=Pa,Oe="#ffffff",Ie="#f2f2f2",nt=p((e,t)=>t?x(e,{s:-40,l:10}):x(e,{s:-40,l:-10}),"mkBorder"),ti,T0=(ti=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||nt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||nt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||nt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||nt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||_(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||_(this.tertiaryColor),this.lineColor=this.lineColor||_(this.background),this.arrowheadColor=this.arrowheadColor||_(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?I(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||I(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||_(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||I(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||I(this.mainBkg,10)):(this.rowOdd=this.rowOdd||O(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||O(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ti,"Theme"),ti),S0=p(e=>{const t=new T0;return t.calculate(e),t},"getThemeVariables"),ei,_0=(ei=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=_(this.background),this.secondaryBorderColor=nt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=nt(this.tertiaryColor,this.darkMode),this.primaryTextColor=_(this.primaryColor),this.secondaryTextColor=_(this.secondaryColor),this.tertiaryTextColor=_(this.tertiaryColor),this.lineColor=_(this.background),this.textColor=_(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(_("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=ar(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=I("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=I(this.sectionBkgColor,10),this.taskBorderColor=ar(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=ar(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||O(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||I(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=O(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=O(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=O(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=_(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=x(this.primaryColor,{h:64}),this.fillType3=x(this.secondaryColor,{h:64}),this.fillType4=x(this.primaryColor,{h:-64}),this.fillType5=x(this.secondaryColor,{h:-64}),this.fillType6=x(this.primaryColor,{h:128}),this.fillType7=x(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330});for(let t=0;t{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ei,"Theme"),ei),B0=p(e=>{const t=new _0;return t.calculate(e),t},"getThemeVariables"),ri,v0=(ri=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=x(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=nt(this.primaryColor,this.darkMode),this.secondaryBorderColor=nt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=nt(this.tertiaryColor,this.darkMode),this.primaryTextColor=_(this.primaryColor),this.secondaryTextColor=_(this.secondaryColor),this.tertiaryTextColor=_(this.tertiaryColor),this.lineColor=_(this.background),this.textColor=_(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=nt(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=ar(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||I(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||I(this.tertiaryColor,40);for(let t=0;t{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ri,"Theme"),ri),L0=p(e=>{const t=new v0;return t.calculate(e),t},"getThemeVariables"),ii,F0=(ii=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=O("#cde498",10),this.primaryBorderColor=nt(this.primaryColor,this.darkMode),this.secondaryBorderColor=nt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=nt(this.tertiaryColor,this.darkMode),this.primaryTextColor=_(this.primaryColor),this.secondaryTextColor=_(this.secondaryColor),this.tertiaryTextColor=_(this.primaryColor),this.lineColor=_(this.background),this.textColor=_(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=I(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||I(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||I(this.tertiaryColor,40);for(let t=0;t{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ii,"Theme"),ii),A0=p(e=>{const t=new F0;return t.calculate(e),t},"getThemeVariables"),oi,E0=(oi=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=O(this.contrast,55),this.background="#ffffff",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=nt(this.primaryColor,this.darkMode),this.secondaryBorderColor=nt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=nt(this.tertiaryColor,this.darkMode),this.primaryTextColor=_(this.primaryColor),this.secondaryTextColor=_(this.secondaryColor),this.tertiaryTextColor=_(this.tertiaryColor),this.lineColor=_(this.background),this.textColor=_(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||O(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=O(this.contrast,55),this.border2=this.contrast,this.actorBorder=O(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(oi,"Theme"),oi),M0=p(e=>{const t=new E0;return t.calculate(e),t},"getThemeVariables"),si,$0=(si=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=nt(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||nt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||nt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||nt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||nt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||_(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||_(this.tertiaryColor),this.lineColor=this.lineColor||_(this.background),this.arrowheadColor=this.arrowheadColor||_(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?I(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||I(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||_(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=x(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||O(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||x(t,{h:30}),this.cScale4=this.cScale4||x(t,{h:60}),this.cScale5=this.cScale5||x(t,{h:90}),this.cScale6=this.cScale6||x(t,{h:120}),this.cScale7=this.cScale7||x(t,{h:150}),this.cScale8=this.cScale8||x(t,{h:210,l:150}),this.cScale9=this.cScale9||x(t,{h:270}),this.cScale10=this.cScale10||x(t,{h:300}),this.cScale11=this.cScale11||x(t,{h:330}),this.darkMode)for(let s=0;s{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(si,"Theme"),si),O0=p(e=>{const t=new $0;return t.calculate(e),t},"getThemeVariables"),ai,I0=(ai=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=_(this.background),this.secondaryBorderColor=nt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=nt(this.tertiaryColor,this.darkMode),this.primaryTextColor=_(this.primaryColor),this.secondaryTextColor=_(this.secondaryColor),this.tertiaryTextColor=_(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(_("#323D47"),10),this.border1="#ccc",this.border2=ar(255,255,255,.25),this.arrowheadColor=_(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||nt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||nt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||nt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||nt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||_(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||_(this.tertiaryColor),this.lineColor=this.lineColor||_(this.background),this.arrowheadColor=this.arrowheadColor||_(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?I(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||I(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||_(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ai,"Theme"),ai),D0=p(e=>{const t=new I0;return t.calculate(e),t},"getThemeVariables"),ni,P0=(ni=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=nt("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||nt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||nt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||nt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||nt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||_(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||_(this.tertiaryColor),this.lineColor=this.lineColor||_(this.background),this.arrowheadColor=this.arrowheadColor||_(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?I(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||I(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||_(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=x(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||O(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let s=0;s{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ni,"Theme"),ni),R0=p(e=>{const t=new P0;return t.calculate(e),t},"getThemeVariables"),li,N0=(li=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=_(this.background),this.secondaryBorderColor=nt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=nt(this.tertiaryColor,this.darkMode),this.primaryTextColor=_(this.primaryColor),this.secondaryTextColor=_(this.secondaryColor),this.tertiaryTextColor=_(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(_("#323D47"),10),this.border1="#ccc",this.border2=ar(255,255,255,.25),this.arrowheadColor=_(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||nt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||nt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||nt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||nt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||_(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||_(this.tertiaryColor),this.lineColor=this.lineColor||_(this.background),this.arrowheadColor=this.arrowheadColor||_(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?I(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||I(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||_(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(li,"Theme"),li),q0=p(e=>{const t=new N0;return t.calculate(e),t},"getThemeVariables"),hi,W0=(hi=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=nt(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||nt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||nt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||nt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||nt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||_(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||_(this.tertiaryColor),this.lineColor=this.lineColor||_(this.background),this.arrowheadColor=this.arrowheadColor||_(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?I(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||I(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||_(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=x(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||O(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let s=0;s{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(hi,"Theme"),hi),z0=p(e=>{const t=new W0;return t.calculate(e),t},"getThemeVariables"),ci,H0=(ci=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=_(this.background),this.secondaryBorderColor=nt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=nt(this.tertiaryColor,this.darkMode),this.primaryTextColor=_(this.primaryColor),this.secondaryTextColor=_(this.secondaryColor),this.tertiaryTextColor=_(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(_("#323D47"),10),this.border1="#ccc",this.border2=ar(255,255,255,.25),this.arrowheadColor=_(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||nt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||nt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||nt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||nt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||_(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||_(this.tertiaryColor),this.lineColor=this.lineColor||_(this.background),this.arrowheadColor=this.arrowheadColor||_(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?I(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||I(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||_(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let r=0;r{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ci,"Theme"),ci),Y0=p(e=>{const t=new H0;return t.calculate(e),t},"getThemeVariables"),Ye={base:{getThemeVariables:S0},dark:{getThemeVariables:B0},default:{getThemeVariables:L0},forest:{getThemeVariables:A0},neutral:{getThemeVariables:M0},neo:{getThemeVariables:O0},"neo-dark":{getThemeVariables:D0},redux:{getThemeVariables:R0},"redux-dark":{getThemeVariables:q0},"redux-color":{getThemeVariables:z0},"redux-dark-color":{getThemeVariables:Y0}},Ht={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Zc={...Ht,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Ye.default.getThemeVariables(),sequence:{...Ht.sequence,messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:p(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:p(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Ht.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Ht.c4,useWidth:void 0,personFont:p(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Ht.flowchart,inheritDir:!1},external_personFont:p(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:p(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:p(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:p(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:p(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:p(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:p(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:p(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:p(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:p(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:p(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:p(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:p(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:p(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:p(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:p(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:p(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:p(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:p(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:p(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Ht.pie,useWidth:984},xyChart:{...Ht.xyChart,useWidth:void 0},requirement:{...Ht.requirement,useWidth:void 0},packet:{...Ht.packet},eventmodeling:{...Ht.eventmodeling},treeView:{...Ht.treeView,useWidth:void 0},radar:{...Ht.radar},railroad:{...Ht.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Ht.ishikawa},sankey:{...Ht.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Ht.venn},cynefin:{...Ht.cynefin}},Kc=p((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...Kc(e[i],"")]:[...r,t+i],[]),"keyify"),U0=new Set(Kc(Zc,"")),Qc=Zc,j0={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},G0=p((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(W.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),ss=p(e=>{if(W.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>ss(t));return}for(const t of Object.keys(e)){if(W.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!U0.has(t)||e[t]==null){W.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=j0[t];i?G0(e[t],i):(W.debug("sanitizing object",t),ss(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(W.debug("sanitizing css option",t),e[t]=Jc(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}W.debug("After sanitization",e)}},"sanitizeDirective"),Jc=p(e=>{let t=0,r=0;for(const i of e){if(t!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),ae=Wt({},gi),as,Br=[],Xi=Wt({},gi),uo=p((e,t)=>{let r=Wt({},e),i={};for(const o of t)rd(o),i=Wt(i,o);if(r=Wt(r,i),i.theme&&i.theme in Ye){const o=Wt({},as),s=Wt(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in Ye&&(r.themeVariables=Ye[r.theme].getThemeVariables(s))}return Xi=r,J0(Xi),Xi},"updateCurrentConfig"),X0=p(e=>(ae=Wt({},gi),ae=Wt(ae,e),e.theme&&Ye[e.theme]&&(ae.themeVariables=Ye[e.theme].getThemeVariables(e.themeVariables)),uo(ae,Br),ae),"setSiteConfig"),V0=p(e=>{as=Wt({},e)},"saveConfigFromInitialize"),Z0=p(e=>(ae=Wt(ae,e),uo(ae,Br),ae),"updateSiteConfig"),td=p(()=>Wt({},ae),"getSiteConfig"),ed=p(e=>(uo(Xi,[e]),At()),"setConfig"),At=p(()=>Wt({},Xi),"getConfig"),rd=p(e=>{e&&(["secure",...ae.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(W.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&rd(e[t])}))},"sanitize"),K0=p(e=>{ss(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Br.push(e),uo(ae,Br)},"addDirective"),ns=p((e=ae)=>{Br=[],uo(e,Br)},"reset"),Q0={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},wh={},id=p(e=>{wh[e]||(W.warn(Q0[e]),wh[e]=!0)},"issueWarning"),J0=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&id("LAZY_LOAD_DEPRECATED")},"checkConfig"),RL=p(()=>{let e={};as&&(e=Wt(e,as));for(const t of Br)e=Wt(e,t);return e},"getUserDefinedConfig"),re=p(e=>(e.flowchart?.htmlLabels!=null&&id("FLOWCHART_HTML_LABELS_DEPRECATED"),De(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),od=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Vi=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,tC=/\s*%%.*\n/gm,di,sd=(di=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},p(di,"UnknownDiagramError"),di),vr={},Pn=p(function(e,t){e=e.replace(od,"").replace(Vi,"").replace(tC,` +`);for(const[r,{detector:i}]of Object.entries(vr))if(i(e,t))return r;throw new sd(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Ra=p((...e)=>{for(const{id:t,detector:r,loader:i}of e)ad(t,r,i)},"registerLazyLoadedDiagrams"),ad=p((e,t,r)=>{vr[e]&&W.warn(`Detector with key ${e} already exists. Overwriting.`),vr[e]={detector:t,loader:r},W.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),eC=p(e=>vr[e].loader,"getDiagramLoader"),fo=//gi,rC=p(e=>e?hd(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),iC=(()=>{let e=!1;return()=>{e||(nd(),e=!0)}})();function nd(){const e="data-temp-href-target";pi.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),pi.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}p(nd,"setupDompurifyHooks");var ld=p(e=>(iC(),pi.sanitize(e)),"removeScript"),Th=p((e,t)=>{if(re(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=ld(e):r!=="loose"&&(e=hd(e),e=e.replace(//g,">"),e=e.replace(/=/g,"="),e=nC(e))}return e},"sanitizeMore"),we=p((e,t)=>e&&(t.dompurifyConfig?e=pi.sanitize(Th(e,t),t.dompurifyConfig).toString():e=pi.sanitize(Th(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),oC=p((e,t)=>typeof e=="string"?we(e,t):e.flat().map(r=>we(r,t)),"sanitizeTextOrArray"),sC=p(e=>fo.test(e),"hasBreaks"),aC=p(e=>e.split(fo),"splitBreaks"),nC=p(e=>e.replace(/#br#/g,"
"),"placeholderToBreak"),hd=p(e=>e.replace(fo,"#br#"),"breakToPlaceholder"),lC=p(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),hC=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),cC=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),Sh=p(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i0&&i+1Math.max(0,e.split(t).length-1),"countOccurrence"),dC=p((e,t)=>{const r=Na(e,"~"),i=Na(t,"~");return r===1&&i===1},"shouldCombineSets"),uC=p(e=>{const t=Na(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let o=i.indexOf("~"),s=i.lastIndexOf("~");for(;o!==-1&&s!==-1&&o!==s;)i[o]="<",i[s]=">",o=i.indexOf("~"),s=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),_h=p(()=>window.MathMLElement!==void 0,"isMathMLSupported"),qa=/\$\$(.*?)\$\$/g,Ji=p(e=>(e.match(qa)?.length??0)>0,"hasKatex"),NL=p(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await cd(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const o={width:r.clientWidth,height:r.clientHeight};return r.remove(),o},"calculateMathMLDimensions"),fC=p(async(e,t)=>{if(!Ji(e))return e;if(!(_h()||t.legacyMathML||t.forceLegacyMathML))return e.replace(qa,"MathML is unsupported in this environment.");{const{default:r}=await ct(async()=>{const{default:o}=await import("./katex-HP8lGamR.js");return{default:o}},[]),i=t.forceLegacyMathML||!_h()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(fo).map(o=>Ji(o)?`

`:`
${o}
`).join("").replace(qa,(o,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),cd=p(async(e,t)=>we(await fC(e,t),t),"renderKatexSanitized"),po={getRows:rC,sanitizeText:we,sanitizeTextOrArray:oC,hasBreaks:sC,splitBreaks:aC,lineBreakRegex:fo,removeScript:ld,getUrl:lC,evaluate:De,getMax:hC,getMin:cC},pC=p(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),gC=p(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),dd=p(function(e,t,r,i){const o=gC(t,r,i);pC(e,o)},"configureSvgSize"),mC=p(function(e,t,r,i){const o=t.node().getBBox(),s=o.width,a=o.height;W.info(`SVG bounds: ${s}x${a}`,o);let n=0,l=0;W.info(`Graph bounds: ${n}x${l}`,e),n=s+r*2,l=a+r*2,W.info(`Calculated bounds: ${n}x${l}`),dd(t,l,n,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),Go={};function Wa(e){return[...e.cssRules].map(t=>t.cssText).join(` +`)}p(Wa,"cssStyleSheetToString");var yC=p((e,t,r,i)=>{let o="";return e in Go&&Go[e]?o=Go[e]({...r,svgId:i}):W.warn(`No theme found for ${e}`),`& { + font-family: ${r.fontFamily}; + font-size: ${r.fontSize}; + fill: ${r.textColor} + } + @keyframes edge-animation-frame { + from { + stroke-dashoffset: 0; + } + } + @keyframes dash { + to { + stroke-dashoffset: 0; + } + } + & .edge-animation-slow { + stroke-dasharray: 9,5 !important; + stroke-dashoffset: 900; + animation: dash 50s linear infinite; + stroke-linecap: round; + } + & .edge-animation-fast { + stroke-dasharray: 9,5 !important; + stroke-dashoffset: 900; + animation: dash 20s linear infinite; + stroke-linecap: round; + } + /* Classes common for multiple diagrams */ + + & .error-icon { + fill: ${r.errorBkgColor}; + } + & .error-text { + fill: ${r.errorTextColor}; + stroke: ${r.errorTextColor}; + } + + & .edge-thickness-normal { + stroke-width: ${r.strokeWidth??1}px; + } + & .edge-thickness-thick { + stroke-width: 3.5px + } + & .edge-pattern-solid { + stroke-dasharray: 0; + } + & .edge-thickness-invisible { + stroke-width: 0; + fill: none; + } + & .edge-pattern-dashed{ + stroke-dasharray: 3; + } + .edge-pattern-dotted { + stroke-dasharray: 2; + } + + & .marker { + fill: ${r.lineColor}; + stroke: ${r.lineColor}; + } + & .marker.cross { + stroke: ${r.lineColor}; + } + + & svg { + font-family: ${r.fontFamily}; + font-size: ${r.fontSize}; + } + & p { + margin: 0 + } + + ${o} + .node .neo-node { + stroke: ${r.nodeBorder}; + } + + [data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon { + stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder}; + filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"}; + } + [data-look="neo"].swimlane.cluster rect { + filter: none; + } + + + [data-look="neo"].node path { + stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder}; + stroke-width: ${r.strokeWidth??1}px; + } + + [data-look="neo"].node .outer-path { + filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"}; + } + + [data-look="neo"].node .neo-line path { + stroke: ${r.nodeBorder}; + filter: none; + } + + [data-look="neo"].node circle{ + stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder}; + filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"}; + } + + [data-look="neo"].node circle .state-start{ + fill: #000000; + } + + [data-look="neo"].icon-shape .icon { + fill: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder}; + filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"}; + } + + [data-look="neo"].icon-shape .icon-neo path { + stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder}; + filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"}; + } + + ${t} +`},"getStyles"),CC=p((e,t)=>{t!==void 0&&(Go[e]=t)},"addStylesForDiagram"),xC=yC,ud={};$y(ud,{clear:()=>bC,getAccDescription:()=>SC,getAccTitle:()=>wC,getDiagramTitle:()=>BC,setAccDescription:()=>TC,setAccTitle:()=>kC,setDiagramTitle:()=>_C});var Rn="",Nn="",qn="",Wn=p(e=>we(e,At()),"sanitizeText"),bC=p(()=>{Rn="",qn="",Nn=""},"clear"),kC=p(e=>{Rn=Wn(e).replace(/^\s+/g,"")},"setAccTitle"),wC=p(()=>Rn,"getAccTitle"),TC=p(e=>{qn=Wn(e).replace(/\n\s+/g,` +`)},"setAccDescription"),SC=p(()=>qn,"getAccDescription"),_C=p(e=>{Nn=Wn(e)},"setDiagramTitle"),BC=p(()=>Nn,"getDiagramTitle"),Bh=W,vC=Dn,Ct=At,qL=ed,WL=gi,zn=p(e=>we(e,Ct()),"sanitizeText"),LC=mC,FC=p(()=>ud,"getCommonDb"),ls={},hs=p((e,t,r)=>{ls[e]&&Bh.warn(`Diagram with id ${e} already registered. Overwriting.`),ls[e]=t,r&&ad(e,r),CC(e,t.styles),t.injectUtils?.(Bh,vC,Ct,zn,LC,FC(),()=>{})},"registerDiagram"),za=p(e=>{if(e in ls)return ls[e];throw new AC(e)},"getDiagram"),ui,AC=(ui=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},p(ui,"DiagramNotFoundError"),ui),EC={value:()=>{}};function fd(){for(var e=0,t=arguments.length,r={},i;e=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}Xo.prototype=fd.prototype={constructor:Xo,on:function(e,t){var r=this._,i=MC(e+"",r),o,s=-1,a=i.length;if(arguments.length<2){for(;++s0)for(var r=new Array(o),i=0,o,s;i=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Lh.hasOwnProperty(t)?{space:Lh[t],local:e}:e}function OC(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Ha&&t.documentElement.namespaceURI===Ha?t.createElement(e):t.createElementNS(r,e)}}function IC(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pd(e){var t=Ps(e);return(t.local?IC:OC)(t)}function DC(){}function Hn(e){return e==null?DC:function(){return this.querySelector(e)}}function PC(e){typeof e!="function"&&(e=Hn(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o=k&&(k=b+1);!(S=y[k])&&++k=0;)(a=i[o])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function lx(e){e||(e=hx);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var r=this._groups,i=r.length,o=new Array(i),s=0;st?1:e>=t?0:NaN}function cx(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function dx(){return Array.from(this)}function ux(){for(var e=this._groups,t=0,r=e.length;t1?this.each((t==null?Tx:typeof t=="function"?_x:Sx)(e,t,r??"")):mi(this.node(),e)}function mi(e,t){return e.style.getPropertyValue(t)||xd(e).getComputedStyle(e,null).getPropertyValue(t)}function vx(e){return function(){delete this[e]}}function Lx(e,t){return function(){this[e]=t}}function Fx(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function Ax(e,t){return arguments.length>1?this.each((t==null?vx:typeof t=="function"?Fx:Lx)(e,t)):this.node()[e]}function bd(e){return e.trim().split(/^|\s+/)}function Yn(e){return e.classList||new kd(e)}function kd(e){this._node=e,this._names=bd(e.getAttribute("class")||"")}kd.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function wd(e,t){for(var r=Yn(e),i=-1,o=t.length;++i=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function ob(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,o=t.length,s;r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Oo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Oo(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=fb.exec(e))?new le(t[1],t[2],t[3],1):(t=pb.exec(e))?new le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gb.exec(e))?Oo(t[1],t[2],t[3],t[4]):(t=mb.exec(e))?Oo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=yb.exec(e))?Ih(t[1],t[2]/100,t[3]/100,1):(t=Cb.exec(e))?Ih(t[1],t[2]/100,t[3]/100,t[4]):Fh.hasOwnProperty(e)?Mh(Fh[e]):e==="transparent"?new le(NaN,NaN,NaN,0):null}function Mh(e){return new le(e>>16&255,e>>8&255,e&255,1)}function Oo(e,t,r,i){return i<=0&&(e=t=r=NaN),new le(e,t,r,i)}function kb(e){return e instanceof mo||(e=ro(e)),e?(e=e.rgb(),new le(e.r,e.g,e.b,e.opacity)):new le}function Ya(e,t,r,i){return arguments.length===1?kb(e):new le(e,t,r,i??1)}function le(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}Un(le,Ya,Bd(mo,{brighter(e){return e=e==null?ds:Math.pow(ds,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?to:Math.pow(to,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new le(Sr(this.r),Sr(this.g),Sr(this.b),us(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$h,formatHex:$h,formatHex8:wb,formatRgb:Oh,toString:Oh}));function $h(){return`#${kr(this.r)}${kr(this.g)}${kr(this.b)}`}function wb(){return`#${kr(this.r)}${kr(this.g)}${kr(this.b)}${kr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Oh(){const e=us(this.opacity);return`${e===1?"rgb(":"rgba("}${Sr(this.r)}, ${Sr(this.g)}, ${Sr(this.b)}${e===1?")":`, ${e})`}`}function us(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Sr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function kr(e){return e=Sr(e),(e<16?"0":"")+e.toString(16)}function Ih(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ce(e,t,r,i)}function vd(e){if(e instanceof Ce)return new Ce(e.h,e.s,e.l,e.opacity);if(e instanceof mo||(e=ro(e)),!e)return new Ce;if(e instanceof Ce)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,o=Math.min(t,r,i),s=Math.max(t,r,i),a=NaN,n=s-o,l=(s+o)/2;return n?(t===s?a=(r-i)/n+(r0&&l<1?0:a,new Ce(a,n,l,e.opacity)}function Tb(e,t,r,i){return arguments.length===1?vd(e):new Ce(e,t,r,i??1)}function Ce(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}Un(Ce,Tb,Bd(mo,{brighter(e){return e=e==null?ds:Math.pow(ds,e),new Ce(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?to:Math.pow(to,e),new Ce(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,o=2*r-i;return new le(ba(e>=240?e-240:e+120,o,i),ba(e,o,i),ba(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Ce(Dh(this.h),Io(this.s),Io(this.l),us(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=us(this.opacity);return`${e===1?"hsl(":"hsla("}${Dh(this.h)}, ${Io(this.s)*100}%, ${Io(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Dh(e){return e=(e||0)%360,e<0?e+360:e}function Io(e){return Math.max(0,Math.min(1,e||0))}function ba(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const jn=e=>()=>e;function Ld(e,t){return function(r){return e+r*t}}function Sb(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function zL(e,t){var r=t-e;return r?Ld(e,r>180||r<-180?r-360*Math.round(r/360):r):jn(isNaN(e)?t:e)}function _b(e){return(e=+e)==1?Fd:function(t,r){return r-t?Sb(t,r,e):jn(isNaN(t)?r:t)}}function Fd(e,t){var r=t-e;return r?Ld(e,r):jn(isNaN(e)?t:e)}const Ph=(function e(t){var r=_b(t);function i(o,s){var a=r((o=Ya(o)).r,(s=Ya(s)).r),n=r(o.g,s.g),l=r(o.b,s.b),c=Fd(o.opacity,s.opacity);return function(h){return o.r=a(h),o.g=n(h),o.b=l(h),o.opacity=c(h),o+""}}return i.gamma=e,i})(1);function rr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var Ua=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ka=new RegExp(Ua.source,"g");function Bb(e){return function(){return e}}function vb(e){return function(t){return e(t)+""}}function Lb(e,t){var r=Ua.lastIndex=ka.lastIndex=0,i,o,s,a=-1,n=[],l=[];for(e=e+"",t=t+"";(i=Ua.exec(e))&&(o=ka.exec(t));)(s=o.index)>r&&(s=t.slice(r,s),n[a]?n[a]+=s:n[++a]=s),(i=i[0])===(o=o[0])?n[a]?n[a]+=o:n[++a]=o:(n[++a]=null,l.push({i:a,x:rr(i,o)})),r=ka.lastIndex;return r180?h+=360:h-c>180&&(c+=360),f.push({i:d.push(o(d)+"rotate(",null,i)-2,x:rr(c,h)})):h&&d.push(o(d)+"rotate("+h+i)}function n(c,h,d,f){c!==h?f.push({i:d.push(o(d)+"skewX(",null,i)-2,x:rr(c,h)}):h&&d.push(o(d)+"skewX("+h+i)}function l(c,h,d,f,u,g){if(c!==d||h!==f){var m=u.push(o(u)+"scale(",null,",",null,")");g.push({i:m-4,x:rr(c,d)},{i:m-2,x:rr(h,f)})}else(d!==1||f!==1)&&u.push(o(u)+"scale("+d+","+f+")")}return function(c,h){var d=[],f=[];return c=e(c),h=e(h),s(c.translateX,c.translateY,h.translateX,h.translateY,d,f),a(c.rotate,h.rotate,d,f),n(c.skewX,h.skewX,d,f),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,f),c=h=null,function(u){for(var g=-1,m=f.length,y;++g=0&&e._call.call(void 0,t),e=e._next;--yi}function Nh(){Lr=(ps=io.now())+Rs,yi=qi=0;try{Ob()}finally{yi=0,Db(),Lr=0}}function Ib(){var e=io.now(),t=e-ps;t>Md&&(Rs-=t,ps=e)}function Db(){for(var e,t=fs,r,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:fs=r);Wi=e,Ga(i)}function Ga(e){if(!yi){qi&&(qi=clearTimeout(qi));var t=e-Lr;t>24?(e<1/0&&(qi=setTimeout(Nh,e-io.now()-Rs)),Ei&&(Ei=clearInterval(Ei))):(Ei||(ps=io.now(),Ei=setInterval(Ib,Md)),yi=1,$d(Nh))}}function qh(e,t,r){var i=new gs;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,r),i}var Pb=fd("start","end","cancel","interrupt"),Rb=[],Id=0,Wh=1,Xa=2,Vo=3,zh=4,Va=5,Zo=6;function Ns(e,t,r,i,o,s){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;Nb(e,r,{name:t,index:i,group:o,on:Pb,tween:Rb,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Id})}function Xn(e,t){var r=Se(e,t);if(r.state>Id)throw new Error("too late; already scheduled");return r}function Pe(e,t){var r=Se(e,t);if(r.state>Vo)throw new Error("too late; already running");return r}function Se(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Nb(e,t,r){var i=e.__transition,o;i[t]=r,r.timer=Od(s,0,r.time);function s(c){r.state=Wh,r.timer.restart(a,r.delay,r.time),r.delay<=c&&a(c-r.delay)}function a(c){var h,d,f,u;if(r.state!==Wh)return l();for(h in i)if(u=i[h],u.name===r.name){if(u.state===Vo)return qh(a);u.state===zh?(u.state=Zo,u.timer.stop(),u.on.call("interrupt",e,e.__data__,u.index,u.group),delete i[h]):+hXa&&i.state=0&&(t=t.slice(0,r)),!t||t==="start"})}function mk(e,t,r){var i,o,s=gk(t)?Xn:Pe;return function(){var a=s(this,e),n=a.on;n!==i&&(o=(i=n).copy()).on(t,r),a.on=o}}function yk(e,t){var r=this._id;return arguments.length<2?Se(this.node(),r).on.on(e):this.each(mk(r,e,t))}function Ck(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function xk(){return this.on("end.remove",Ck(this._id))}function bk(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Hn(e));for(var i=this._groups,o=i.length,s=new Array(o),a=0;a=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Nd;const r=10**t;return function(i){this._+=i[0];for(let o=1,s=i.length;oCr)if(!(Math.abs(d*l-c*h)>Cr)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let u=i-a,g=o-n,m=l*l+c*c,y=u*u+g*g,C=Math.sqrt(m),b=Math.sqrt(f),k=s*Math.tan((Za-Math.acos((m+f-y)/(2*C*b)))/2),T=k/b,S=k/C;Math.abs(T-1)>Cr&&this._append`L${t+T*h},${r+T*d}`,this._append`A${s},${s},0,0,${+(d*u>h*g)},${this._x1=t+S*l},${this._y1=r+S*c}`}}arc(t,r,i,o,s,a){if(t=+t,r=+r,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(o),l=i*Math.sin(o),c=t+n,h=r+l,d=1^a,f=a?o-s:s-o;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>Cr||Math.abs(this._y1-h)>Cr)&&this._append`L${c},${h}`,i&&(f<0&&(f=f%Ka+Ka),f>Uk?this._append`A${i},${i},0,1,${d},${t-n},${r-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=h}`:f>Cr&&this._append`A${i},${i},0,${+(f>=Za)},${d},${this._x1=t+i*Math.cos(s)},${this._y1=r+i*Math.sin(s)}`)}rect(t,r,i,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}}function zr(e){return function(){return e}}const HL=Math.abs,YL=Math.atan2,UL=Math.cos,jL=Math.max,GL=Math.min,XL=Math.sin,VL=Math.sqrt,Hh=1e-12,Zn=Math.PI,Yh=Zn/2,ZL=2*Zn;function KL(e){return e>1?0:e<-1?Zn:Math.acos(e)}function QL(e){return e>=1?Yh:e<=-1?-Yh:Math.asin(e)}function Xk(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new Gk(t)}function Vk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qd(e){this._context=e}qd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Zi(e){return new qd(e)}function Zk(e){return e[0]}function Kk(e){return e[1]}function Qk(e,t){var r=zr(!0),i=null,o=Zi,s=null,a=Xk(n);e=typeof e=="function"?e:e===void 0?Zk:zr(e),t=typeof t=="function"?t:t===void 0?Kk:zr(t);function n(l){var c,h=(l=Vk(l)).length,d,f=!1,u;for(i==null&&(s=o(u=a())),c=0;c<=h;++c)!(c0)for(var i=e[0],o=t[0],s=e[r]-i,a=t[r]-o,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*s),this._beta*t[n]+(1-this._beta)*(o+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const e1=(function e(t){function r(i){return t===1?new qs(i):new jd(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function ys(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Kn(e,t){this._context=e,this._k=(1-t)/6}Kn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ys(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:ys(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Gd=(function e(t){function r(i){return new Kn(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Qn(e,t){this._context=e,this._k=(1-t)/6}Qn.prototype={areaStart:lr,areaEnd:lr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ys(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const r1=(function e(t){function r(i){return new Qn(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Jn(e,t){this._context=e,this._k=(1-t)/6}Jn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ys(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const i1=(function e(t){function r(i){return new Jn(i,t)}return r.tension=function(i){return e(+i)},r})(0);function tl(e,t,r){var i=e._x1,o=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Hh){var n=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,o=(o*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Hh){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,o,s,a,e._x2,e._y2)}function Xd(e,t){this._context=e,this._alpha=t}Xd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:tl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Vd=(function e(t){function r(i){return t?new Xd(i,t):new Kn(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Zd(e,t){this._context=e,this._alpha=t}Zd.prototype={areaStart:lr,areaEnd:lr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:tl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const o1=(function e(t){function r(i){return t?new Zd(i,t):new Qn(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Kd(e,t){this._context=e,this._alpha=t}Kd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:tl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const s1=(function e(t){function r(i){return t?new Kd(i,t):new Jn(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Qd(e){this._context=e}Qd.prototype={areaStart:lr,areaEnd:lr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function a1(e){return new Qd(e)}function Uh(e){return e<0?-1:1}function jh(e,t,r){var i=e._x1-e._x0,o=t-e._x1,s=(e._y1-e._y0)/(i||o<0&&-0),a=(r-e._y1)/(o||i<0&&-0),n=(s*o+a*i)/(i+o);return(Uh(s)+Uh(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(n))||0}function Gh(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function wa(e,t,r){var i=e._x0,o=e._y0,s=e._x1,a=e._y1,n=(s-i)/3;e._context.bezierCurveTo(i+n,o+n*t,s-n,a-n*r,s,a)}function Cs(e){this._context=e}Cs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:wa(this,this._t0,Gh(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,wa(this,Gh(this,r=jh(this,e,t)),r);break;default:wa(this,this._t0,r=jh(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Jd(e){this._context=new tu(e)}(Jd.prototype=Object.create(Cs.prototype)).point=function(e,t){Cs.prototype.point.call(this,t,e)};function tu(e){this._context=e}tu.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,o,s){this._context.bezierCurveTo(t,e,i,r,s,o)}};function eu(e){return new Cs(e)}function ru(e){return new Jd(e)}function iu(e){this._context=e}iu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var i=Xh(e),o=Xh(t),s=0,a=1;a=0;--t)o[t]=(a[t]-o[t+1])/s[t];for(s[r-1]=(e[r]+o[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function su(e){return new Ws(e,.5)}function au(e){return new Ws(e,0)}function nu(e){return new Ws(e,1)}function zi(e,t,r){this.k=e,this.x=t,this.y=r}zi.prototype={constructor:zi,scale:function(e){return e===1?this:new zi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new zi(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};zi.prototype;var n1=p(e=>{const{securityLevel:t}=Ct();let r=ut("body");if(t==="sandbox"){const s=ut(`#i${e}`).node()?.contentDocument??document;r=ut(s.body)}return r.select(`#${e}`)},"selectSvgElement");function el(e){return typeof e>"u"||e===null}p(el,"isNothing");function lu(e){return typeof e=="object"&&e!==null}p(lu,"isObject");function hu(e){return Array.isArray(e)?e:el(e)?[]:[e]}p(hu,"toArray");function cu(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;rn&&(s=" ... ",t=i-n+s.length),r-i>n&&(a=" ...",r=i+n-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}p(Ko,"getLine");function Qo(e,t){return Rt.repeat(" ",t-e.length)+e}p(Qo,"padStart");function fu(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var n="",l,c,h=Math.min(e.line+t.linesAfter,o.length).toString().length,d=t.maxLength-(t.indent+h+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)c=Ko(e.buffer,i[a-l],o[a-l],e.position-(i[a]-i[a-l]),d),n=Rt.repeat(" ",t.indent)+Qo((e.line-l+1).toString(),h)+" | "+c.str+` +`+n;for(c=Ko(e.buffer,i[a],o[a],e.position,d),n+=Rt.repeat(" ",t.indent)+Qo((e.line+1).toString(),h)+" | "+c.str+` +`,n+=Rt.repeat("-",t.indent+h+3+c.pos)+`^ +`,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)c=Ko(e.buffer,i[a+l],o[a+l],e.position-(i[a]-i[a+l]),d),n+=Rt.repeat(" ",t.indent)+Qo((e.line+l+1).toString(),h)+" | "+c.str+` +`;return n.replace(/\n$/,"")}p(fu,"makeSnippet");var p1=fu,g1=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],m1=["scalar","sequence","mapping"];function pu(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}p(pu,"compileStyleAliases");function gu(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(g1.indexOf(r)===-1)throw new ne('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=pu(t.styleAliases||null),m1.indexOf(this.kind)===-1)throw new ne('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}p(gu,"Type$1");var Kt=gu;function Ja(e,t){var r=[];return e[t].forEach(function(i){var o=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(o=a)}),r[o]=i}),r}p(Ja,"compileList");function mu(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(p(i,"collectType"),t=0,r=arguments.length;t=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:p(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:p(function(e){return e.toString(10)},"decimal"),hexadecimal:p(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),_1=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Fu(e){return!(e===null||!_1.test(e)||e[e.length-1]==="_")}p(Fu,"resolveYamlFloat");function Au(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}p(Au,"constructYamlFloat");var B1=/^[-+]?[0-9]+e/;function Eu(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Rt.isNegativeZero(e))return"-0.0";return r=e.toString(10),B1.test(r)?r.replace("e",".e"):r}p(Eu,"representYamlFloat");function Mu(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Rt.isNegativeZero(e))}p(Mu,"isFloat");var v1=new Kt("tag:yaml.org,2002:float",{kind:"scalar",resolve:Fu,construct:Au,predicate:Mu,represent:Eu,defaultStyle:"lowercase"}),$u=k1.extend({implicit:[w1,T1,S1,v1]}),L1=$u,Ou=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Iu=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Du(e){return e===null?!1:Ou.exec(e)!==null||Iu.exec(e)!==null}p(Du,"resolveYamlTimestamp");function Pu(e){var t,r,i,o,s,a,n,l=0,c=null,h,d,f;if(t=Ou.exec(e),t===null&&(t=Iu.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,i,o));if(s=+t[4],a=+t[5],n=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(h=+t[10],d=+(t[11]||0),c=(h*60+d)*6e4,t[9]==="-"&&(c=-c)),f=new Date(Date.UTC(r,i,o,s,a,n,l)),c&&f.setTime(f.getTime()-c),f}p(Pu,"constructYamlTimestamp");function Ru(e){return e.toISOString()}p(Ru,"representYamlTimestamp");var F1=new Kt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Du,construct:Pu,instanceOf:Date,represent:Ru});function Nu(e){return e==="<<"||e===null}p(Nu,"resolveYamlMerge");var A1=new Kt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Nu}),il=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function qu(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=il;for(r=0;r64)){if(t<0)return!1;i+=6}return i%8===0}p(qu,"resolveYamlBinary");function Wu(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=il,a=0,n=[];for(t=0;t>16&255),n.push(a>>8&255),n.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=o%4*6,r===0?(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)):r===18?(n.push(a>>10&255),n.push(a>>2&255)):r===12&&n.push(a>>4&255),new Uint8Array(n)}p(Wu,"constructYamlBinary");function zu(e){var t="",r=0,i,o,s=e.length,a=il;for(i=0;i>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return o=s%3,o===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):o===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):o===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}p(zu,"representYamlBinary");function Hu(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}p(Hu,"isBinary");var E1=new Kt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:qu,construct:Wu,predicate:Hu,represent:zu}),M1=Object.prototype.hasOwnProperty,$1=Object.prototype.toString;function Yu(e){if(e===null)return!0;var t=[],r,i,o,s,a,n=e;for(r=0,i=n.length;r>10)+55296,(e-65536&1023)+56320)}p(sf,"charFromCodepoint");function ol(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}p(ol,"setProperty");var af=new Array(256),nf=new Array(256);for(mr=0;mr<256;mr++)af[mr]=en(mr)?1:0,nf[mr]=en(mr);var mr;function lf(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Zu,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}p(lf,"State$1");function sl(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=p1(r),new ne(t,r)}p(sl,"generateError");function tt(e,t){throw sl(e,t)}p(tt,"throwError");function oo(e,t){e.onWarning&&e.onWarning.call(null,sl(e,t))}p(oo,"throwWarning");var Zh={YAML:p(function(t,r,i){var o,s,a;t.version!==null&&tt(t,"duplication of %YAML directive"),i.length!==1&&tt(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),o===null&&tt(t,"ill-formed argument of the YAML directive"),s=parseInt(o[1],10),a=parseInt(o[2],10),s!==1&&tt(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&oo(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:p(function(t,r,i){var o,s;i.length!==2&&tt(t,"TAG directive accepts exactly two arguments"),o=i[0],s=i[1],Ju.test(o)||tt(t,"ill-formed tag handle (first argument) of the TAG directive"),hr.call(t.tagMap,o)&&tt(t,'there is a previously declared suffix for "'+o+'" tag handle'),tf.test(s)||tt(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{tt(t,"tag prefix is malformed: "+s)}t.tagMap[o]=s},"handleTagDirective")};function Ue(e,t,r,i){var o,s,a,n;if(t1&&(e.result+=Rt.repeat(` +`,t-1))}p(Hs,"writeFoldedLines");function hf(e,t,r){var i,o,s,a,n,l,c,h,d=e.kind,f=e.result,u;if(u=e.input.charCodeAt(e.position),te(u)||wr(u)||u===35||u===38||u===42||u===33||u===124||u===62||u===39||u===34||u===37||u===64||u===96||(u===63||u===45)&&(o=e.input.charCodeAt(e.position+1),te(o)||r&&wr(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,n=!1;u!==0;){if(u===58){if(o=e.input.charCodeAt(e.position+1),te(o)||r&&wr(o))break}else if(u===35){if(i=e.input.charCodeAt(e.position-1),te(i))break}else{if(e.position===e.lineStart&&yo(e)||r&&wr(u))break;if(be(u))if(l=e.line,c=e.lineStart,h=e.lineIndent,$t(e,!1,-1),e.lineIndent>=t){n=!0,u=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=c,e.lineIndent=h;break}}n&&(Ue(e,s,a,!1),Hs(e,e.line-l),s=a=e.position,n=!1),nr(u)||(a=e.position+1),u=e.input.charCodeAt(++e.position)}return Ue(e,s,a,!1),e.result?!0:(e.kind=d,e.result=f,!1)}p(hf,"readPlainScalar");function cf(e,t){var r,i,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Ue(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,o=e.position;else return!0;else be(r)?(Ue(e,i,o,!0),Hs(e,$t(e,!1,t)),i=o=e.position):e.position===e.lineStart&&yo(e)?tt(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);tt(e,"unexpected end of the stream within a single quoted scalar")}p(cf,"readSingleQuotedScalar");function df(e,t){var r,i,o,s,a,n;if(n=e.input.charCodeAt(e.position),n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return Ue(e,r,e.position,!0),e.position++,!0;if(n===92){if(Ue(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),be(n))$t(e,!1,t);else if(n<256&&af[n])e.result+=nf[n],e.position++;else if((a=rf(n))>0){for(o=a,s=0;o>0;o--)n=e.input.charCodeAt(++e.position),(a=ef(n))>=0?s=(s<<4)+a:tt(e,"expected hexadecimal character");e.result+=sf(s),e.position++}else tt(e,"unknown escape sequence");r=i=e.position}else be(n)?(Ue(e,r,i,!0),Hs(e,$t(e,!1,t)),r=i=e.position):e.position===e.lineStart&&yo(e)?tt(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}tt(e,"unexpected end of the stream within a double quoted scalar")}p(df,"readDoubleQuotedScalar");function uf(e,t){var r=!0,i,o,s,a=e.tag,n,l=e.anchor,c,h,d,f,u,g=Object.create(null),m,y,C,b;if(b=e.input.charCodeAt(e.position),b===91)h=93,u=!1,n=[];else if(b===123)h=125,u=!0,n={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=n),b=e.input.charCodeAt(++e.position);b!==0;){if($t(e,!0,t),b=e.input.charCodeAt(e.position),b===h)return e.position++,e.tag=a,e.anchor=l,e.kind=u?"mapping":"sequence",e.result=n,!0;r?b===44&&tt(e,"expected the node content, but found ','"):tt(e,"missed comma between flow collection entries"),y=m=C=null,d=f=!1,b===63&&(c=e.input.charCodeAt(e.position+1),te(c)&&(d=f=!0,e.position++,$t(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,Fr(e,t,bs,!1,!0),y=e.tag,m=e.result,$t(e,!0,t),b=e.input.charCodeAt(e.position),(f||e.line===i)&&b===58&&(d=!0,b=e.input.charCodeAt(++e.position),$t(e,!0,t),Fr(e,t,bs,!1,!0),C=e.result),u?Tr(e,n,g,y,m,C,i,o,s):d?n.push(Tr(e,null,g,y,m,C,i,o,s)):n.push(m),$t(e,!0,t),b=e.input.charCodeAt(e.position),b===44?(r=!0,b=e.input.charCodeAt(++e.position)):r=!1}tt(e,"unexpected end of the stream within a flow collection")}p(uf,"readFlowCollection");function ff(e,t){var r,i,o=Ta,s=!1,a=!1,n=t,l=0,c=!1,h,d;if(d=e.input.charCodeAt(e.position),d===124)i=!1;else if(d===62)i=!0;else return!1;for(e.kind="scalar",e.result="";d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)Ta===o?o=d===43?Vh:N1:tt(e,"repeat of a chomping mode identifier");else if((h=of(d))>=0)h===0?tt(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?tt(e,"repeat of an indentation width identifier"):(n=t+h-1,a=!0);else break;if(nr(d)){do d=e.input.charCodeAt(++e.position);while(nr(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!be(d)&&d!==0)}for(;d!==0;){for(zs(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!a||e.lineIndentn&&(n=e.lineIndent),be(d)){l++;continue}if(e.lineIndentt)&&l!==0)tt(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(y&&(a=e.line,n=e.lineStart,l=e.position),Fr(e,t,ks,!0,o)&&(y?g=e.result:m=e.result),y||(Tr(e,d,f,u,g,m,a,n,l),u=g=m=null),$t(e,!0,-1),b=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&b!==0)tt(e,"bad indentation of a mapping entry");else if(e.lineIndentt?l=1:e.lineIndent===t?l=0:e.lineIndentt?l=1:e.lineIndent===t?l=0:e.lineIndent tag; it should be "scalar", not "'+e.kind+'"'),d=0,f=e.implicitTypes.length;d"),e.result!==null&&g.kind!==e.kind&&tt(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):tt(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||h}p(Fr,"composeNode");function Cf(e){var t=e.position,r,i,o,s=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&($t(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!te(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&tt(e,"directive name must not be less than one character in length");a!==0;){for(;nr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!be(a));break}if(be(a))break;for(r=e.position;a!==0&&!te(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&zs(e),hr.call(Zh,i)?Zh[i](e,i,o):oo(e,'unknown document directive "'+i+'"')}if($t(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,$t(e,!0,-1)):s&&tt(e,"directives end mark is expected"),Fr(e,e.lineIndent-1,ks,!1,!0),$t(e,!0,-1),e.checkLineBreaks&&W1.test(e.input.slice(t,e.position))&&oo(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&yo(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,$t(e,!0,-1));return}if(e.position"u"&&(r=t,t=null);var i=al(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o=55296&&r<=56319&&t+1=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}p(Vr,"codePointAt");function ll(e){var t=/^\n* /;return t.test(e)}p(ll,"needIndentIndicator");var $f=1,hn=2,Of=3,If=4,jr=5;function Df(e,t,r,i,o,s,a,n){var l,c=0,h=null,d=!1,f=!1,u=i!==-1,g=-1,m=Ef(Vr(e,0))&&Mf(Vr(e,e.length-1));if(t||a)for(l=0;l=65536?l+=2:l++){if(c=Vr(e,l),!xi(c))return jr;m=m&&ln(c,h,n),h=c}else{for(l=0;l=65536?l+=2:l++){if(c=Vr(e,l),c===so)d=!0,u&&(f=f||l-g-1>i&&e[g+1]!==" ",g=l);else if(!xi(c))return jr;m=m&&ln(c,h,n),h=c}f=f||u&&l-g-1>i&&e[g+1]!==" "}return!d&&!f?m&&!a&&!o(e)?$f:s===ao?jr:hn:r>9&&ll(e)?jr:a?s===ao?jr:hn:f?If:Of}p(Df,"chooseScalarStyle");function Pf(e,t,r,i,o){e.dump=(function(){if(t.length===0)return e.quotingType===ao?'""':"''";if(!e.noCompatMode&&(l2.indexOf(t)!==-1||h2.test(t)))return e.quotingType===ao?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),n=i||e.flowLevel>-1&&r>=e.flowLevel;function l(c){return Af(e,c)}switch(p(l,"testAmbiguity"),Df(t,n,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,o)){case $f:return t;case hn:return"'"+t.replace(/'/g,"''")+"'";case Of:return"|"+cn(t,e.indent)+dn(an(t,s));case If:return">"+cn(t,e.indent)+dn(an(Rf(t,a),s));case jr:return'"'+Nf(t)+'"';default:throw new ne("impossible error: invalid scalar style")}})()}p(Pf,"writeScalar");function cn(e,t){var r=ll(e)?String(t):"",i=e[e.length-1]===` +`,o=i&&(e[e.length-2]===` +`||e===` +`),s=o?"+":i?"":"-";return r+s+` +`}p(cn,"blockHeader");function dn(e){return e[e.length-1]===` +`?e.slice(0,-1):e}p(dn,"dropEndingNewline");function Rf(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(` +`);return c=c!==-1?c:e.length,r.lastIndex=c,un(e.slice(0,c),t)})(),o=e[0]===` +`||e[0]===" ",s,a;a=r.exec(e);){var n=a[1],l=a[2];s=l[0]===" ",i+=n+(!o&&!s&&l!==""?` +`:"")+un(l,t),o=s}return i}p(Rf,"foldString");function un(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,o=0,s,a=0,n=0,l="";i=r.exec(e);)n=i.index,n-o>t&&(s=a>o?a:n,l+=` +`+e.slice(o,s),o=s+1),a=n;return l+=` +`,e.length-o>t&&a>o?l+=e.slice(o,a)+` +`+e.slice(a+1):l+=e.slice(o),l.slice(1)}p(un,"foldLine");function Nf(e){for(var t="",r=0,i,o=0;o=65536?o+=2:o++)r=Vr(e,o),i=Qt[r],!i&&xi(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||Lf(r);return t}p(Nf,"escapeString");function qf(e,t,r){var i="",o=e.tag,s,a,n;for(s=0,a=r.length;s"u"&&$e(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}p(qf,"writeFlowSequence");function fn(e,t,r,i){var o="",s=e.tag,a,n,l;for(a=0,n=r.length;a"u"&&$e(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=Ts(e,t)),e.dump&&so===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}p(fn,"writeBlockSequence");function Wf(e,t,r){var i="",o=e.tag,s=Object.keys(r),a,n,l,c,h;for(a=0,n=s.length;a1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),$e(e,t,c,!1,!1)&&(h+=e.dump,i+=h));e.tag=o,e.dump="{"+i+"}"}p(Wf,"writeFlowMapping");function zf(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),n,l,c,h,d,f;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new ne("sortKeys must be a boolean or a function");for(n=0,l=a.length;n1024,d&&(e.dump&&so===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,d&&(f+=Ts(e,t)),$e(e,t+1,h,!0,d)&&(e.dump&&so===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,o+=f));e.tag=s,e.dump=o||"{}"}p(zf,"writeBlockMapping");function pn(e,t,r){var i,o,s,a,n,l;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}p(pn,"detectType");function $e(e,t,r,i,o,s,a){e.tag=null,e.dump=r,pn(e,r,!1)||pn(e,r,!0);var n=bf.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var h=n==="[object Object]"||n==="[object Array]",d,f;if(h&&(d=e.duplicates.indexOf(r),f=d!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(o=!1),f&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(h&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),n==="[object Object]")i&&Object.keys(e.dump).length!==0?(zf(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(Wf(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?fn(e,t-1,e.dump,o):fn(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(qf(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object String]")e.tag!=="?"&&Pf(e,e.dump,t,s,l);else{if(n==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new ne("unacceptable kind of an object to dump "+n)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}p($e,"writeNode");function Hf(e,t){var r=[],i=[],o,s;for(Ss(e,r,i),o=0,s=i.length;o{const{handDrawnSeed:t}=Ct();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),wi=p(e=>{const t=m2([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),m2=p(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),Yf=p(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),K=p(e=>{const{stylesArray:t}=wi(e),r=[],i=[],o=[],s=[];return t.forEach(a=>{const n=a[0];Yf(n)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),n.includes("stroke")&&o.push(a.join(":")+" !important"),n==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:s}},"styles2String"),X=p((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=Ct(),{nodeBorder:o,mainBkg:s}=r,{stylesMap:a}=wi(e);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||o,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:y2(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),y2=p(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const o=isNaN(t[0])?0:t[0];return[o,o]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray"),Po={},Pt={},Kh;function C2(){return Kh||(Kh=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.BLANK_URL=Pt.relativeFirstCharacters=Pt.whitespaceEscapeCharsRegex=Pt.urlSchemeRegex=Pt.ctrlCharactersRegex=Pt.htmlCtrlEntityRegex=Pt.htmlEntitiesRegex=Pt.invalidProtocolRegex=void 0,Pt.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Pt.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Pt.htmlCtrlEntityRegex=/&(newline|tab);/gi,Pt.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Pt.urlSchemeRegex=/^.+(:|:)/gim,Pt.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Pt.relativeFirstCharacters=[".","/"],Pt.BLANK_URL="about:blank"),Pt}var Qh;function x2(){if(Qh)return Po;Qh=1,Object.defineProperty(Po,"__esModule",{value:!0}),Po.sanitizeUrl=s;var e=C2();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var n=a.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(a){return URL.canParse(a)}function o(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return e.BLANK_URL;var n,l=o(a.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=o(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),d=h.match(e.urlSchemeRegex);if(!d)return c;var f=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(f))return e.BLANK_URL;var u=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return u;if(f==="http:"||f==="https:"){if(!i(u))return e.BLANK_URL;var g=new URL(u);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return u}return Po}var b2=x2();function Sa(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function k2(){}function Uf(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function hl(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const w2="[object RegExp]",jf="[object String]",Gf="[object Number]",Xf="[object Boolean]",Vf="[object Arguments]",T2="[object Symbol]",S2="[object Date]",_2="[object Map]",B2="[object Set]",v2="[object Array]",L2="[object ArrayBuffer]",F2="[object Object]",A2="[object DataView]",E2="[object Uint8Array]",M2="[object Uint8ClampedArray]",$2="[object Uint16Array]",O2="[object Uint32Array]",I2="[object Int8Array]",D2="[object Int16Array]",P2="[object Int32Array]",R2="[object Float32Array]",N2="[object Float64Array]",Jh=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function cl(e){return typeof Jh.Buffer<"u"&&Jh.Buffer.isBuffer(e)}function q2(e){return Number.isSafeInteger(e)&&e>=0}function Zf(e){return e!=null&&typeof e!="function"&&q2(e.length)}function W2(e){return e==="__proto__"}function dl(e){return e==null||typeof e!="object"&&typeof e!="function"}function ul(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function z2(e,t){return Zr(e,void 0,e,new Map,t)}function Zr(e,t,r,i=new Map,o=void 0){const s=o?.(e,t,r,i);if(s!==void 0)return s;if(dl(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){const a=new Array(e.length);i.set(e,a);for(let n=0;n{if(typeof e=="object"){if(hl(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return s.set(e,a),ge(a,e,o,s),a}switch(Object.prototype.toString.call(e)){case Gf:case jf:case Xf:{const a=new e.constructor(e?.valueOf());return ge(a,e),a}case Vf:{const a={};return ge(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function tc(e){return Y2(e)}function gn(e){return e!==null&&typeof e=="object"&&hl(e)==="[object Arguments]"}function mn(e){return typeof e=="object"&&e!==null}function U2(e){return mn(e)&&Zf(e)}function Jo(e){return ul(e)}function j2(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function Co(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const o=t?t.apply(this,i):i[0],s=r.cache;if(s.has(o))return s.get(o);const a=e.apply(this,i);return r.cache=s.set(o,a)||s,a};return r.cache=new(Co.Cache||Map),r}Co.Cache=Map;function G2(e){if(dl(e))return e;if(Array.isArray(e)||ul(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);const r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){const i=new r(e);return i.lastIndex=e.lastIndex,i}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let i;return e instanceof AggregateError?i=new r(e.errors,e.message,{cause:e.cause}):i=new r(e.message,{cause:e.cause}),i.stack=e.stack,Object.assign(i,e),i}return typeof File<"u"&&e instanceof File?new r([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function X2(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let o=e;for(let s=0;sr!=="constructor").length===0:t.length===0}return!0}var Z2="​",K2={curveBasis:Qa,curveBasisClosed:Jk,curveBasisOpen:t1,curveBumpX:zd,curveBumpY:Hd,curveBundle:e1,curveCardinalClosed:r1,curveCardinalOpen:i1,curveCardinal:Gd,curveCatmullRomClosed:o1,curveCatmullRomOpen:s1,curveCatmullRom:Vd,curveLinear:Zi,curveLinearClosed:a1,curveMonotoneX:eu,curveMonotoneY:ru,curveNatural:ou,curveStep:su,curveStepAfter:nu,curveStepBefore:au},Q2=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,J2=p(function(e,t){const r=Kf(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(n=>n.args);ss(a),i=Wt(i,[...a])}else i=r.args;if(!i)return;let o=Pn(e,t);const s="config";return i[s]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[s],delete i[s]),i},"detectInit"),Kf=p(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${Q2.source})(?=[}][%]{2}).* +`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),W.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const o=[];for(;(i=Vi.exec(e))!==null;)if(i.index===Vi.lastIndex&&Vi.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const s=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:s,args:a})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(r){return W.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),tw=p(function(e){return e.replace(Vi,"")},"removeDirectives"),ew=p(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function fl(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return K2[r]??t}p(fl,"interpolateToCurve");function Qf(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?b2.sanitizeUrl(r):r}p(Qf,"formatUrl");var rw=p((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let s=window;for(let a=0;a{r+=pl(o,t),t=o});const i=r/2;return gl(e,i)}p(Jf,"traverseEdge");function tp(e){return e.length===1?e[0]:Jf(e)}p(tp,"calcLabelPosition");var rc=p((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),gl=p((e,t)=>{let r,i=t;for(const o of e){if(r){const s=pl(o,r);if(s===0)return r;if(s=1)return{x:o.x,y:o.y};if(a>0&&a<1)return{x:rc((1-a)*r.x+a*o.x,5),y:rc((1-a)*r.y+a*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),iw=p((e,t,r)=>{W.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=gl(t,25),s=e?10:5,a=Math.atan2(t[0].y-o.y,t[0].x-o.x),n={x:0,y:0};return n.x=Math.sin(a)*s+(t[0].x+o.x)/2,n.y=-Math.cos(a)*s+(t[0].y+o.y)/2,n},"calcCardinalityPosition");function ep(e,t,r){const i=structuredClone(r);W.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,s=gl(i,o),a=10+e*.5,n=Math.atan2(i[0].y-s.y,i[0].x-s.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n+Math.PI)*a+(i[0].y+s.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(i[0].y+s.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2-5):(l.x=Math.sin(n)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2),l}p(ep,"calcTerminalLabelPosition");function rp(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}p(rp,"getStylesFromArray");var ic=0,ow=p(()=>(ic++,"id-"+Math.random().toString(36).substr(2,12)+"-"+ic),"generateId");function ip(e){let t="";const r="0123456789abcdef",i=r.length;for(let o=0;oip(e.length),"random"),aw=p(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),nw=p(function(e,t){const r=t.text.replace(po.lineBreakRegex," "),[,i]=Ys(t.fontSize),o=e.append("text");o.attr("x",t.x),o.attr("y",t.y),o.style("text-anchor",t.anchor),o.style("font-family",t.fontFamily),o.style("font-size",i),o.style("font-weight",t.fontWeight),o.attr("fill",t.fill),t.class!==void 0&&o.attr("class",t.class);const s=o.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),o},"drawSimpleText"),lw=Co((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),po.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let s="";return i.forEach((a,n)=>{const l=Ge(`${a} `,r),c=Ge(s,r);if(l>t){const{hyphenatedStrings:f,remainingWord:u}=hw(a,t,"-",r);o.push(s,...f),s=u}else c+l>=t?(o.push(s),s=a):s=[s,a].filter(Boolean).join(" ");n+1===i.length&&o.push(s)}),o.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),hw=Co((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],s=[];let a="";return o.forEach((n,l)=>{const c=`${a}${n}`;if(Ge(c,i)>=t){const d=l+1,f=o.length===d,u=`${c}${r}`;s.push(f?c:u),a=""}else a=c}),{hyphenatedStrings:s,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function op(e,t){return ml(e,t).height}p(op,"calculateTextHeight");function Ge(e,t){return ml(e,t).width}p(Ge,"calculateTextWidth");var ml=Co((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,s]=Ys(r),a=["sans-serif",i],n=e.split(po.lineBreakRegex),l=[],c=ut("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const f of a){let u=0;const g={width:0,height:0,lineHeight:0};for(const m of n){const y=aw();y.text=m||Z2;const C=nw(h,y).style("font-size",s).style("font-weight",o).style("font-family",f),b=(C._groups||C)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),u=Math.round(b.height),g.height+=u,g.lineHeight=Math.round(Math.max(g.lineHeight,u))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),fi,cw=(fi=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},p(fi,"InitIDGenerator"),fi),Ro,dw=p(function(e){return Ro=Ro||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Ro.innerHTML=e,unescape(Ro.textContent)},"entityDecode");function yl(e){return"str"in e}p(yl,"isDetailedError");var uw=p((e,t,r,i)=>{if(!i)return;const o=e.node()?.getBBox();o&&e.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Ys=p(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function Cl(e,t){return V2({},e,t)}p(Cl,"cleanAndMerge");var xe={assignWithDepth:Wt,wrapLabel:lw,calculateTextHeight:op,calculateTextWidth:Ge,calculateTextDimensions:ml,cleanAndMerge:Cl,detectInit:J2,detectDirective:Kf,isSubstringInArray:ew,interpolateToCurve:fl,calcLabelPosition:tp,calcCardinalityPosition:iw,calcTerminalLabelPosition:ep,formatUrl:Qf,getStylesFromArray:rp,generateId:ow,random:sw,runFunc:rw,entityDecode:dw,insertTitle:uw,isLabelCoordinateInPath:sp,parseFontSize:Ys,InitIDGenerator:cw},fw=p(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),Ar=p(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),JL=p((e,t,{counter:r=0,prefix:i,suffix:o},s)=>s||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function zt(e){return e??null}p(zt,"handleUndefinedAttr");function sp(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return o.includes(r.toString())||o.includes(i.toString())}p(sp,"isLabelCoordinateInPath");var xl=p(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins");async function ap(e,t){const r=e.getElementsByTagName("img");if(!r||r.length===0)return;const i=t.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(o=>new Promise(s=>{function a(){if(o.style.display="flex",o.style.flexDirection="column",i){const n=Ct().fontSize?Ct().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[c=Qc.fontSize]=Ys(n),h=c*l+"px";o.style.minWidth=h,o.style.maxWidth=h}else o.style.width="100%";s(o)}p(a,"setupImage"),setTimeout(()=>{o.complete&&a()}),o.addEventListener("error",a),o.addEventListener("load",a)})))}p(ap,"configureLabelImages");const pw=Object.freeze({left:0,top:0,width:16,height:16}),_s=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),np=Object.freeze({...pw,..._s}),gw=Object.freeze({...np,body:"",hidden:!1}),mw=Object.freeze({width:null,height:null}),yw=Object.freeze({...mw,..._s}),Cw=(e,t,r,i="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const n=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:n};return _a(c)?c:null}const s=o[0],a=s.split("-");if(a.length>1){const n={provider:i,prefix:a.shift(),name:a.join("-")};return _a(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:s};return _a(n,r)?n:null}return null},_a=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function xw(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function oc(e,t){const r=xw(e,t);for(const i in gw)i in _s?i in e&&!(i in r)&&(r[i]=_s[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function bw(e,t){const r=e.icons,i=e.aliases||Object.create(null),o=Object.create(null);function s(a){if(r[a])return o[a]=[];if(!(a in o)){o[a]=null;const n=i[a]&&i[a].parent,l=n&&s(n);l&&(o[a]=[n].concat(l))}return o[a]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(s),o}function sc(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let s={};function a(n){s=oc(i[n]||o[n],s)}return a(t),r.forEach(a),oc(e,s)}function kw(e,t){if(e.icons[t])return sc(e,t,[]);const r=bw(e,[t])[t];return r?sc(e,t,r):null}const ww=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Tw=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ac(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(ww);if(i===null||!i.length)return e;const o=[];let s=i.shift(),a=Tw.test(s);for(;;){if(a){const n=parseFloat(s);isNaN(n)?o.push(s):o.push(Math.ceil(n*t*r)/r)}else o.push(s);if(s=i.shift(),s===void 0)return o.join("");a=!a}}function Sw(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const o=e.indexOf(">",i),s=e.indexOf("",s);if(a===-1)break;r+=e.slice(o+1,s).trim(),e=e.slice(0,i).trim()+e.slice(a+1)}return{defs:r,content:e}}function _w(e,t){return e?""+e+""+t:t}function Bw(e,t,r){const i=Sw(e);return _w(i.defs,t+i.content+r)}const vw=e=>e==="unset"||e==="undefined"||e==="none";function Lw(e,t){const r={...np,...e},i={...yw,...t},o={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,i].forEach(m=>{const y=[],C=m.hFlip,b=m.vFlip;let k=m.rotate;C?b?k+=2:(y.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),y.push("scale(-1 1)"),o.top=o.left=0):b&&(y.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),y.push("scale(1 -1)"),o.top=o.left=0);let T;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:T=o.height/2+o.top,y.unshift("rotate(90 "+T.toString()+" "+T.toString()+")");break;case 2:y.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:T=o.width/2+o.left,y.unshift("rotate(-90 "+T.toString()+" "+T.toString()+")");break}k%2===1&&(o.left!==o.top&&(T=o.left,o.left=o.top,o.top=T),o.width!==o.height&&(T=o.width,o.width=o.height,o.height=T)),y.length&&(s=Bw(s,'',""))});const a=i.width,n=i.height,l=o.width,c=o.height;let h,d;a===null?(d=n===null?"1em":n==="auto"?c:n,h=ac(d,l/c)):(h=a==="auto"?l:a,d=n===null?ac(h,c/l):n==="auto"?c:n);const f={},u=(m,y)=>{vw(y)||(f[m]=y.toString())};u("width",h),u("height",d);const g=[o.left,o.top,l,c];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:s}}const Fw=/\sid="(\S+)"/g,nc=new Map;function Aw(e){e=e.replace(/[0-9]+$/,"")||"a";const t=nc.get(e)||0;return nc.set(e,t+1),t?`${e}${t}`:e}function Ew(e){const t=[];let r;for(;r=Fw.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(o=>{const s=Aw(o),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function Mw(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'"+e+""}var $w={body:'?',height:80,width:80},yn=new Map,lp=new Map,Ow=p(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(W.debug("Registering icon pack:",t.name),"loader"in t)lp.set(t.name,t.loader);else if("icons"in t)yn.set(t.name,t.icons);else throw W.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),hp=p(async(e,t)=>{const r=Cw(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let o=yn.get(i);if(!o){const a=lp.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await a(),prefix:i},yn.set(i,o)}catch(n){throw W.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=kw(o,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),Iw=p(async e=>{try{return await hp(e),!0}catch{return!1}},"isIconAvailable"),xo=p(async(e,t,r)=>{let i;try{i=await hp(e,t?.fallbackPrefix)}catch(a){W.error(a),i=$w}const o=Lw(i,t),s=Mw(Ew(o.body),{...o.attributes,...r});return we(s,At())},"getIconSVG");function bl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $r=bl();function cp(e){$r=e}var Ki={exec:()=>null};function xt(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(ee.caret,"$1"),r=r.replace(o,a),i},getRegex:()=>new RegExp(r,t)};return i}var Dw=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^
/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Pw=/^(?:[ \t]*(?:\n|$))+/,Rw=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Nw=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,bo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qw=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,kl=/(?:[*+-]|\d{1,9}[.)])/,dp=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,up=xt(dp).replace(/bull/g,kl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ww=xt(dp).replace(/bull/g,kl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),wl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,zw=/^[^\n]+/,Tl=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Hw=xt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Tl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Yw=xt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,kl).getRegex(),Us="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Sl=/|$))/,Uw=xt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Sl).replace("tag",Us).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fp=xt(wl).replace("hr",bo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Us).getRegex(),jw=xt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",fp).getRegex(),_l={blockquote:jw,code:Rw,def:Hw,fences:Nw,heading:qw,hr:bo,html:Uw,lheading:up,list:Yw,newline:Pw,paragraph:fp,table:Ki,text:zw},lc=xt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",bo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Us).getRegex(),Gw={..._l,lheading:Ww,table:lc,paragraph:xt(wl).replace("hr",bo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",lc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Us).getRegex()},Xw={..._l,html:xt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Sl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ki,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xt(wl).replace("hr",bo).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",up).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Vw=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Zw=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pp=/^( {2,}|\\)\n(?!\s*$)/,Kw=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Dw?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),yp=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,rT=xt(yp,"u").replace(/punct/g,js).getRegex(),iT=xt(yp,"u").replace(/punct/g,mp).getRegex(),Cp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",oT=xt(Cp,"gu").replace(/notPunctSpace/g,gp).replace(/punctSpace/g,Bl).replace(/punct/g,js).getRegex(),sT=xt(Cp,"gu").replace(/notPunctSpace/g,tT).replace(/punctSpace/g,Jw).replace(/punct/g,mp).getRegex(),aT=xt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,gp).replace(/punctSpace/g,Bl).replace(/punct/g,js).getRegex(),nT=xt(/\\(punct)/,"gu").replace(/punct/g,js).getRegex(),lT=xt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),hT=xt(Sl).replace("(?:-->|$)","-->").getRegex(),cT=xt("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",hT).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Bs=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,dT=xt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Bs).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xp=xt(/^!?\[(label)\]\[(ref)\]/).replace("label",Bs).replace("ref",Tl).getRegex(),bp=xt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Tl).getRegex(),uT=xt("reflink|nolink(?!\\()","g").replace("reflink",xp).replace("nolink",bp).getRegex(),hc=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,vl={_backpedal:Ki,anyPunctuation:nT,autolink:lT,blockSkip:eT,br:pp,code:Zw,del:Ki,emStrongLDelim:rT,emStrongRDelimAst:oT,emStrongRDelimUnd:aT,escape:Vw,link:dT,nolink:bp,punctuation:Qw,reflink:xp,reflinkSearch:uT,tag:cT,text:Kw,url:Ki},fT={...vl,link:xt(/^!?\[(label)\]\((.*?)\)/).replace("label",Bs).getRegex(),reflink:xt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Bs).getRegex()},Cn={...vl,emStrongRDelimAst:sT,emStrongLDelim:iT,url:xt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",hc).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:xt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},cc=e=>gT[e];function Le(e,t){if(t){if(ee.escapeTest.test(e))return e.replace(ee.escapeReplace,cc)}else if(ee.escapeTestNoEncode.test(e))return e.replace(ee.escapeReplaceNoEncode,cc);return e}function dc(e){try{e=encodeURI(e).replace(ee.percentDecode,"%")}catch{return null}return e}function uc(e,t){let r=e.replace(ee.findPipe,(s,a,n)=>{let l=!1,c=a;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(ee.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length0?-2:-1}function fc(e,t,r,i,o){let s=t.href,a=t.title||null,n=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,l}function yT(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(` +`).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[n]=a;return n.length>=o.length?s.slice(o.length):s}).join(` +`)}var vs=class{options;rules;lexer;constructor(t){this.options=t||$r}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:$i(i,` +`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=yT(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let o=$i(i,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(i=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:$i(r[0],` +`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=$i(r[0],` +`).split(` +`),o="",s="",a=[];for(;i.length>0;){let n=!1,l=[],c;for(c=0;c1,s={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let a=this.rules.other.listItemRegex(i),n=!1;for(;t;){let c=!1,h="",d="";if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let f=r[2].split(` +`,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),u=t.split(` +`,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(u)&&(h+=u+` +`,t=t.substring(u.length+1),c=!0),!c){let b=this.rules.other.nextBulletRegex(m),k=this.rules.other.hrRegex(m),T=this.rules.other.fencesBeginRegex(m),S=this.rules.other.headingBeginRegex(m),B=this.rules.other.htmlBeginRegex(m);for(;t;){let v=t.split(` +`,1)[0],L;if(u=v,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),L=u):L=u.replace(this.rules.other.tabCharGlobal," "),T.test(u)||S.test(u)||B.test(u)||b.test(u)||k.test(u))break;if(L.search(this.rules.other.nonSpaceChar)>=m||!u.trim())d+=` +`+L.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(f)||S.test(f)||k.test(f))break;d+=` +`+u}!g&&!u.trim()&&(g=!0),h+=v+` +`,t=t.substring(v.length+1),f=L.slice(m)}}s.loose||(n?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(n=!0));let y=null,C;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(C=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:h,task:!!y,checked:C,loose:!1,text:d,tokens:[]}),s.raw+=h}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;cf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}if(s.loose)for(let c=0;c({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[c]})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===` +`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let a=$i(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=mT(r[2],"()");if(a===-2)return;if(a>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let o=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(o);a&&(o=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?o=o.slice(1):o=o.slice(1,-1)),fc(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let o=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[o.toLowerCase()];if(!s){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return fc(i,s,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||o[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[2])||!i||this.rules.inline.punctuation.exec(i))){let s=[...o[0]].length-1,a,n,l=s,c=0,h=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+s);(o=h.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(n=[...a].length,o[3]||o[4]){l+=n;continue}else if((o[5]||o[6])&&s%3&&!((s+n)%3)){c+=n;continue}if(l-=n,l>0)continue;n=Math.min(n,n+l+c);let d=[...o[0]][0].length,f=t.slice(0,s+o.index+d+n);if(Math.min(s,n)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let u=f.slice(2,-2);return{type:"strong",raw:f,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(i),s=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return o&&s&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,o;return r[2]==="@"?(i=r[1],o="mailto:"+i):(i=r[1],o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=r[0],o="mailto:"+i;else{let s;do s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(s!==r[0]);i=r[0],r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},me=class xn{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||$r,this.options.tokenizer=this.options.tokenizer||new vs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:ee,block:No.normal,inline:Mi.normal};this.options.pedantic?(r.block=No.pedantic,r.inline=Mi.pedantic):this.options.gfm&&(r.block=No.gfm,this.options.breaks?r.inline=Mi.breaks:r.inline=Mi.gfm),this.tokenizer.rules=r}static get rules(){return{block:No,inline:Mi}}static lex(t,r){return new xn(r).lex(t)}static lexInline(t,r){return new xn(r).inlineTokens(t)}lex(t){t=t.replace(ee.carriageReturn,` +`),this.blockTokens(t,this.tokens);for(let r=0;r(o=a.call({lexer:this},t,r))?(t=t.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let a=r.at(-1);o.raw.length===1&&a!==void 0?a.raw+=` +`:r.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.text,this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),r.push(o);continue}let s=t;if(this.options.extensions?.startBlock){let a=1/0,n=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},n),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(s=t.substring(0,a+1))}if(this.state.top&&(o=this.tokenizer.paragraph(s))){let a=r.at(-1);i&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o),i=s.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,o=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)s=o[2]?o[2].length:0,i=i.slice(0,o.index+s)+"["+"a".repeat(o[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,n="";for(;t;){a||(n=""),a=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,i,n)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(u=>{f=u.call({lexer:this},d),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(n=l.raw.slice(-1)),a=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},Ls=class{options;parser;constructor(t){this.options=t||$r}space(t){return""}code({text:t,lang:r,escaped:i}){let o=(r||"").match(ee.notSpaceStart)?.[0],s=t.replace(ee.endingNewline,"")+` +`;return o?'
'+(i?s:Le(s,!0))+`
+`:"
"+(i?s:Le(s,!0))+`
+`}blockquote({tokens:t}){return`
+${this.parser.parse(t)}
+`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`${this.parser.parseInline(t)} +`}hr(t){return`
+`}list(t){let r=t.ordered,i=t.start,o="";for(let n=0;n +`+o+" +`}listitem(t){let r="";if(t.task){let i=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=i+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=i+" "+Le(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`
  • ${r}
  • +`}checkbox({checked:t}){return"'}paragraph({tokens:t}){return`

    ${this.parser.parseInline(t)}

    +`}table(t){let r="",i="";for(let s=0;s${o}`),` + +`+r+` +`+o+`
    +`}tablerow({text:t}){return` +${t} +`}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+` +`}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${Le(t,!0)}`}br(t){return"
    "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:r,tokens:i}){let o=this.parser.parseInline(i),s=dc(t);if(s===null)return o;t=s;let a='
    ",a}image({href:t,title:r,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let s=dc(t);if(s===null)return Le(i);t=s;let a=`${i}{let n=s[a].flat(1/0);i=i.concat(this.walkTokens(n,r))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let o={...i};if(o.async=this.defaults.async||o.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...n){let l=s.renderer.apply(this,n);return l===!1&&(l=a.apply(this,n)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),o.extensions=r),i.renderer){let s=this.defaults.renderer||new Ls(this.defaults);for(let a in i.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let n=a,l=i.renderer[n],c=s[n];s[n]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d||""}}o.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new vs(this.defaults);for(let a in i.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let n=a,l=i.tokenizer[n],c=s[n];s[n]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}o.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new Hi;for(let a in i.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let n=a,l=i.hooks[n],c=s[n];Hi.passThroughHooks.has(a)?s[n]=h=>{if(this.defaults.async&&Hi.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(s,h);return c.call(s,f)})();let d=l.call(s,h);return c.call(s,d)}:s[n]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,h);return f===!1&&(f=await c.apply(s,h)),f})();let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}o.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,a=i.walkTokens;o.walkTokens=function(n){let l=[];return l.push(a.call(this,n)),s&&(l=l.concat(s.call(this,n))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return me.lex(t,r??this.defaults)}parser(t,r){return ye.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let o={...i},s={...this.defaults,...o},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&o.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let n=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer():t?me.lex:me.lexInline)(n,s),c=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():t?ye.parse:ye.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let n=(s.hooks?s.hooks.provideLexer():t?me.lex:me.lexInline)(r,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():t?ye.parse:ye.parseInline)(n,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(n){return a(n)}}}onError(t,r){return i=>{if(i.message+=` +Please report this to https://github.com/markedjs/marked.`,t){let o="

    An error occurred:

    "+Le(i.message+"",!0)+"
    ";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},Er=new CT;function kt(e,t){return Er.parse(e,t)}kt.options=kt.setOptions=function(e){return Er.setOptions(e),kt.defaults=Er.defaults,cp(kt.defaults),kt};kt.getDefaults=bl;kt.defaults=$r;kt.use=function(...e){return Er.use(...e),kt.defaults=Er.defaults,cp(kt.defaults),kt};kt.walkTokens=function(e,t){return Er.walkTokens(e,t)};kt.parseInline=Er.parseInline;kt.Parser=ye;kt.parser=ye.parse;kt.Renderer=Ls;kt.TextRenderer=Ll;kt.Lexer=me;kt.lexer=me.lex;kt.Tokenizer=vs;kt.Hooks=Hi;kt.parse=kt;kt.options;kt.setOptions;kt.use;kt.walkTokens;kt.parseInline;ye.parse;me.lex;function kp(e){for(var t=[],r=1;r/g,` +`).replace(/\n{2,}/g,` +`);return kp(i)}p(wp,"preprocessMarkdown");function Tp(e){return e.split(/\\n|\n|/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}p(Tp,"nonMarkdownToLines");function Sp(e,t={}){const r=wp(e,t),i=kt.lexer(r),o=[[]];let s=0;function a(n,l="normal"){n.type==="text"?n.text.split(` +`).forEach((h,d)=>{d!==0&&(s++,o.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&o[s].push({content:f,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&o[s].push({content:n.text,type:"normal"})}return p(a,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{a(l)}):n.type==="html"?o[s].push({content:n.text,type:"normal"}):o[s].push({content:n.raw,type:"normal"})}),o}p(Sp,"markdownToLines");function _p(e){return e?`

    ${e.replace(/\\n|\n/g,"
    ")}

    `:""}p(_p,"nonMarkdownToHTML");function Bp(e,{markdownAutoWrap:t}={}){const r=kt.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"
    ").replace(/ /g," "):o.text.replace(/\n */g,"
    "):o.type==="strong"?`${o.tokens?.map(i).join("")}`:o.type==="em"?`${o.tokens?.map(i).join("")}`:o.type==="paragraph"?`

    ${o.tokens?.map(i).join("")}

    `:o.type==="space"?"":o.type==="html"?`${o.text}`:o.type==="escape"?o.text:(W.warn(`Unsupported markdown: ${o.type}`),o.raw)}return p(i,"output"),r.map(i).join("")}p(Bp,"markdownToHTML");function vp(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}p(vp,"splitTextToChars");function Lp(e,t){const r=vp(t.content);return Fl(e,[],r,t.type)}p(Lp,"splitWordToFitWidth");function Fl(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...s]=r,a=[...t,o];return e([{content:a.join(""),type:i}])?Fl(e,a,s,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}p(Fl,"splitWordToFitWidthRecursion");function Fp(e,t){if(e.some(({content:r})=>r.includes(` +`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Fs(e,t)}p(Fp,"splitLineToFitWidth");function Fs(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let o="";e[0].content===" "&&(o=" ",e.shift());const s=e.shift()??{content:" ",type:"normal"},a=[...i];if(o!==""&&a.push({content:o,type:"normal"}),a.push(s),t(a))return Fs(e,t,r,a);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[n,l]=Lp(t,s);r.push([n]),l.content&&e.unshift(l)}return Fs(e,t,r)}p(Fs,"splitLineToFitWidthRecursion");function kn(e,t){t&&e.attr("style",t)}p(kn,"applyStyle");var pc=16384;async function Ap(e,t,r,i,o=!1,s=At()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,pc)}px`),a.attr("height",`${Math.min(10*r,pc)}px`);const n=a.append("xhtml:div"),l=Ji(t.label)?await cd(t.label.replace(po.lineBreakRegex,` +`),s):we(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),kn(h,t.labelStyle),h.attr("class",`${c} ${i}`),kn(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&n.attr("class","labelBkg");let d=n.node().getBoundingClientRect();return d.width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px"),d=n.node().getBoundingClientRect()),a.node()}p(Ap,"addHtmlSpan");function Gs(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}p(Gs,"createTspan");function Ep(e,t,r){const i=e.append("text"),o=Gs(i,1,t);Xs(o,r);const s=o.node().getComputedTextLength();return i.remove(),s}p(Ep,"computeWidthOfText");function xT(e,t,r){const i=e.append("text"),o=Gs(i,1,t);Xs(o,[{content:r,type:"normal"}]);const s=o.node()?.getBoundingClientRect();return s&&i.remove(),s}p(xT,"computeDimensionOfText");function Mp(e,t,r,i=!1,o=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=p(u=>Ep(a,1.1,u)<=e,"checkWidth"),f=d(h)?[h]:Fp(h,d);for(const u of f){const g=Gs(l,c,1.1,o);Xs(g,u),c++}}if(i){const h=l.node().getBBox(),d=2;return n.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),a.node()}else return l.node()}p(Mp,"createFormattedText");function wn(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}p(wn,"decodeHTMLEntities");function Xs(e,t){e.text(""),t.forEach((r,i)=>{const o=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?o.text(wn(r.content)):o.text(" "+wn(r.content))})}p(Xs,"updateTextContentAndStyles");async function $p(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,s,a)=>(r.push((async()=>{const n=`${s}:${a}`;return await Iw(n)?await xo(n,void 0,{class:"label-icon"}):``})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}p($p,"replaceIconSubstring");var Re=p(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:s=!0,markdown:a=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(W.debug("XYZ createText",t,r,i,o,s,n,"addSvgBackground: ",c),s){const d=a?Bp(t,h):_p(t),f=await $p(Ar(d),h),u=t.replace(/\\\\/g,"\\"),g={isNode:n,label:Ji(t)?u:f,labelStyle:r.replace("fill:","color:")};return await Ap(e,g,l,o,c,h)}else{const d=Ar(t.replace(//g,"
    ")),f=a?Sp(d.replace("
    ","
    "),h):Tp(d),u=Mp(l,e,f,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ut(u).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");ut(u).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ut(u).select("text").attr("style",m)}return i?ut(u).selectAll("tspan.text-outer-tspan").classed("title-row",!0):ut(u).selectAll("tspan.text-outer-tspan").classed("row",!0),u}},"createText");function Ba(e,t,r){if(e&&e.length){const[i,o]=t,s=Math.PI/180*r,a=Math.cos(s),n=Math.sin(s);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-o)*n+i,l[1]=(c-i)*n+(h-o)*a+o}}}function bT(e,t){return e[0]===t[0]&&e[1]===t[1]}function kT(e,t,r,i=1){const o=r,s=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of a)Ba(c,n,o);const l=(function(c,h,d){const f=[];for(const b of c){const k=[...b];bT(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&f.push(k)}const u=[];h=Math.max(h,.1);const g=[];for(const b of f)for(let k=0;kb.ymink.ymin?1:b.xk.x?1:b.ymax===k.ymax?0:(b.ymax-k.ymax)/Math.abs(b.ymax-k.ymax))),!g.length)return u;let m=[],y=g[0].ymin,C=0;for(;m.length||g.length;){if(g.length){let b=-1;for(let k=0;ky);k++)b=k;g.splice(0,b+1).forEach((k=>{m.push({s:y,edge:k})}))}if(m=m.filter((b=>!(b.edge.ymax<=y))),m.sort(((b,k)=>b.edge.x===k.edge.x?0:(b.edge.x-k.edge.x)/Math.abs(b.edge.x-k.edge.x))),(d!==1||C%h==0)&&m.length>1)for(let b=0;b=m.length)break;const T=m[b].edge,S=m[k].edge;u.push([[Math.round(T.x),y],[Math.round(S.x),y]])}y+=d,m.forEach((b=>{b.edge.x=b.edge.x+d*b.edge.islope})),C++}return u})(a,s,i);if(o){for(const c of a)Ba(c,n,-o);(function(c,h,d){const f=[];c.forEach((u=>f.push(...u))),Ba(f,h,d)})(l,n,-o)}return l}function ko(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let s=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=o),kT(e,o,i,s||1)}class Al{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=ko(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}}function Vs(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class wT extends Al{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=ko(t,Object.assign({},r,{hachureGap:i})),s=Math.PI/180*r.hachureAngle,a=[],n=.5*i*Math.cos(s),l=.5*i*Math.sin(s);for(const[c,h]of o)Vs([c,h])&&a.push([[c[0]-n,c[1]+l],[...h]],[[c[0]+n,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}}class TT extends Al{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(t,o);return i.ops=i.ops.concat(s.ops),i}}class ST{constructor(t){this.helper=t}fillPolygons(t,r){const i=ko(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=o/4;for(const n of t){const l=Vs(n),c=l/o,h=Math.ceil(c)-1,d=l-h*o,f=(n[0][0]+n[1][0])/2-o/4,u=Math.min(n[0][1],n[1][1]);for(let g=0;g{const n=Vs(a),l=Math.floor(n/(i+o)),c=(n+o-l*(i+o))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let u=0;u{const a=Vs(s),n=Math.round(a/(2*r));let l=s[0],c=s[1];l[0]>c[0]&&(l=s[1],c=s[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;dh%2?c+r:c+t));s.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":s.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],s.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":s.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=i,r=o}return s}function Ip(e){const t=[];let r="",i=0,o=0,s=0,a=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,o]=h,[s,a]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,o]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,o]});break;case"V":o=h[0],t.push({key:"L",data:[i,o]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=i+(i-n),f=o+(o-l)):(d=i,f=o),t.push({key:"C",data:[d,f,...h]}),n=h[0],l=h[1],i=h[2],o=h[3];break}case"T":{const[d,f]=h;let u=0,g=0;r==="Q"||r==="T"?(u=i+(i-n),g=o+(o-l)):(u=i,g=o);const m=i+2*(u-i)/3,y=o+2*(g-o)/3,C=d+2*(u-d)/3,b=f+2*(g-f)/3;t.push({key:"C",data:[m,y,C,b,d,f]}),n=u,l=g,i=d,o=f;break}case"Q":{const[d,f,u,g]=h,m=i+2*(d-i)/3,y=o+2*(f-o)/3,C=u+2*(d-u)/3,b=g+2*(f-g)/3;t.push({key:"C",data:[m,y,C,b,u,g]}),n=d,l=f,i=u,o=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),u=h[2],g=h[3],m=h[4],y=h[5],C=h[6];d===0||f===0?(t.push({key:"C",data:[i,o,y,C,y,C]}),i=y,o=C):(i!==y||o!==C)&&(Dp(i,o,y,C,d,f,u,g,m).forEach((function(b){t.push({key:"C",data:b})})),i=y,o=C);break}case"Z":t.push({key:"Z",data:[]}),i=s,o=a}r=c}return t}function Oi(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function Dp(e,t,r,i,o,s,a,n,l,c){const h=(d=a,Math.PI*d/180);var d;let f=[],u=0,g=0,m=0,y=0;if(c)[u,g,m,y]=c;else{[e,t]=Oi(e,t,-h),[r,i]=Oi(r,i,-h);const q=(e-r)/2,$=(t-i)/2;let E=q*q/(o*o)+$*$/(s*s);E>1&&(E=Math.sqrt(E),o*=E,s*=E);const A=o*o,P=s*s,M=A*P-A*$*$-P*q*q,H=A*$*$+P*q*q,Y=(n===l?-1:1)*Math.sqrt(Math.abs(M/H));m=Y*o*$/s+(e+r)/2,y=Y*-s*q/o+(t+i)/2,u=Math.asin(parseFloat(((t-y)/s).toFixed(9))),g=Math.asin(parseFloat(((i-y)/s).toFixed(9))),eg&&(u-=2*Math.PI),!l&&g>u&&(g-=2*Math.PI)}let C=g-u;if(Math.abs(C)>120*Math.PI/180){const q=g,$=r,E=i;g=l&&g>u?u+120*Math.PI/180*1:u+120*Math.PI/180*-1,f=Dp(r=m+o*Math.cos(g),i=y+s*Math.sin(g),$,E,o,s,a,0,l,[g,q,m,y])}C=g-u;const b=Math.cos(u),k=Math.sin(u),T=Math.cos(g),S=Math.sin(g),B=Math.tan(C/4),v=4/3*o*B,L=4/3*s*B,N=[e,t],R=[e+v*k,t-L*b],D=[r+v*S,i-L*T],U=[r,i];if(R[0]=2*N[0]-R[0],R[1]=2*N[1]-R[1],c)return[R,D,U].concat(f);{f=[R,D,U].concat(f);const q=[];for(let $=0;$2){const o=[];for(let s=0;s2*Math.PI&&(u=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-u)/2),C=kc(y,c,h,d,f,u,g,1,l);if(!l.disableMultiStroke){const b=kc(y,c,h,d,f,u,g,1.5,l);C.push(...b)}return a&&(n?C.push(...cr(c,h,c+d*Math.cos(u),h+f*Math.sin(u),l),...cr(c,h,c+d*Math.cos(g),h+f*Math.sin(g),l)):C.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(u),h+f*Math.sin(u)]})),{type:"path",ops:C}}function Cc(e,t){const r=Ip(Op(El(e))),i=[];let o=[0,0],s=[0,0];for(const{key:a,data:n}of r)switch(a){case"M":s=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...cr(s[0],s[1],n[0],n[1],t)),s=[n[0],n[1]];break;case"C":{const[l,c,h,d,f,u]=n;i.push(...ET(l,c,h,d,f,u,s,t)),s=[f,u];break}case"Z":i.push(...cr(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]]}return{type:"path",ops:i}}function Fa(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,s=i.length;if(s>2){r.push({op:"move",data:[i[0][0]+at(o,t),i[0][1]+at(o,t)]});for(let a=1;a500?.4:-.0016668*l+1.233334;let h=o.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,f=.2+.2*Np(o);let u=o.bowing*o.maxRandomnessOffset*(i-t)/200,g=o.bowing*o.maxRandomnessOffset*(e-r)/200;u=at(u,o,c),g=at(g,o,c);const m=[],y=()=>at(d,o,c),C=()=>at(h,o,c),b=o.preserveVertices;return a?m.push({op:"move",data:[e+(b?0:y()),t+(b?0:y())]}):m.push({op:"move",data:[e+(b?0:at(h,o,c)),t+(b?0:at(h,o,c))]}),a?m.push({op:"bcurveTo",data:[u+e+(r-e)*f+y(),g+t+(i-t)*f+y(),u+e+2*(r-e)*f+y(),g+t+2*(i-t)*f+y(),r+(b?0:y()),i+(b?0:y())]}):m.push({op:"bcurveTo",data:[u+e+(r-e)*f+C(),g+t+(i-t)*f+C(),u+e+2*(r-e)*f+C(),g+t+2*(i-t)*f+C(),r+(b?0:C()),i+(b?0:C())]}),m}function Wo(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+at(t,r),e[0][1]+at(t,r)]),i.push([e[0][0]+at(t,r),e[0][1]+at(t,r)]);for(let o=1;o3){const s=[],a=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+21&&o.push(n)):o.push(n),o.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],f=xr(l,c,.5),u=xr(c,h,.5),g=xr(h,d,.5),m=xr(f,u,.5),y=xr(u,g,.5),C=xr(m,y,.5);_n([l,f,m,C],0,r,o),_n([C,y,g,d],0,r,o)}var s,a;return o}function $T(e,t){return Ms(e,0,e.length,t)}function Ms(e,t,r,i,o){const s=o||[],a=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;hl&&(l=d,c=h)}return Math.sqrt(l)>i?(Ms(e,t,c+1,i,s),Ms(e,c,r,i,s)):(s.length||s.push(a),s.push(n)),s}function Aa(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let s=0;s0?Ms(i,0,i.length,r):i}const ce="none";class $s{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,o,s){const a=this._o(s);return this._d("line",[Pp(t,r,i,o,a)],a)}rectangle(t,r,i,o,s){const a=this._o(s),n=[],l=AT(t,r,i,o,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];a.fillStyle==="solid"?n.push(Fa([c],a)):n.push(Hr([c],a))}return a.stroke!==ce&&n.push(l),this._d("rectangle",n,a)}ellipse(t,r,i,o,s){const a=this._o(s),n=[],l=Rp(i,o,a),c=Tn(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=Tn(t,r,a,l).opset;h.type="fillPath",n.push(h)}else n.push(Hr([c.estimatedPoints],a));return a.stroke!==ce&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,r,i,o){const s=this.ellipse(t,r,i,i,o);return s.shape="circle",s}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[es(t,!1,i)],i)}arc(t,r,i,o,s,a,n=!1,l){const c=this._o(l),h=[],d=yc(t,r,i,o,s,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const f=Object.assign({},c);f.disableMultiStroke=!0;const u=yc(t,r,i,o,s,a,!0,!1,f);u.type="fillPath",h.push(u)}else h.push((function(f,u,g,m,y,C,b){const k=f,T=u;let S=Math.abs(g/2),B=Math.abs(m/2);S+=at(.01*S,b),B+=at(.01*B,b);let v=y,L=C;for(;v<0;)v+=2*Math.PI,L+=2*Math.PI;L-v>2*Math.PI&&(v=0,L=2*Math.PI);const N=(L-v)/b.curveStepCount,R=[];for(let D=v;D<=L;D+=N)R.push([k+S*Math.cos(D),T+B*Math.sin(D)]);return R.push([k+S*Math.cos(L),T+B*Math.sin(L)]),R.push([k,T]),Hr([R],b)})(t,r,i,o,s,a,c));return c.stroke!==ce&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],s=mc(t,i);if(i.fill&&i.fill!==ce)if(i.fillStyle==="solid"){const a=mc(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?a.push(...c):c.length===3?a.push(...Aa(wc([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...Aa(wc(c),10,(1+i.roughness)/2))}a.length&&o.push(Hr([a],i))}return i.stroke!==ce&&o.push(s),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],s=es(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(Fa([t],i)):o.push(Hr([t],i))),i.stroke!==ce&&o.push(s),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=i.fill&&i.fill!=="transparent"&&i.fill!==ce,a=i.stroke!==ce,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,f){const u=Ip(Op(El(h))),g=[];let m=[],y=[0,0],C=[];const b=()=>{C.length>=4&&m.push(...Aa(C,d)),C=[]},k=()=>{b(),m.length&&(g.push(m),m=[])};for(const{key:S,data:B}of u)switch(S){case"M":k(),y=[B[0],B[1]],m.push(y);break;case"L":b(),m.push([B[0],B[1]]);break;case"C":if(!C.length){const v=m.length?m[m.length-1]:y;C.push([v[0],v[1]])}C.push([B[0],B[1]]),C.push([B[2],B[3]]),C.push([B[4],B[5]]);break;case"Z":b(),m.push([y[0],y[1]])}if(k(),!f)return g;const T=[];for(const S of g){const B=$T(S,f);B.length&&T.push(B)}return T})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=Cc(t,i);if(s)if(i.fillStyle==="solid")if(l.length===1){const h=Cc(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else o.push(Fa(l,i));else o.push(Hr(l,i));return a&&(n?l.forEach((h=>{o.push(es(h,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const s=typeof r=="number"&&r>=0?o.data.map((a=>+a.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":i+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":i+=`L${s[0]} ${s[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:ce};break;case"fillPath":a={d:this.opsToPath(s),stroke:ce,strokeWidth:0,fill:i.fill||ce};break;case"fillSketch":a=this.fillSketch(s,i)}a&&o.push(a)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||ce,strokeWidth:i,fill:ce}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class OT{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new $s(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,a,s),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,a,s,n),o.restore();break}case"fillSketch":this.fillSketch(o,a,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const s of r.ops){const a=typeof i=="number"&&i>=0?s.data.map((n=>+n.toFixed(i))):s.data;switch(s.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a),a}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a),a}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a),a}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s),s}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const zo="http://www.w3.org/2000/svg";class IT{constructor(t,r){this.svg=t,this.gen=new $s(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,s=o.createElementNS(zo,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=o.createElementNS(zo,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=o.createElementNS(zo,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(o,n,i)}l&&s.appendChild(l)}return s}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const s=t.createElementNS(zo,"path");return s.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",o+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a)}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a)}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a)}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var V={canvas:(e,t)=>new OT(e,t),svg:(e,t)=>new IT(e,t),generator:e=>new $s(e),newSeed:()=>$s.newSeed()},st=p(async(e,t,r)=>{let i;const o=t.useHtmlLabels||De(Ct()?.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=s.insert("g").attr("class","label").attr("style",zt(t.labelStyle));let n;t.label===void 0?n="":n=typeof t.label=="string"?t.label:t.label[0];const l=!!t.icon||!!t.img,c=t.labelType==="markdown",h=await Re(a,we(Ar(n),Ct()),{useHtmlLabels:o,width:t.width||Ct().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},Ct());let d=h.getBBox();const f=(t?.padding??0)/2;if(o){const u=h.children[0],g=ut(h);await ap(u,n),d=u.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return o?a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):a.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:f,label:a}},"labelHelper"),Ea=p(async(e,t,r)=>{const i=r.useHtmlLabels??re(Ct()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Re(o,we(Ar(t),Ct()),{useHtmlLabels:i,width:r.width||Ct()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const n=r.padding/2;if(re(Ct())){const l=s.children[0],c=ut(s);a=l.getBoundingClientRect(),c.attr("width",a.width),c.attr("height",a.height)}return i?o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):o.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:a,halfPadding:n,label:o}},"insertLabel"),Q=p((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),it=p((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function gt(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}p(gt,"createPathFromPoints");function dr(e,t,r,i,o,s){const a=[],l=r-e,c=i-t,h=l/s,d=2*Math.PI/h,f=t+c/2;for(let u=0;u<=50;u++){const g=u/50,m=e+g*l,y=f+o*Math.sin(d*(m-e));a.push({x:m,y})}return a}p(dr,"generateFullSineWavePoints");function lo(e,t,r,i,o,s){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",i);const o=t.find(l=>l.getAttribute("fill")!=="none"),s=t.find(l=>l.getAttribute("stroke")!=="none"),a=p((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:a(o,"fill"),"fill-opacity":a(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(s){const l={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}p(Bn,"mergePaths");var DT=p((e,t)=>{var r=e.x,i=e.y,o=t.x-r,s=t.y-i,a=e.width/2,n=e.height/2,l,c;return Math.abs(s)*a>Math.abs(o)*n?(s<0&&(n=-n),l=s===0?0:n*o/s,c=n):(o<0&&(a=-a),l=a,c=o===0?0:a*s/o),{x:r+l,y:i+c}},"intersectRect"),Or=DT,PT=p(async(e,t,r,i=!1,o=!1)=>{let s=t||"";typeof s=="object"&&(s=s[0]);const a=Ct(),n=re(a);return await Re(e,s,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},a)},"createLabel"),or=PT,ur=p((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),RT=p(async(e,t)=>{const r=Ct(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,n=a,{labelStyles:l,nodeStyles:c,borderStyles:h,backgroundStyles:d}=K(t),f=e.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look),u=De(r.flowchart.htmlLabels),g=t.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Re(m,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let C=y.getBBox();if(u){const q=y.children[0],$=ut(y);C=q.getBoundingClientRect(),$.attr("width",C.width),$.attr("height",C.height)}const b=t.padding??0,k=t.width<=C.width+b?C.width+b:t.width;t.width<=C.width+b?t.diff=(k-t.width)/2-b:t.diff=-b;const T=t.height,S=t.y-T/2,B=t.y+T/2,v=t.x-k/2,L=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:S+T/3,N=g?4:0,R=C.height+2*N;let D,U;if(g){const q=Math.max(R,C.height+2*N),$=v+q,E=Math.max(0,k-q);if(t.look==="handDrawn"){const M=V.svg(f),H=X(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),Y=X(t,{roughness:.7,fill:"none",stroke:n,seed:o}),ot=M.rectangle(v,S,q,T,H);D=f.insert(()=>ot,":first-child");const Z=M.rectangle($,S,E,T,Y);U=f.insert(()=>Z,":first-child"),D.select("path:nth-child(2)").attr("style",h.join(";")),D.select("path").attr("style",d.join(";").replace("fill","stroke"))}else D=f.insert("rect",":first-child"),U=f.insert("rect",":first-child"),D.attr("class","swimlane-title").attr("style",c).attr("x",v).attr("y",S).attr("width",q).attr("height",T).attr("fill",s).attr("stroke",n),U.attr("class","swimlane-body").attr("style",c).attr("x",$).attr("y",S).attr("width",E).attr("height",T).attr("fill","none").attr("stroke",n);const A=v+q/2,P=t.y;m.attr("transform",`translate(${A}, ${P}) rotate(-90) translate(${-C.width/2}, ${-C.height/2})`)}else{const q=Math.max(0,L-S),$=Math.min(R,q),E=S+$,A=Math.max(0,B-E),P=t.x-k/2;if(t.look==="handDrawn"){const Y=V.svg(f),ot=X(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),Z=X(t,{roughness:.7,fill:"none",stroke:n,seed:o}),dt=Y.rectangle(P,S,k,$,ot);D=f.insert(()=>dt,":first-child");const ft=Y.rectangle(P,E,k,A,Z);U=f.insert(()=>ft,":first-child"),D.select("path:nth-child(2)").attr("style",h.join(";")),D.select("path").attr("style",d.join(";").replace("fill","stroke"))}else D=f.insert("rect",":first-child"),U=f.insert("rect",":first-child"),D.attr("class","swimlane-title").attr("style",c).attr("x",P).attr("y",S).attr("width",k).attr("height",$).attr("fill",s).attr("stroke",n),U.attr("class","swimlane-body").attr("style",c).attr("x",P).attr("y",E).attr("width",k).attr("height",A).attr("fill","none").attr("stroke",n);const M=t.x-C.width/2,H=S+($-C.height)/2;m.attr("transform",`translate(${M}, ${H})`)}if(W.trace("Swimlane data ",t,JSON.stringify(t)),l){const q=m.select("span");q&&q.attr("style",l)}return t.offsetX=0,t.width=k,t.height=T,t.offsetY=C.height-b/2,t.intersect=function(q){return Or(t,q)},{cluster:f,labelBBox:C}},"swimlane"),qp=p(async(e,t)=>{W.info("Creating subgraph rect for ",t.id,t);const r=Ct(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=K(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=re(r),u=d.insert("g").attr("class","cluster-label ");let g;t.labelType==="markdown"?g=await Re(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):g=await or(u,t.label,t.labelStyle||"",!1,!0);let m=g.getBBox();if(re(r)){const v=g.children[0],L=ut(g);m=v.getBoundingClientRect(),L.attr("width",m.width),L.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,b=t.x-y/2,k=t.y-C/2;W.trace("Data ",t,JSON.stringify(t));let T;if(t.look==="handDrawn"){const v=V.svg(d),L=X(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),N=v.path(ur(b,k,y,C,0),L);T=d.insert(()=>(W.debug("Rough node insert CXC",N),N),":first-child"),T.select("path:nth-child(2)").attr("style",c.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",k).attr("width",y).attr("height",C);const{subGraphTitleTopMargin:S}=xl(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),n){const v=u.select("span");v&&v.attr("style",n)}const B=T.node().getBBox();return t.offsetX=0,t.width=B.width,t.height=B.height,t.offsetY=m.height-t.padding/2,t.intersect=function(v){return Or(t,v)},{cluster:d,labelBBox:m}},"rect"),NT=p((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,s=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return Or(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),qT=p(async(e,t)=>{const r=Ct(),{themeVariables:i,handDrawnSeed:o}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:n,nodeBorder:l}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),h=c.insert("g",":first-child"),d=c.insert("g").attr("class","cluster-label");let f=c.append("rect");const u=await or(d,t.label,t.labelStyle,void 0,!0);let g=u.getBBox();if(re(r)){const N=u.children[0],R=ut(u);g=N.getBoundingClientRect(),R.attr("width",g.width),R.attr("height",g.height)}const m=0*t.padding,y=m/2,C=(t.width<=g.width+t.padding?g.width+t.padding:t.width)+m;t.width<=g.width+t.padding?t.diff=(C-t.width)/2-t.padding:t.diff=-t.padding;const b=t.height+m,k=t.height+m-g.height-6,T=t.x-C/2,S=t.y-b/2;t.width=C;const B=t.y-t.height/2-y+g.height+2;let v;if(t.look==="handDrawn"){const N=t.cssClasses.includes("statediagram-cluster-alt"),R=V.svg(c),D=t.rx||t.ry?R.path(ur(T,S,C,b,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:l,seed:o}):R.rectangle(T,S,C,b,{seed:o});v=c.insert(()=>D,":first-child");const U=R.rectangle(T,B,C,k,{fill:N?s:a,fillStyle:N?"hachure":"solid",stroke:l,seed:o});v=c.insert(()=>D,":first-child"),f=c.insert(()=>U)}else v=h.insert("rect",":first-child"),v.attr("class","outer").attr("x",T).attr("y",S).attr("width",C).attr("height",b).attr("data-look",t.look),f.attr("class","inner").attr("x",T).attr("y",B).attr("width",C).attr("height",k);d.attr("transform",`translate(${t.x-g.width/2}, ${S+1-(re(r)?0:3)})`);const L=v.node().getBBox();return t.height=L.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(N){return Or(t,N)},{cluster:c,labelBBox:g}},"roundedWithTitle"),WT=p(async(e,t)=>{W.info("Creating subgraph rect for ",t.id,t);const r=Ct(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=K(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=re(r),u=d.insert("g").attr("class","cluster-label "),g=await Re(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let m=g.getBBox();if(re(r)){const v=g.children[0],L=ut(g);m=v.getBoundingClientRect(),L.attr("width",m.width),L.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,b=t.x-y/2,k=t.y-C/2;W.trace("Data ",t,JSON.stringify(t));let T;if(t.look==="handDrawn"){const v=V.svg(d),L=X(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:o}),N=v.path(ur(b,k,y,C,t.rx),L);T=d.insert(()=>(W.debug("Rough node insert CXC",N),N),":first-child"),T.select("path:nth-child(2)").attr("style",c.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",k).attr("width",y).attr("height",C);const{subGraphTitleTopMargin:S}=xl(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),n){const v=u.select("span");v&&v.attr("style",n)}const B=T.node().getBBox();return t.offsetX=0,t.width=B.width,t.height=B.height,t.offsetY=m.height-t.padding/2,t.intersect=function(v){return Or(t,v)},{cluster:d,labelBBox:m}},"kanbanSection"),zT=p((e,t)=>{const r=Ct(),{themeVariables:i,handDrawnSeed:o}=r,{nodeBorder:s}=i,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),n=a.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const h=t.height+l,d=t.x-c/2,f=t.y-h/2;t.width=c;let u;if(t.look==="handDrawn"){const y=V.svg(a).rectangle(d,f,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:o});u=a.insert(()=>y,":first-child")}else{u=n.insert("rect",":first-child");let m="outer";t.look,m="divider",u.attr("class",m).attr("x",d).attr("y",f).attr("width",c).attr("height",h).attr("data-look",t.look)}const g=u.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return Or(t,m)},{cluster:a,labelBBox:{}}},"divider"),HT=qp,YT={rect:qp,squareRect:HT,roundedWithTitle:qT,noteGroup:NT,divider:zT,kanbanSection:WT,swimlane:RT},Wp=new Map,UT=p(async(e,t)=>{const r=t.shape||"rect",i=await YT[r](e,t);return Wp.set(t.id,i),i},"insertCluster"),sF=p(()=>{Wp=new Map},"clear");function zp(e,t){return e.intersect(t)}p(zp,"intersectNode");var jT=zp;function Hp(e,t,r,i){var o=e.x,s=e.y,a=o-i.x,n=s-i.y,l=Math.sqrt(t*t*n*n+r*r*a*a),c=Math.abs(t*r*a/l);i.x0}p(vn,"sameSign");var XT=jp;function Gp(e,t,r){let i=e.x,o=e.y,s=[],a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){a=Math.min(a,h.x),n=Math.min(n,h.y)}):(a=Math.min(a,t.x),n=Math.min(n,t.y));let l=i-e.width/2-a,c=o-e.height/2-n;for(let h=0;h1&&s.sort(function(h,d){let f=h.x-r.x,u=h.y-r.y,g=Math.sqrt(f*f+u*u),m=d.x-r.x,y=d.y-r.y,C=Math.sqrt(m*m+y*y);return gh,":first-child");return d.attr("class","anchor").attr("style",zt(n)),Q(t,d),t.intersect=function(f){return W.info("Circle intersect",t,a,f),G.circle(t,a,f)},s}p(Xp,"anchor");function Ln(e,t,r,i,o,s,a){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,f=(i-t)/2,u=d/o,g=f/s,m=Math.sqrt(u**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),C=l+y*s*Math.sin(h)*(a?-1:1),b=c-y*o*Math.cos(h)*(a?-1:1),k=Math.atan2((t-b)/s,(e-C)/o);let S=Math.atan2((i-b)/s,(r-C)/o)-k;a&&S<0&&(S+=2*Math.PI),!a&&S>0&&(S-=2*Math.PI);const B=[];for(let v=0;v<20;v++){const L=v/19,N=k+L*S,R=C+o*Math.cos(N),D=b+s*Math.sin(N);B.push({x:R,y:D})}return B}p(Ln,"generateArcPoints");function Vp(e,t,r){const[i,o]=[t,r].sort((s,a)=>a-s);return o*(1-Math.sqrt(1-(e/i/2)**2))}p(Vp,"calculateArcSagitta");async function Zp(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=p(N=>N+a,"calcTotalHeight"),l=p(N=>{const R=N/2;return[R/(2.5+N/50),R]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await st(e,t,it(t)),d=n(t?.height?t?.height:h.height),[f,u]=l(d),g=Vp(d,f,u),y=(t?.width?t?.width:h.width)+s*2+g-g,C=d,{cssStyles:b}=t,k=[{x:y/2,y:-C/2},{x:-y/2,y:-C/2},...Ln(-y/2,-C/2,-y/2,C/2,f,u,!1),{x:y/2,y:C/2},...Ln(y/2,C/2,y/2,-C/2,f,u,!0)],T=V.svg(c),S=X(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const B=gt(k),v=T.path(B,S),L=c.insert(()=>v,":first-child");return L.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),L.attr("transform",`translate(${f/2}, 0)`),Q(t,L),t.intersect=function(N){return G.polygon(t,k,N)},c}p(Zp,"bowTieRect");function Ve(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}p(Ve,"insertPolygonShape");var Ho=12;async function Kp(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?28:o,a=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await st(e,t,it(t)),c=(t?.width??l.width)+(t.look==="neo"?s*2:s+Ho),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,f=c,u=-h,g=0,m=[{x:d+Ho,y:u},{x:f,y:u},{x:f,y:g},{x:d,y:g},{x:d,y:u+Ho},{x:d+Ho,y:u}];let y;const{cssStyles:C}=t;if(t.look==="handDrawn"){const b=V.svg(n),k=X(t,{}),T=gt(m),S=b.path(T,k);y=n.insert(()=>S,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),C&&y.attr("style",C)}else y=Ve(n,c,h,m);return i&&y.attr("style",i),Q(t,y),t.intersect=function(b){return G.polygon(t,m,b)},n}p(Kp,"card");function Qp(e,t){const{nodeStyles:r}=K(t);t.label="";const i=e.insert("g").attr("class",it(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=Math.max(28,t.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],n=V.svg(i),l=X(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=gt(a),h=n.path(c,l),d=i.insert(()=>h,":first-child");return o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(f){return G.polygon(t,a,f)},i}p(Qp,"choice");async function Ml(e,t,r){const{labelStyles:i,nodeStyles:o}=K(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:n}=await st(e,t,it(t)),l=16,c=r?.padding??n,h=t.look==="neo"?a.width/2+l*2:a.width/2+c;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=V.svg(s),g=X(t,{}),m=u.circle(0,0,h*2,g);d=s.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",zt(f))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",h).attr("cx",0).attr("cy",0);return Q(t,d),t.calcIntersect=function(u,g){const m=u.width/2;return G.circle(u,m,g)},t.intersect=function(u){return W.info("Circle intersect",t,h,u),G.circle(t,h,u)},s}p(Ml,"circle");function Jp(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},s={x:-(i/2)*t,y:i/2*r},a={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${s.x},${s.y} L ${n.x},${n.y} + M ${o.x},${o.y} L ${a.x},${a.y}`}p(Jp,"createLine");function tg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",it(t)).attr("id",t.domId??t.id),s=Math.max(30,t?.width??0),{cssStyles:a}=t,n=V.svg(o),l=X(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,s*2,l),h=Jp(s),d=n.path(h,l),f=o.insert(()=>c,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),a&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),Q(t,f),t.intersect=function(u){return W.info("crossedCircle intersect",t,{radius:s,point:u}),G.circle(t,s,u)},o}p(tg,"crossedCircle");function ze(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;dS,":first-child").attr("stroke-opacity",0),B.insert(()=>k,":first-child"),B.attr("class","text"),f&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),Q(t,B),t.intersect=function(v){return G.polygon(t,g,v)},o}p(eg,"curlyBraceLeft");function He(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;dS,":first-child").attr("stroke-opacity",0),B.insert(()=>k,":first-child"),B.attr("class","text"),f&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),Q(t,B),t.intersect=function(v){return G.polygon(t,g,v)},o}p(rg,"curlyBraceRight");function Yt(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;dN,":first-child").attr("stroke-opacity",0),R.insert(()=>T,":first-child"),R.insert(()=>v,":first-child"),R.attr("class","text"),f&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",i),R.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),Q(t,R),t.intersect=function(D){return G.polygon(t,m,D)},o}p(ig,"curlyBraces");async function og(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=20,l=5,{shapeSvg:c,bbox:h}=await st(e,t,it(t)),d=Math.max(n,(h.width+s*2)*1.25,t?.width??0),f=Math.max(l,h.height+a*2,t?.height??0),u=f/2,{cssStyles:g}=t,m=V.svg(c),y=X(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=d,b=f,k=C-u,T=b/4,S=[{x:k,y:0},{x:T,y:0},{x:0,y:b/2},{x:T,y:b},{x:k,y:b},...lo(-k,-b/2,u,50,270,90)],B=gt(S),v=m.path(B,y),L=c.insert(()=>v,":first-child");return L.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&L.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&L.selectChildren("path").attr("style",i),L.attr("transform",`translate(${-d/2}, ${-f/2})`),Q(t,L),t.intersect=function(N){return G.polygon(t,S,N)},c}p(og,"curvedTrapezoid");var ZT=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),KT=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),QT=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Tc=8,Sc=8;async function sg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?24:o,a=t.look==="neo"?24:o;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-a,t.widthS,":first-child"),g=n.insert(()=>T,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=ZT(0,0,h,u,d,f);g=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",zt(m)).attr("style",i)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),Q(t,g),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(y){const C=G.rect(t,y),b=C.x-(t.x??0);if(d!=0&&(Math.abs(b)<(t.width??0)/2||Math.abs(b)==(t.width??0)/2&&Math.abs(C.y-(t.y??0))>(t.height??0)/2-f)){let k=f*f*(1-b*b/(d*d));k>0&&(k=Math.sqrt(k)),k=f-k,y.y-(t.y??0)>0&&(k=-k),C.y+=k}return C},n}p(sg,"cylinder");async function Ti(e,t,r){const{labelStyles:i,nodeStyles:o}=K(t);t.labelStyle=i;const{shapeSvg:s,bbox:a}=await st(e,t,it(t)),n=Math.max(a.width+r.labelPaddingX*2,t?.width||0),l=Math.max(a.height+r.labelPaddingY*2,t?.height||0),c=-n/2,h=-l/2;let d,{rx:f,ry:u}=t;const{cssStyles:g}=t;if(r?.rx&&r.ry&&(f=r.rx,u=r.ry),t.look==="handDrawn"){const m=V.svg(s),y=X(t,{}),C=f||u?m.path(ur(c,h,n,l,f||0),y):m.rectangle(c,h,n,l,y);d=s.insert(()=>C,":first-child"),d.attr("class","basic label-container").attr("style",zt(g))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",o).attr("rx",zt(f)).attr("ry",zt(u)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return Q(t,d),t.calcIntersect=function(m,y){return G.rect(m,y)},t.intersect=function(m){return G.rect(t,m)},s}p(Ti,"drawRect");async function ag(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:s,width:a,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(s??0)*2,labelPaddingY:o??s??0},c=await Ti(e,t,l);if(t.look==="handDrawn"){const u=V.svg(c),g=X(t,{}),m=c.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return c;let C=null;if(y instanceof SVGGraphicsElement)C=y.getBBox();else return c;return c.insert(()=>u.line(C.x,C.y,C.x+C.width,C.y,g),".basic.label-container g.label"),c.insert(()=>u.line(C.x,C.y+C.height,C.x+C.width,C.y+C.height,g),".basic.label-container g.label"),m.remove(),c}const h=c.select(".basic.label-container"),d=(Number(h.attr("width"))||a)??0,f=(Number(h.attr("height"))||n)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),c}p(ag,"datastore");async function ng(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await st(e,t,it(t)),c=n.width+o,h=n.height+s,d=h*.2,f=-c/2,u=-h/2-d/2,{cssStyles:g}=t,m=V.svg(a),y=X(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=[{x:f,y:u+d},{x:-f,y:u+d},{x:-f,y:-u},{x:f,y:-u},{x:f,y:u},{x:-f,y:u},{x:-f,y:u+d}],b=m.polygon(C.map(T=>[T.x,T.y]),y),k=a.insert(()=>b,":first-child");return k.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),l.attr("transform",`translate(${f+(t.padding??0)/2-(n.x-(n.left??0))}, ${u+d+(t.padding??0)/2-(n.y-(n.top??0))})`),Q(t,k),t.intersect=function(T){return G.rect(t,T)},a}p(ng,"dividedRectangle");async function lg(e,t){const{labelStyles:r,nodeStyles:i}=K(t),o=t.look==="neo"?12:5;t.labelStyle=r;const s=t.padding??0,a=t.look==="neo"?16:s,{shapeSvg:n,bbox:l}=await st(e,t,it(t)),c=(t?.width?t?.width/2:l.width/2)+(a??0),h=c-o;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=V.svg(n),g=X(t,{roughness:.2,strokeWidth:2.5}),m=X(t,{roughness:.2,strokeWidth:1.5}),y=u.circle(0,0,c*2,g),C=u.circle(0,0,h*2,m);d=n.insert("g",":first-child"),d.attr("class",zt(t.cssClasses)).attr("style",zt(f)),d.node()?.appendChild(y),d.node()?.appendChild(C)}else{d=n.insert("g",":first-child");const u=d.insert("circle",":first-child"),g=d.insert("circle");d.attr("class","basic label-container").attr("style",i),u.attr("class","outer-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0)}return Q(t,d),t.intersect=function(u){return W.info("DoubleCircle intersect",t,c,u),G.circle(t,c,u)},n}p(lg,"doublecircle");function hg(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=K(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",it(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,l=V.svg(s),{nodeBorder:c}=r,h=X(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),f=s.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",o),Q(t,f),t.intersect=function(u){return W.info("filledCircle intersect",t,{radius:a,point:u}),G.circle(t,a,u)},s}p(hg,"filledCircle");var _c=10,Bc=10;async function cg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.height<_c&&(t.height=_c),t.width=(t?.width??0)-s-s/2,t.widthC,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return u&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),t.width=c,t.height=h,Q(t,b),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-h/2+(t.padding??0)/2+(n.y-(n.top??0))})`),t.intersect=function(k){return W.info("Triangle intersect",t,f,k),G.polygon(t,f,k)},a}p(cg,"flippedTriangle");function dg(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:s}=K(t);t.label="";const a=e.insert("g").attr("class",it(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,d=-1*c/2,f=V.svg(a),u=X(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const g=f.rectangle(h,d,l,c,u),m=a.insert(()=>g,":first-child");n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),Q(t,m);const y=i?.padding??0;return t.width&&t.height&&(t.width+=y/2||0,t.height+=y/2||0),t.intersect=function(C){return G.rect(t,C)},a}p(dg,"forkJoin");async function ug(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=15,s=10,a=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.heightb,":first-child");return k.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),Q(t,k),t.intersect=function(T){return W.info("Pill intersect",t,{radius:f,point:T}),G.polygon(t,y,T)},l}p(ug,"halfRoundedRectangle");var JT=p((e,t,r,i,o)=>[`M${e+o},${t}`,`L${e+r-o},${t}`,`L${e+r},${t-i/2}`,`L${e+r-o},${t-i}`,`L${e+o},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function fg(e,t){const{labelStyles:r,nodeStyles:i}=K(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const s=t.padding??0,a=70,n=32,l=t.look==="neo"?a:s,c=t.look==="neo"?n:s;if(t.width||t.height){const k=(t.height??0)/o;t.width=(t?.width??0)-2*k-c,t.height=(t.height??0)-l}const{shapeSvg:h,bbox:d}=await st(e,t,it(t)),f=(t?.height?t?.height:d.height)+l,u=f/o,g=(t?.width?t?.width:d.width)+2*u+c,m=[{x:u,y:0},{x:g-u,y:0},{x:g,y:-f/2},{x:g-u,y:-f},{x:u,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:C}=t;if(t.look==="handDrawn"){const b=V.svg(h),k=X(t,{}),T=JT(0,0,g,f,u),S=b.path(T,k);y=h.insert(()=>S,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),C&&y.attr("style",C)}else y=Ve(h,g,f,m);return i&&y.attr("style",i),t.width=g,t.height=f,Q(t,y),t.intersect=function(b){return G.polygon(t,m,b)},h}p(fg,"hexagon");async function pg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await st(e,t,it(t)),s=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,l=V.svg(o),c=X(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=gt(h),f=l.path(d,c),u=o.insert(()=>f,":first-child");return u.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",i),u.attr("transform",`translate(${-s/2}, ${-a/2})`),Q(t,u),t.intersect=function(g){return W.info("Pill intersect",t,{points:h}),G.polygon(t,h,g)},o}p(pg,"hourglass");async function gg(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=K(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await st(e,t,"icon-shape default"),f=t.pos==="t",u=n,g=n,{nodeBorder:m}=r,{stylesMap:y}=wi(t),C=-g/2,b=-u/2,k=t.label?8:0,T=V.svg(c),S=X(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const B=T.rectangle(C,b,g,u,S),v=Math.max(g,h.width),L=u+h.height+k,N=T.rectangle(-v/2,-L/2,v,L,{...S,fill:"transparent",stroke:"none"}),R=c.insert(()=>B,":first-child"),D=c.insert(()=>N);if(t.icon){const U=c.append("g");U.html(`${await xo(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const q=U.node().getBBox(),$=q.width,E=q.height,A=q.x,P=q.y;U.attr("transform",`translate(${-$/2-A},${f?h.height/2+k/2-E/2-P:-h.height/2-k/2-E/2-P})`),U.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-L/2:L/2-h.height})`),R.attr("transform",`translate(0,${f?h.height/2+k/2:-h.height/2-k/2})`),Q(t,D),t.intersect=function(U){if(W.info("iconSquare intersect",t,U),!t.label)return G.rect(t,U);const q=t.x??0,$=t.y??0,E=t.height??0;let A=[];return f?A=[{x:q-h.width/2,y:$-E/2},{x:q+h.width/2,y:$-E/2},{x:q+h.width/2,y:$-E/2+h.height+k},{x:q+g/2,y:$-E/2+h.height+k},{x:q+g/2,y:$+E/2},{x:q-g/2,y:$+E/2},{x:q-g/2,y:$-E/2+h.height+k},{x:q-h.width/2,y:$-E/2+h.height+k}]:A=[{x:q-g/2,y:$-E/2},{x:q+g/2,y:$-E/2},{x:q+g/2,y:$-E/2+u},{x:q+h.width/2,y:$-E/2+u},{x:q+h.width/2/2,y:$+E/2},{x:q-h.width/2,y:$+E/2},{x:q-h.width/2,y:$-E/2+u},{x:q-g/2,y:$-E/2+u}],G.polygon(t,A,U)},c}p(gg,"icon");async function mg(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=K(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await st(e,t,"icon-shape default"),f=20,u=t.label?8:0,g=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:C}=wi(t),b=V.svg(c),k=X(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const T=C.get("fill");k.stroke=T??y;const S=c.append("g");t.icon&&S.html(`${await xo(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const B=S.node().getBBox(),v=B.width,L=B.height,N=B.x,R=B.y,D=Math.max(v,L)*Math.SQRT2+f*2,U=b.circle(0,0,D,k),q=Math.max(D,h.width),$=D+h.height+u,E=b.rectangle(-q/2,-$/2,q,$,{...k,fill:"transparent",stroke:"none"}),A=c.insert(()=>U,":first-child"),P=c.insert(()=>E);return S.attr("transform",`translate(${-v/2-N},${g?h.height/2+u/2-L/2-R:-h.height/2-u/2-L/2-R})`),S.attr("style",`color: ${C.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-$/2:$/2-h.height})`),A.attr("transform",`translate(0,${g?h.height/2+u/2:-h.height/2-u/2})`),Q(t,P),t.intersect=function(M){return W.info("iconSquare intersect",t,M),G.rect(t,M)},c}p(mg,"iconCircle");async function yg(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=K(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await st(e,t,"icon-shape default"),u=t.pos==="t",g=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:C}=r,{stylesMap:b}=wi(t),k=-m/2,T=-g/2,S=t.label?8:0,B=V.svg(c),v=X(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const L=b.get("fill");v.stroke=L??C;const N=B.path(ur(k,T,m,g,5),v),R=Math.max(m,h.width),D=g+h.height+S,U=B.rectangle(-R/2,-D/2,R,D,{...v,fill:"transparent",stroke:"none"}),q=c.insert(()=>N,":first-child").attr("class","icon-shape2"),$=c.insert(()=>U);if(t.icon){const E=c.append("g");E.html(`${await xo(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const A=E.node().getBBox(),P=A.width,M=A.height,H=A.x,Y=A.y;E.attr("transform",`translate(${-P/2-H},${u?h.height/2+S/2-M/2-Y:-h.height/2-S/2-M/2-Y})`),E.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-D/2:D/2-h.height})`),q.attr("transform",`translate(0,${u?h.height/2+S/2:-h.height/2-S/2})`),Q(t,$),t.intersect=function(E){if(W.info("iconSquare intersect",t,E),!t.label)return G.rect(t,E);const A=t.x??0,P=t.y??0,M=t.height??0;let H=[];return u?H=[{x:A-h.width/2,y:P-M/2},{x:A+h.width/2,y:P-M/2},{x:A+h.width/2,y:P-M/2+h.height+S},{x:A+m/2,y:P-M/2+h.height+S},{x:A+m/2,y:P+M/2},{x:A-m/2,y:P+M/2},{x:A-m/2,y:P-M/2+h.height+S},{x:A-h.width/2,y:P-M/2+h.height+S}]:H=[{x:A-m/2,y:P-M/2},{x:A+m/2,y:P-M/2},{x:A+m/2,y:P-M/2+g},{x:A+h.width/2,y:P-M/2+g},{x:A+h.width/2/2,y:P+M/2},{x:A-h.width/2,y:P+M/2},{x:A-h.width/2,y:P-M/2+g},{x:A-m/2,y:P-M/2+g}],G.polygon(t,H,E)},c}p(yg,"iconRounded");async function Cg(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=K(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await st(e,t,"icon-shape default"),u=t.pos==="t",g=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:C}=r,{stylesMap:b}=wi(t),k=-m/2,T=-g/2,S=t.label?8:0,B=V.svg(c),v=X(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const L=b.get("fill");v.stroke=L??C;const N=B.path(ur(k,T,m,g,.1),v),R=Math.max(m,h.width),D=g+h.height+S,U=B.rectangle(-R/2,-D/2,R,D,{...v,fill:"transparent",stroke:"none"}),q=c.insert(()=>N,":first-child"),$=c.insert(()=>U);if(t.icon){const E=c.append("g");E.html(`${await xo(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const A=E.node().getBBox(),P=A.width,M=A.height,H=A.x,Y=A.y;E.attr("transform",`translate(${-P/2-H},${u?h.height/2+S/2-M/2-Y:-h.height/2-S/2-M/2-Y})`),E.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-D/2:D/2-h.height})`),q.attr("transform",`translate(0,${u?h.height/2+S/2:-h.height/2-S/2})`),Q(t,$),t.intersect=function(E){if(W.info("iconSquare intersect",t,E),!t.label)return G.rect(t,E);const A=t.x??0,P=t.y??0,M=t.height??0;let H=[];return u?H=[{x:A-h.width/2,y:P-M/2},{x:A+h.width/2,y:P-M/2},{x:A+h.width/2,y:P-M/2+h.height+S},{x:A+m/2,y:P-M/2+h.height+S},{x:A+m/2,y:P+M/2},{x:A-m/2,y:P+M/2},{x:A-m/2,y:P-M/2+h.height+S},{x:A-h.width/2,y:P-M/2+h.height+S}]:H=[{x:A-m/2,y:P-M/2},{x:A+m/2,y:P-M/2},{x:A+m/2,y:P-M/2+g},{x:A+h.width/2,y:P-M/2+g},{x:A+h.width/2/2,y:P+M/2},{x:A-h.width/2,y:P+M/2},{x:A-h.width/2,y:P-M/2+g},{x:A-m/2,y:P-M/2+g}],G.polygon(t,H,E)},c}p(Cg,"iconSquare");async function xg(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/s;const{labelStyles:a}=K(t);t.labelStyle=a;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??o),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??s;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:f,label:u}=await st(e,t,"image-shape default"),g=t.pos==="t",m=-c/2,y=-h/2,C=t.label?8:0,b=V.svg(d),k=X(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const T=b.rectangle(m,y,c,h,k),S=Math.max(c,f.width),B=h+f.height+C,v=b.rectangle(-S/2,-B/2,S,B,{...k,fill:"none",stroke:"none"}),L=d.insert(()=>T,":first-child"),N=d.insert(()=>v);if(t.img){const R=d.append("image");R.attr("href",t.img),R.attr("width",c),R.attr("height",h),R.attr("preserveAspectRatio","none"),R.attr("transform",`translate(${-c/2},${g?B/2-h:-B/2})`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-C/2:h/2-f.height/2+C/2})`),L.attr("transform",`translate(0,${g?f.height/2+C/2:-f.height/2-C/2})`),Q(t,N),t.intersect=function(R){if(W.info("iconSquare intersect",t,R),!t.label)return G.rect(t,R);const D=t.x??0,U=t.y??0,q=t.height??0;let $=[];return g?$=[{x:D-f.width/2,y:U-q/2},{x:D+f.width/2,y:U-q/2},{x:D+f.width/2,y:U-q/2+f.height+C},{x:D+c/2,y:U-q/2+f.height+C},{x:D+c/2,y:U+q/2},{x:D-c/2,y:U+q/2},{x:D-c/2,y:U-q/2+f.height+C},{x:D-f.width/2,y:U-q/2+f.height+C}]:$=[{x:D-c/2,y:U-q/2},{x:D+c/2,y:U-q/2},{x:D+c/2,y:U-q/2+h},{x:D+f.width/2,y:U-q/2+h},{x:D+f.width/2/2,y:U+q/2},{x:D-f.width/2,y:U+q/2},{x:D-f.width/2,y:U-q/2+h},{x:D-c/2,y:U-q/2+h}],G.polygon(t,$,R)},d}p(xg,"imageSquare");async function bg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await st(e,t,it(t)),c=Math.max(l.width+(a??0)*2,t?.width??0),h=Math.max(l.height+(s??0)*2,t?.height??0),d=[{x:0,y:0},{x:c,y:0},{x:c+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=V.svg(n),m=X(t,{}),y=gt(d),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),u&&f.attr("style",u)}else f=Ve(n,c,h,d);return i&&f.attr("style",i),t.width=c,t.height=h,Q(t,f),t.intersect=function(g){return G.polygon(t,d,g)},n}p(bg,"inv_trapezoid");async function kg(e,t){const{shapeSvg:r,bbox:i,label:o}=await st(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),Q(t,s),t.intersect=function(l){return G.rect(t,l)},r}p(kg,"labelRect");async function wg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await st(e,t,it(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=V.svg(n),m=X(t,{}),y=gt(d),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=Ve(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,Q(t,f),t.intersect=function(g){return G.polygon(t,d,g)},n}p(wg,"lean_left");async function Tg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await st(e,t,it(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=V.svg(n),m=X(t,{}),y=gt(d),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=Ve(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,Q(t,f),t.intersect=function(g){return G.polygon(t,d,g)},n}p(Tg,"lean_right");function Sg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",it(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,a=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),l=7,c=[{x:a,y:0},{x:0,y:n+l/2},{x:a-2*l,y:n+l/2},{x:0,y:2*n},{x:a,y:n-l/2},{x:2*l,y:n-l/2}],h=V.svg(o),d=X(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=gt(c),u=h.path(f,d),g=o.insert(()=>u,":first-child");return g.attr("class","outer-path"),s&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",i),g.attr("transform",`translate(-${a/2},${-n})`),Q(t,g),t.intersect=function(m){return W.info("lightningBolt intersect",t,m),G.polygon(t,c,m)},o}p(Sg,"lightningBolt");var tS=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),eS=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),rS=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),vc=10,Lc=10;async function _g(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?24:o;if(t.width||t.height){const C=t.width??0;t.width=(t.width??0)-s,t.widthB,":first-child").attr("class","line"),m=n.insert(()=>S,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const C=tS(0,0,h,u,d,f,g);m=n.insert("path",":first-child").attr("d",C).attr("class","basic label-container outer-path").attr("style",zt(y)).attr("style",i)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),Q(t,m),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),t.intersect=function(C){const b=G.rect(t,C),k=b.x-(t.x??0);if(d!=0&&(Math.abs(k)<(t.width??0)/2||Math.abs(k)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-f)){let T=f*f*(1-k*k/(d*d));T>0&&(T=Math.sqrt(T)),T=f-T,C.y-(t.y??0)>0&&(T=-T),b.y+=T}return b},n}p(_g,"linedCylinder");async function Bg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;if(t.width||t.height){const T=t.width;t.width=(T??0)*10/11-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:l,label:c}=await st(e,t,it(t)),h=(t?.width?t?.width:l.width)+(s??0)*2,d=(t?.height?t?.height:l.height)+(a??0)*2,f=t.look==="neo"?d/4:d/8,u=d+f,{cssStyles:g}=t,m=V.svg(n),y=X(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=[{x:-h/2-h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:u/2},...dr(-h/2-h/2*.1,u/2,h/2+h/2*.1,u/2,f,.8),{x:h/2+h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:-u/2},{x:-h/2,y:-u/2},{x:-h/2,y:u/2*1.1},{x:-h/2,y:-u/2}],b=m.polygon(C.map(T=>[T.x,T.y]),y),k=n.insert(()=>b,":first-child");return k.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(0,${-f/2})`),c.attr("transform",`translate(${-h/2+(t.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(t.padding??0)-f/2-(l.y-(l.top??0))})`),Q(t,k),t.intersect=function(T){return G.polygon(t,C,T)},n}p(Bg,"linedWaveEdgedRect");async function vg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await st(e,t,it(t)),d=(t?.width?t?.width:c.width)+s*2+2*n,f=(t?.height?t?.height:c.height)+a*2+2*n,u=d-2*n,g=f-2*n,m=-u/2,y=-g/2,{cssStyles:C}=t,b=V.svg(l),k=X(t,{}),T=[{x:m-n,y:y+n},{x:m-n,y:y+g+n},{x:m+u-n,y:y+g+n},{x:m+u-n,y:y+g},{x:m+u,y:y+g},{x:m+u,y:y+g-n},{x:m+u+n,y:y+g-n},{x:m+u+n,y:y-n},{x:m+n,y:y-n},{x:m+n,y},{x:m,y},{x:m,y:y+n}],S=[{x:m,y:y+n},{x:m+u-n,y:y+n},{x:m+u-n,y:y+g},{x:m+u,y:y+g},{x:m+u,y},{x:m,y}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const B=gt(T);let v=b.path(B,k);const L=gt(S);let N=b.path(L,k);t.look!=="handDrawn"&&(v=Bn(v),N=Bn(N));const R=l.insert("g",":first-child");return R.insert(()=>v),R.insert(()=>N),R.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),Q(t,R),t.intersect=function(D){return G.polygon(t,T,D)},l}p(vg,"multiRect");async function Lg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await st(e,t,it(t)),n=t.padding??0,l=t.look==="neo"?16:n,c=t.look==="neo"?12:n;let h=!0;(t.width||t.height)&&(h=!1,t.width=(t?.width??0)-l*2,t.height=(t?.height??0)-c*3);const d=Math.max(s.width,t?.width??0)+l*2,f=Math.max(s.height,t?.height??0)+c*3,u=t.look==="neo"?f/4:f/8,g=f+(h?u/2:-u/2),m=-d/2,y=-g/2,C=10,{cssStyles:b}=t,k=dr(m-C,y+g+C,m+d-C,y+g+C,u,.8),T=k?.[k.length-1],S=[{x:m-C,y:y+C},{x:m-C,y:y+g+C},...k,{x:m+d-C,y:T.y-C},{x:m+d,y:T.y-C},{x:m+d,y:T.y-2*C},{x:m+d+C,y:T.y-2*C},{x:m+d+C,y:y-C},{x:m+C,y:y-C},{x:m+C,y},{x:m,y},{x:m,y:y+C}],B=[{x:m,y:y+C},{x:m+d-C,y:y+C},{x:m+d-C,y:T.y-C},{x:m+d,y:T.y-C},{x:m+d,y},{x:m,y}],v=V.svg(o),L=X(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const N=gt(S),R=v.path(N,L),D=gt(B),U=v.path(D,L),q=o.insert(()=>R,":first-child");return q.insert(()=>U),q.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&q.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&q.selectAll("path").attr("style",i),q.attr("transform",`translate(0,${-u/2})`),a.attr("transform",`translate(${-(s.width/2)-C-(s.x-(s.left??0))}, ${-(s.height/2)+C-u/2-(s.y-(s.top??0))})`),Q(t,q),t.intersect=function($){return G.polygon(t,S,$)},o}p(Lg,"multiWaveEdgedRectangle");async function Fg(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=K(t);t.labelStyle=i,t.useHtmlLabels||re(At())||(t.centerLabel=!0);const{shapeSvg:a,bbox:n,label:l}=await st(e,t,it(t)),c=Math.max(n.width+(t.padding??0)*2,t?.width??0),h=Math.max(n.height+(t.padding??0)*2,t?.height??0),d=-c/2,f=-h/2,{cssStyles:u}=t,g=V.svg(a),m=X(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,c,h,m),C=a.insert(()=>y,":first-child");return C.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),u&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",u),o&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",o),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Q(t,C),t.intersect=function(b){return G.rect(t,b)},a}p(Fg,"note");var iS=p((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function Ag(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await st(e,t,it(t)),a=s.width+(t.padding??0),n=s.height+(t.padding??0),l=a+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=V.svg(o),g=X(t,{}),m=iS(0,0,l),y=u.path(m,g);d=o.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),f&&d.attr("style",f)}else d=Ve(o,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&d.attr("style",i),Q(t,d),t.calcIntersect=function(u,g){const m=u.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],C=G.polygon(u,y,g);return{x:C.x-.5,y:C.y-.5}},t.intersect=function(u){return this.calcIntersect(t,u)},o}p(Ag,"question");async function Eg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?21:o??0,a=t.look==="neo"?12:o??0,{shapeSvg:n,bbox:l,label:c}=await st(e,t,it(t)),h=(t?.width??l.width)+(t.look==="neo"?s*2:s),d=(t?.height??l.height)+(t.look==="neo"?a*2:a),f=-h/2,u=-d/2,g=u/2,m=[{x:f+g,y:u},{x:f,y:0},{x:f+g,y:-u},{x:-f,y:-u},{x:-f,y:u}],{cssStyles:y}=t,C=V.svg(n),b=X(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const k=gt(m),T=C.path(k,b),S=n.insert(()=>T,":first-child");return S.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),S.attr("transform",`translate(${-g/2},0)`),c.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),Q(t,S),t.intersect=function(B){return G.polygon(t,m,B)},n}p(Eg,"rect_left_inv_arrow");async function Mg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=s.insert("g"),n=s.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await or(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(re(Ct())){const L=h.children[0],N=ut(h);d=L.getBoundingClientRect(),N.attr("width",d.width),N.attr("height",d.height)}W.info("Text 2",l);const f=l||[],u=h.getBBox(),g=await or(n,Array.isArray(f)?f.join("
    "):f,t.labelStyle,!0,!0),m=g.children[0],y=ut(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const C=(t.padding||0)/2;ut(g).attr("transform","translate( "+(d.width>u.width?0:(u.width-d.width)/2)+", "+(u.height+C+5)+")"),ut(h).attr("transform","translate( "+(d.width(W.debug("Rough node insert CXC",R),D),":first-child"),B=s.insert(()=>(W.debug("Rough node insert CXC",R),R),":first-child")}else B=a.insert("rect",":first-child"),v=a.insert("line"),B.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-C).attr("y",-d.height/2-C).attr("width",d.width+(t.padding||0)).attr("height",d.height+(t.padding||0)),v.attr("class","divider").attr("x1",-d.width/2-C).attr("x2",d.width/2+C).attr("y1",-d.height/2-C+u.height+C).attr("y2",-d.height/2-C+u.height+C);return Q(t,B),t.intersect=function(L){return G.rect(t,L)},s}p(Mg,"rectWithTitle");async function $g(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,o={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return Ti(e,t,o)}p($g,"roundedRect");var yr=8;async function Og(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await st(e,t,it(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?yr:yr*2),h=(t?.height??n.height)+s*2,d=c-yr,f=h,u=yr-c/2,g=-h/2,{cssStyles:m}=t,y=V.svg(a),C=X(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const b=[{x:u,y:g},{x:u+d,y:g},{x:u+d,y:g+f},{x:u-yr,y:g+f},{x:u-yr,y:g},{x:u,y:g},{x:u,y:g+f}],k=y.polygon(b.map(S=>[S.x,S.y]),C),T=a.insert(()=>k,":first-child");return T.attr("class","basic label-container outer-path").attr("style",zt(m)),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),m&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),l.attr("transform",`translate(${yr/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Q(t,T),t.intersect=function(S){return G.rect(t,S)},a}p(Og,"shadedProcess");async function Ig(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:l,label:c}=await st(e,t,it(t)),h=(t?.width?t?.width:l.width)+s*2,d=((t?.height?t?.height:l.height)+a*2)*1.5,f=h,u=d/1.5,g=-f/2,m=-u/2,{cssStyles:y}=t,C=V.svg(n),b=X(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const k=[{x:g,y:m},{x:g,y:m+u},{x:g+f,y:m+u},{x:g+f,y:m-u/2}],T=gt(k),S=C.path(T,b),B=n.insert(()=>S,":first-child");return B.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",y),i&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",i),B.attr("transform",`translate(0, ${u/4})`),c.attr("transform",`translate(${-f/2+(t.padding??0)-(l.x-(l.left??0))}, ${-u/4+(t.padding??0)-(l.y-(l.top??0))})`),Q(t,B),t.intersect=function(v){return G.polygon(t,k,v)},n}p(Ig,"slopedRect");async function Dg(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o};return Ti(e,t,s)}p(Dg,"squareRect");async function Pg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?20:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await st(e,t,it(t)),c=l.height+(t.look==="neo"?a*2:a),h=l.width+c/4+(t.look==="neo"?s*2:s),d=c/2,{cssStyles:f}=t,u=V.svg(n),g=X(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-c/2},{x:h/2-d,y:-c/2},...lo(-h/2+d,0,d,50,90,270),{x:h/2-d,y:c/2},...lo(h/2-d,0,d,50,270,450)],y=gt(m),C=u.path(y,g),b=n.insert(()=>C,":first-child");return b.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),Q(t,b),t.intersect=function(k){return G.polygon(t,m,k)},n}p(Pg,"stadium");async function Rg(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return Ti(e,t,r)}p(Rg,"state");function Ng(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=K(t);t.labelStyle=i;const{cssStyles:s}=t,{lineColor:a,stateBorder:n,nodeBorder:l,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const h=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),d=V.svg(h),f=X(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const u=d.circle(0,0,t.width,{...f,stroke:a,strokeWidth:2}),g=n??l,m=(t.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),C=h.insert(()=>u,":first-child");if(C.insert(()=>y),t.look!=="handDrawn"&&C.attr("class","outer-path"),s&&C.selectAll("path").attr("style",s),o&&C.selectAll("path").attr("style",o),t.width<25&&c&&t.look!=="handDrawn"){const b=e.node()?.ownerSVGElement?.id??"",k=b?`${b}-drop-shadow-small`:"drop-shadow-small";C.attr("style",`filter:url(#${k})`)}return Q(t,C),t.intersect=function(b){return G.circle(t,(t.width??0)/2,b)},h}p(Ng,"stateEnd");function qg(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:o}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const l=V.svg(s).circle(0,0,t.width,g2(i));a=s.insert(()=>l),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else a=s.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&o&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",l=n?`${n}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${l})`)}return Q(t,a),t.intersect=function(n){return G.circle(t,(t.width??7)/2,n)},s}p(qg,"stateStart");var Yr=8;async function Wg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t?.padding??8,s=t.look==="neo"?28:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await st(e,t,it(t)),c=(t?.width??l.width)+2*Yr+s,h=(t?.height??l.height)+a,d=c-2*Yr,f=h,u=-c/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look==="handDrawn"){const y=V.svg(n),C=X(t,{}),b=y.rectangle(u,g,d+16,f,C),k=y.line(u+Yr,g,u+Yr,g+f,C),T=y.line(u+Yr+d,g,u+Yr+d,g+f,C);n.insert(()=>k,":first-child"),n.insert(()=>T,":first-child");const S=n.insert(()=>b,":first-child"),{cssStyles:B}=t;S.attr("class","basic label-container").attr("style",zt(B)),Q(t,S)}else{const y=Ve(n,d,f,m);i&&y.attr("style",i),Q(t,y)}return t.intersect=function(y){return G.polygon(t,m,y)},n}p(Wg,"subroutine");var Ma=.2;async function zg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-s*2-Ma*(t.height+a*2),10));const{shapeSvg:n,bbox:l}=await st(e,t,it(t)),c=(t?.height?t?.height:l.height)+a*2,h=Ma*c,d=Ma*c,u=(t?.width?t?.width:l.width)+s*2+h-h,g=c,m=-u/2,y=-g/2,{cssStyles:C}=t,b=V.svg(n),k=X(t,{}),T=[{x:m-h/2,y},{x:m+u+h/2,y},{x:m+u+h/2,y:y+g},{x:m-h/2,y:y+g}],S=[{x:m+u-h/2,y:y+g},{x:m+u+h/2,y:y+g},{x:m+u+h/2,y:y+g-d}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const B=gt(T),v=b.path(B,k),L=gt(S),N=b.path(L,{...k,fillStyle:"solid"}),R=n.insert(()=>N,":first-child");return R.insert(()=>v,":first-child"),R.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",i),Q(t,R),t.intersect=function(D){return G.polygon(t,T,D)},n}p(zg,"taggedRect");async function Hg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await st(e,t,it(t)),n=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,f=l+c,{cssStyles:u}=t,g=V.svg(o),m=X(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-n/2-n/2*.1,y:f/2},...dr(-n/2-n/2*.1,f/2,n/2+n/2*.1,f/2,c,.8),{x:n/2+n/2*.1,y:-f/2},{x:-n/2-n/2*.1,y:-f/2}],C=-n/2+n/2*.1,b=-f/2-d*.4,k=[{x:C+n-h,y:(b+l)*1.3},{x:C+n,y:b+l-d},{x:C+n,y:(b+l)*.9},...dr(C+n,(b+l)*1.25,C+n-h,(b+l)*1.3,-l*.02,.5)],T=gt(y),S=g.path(T,m),B=gt(k),v=g.path(B,{...m,fillStyle:"solid"}),L=o.insert(()=>v,":first-child");return L.insert(()=>S,":first-child"),L.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),L.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),Q(t,L),t.intersect=function(N){return G.polygon(t,y,N)},o}p(Hg,"taggedWaveEdgedRectangle");async function Yg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await st(e,t,it(t)),a=Math.max(s.width+(t.padding??0),t?.width||0),n=Math.max(s.height+(t.padding??0),t?.height||0),l=-a/2,c=-n/2,h=o.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",a).attr("height",n),Q(t,h),t.intersect=function(d){return G.rect(t,d)},o}p(Yg,"text");var oS=p((e,t,r,i,o,s)=>`M${e},${t} + a${o},${s} 0,0,1 0,${-i} + l${r},0 + a${o},${s} 0,0,1 0,${i} + M${r},${-i} + a${o},${s} 0,0,0 0,${i} + l${-r},0`,"createCylinderPathD"),sS=p((e,t,r,i,o,s)=>[`M${e},${t}`,`M${e+r},${t}`,`a${o},${s} 0,0,0 0,${-i}`,`l${-r},0`,`a${o},${s} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),aS=p((e,t,r,i,o,s)=>[`M${e+r/2},${-i/2}`,`a${o},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),Fc=5,Ac=10;async function Ug(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?12:o/2;if(t.width||t.height){const m=t.height??0;t.height=(t.height??0)-s,t.heightk,":first-child"),g=a.insert(()=>b,":first-child"),g.attr("class","basic label-container"),u&&g.attr("style",u)}else{const m=oS(0,0,f,c,d,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",zt(u)).attr("style",i),g.attr("class","basic label-container outer-path"),u&&g.selectAll("path").attr("style",u),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${c/2} )`),l.attr("transform",`translate(${-(n.width/2)-d-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Q(t,g),t.intersect=function(m){const y=G.rect(t,m),C=y.y-(t.y??0);if(h!=0&&(Math.abs(C)<(t.height??0)/2||Math.abs(C)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-d)){let b=d*d*(1-C*C/(h*h));b!=0&&(b=Math.sqrt(Math.abs(b))),b=d-b,m.x-(t.x??0)>0&&(b=-b),y.x+=b}return y},a}p(Ug,"tiltedCylinder");async function jg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=(t.look==="neo",o),a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await st(e,t,it(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=V.svg(n),m=X(t,{}),y=gt(d),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=Ve(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,Q(t,f),t.intersect=function(g){return G.polygon(t,d,g)},n}p(jg,"trapezoid");async function Gg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-a*2,t.heightb,":first-child");return k.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),Q(t,k),t.intersect=function(T){return G.polygon(t,y,T)},c}p(Gg,"trapezoidalPentagon");var Ec=10,Mc=10;async function Xg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.width=((t?.width??0)-s)/2,t.widthb,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),t.width=h,t.height=d,Q(t,k),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${d/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(T){return W.info("Triangle intersect",t,u,T),G.polygon(t,u,T)},a}p(Xg,"triangle");async function Vg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10));const{shapeSvg:l,bbox:c,label:h}=await st(e,t,it(t)),d=(t?.width?t?.width:c.width)+(s??0)*2,f=(t?.height?t?.height:c.height)+(a??0)*2,u=t.look==="neo"?f/4:f/8,g=f+(n?u:-u),{cssStyles:m}=t,C=14-d,b=C>0?C/2:0,k=V.svg(l),T=X(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const S=[{x:-d/2-b,y:g/2},...dr(-d/2-b,g/2,d/2+b,g/2,u,.8),{x:d/2+b,y:-g/2},{x:-d/2-b,y:-g/2}],B=gt(S),v=k.path(B,T),L=l.insert(()=>v,":first-child");return L.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),L.attr("transform",`translate(0,${-u/2})`),h.attr("transform",`translate(${-d/2+(t.padding??0)-(c.x-(c.left??0))},${-f/2+(t.padding??0)-u-(c.y-(c.top??0))})`),Q(t,L),t.intersect=function(N){return G.polygon(t,S,N)},l}p(Vg,"waveEdgedRectangle");async function Zg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?20:o;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);const T=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-a-T*(20/9)),t.width=t.width-s*2}const{shapeSvg:n,bbox:l}=await st(e,t,it(t)),c=(t?.width?t?.width:l.width)+s*2,h=(t?.height?t?.height:l.height)+a,d=h/8,f=h+d*2,{cssStyles:u}=t,g=V.svg(n),m=X(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-c/2,y:f/2},...dr(-c/2,f/2,c/2,f/2,d,1),{x:c/2,y:-f/2},...dr(c/2,-f/2,-c/2,-f/2,d,-1)],C=gt(y),b=g.path(C,m),k=n.insert(()=>b,":first-child");return k.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),Q(t,k),t.intersect=function(T){return G.polygon(t,y,T)},n}p(Zg,"waveRectangle");var Mt=10;async function Kg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-Mt,10),t.height=Math.max((t?.height??0)-s*2-Mt,10));const{shapeSvg:a,bbox:n,label:l}=await st(e,t,it(t)),c=(t?.width?t?.width:n.width)+o*2+Mt,h=(t?.height?t?.height:n.height)+s*2+Mt,d=c-Mt,f=h-Mt,u=-d/2,g=-f/2,{cssStyles:m}=t,y=V.svg(a),C=X(t,{}),b=[{x:u-Mt,y:g-Mt},{x:u-Mt,y:g+f},{x:u+d,y:g+f},{x:u+d,y:g-Mt}],k=`M${u-Mt},${g-Mt} L${u+d},${g-Mt} L${u+d},${g+f} L${u-Mt},${g+f} L${u-Mt},${g-Mt} + M${u-Mt},${g} L${u+d},${g} + M${u},${g-Mt} L${u},${g+f}`;t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const T=y.path(k,C),S=a.insert(()=>T,":first-child");return S.attr("transform",`translate(${Mt/2}, ${Mt/2})`),S.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+Mt/2-(n.x-(n.left??0))}, ${-(n.height/2)+Mt/2-(n.y-(n.top??0))})`),Q(t,S),t.intersect=function(B){return G.polygon(t,b,B)},a}p(Kg,"windowPane");var $c=new Set(["redux-color","redux-dark-color"]),nS=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function $l(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=At(),{rowEven:s,rowOdd:a,nodeBorder:n,borderColorArray:l}=o;if(t.look==="handDrawn"){const{themeVariables:et}=At(),{background:pt}=et,wt={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${pt}`]};await $l(e,wt)}const c=At();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:f}=t,{labelStyles:u,nodeStyles:g}=K(t);if(r.attributes.length===0&&t.label){const et={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Ge(t.label,c)+et.labelPaddingX*20){const et=C.width+h*2-(S+B+v+L);S+=et/D,B+=et/D,v>0&&(v+=et/D),L>0&&(L+=et/D)}const q=S+B+v+L,$=V.svg(y),E=X(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");let A=0;T.length>0&&(A=T.reduce((et,pt)=>et+(pt?.rowHeight??0),0));const P=Math.max(U.width+h*2,t?.width||0,q),M=Math.max((A??0)+C.height,t?.height||0),H=-P/2,Y=-M/2;if(y.selectAll("g:not(:first-child)").each((et,pt,wt)=>{const _t=ut(wt[pt]),Bt=_t.attr("transform");let Ot=0,yt=0;if(Bt){const Tt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Bt);Tt&&(Ot=parseFloat(Tt[1]),yt=parseFloat(Tt[2]),_t.attr("class").includes("attribute-name")?Ot+=S:_t.attr("class").includes("attribute-keys")?Ot+=S+B:_t.attr("class").includes("attribute-comment")&&(Ot+=S+B+v))}_t.attr("transform",`translate(${H+h/2+Ot}, ${yt+Y+C.height+d/2})`)}),y.select(".name").attr("transform","translate("+-C.width/2+", "+(Y+d/2)+")"),i!=null&&$c.has(i)){const et=r.colorIndex??0;y.attr("data-color-id",`color-${et%l.length}`)}const ot=$.rectangle(H,Y,P,M,E),Z=y.insert(()=>ot,":first-child").attr("class","outer-path").attr("style",f.join(""));k.push(0);for(const[et,pt]of T.entries()){const _t=(et+1)%2===0&&pt.yOffset!==0,Bt=$.rectangle(H,C.height+Y+pt?.yOffset,P,pt?.rowHeight,{...E,fill:_t?s:a,stroke:n});y.insert(()=>Bt,"g.label").attr("style",f.join("")).attr("class",`row-rect-${_t?"even":"odd"}`)}const dt=1e-4;let ft=Xr(H,C.height+Y,P+H,C.height+Y,dt),bt=$.polygon(ft.map(et=>[et.x,et.y]),E);if(y.insert(()=>bt).attr("class","divider"),ft=Xr(S+H,C.height+Y,S+H,M+Y,dt),bt=$.polygon(ft.map(et=>[et.x,et.y]),E),y.insert(()=>bt).attr("class","divider"),N){const et=S+B+H;ft=Xr(et,C.height+Y,et,M+Y,dt),bt=$.polygon(ft.map(pt=>[pt.x,pt.y]),E),y.insert(()=>bt).attr("class","divider")}if(R){const et=S+B+v+H;ft=Xr(et,C.height+Y,et,M+Y,dt),bt=$.polygon(ft.map(pt=>[pt.x,pt.y]),E),y.insert(()=>bt).attr("class","divider")}for(const et of k){const pt=C.height+Y+et;ft=Xr(H,pt,P+H,pt,dt),bt=$.polygon(ft.map(wt=>[wt.x,wt.y]),E),y.insert(()=>bt).attr("class","divider")}if(Q(t,Z),g&&t.look!=="handDrawn")if(i!=null&&nS.has(i))y.selectAll("path").attr("style",g);else{const pt=g.split(";")?.filter(wt=>wt.includes("stroke"))?.map(wt=>`${wt}`).join("; ");y.selectAll("path").attr("style",pt??""),y.selectAll(".row-rect-even path").attr("style",g)}return t.intersect=function(et){return G.rect(t,et)},y}p($l,"erBox");async function Gr(e,t,r,i=0,o=0,s=[],a=""){const n=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",a);t!==Sh(t)&&(t=Sh(t),t=t.replaceAll("<","<").replaceAll(">",">"));const l=n.node().appendChild(await Re(n,t,{width:Ge(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let c=l.getBBox();if(De(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=ut(l);c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}p(Gr,"addText");function Xr(e,t,r,i,o){return e===r?[{x:e-o/2,y:t},{x:e+o/2,y:t},{x:r+o/2,y:i},{x:r-o/2,y:i}]:[{x:e,y:t-o/2},{x:e,y:t+o/2},{x:r,y:i+o/2},{x:r,y:i-o/2}]}p(Xr,"lineToPolygon");async function Qg(e,t,r,i,o=r.class.padding??12){const s=i?0:3,a=e.insert("g").attr("class",it(t)).attr("id",t.domId||t.id);let n=null,l=null,c=null,h=null,d=0,f=0,u=0;if(n=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const b=t.annotations[0];await Yi(n,{text:`«${b}»`},0),d=n.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await Yi(l,t,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const b of t.members){const k=await Yi(c,b,m,[b.parseClassifier()]);m+=k+s}u=c.node().getBBox().height,u<=0&&(u=o/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const b of t.methods){const k=await Yi(h,b,y,[b.parseClassifier()]);y+=k+s}let C=a.node().getBBox();if(n!==null){const b=n.node().getBBox();n.attr("transform",`translate(${-b.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),C=a.node().getBBox(),c.attr("transform",`translate(0, ${d+f+o*2})`),C=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(u?u+o*4:o*2)})`),C=a.node().getBBox(),{shapeSvg:a,bbox:C}}p(Qg,"textHelper");async function Yi(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),s=At();let a="useHtmlLabels"in t?t.useHtmlLabels:De(s.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),Ji(n)&&(a=!0);const l=await Re(o,zn(Ar(n)),{width:Ge(n,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,h=1;if(a){const d=l.children[0],f=ut(l);h=d.innerHTML.split("
    ").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const u=d.getElementsByTagName("img");if(u){const g=n.replace(/]*>/g,"").trim()==="";await Promise.all([...u].map(m=>new Promise(y=>{function C(){if(m.style.display="flex",m.style.flexDirection="column",g){const b=s.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,T=parseInt(b,10)*5+"px";m.style.minWidth=T,m.style.maxWidth=T}else m.style.width="100%";y(m)}p(C,"setupImage"),setTimeout(()=>{m.complete&&C()}),m.addEventListener("error",C),m.addEventListener("load",C)})))}c=d.getBoundingClientRect(),f.attr("width",c.width),f.attr("height",c.height)}else{i.includes("font-weight: bolder")&&ut(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=n[0]+n.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),n[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),c=l.getBBox()}return o.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}p(Yi,"addText");async function Jg(e,t){const r=Ct(),{themeVariables:i}=r,{useGradient:o}=i,s=r.class.padding??12,a=s,n=t.useHtmlLabels??De(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await Qg(e,t,r,n,a),{labelStyles:d,nodeStyles:f}=K(t);t.labelStyle=d,t.cssStyles=l.styles||"";const u=l.styles?.join(";")||f||"";t.cssStyles||(t.cssStyles=u.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!r.class?.hideEmptyMembersBox,m=V.svg(c),y=X(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=Math.max(t.width??0,h.width);let b=Math.max(t.height??0,h.height);const k=(t.height??0)>h.height;l.members.length===0&&l.methods.length===0?b+=a:l.members.length>0&&l.methods.length===0&&(b+=a*2);const T=-C/2,S=-b/2;let B=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;k&&(B=s*2);const v=m.rectangle(T-s,S-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),C+2*s,b+2*s+B,y),L=c.insert(()=>v,":first-child");L.attr("class","basic label-container outer-path");const N=L.node().getBBox(),R=c.select(".annotation-group").node().getBBox().height-(g?s/2:0)||0,D=c.select(".label-group").node().getBBox().height-(g?s/2:0)||0,U=c.select(".members-group").node().getBBox().height-(g?s/2:0)||0,q=(R+D+S+s-(S-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(c.selectAll(".text").each(($,E,A)=>{const P=ut(A[E]),M=P.attr("transform");let H=0;if(M){const dt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(M);dt&&(H=parseFloat(dt[2]))}let Y=H+S+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(P.attr("class").includes("methods-group")){const Z=Math.max(U,a/2);k?Y=Math.max(q,R+D+Z+S+a*2+s)+a*2:Y=R+D+Z+S+a*4+s}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?Y=H-a:Y=H),n||(Y-=4);let ot=T;(P.attr("class").includes("label-group")||P.attr("class").includes("annotation-group"))&&(ot=-P.node()?.getBBox().width/2||0,c.selectAll("text").each(function(Z,dt,ft){window.getComputedStyle(ft[dt]).textAnchor==="middle"&&(ot=0)})),P.attr("transform",`translate(${ot}, ${Y})`)}),l.members.length>0||l.methods.length>0||g){const $=R+D+S+s,E=m.line(N.x,$,N.x+N.width,$+.001,y);c.insert(()=>E).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(g||l.members.length>0||l.methods.length>0){const $=R+D+U+S+a*2+s,E=m.line(N.x,k?Math.max(q,$):$,N.x+N.width,(k?Math.max(q,$):$)+.001,y);c.insert(()=>E).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(l.look!=="handDrawn"&&c.selectAll("path").attr("style",u),L.select(":nth-child(2)").attr("style",u),c.selectAll(".divider").select("path").attr("style",u),t.labelStyle?c.selectAll("span").attr("style",t.labelStyle):c.selectAll("span").attr("style",u),!n){const $=RegExp(/color\s*:\s*([^;]*)/),E=$.exec(u);if(E){const A=E[0].replace("color","fill");c.selectAll("tspan").attr("style",A)}else if(d){const A=$.exec(d);if(A){const P=A[0].replace("color","fill");c.selectAll("tspan").attr("style",P)}}}return Q(t,L),t.intersect=function($){return G.rect(t,$)},c}p(Jg,"classBox");async function tm(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t,s=t,a=20,n=20,l="verifyMethod"in t,c=it(t),{themeVariables:h}=Ct(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,u=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let g;l?g=await Fe(u,`<<${o.type}>>`,0,t.labelStyle):g=await Fe(u,"<<Element>>",0,t.labelStyle);let m=g;const y=await Fe(u,o.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+n,l){const N=await Fe(u,`${o.requirementId?`ID: ${o.requirementId}`:""}`,m,t.labelStyle);m+=N;const R=await Fe(u,`${o.text?`Text: ${o.text}`:""}`,m,t.labelStyle);m+=R;const D=await Fe(u,`${o.risk?`Risk: ${o.risk}`:""}`,m,t.labelStyle);m+=D,await Fe(u,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,m,t.labelStyle)}else{const N=await Fe(u,`${s.type?`Type: ${s.type}`:""}`,m,t.labelStyle);m+=N,await Fe(u,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,t.labelStyle)}const C=(u.node()?.getBBox().width??200)+a,b=(u.node()?.getBBox().height??200)+a,k=-C/2,T=-b/2,S=V.svg(u),B=X(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const v=S.rectangle(k,T,C,b,B),L=u.insert(()=>v,":first-child");if(L.attr("class","basic label-container outer-path").attr("style",i),d?.length){const N=t.colorIndex??0;u.attr("data-color-id",`color-${N%d.length}`)}if(u.selectAll(".label").each((N,R,D)=>{const U=ut(D[R]),q=U.attr("transform");let $=0,E=0;if(q){const H=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(q);H&&($=parseFloat(H[1]),E=parseFloat(H[2]))}const A=E-b/2;let P=k+a/2;(R===0||R===1)&&(P=$),U.attr("transform",`translate(${P}, ${A+a})`)}),m>g+y+n){const N=T+g+y+n;let R;if(t.look==="neo"){const q=[[k,N],[k+C,N],[k+C,N+.001],[k,N+.001]];R=S.polygon(q,B)}else R=S.line(k,N,k+C,N,B);u.insert(()=>R).attr("class","divider")}return Q(t,L),t.intersect=function(N){return G.rect(t,N)},i&&t.look!=="handDrawn"&&(f||d?.length)&&u.selectAll("path").attr("style",i),u}p(tm,"requirementBox");async function Fe(e,t,r,i=""){if(t==="")return 0;const o=e.insert("g").attr("class","label").attr("style",i),s=Ct(),a=s.htmlLabels??!0,n=await Re(o,zn(Ar(t)),{width:Ge(t,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:i},s);let l;if(a){const c=n.children[0],h=ut(n);l=c.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const c=n.children[0];for(const h of c.children)i&&h.setAttribute("style",i);l=n.getBBox(),l.height+=6}return o.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}p(Fe,"addText");var lS=p(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function em(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=K(t);t.labelStyle=i||"";const s=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:l,label:c}=await st(e,t,it(t)),h=t.padding||10;let d="",f;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),f=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const u={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await Ea(f,"ticket"in t&&t.ticket||"",u):{label:g,bbox:m}=await Ea(n,"ticket"in t&&t.ticket||"",u);const{label:y,bbox:C}=await Ea(n,"assigned"in t&&t.assigned||"",u);t.width=a;const b=10,k=t?.width||0,T=Math.max(m.height,C.height)/2,S=Math.max(l.height+b*2,t?.height||0)+T,B=-k/2,v=-S/2;c.attr("transform","translate("+(h-k/2)+", "+(-T-l.height/2)+")"),g.attr("transform","translate("+(h-k/2)+", "+(-T+l.height/2)+")"),y.attr("transform","translate("+(h+k/2-C.width-2*s)+", "+(-T+l.height/2)+")");let L;const{rx:N,ry:R}=t,{cssStyles:D}=t;if(t.look==="handDrawn"){const U=V.svg(n),q=X(t,{}),$=N||R?U.path(ur(B,v,k,S,N||0),q):U.rectangle(B,v,k,S,q);L=n.insert(()=>$,":first-child"),L.attr("class","basic label-container").attr("style",D||null)}else{L=n.insert("rect",":first-child"),L.attr("class","basic label-container __APA__").attr("style",o).attr("rx",N??5).attr("ry",R??5).attr("x",B).attr("y",v).attr("width",k).attr("height",S);const U="priority"in t&&t.priority;if(U){const q=n.append("line"),$=B+2,E=v+Math.floor((N??0)/2),A=v+S-Math.floor((N??0)/2);q.attr("x1",$).attr("y1",E).attr("x2",$).attr("y2",A).attr("stroke-width","4").attr("stroke",lS(U))}}return Q(t,L),t.height=S,t.intersect=function(U){return G.rect(t,U)},n}p(em,"kanbanItem");async function rm(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await st(e,t,it(t)),l=s.width+10*a,c=s.height+8*a,h=.15*l,{cssStyles:d}=t,f=s.width+20,u=s.height+20,g=Math.max(l,f),m=Math.max(c,u);n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const C=`M0 0 + a${h},${h} 1 0,0 ${g*.25},${-1*m*.1} + a${h},${h} 1 0,0 ${g*.25},0 + a${h},${h} 1 0,0 ${g*.25},0 + a${h},${h} 1 0,0 ${g*.25},${m*.1} + + a${h},${h} 1 0,0 ${g*.15},${m*.33} + a${h*.8},${h*.8} 1 0,0 0,${m*.34} + a${h},${h} 1 0,0 ${-1*g*.15},${m*.33} + + a${h},${h} 1 0,0 ${-1*g*.25},${m*.15} + a${h},${h} 1 0,0 ${-1*g*.25},0 + a${h},${h} 1 0,0 ${-1*g*.25},0 + a${h},${h} 1 0,0 ${-1*g*.25},${-1*m*.15} + + a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33} + a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34} + a${h},${h} 1 0,0 ${g*.1},${-1*m*.33} + H0 V0 Z`;if(t.look==="handDrawn"){const b=V.svg(o),k=X(t,{}),T=b.path(C,k);y=o.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",zt(d))}else y=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",C);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),Q(t,y),t.calcIntersect=function(b,k){return G.rect(b,k)},t.intersect=function(b){return W.info("Bang intersect",t,b),G.rect(t,b)},o}p(rm,"bang");async function im(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await st(e,t,it(t)),l=s.width+2*a,c=s.height+2*a,h=.15*l,d=.25*l,f=.35*l,u=.2*l,{cssStyles:g}=t;let m;const y=`M0 0 + a${h},${h} 0 0,1 ${l*.25},${-1*l*.1} + a${f},${f} 1 0,1 ${l*.4},${-1*l*.1} + a${d},${d} 1 0,1 ${l*.35},${l*.2} + + a${h},${h} 1 0,1 ${l*.15},${c*.35} + a${u},${u} 1 0,1 ${-1*l*.15},${c*.65} + + a${d},${h} 1 0,1 ${-1*l*.25},${l*.15} + a${f},${f} 1 0,1 ${-1*l*.5},0 + a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15} + + a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35} + a${u},${u} 1 0,1 ${l*.1},${-1*c*.65} + H0 V0 Z`;if(t.look==="handDrawn"){const C=V.svg(o),b=X(t,{}),k=C.path(y,b);m=o.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",zt(g))}else m=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),Q(t,m),t.calcIntersect=function(C,b){return G.rect(C,b)},t.intersect=function(C){return W.info("Cloud intersect",t,C),G.rect(t,C)},o}p(im,"cloud");async function om(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await st(e,t,it(t)),l=s.width+8*a,c=s.height+2*a,h=5,d=t.look==="neo"?` + M${-l/2} ${c/2-h} + v${-c+2*h} + q0,-${h} ${h},-${h} + h${l-2*h} + q${h},0 ${h},${h} + v${c-h} + H${-l/2} + Z + `:` + M${-l/2} ${c/2-h} + v${-c+2*h} + q0,-${h} ${h},-${h} + h${l-2*h} + q${h},0 ${h},${h} + v${c-2*h} + q0,${h} ${-h},${h} + h${-(l-2*h)} + q${-h},0 ${-h},${-h} + Z + `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return o.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),o.append(()=>n.node()),Q(t,f),t.calcIntersect=function(u,g){return G.rect(u,g)},t.intersect=function(u){return G.rect(t,u)},o}p(om,"defaultMindmapNode");async function sm(e,t){const r={padding:t.padding??0};return Ml(e,t,r)}p(sm,"mindmapCircle");var hS=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Dg},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:$g},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Pg},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Wg},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:sg},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:ag},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Ml},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:rm},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:im},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Ag},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:fg},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Tg},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:wg},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:jg},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:bg},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:lg},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Yg},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Kp},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Og},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:qg},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:Ng},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:dg},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:pg},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:eg},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:rg},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:ig},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Sg},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Vg},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:ug},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Ug},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:_g},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:og},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:ng},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Xg},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Kg},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:hg},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Gg},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:cg},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Ig},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Lg},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:vg},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Zp},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:tg},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Hg},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:zg},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Zg},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Eg},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Bg}],cS=p(()=>{const t=[...Object.entries({state:Rg,choice:Qp,note:Fg,rectWithTitle:Mg,labelRect:kg,iconSquare:Cg,iconCircle:mg,icon:gg,iconRounded:yg,imageSquare:xg,anchor:Xp,kanbanItem:em,mindmapCircle:sm,defaultMindmapNode:om,classBox:Jg,erBox:$l,requirementBox:tm}),...hS.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),am=cS();function dS(e){return e in am}p(dS,"isValidShape");var Zs=new Map;async function nm(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?am[t.shape]:void 0;if(!s)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),o=await s(i,t,r)}else o=await s(e,t,r),i=o;return i.attr("data-look",zt(t.look)),t.tooltip&&o.attr("title",t.tooltip),Zs.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}p(nm,"insertNode");var aF=p((e,t)=>{Zs.set(t.id,e)},"setNodeElem"),nF=p(()=>{Zs.clear()},"clear"),lF=p(e=>{const t=Zs.get(e.id);W.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),Di=p((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),Zt={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Oc={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function Ui(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=vt(e),t=vt(t);const[r,i]=[e.x,e.y],[o,s]=[t.x,t.y],a=o-r,n=s-i;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}p(Ui,"calculateDeltaAndAngle");var vt=p(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),uS=p(e=>({x:p(function(t,r,i){let o=0;const s=vt(i[0]).x=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Zt,e.arrowTypeEnd)){const{angle:u,deltaX:g}=Ui(i[i.length-1],i[i.length-2]);o=Zt[e.arrowTypeEnd]*Math.cos(u)*(g>=0?1:-1)}const a=Math.abs(vt(t).x-vt(i[i.length-1]).x),n=Math.abs(vt(t).y-vt(i[i.length-1]).y),l=Math.abs(vt(t).x-vt(i[0]).x),c=Math.abs(vt(t).y-vt(i[0]).y),h=Zt[e.arrowTypeStart],d=Zt[e.arrowTypeEnd],f=1;if(a0&&n0&&c=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Zt,e.arrowTypeEnd)){const{angle:u,deltaY:g}=Ui(i[i.length-1],i[i.length-2]);o=Zt[e.arrowTypeEnd]*Math.abs(Math.sin(u))*(g>=0?1:-1)}const a=Math.abs(vt(t).y-vt(i[i.length-1]).y),n=Math.abs(vt(t).x-vt(i[i.length-1]).x),l=Math.abs(vt(t).y-vt(i[0]).y),c=Math.abs(vt(t).x-vt(i[0]).x),h=Zt[e.arrowTypeStart],d=Zt[e.arrowTypeEnd],f=1;if(a0&&n0&&c{t.arrowTypeStart&&Ic(e,"start",t.arrowTypeStart,r,i,o,s,a),t.arrowTypeEnd&&Ic(e,"end",t.arrowTypeEnd,r,i,o,s,a)},"addEdgeMarkers"),pS={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},gS=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Ic=p((e,t,r,i,o,s,a=!1,n)=>{const l=pS[r],c=l&&gS.includes(l.type);if(!l){W.warn(`Unknown arrow type: ${r}`);return}const h=l.type,u=`${o}_${s}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const g=n.replace(/[^\dA-Za-z]/g,"_"),m=`${u}_${g}`;if(!document.getElementById(m)){const y=document.getElementById(u);if(y){const C=y.cloneNode(!0);C.id=m,C.querySelectorAll("path, circle, line").forEach(k=>{k.setAttribute("stroke",n),l.fill&&k.setAttribute("fill",n)}),y.parentNode?.appendChild(C)}}e.attr(`marker-${t}`,`url(${i}#${m})`)}else e.attr(`marker-${t}`,`url(${i}#${u})`)},"addEdgeMarker"),mS=p(e=>typeof e=="string"?e:Ct()?.flowchart?.curve,"resolveEdgeCurveType"),Os=new Map,Ut=new Map,hF=p(()=>{Os.clear(),Ut.clear()},"clear"),Pi=p(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),yS=p(async(e,t)=>{const r=Ct();let i=re(r);const{labelStyles:o}=K(t);t.labelStyle=o;const s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await Re(e,t.label,{style:Pi(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);a.node().appendChild(c),W.info("abc82",t,t.labelType);let h=c.getBBox(),d=h;if(i){const u=c.children[0],g=ut(c);h=u.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const u=ut(c).select("text").node();u&&typeof u.getBBox=="function"&&(d=u.getBBox())}a.attr("transform",Di(d,i)),Os.set(t.id,s),t.width=h.width,t.height=h.height;let f;if(t.startLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await or(g,t.startLabelLeft,Pi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ut(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",Di(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).startLeft=u,ji(f,t.startLabelLeft)}if(t.startLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await or(g,t.startLabelRight,Pi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ut(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",Di(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).startRight=u,ji(f,t.startLabelRight)}if(t.endLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await or(u,t.endLabelLeft,Pi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ut(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",Di(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).endLeft=u,ji(f,t.endLabelLeft)}if(t.endLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await or(u,t.endLabelRight,Pi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ut(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",Di(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).endRight=u,ji(f,t.endLabelRight)}return c},"insertEdgeLabel");function ji(e,t){re(Ct())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}p(ji,"setTerminalWidth");var CS=p((e,t)=>{W.debug("Moving label abc88 ",e.id,e.label,Os.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=Ct(),{subGraphTitleTotalMargin:o}=xl(i);if(e.label){const s=Os.get(e.id);let a=e.x,n=e.y;if(r){const l=xe.calcLabelPosition(r);W.debug("Moving label "+e.label+" from (",a,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(a=l.x,n=l.y)}s.attr("transform",`translate(${a}, ${n+o/2})`)}if(e.startLabelLeft){const s=Ut.get(e.id).startLeft;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const s=Ut.get(e.id).startRight;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const s=Ut.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const s=Ut.get(e.id).endRight;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),xS=p((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,o=Math.abs(i.x-r.x),s=Math.abs(i.y-r.y);return o<.001||s<.001?t:s>=o?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),bS=p((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),s=Math.abs(t.y-i),a=e.width/2,n=e.height/2;return o>=a||s>=n},"outsideNode"),kS=p((e,t,r)=>{W.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(t)} + insidePoint : ${JSON.stringify(r)} + node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,s=Math.abs(i-r.x),a=e.width/2;let n=r.xMath.abs(i-t.x)*l){let d=r.y{W.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(s=>{if(W.info("abc88 checking point",s,t),!bS(t,s)&&!o){const a=kS(t,i,s);W.debug("abc88 inside",s,i,a),W.debug("abc88 intersection",a,t);let n=!1;r.forEach(l=>{n=n||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?W.warn("abc88 no intersect",a,r):r.push(a),o=!0}else W.warn("abc88 outside",s,i),i=s,o||r.push(s)}),W.debug("returning points",r),r},"cutPathAtIntersect");function lm(e){const t=[],r=[];for(let i=1;i5&&Math.abs(s.y-o.y)>5||o.y===s.y&&s.x===a.x&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-a.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}p(lm,"extractCornerPoints");var Pc=p(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o),a=r/s;return{x:t.x-a*i,y:t.y-a*o}},"findAdjacentPoint"),wS=p(function(e){const{cornerPointPositions:t}=lm(e),r=[];for(let i=0;i10&&Math.abs(s.y-o.y)>=10){W.debug("Corner point fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));const u=5;a.x===n.x?f={x:c<0?n.x-u+d:n.x+u-d,y:h<0?n.y-d:n.y+d}:f={x:c<0?n.x-d:n.x+d,y:h<0?n.y-u+d:n.y+u-d}}else W.debug("Corner point skipping fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));r.push(f,l)}else r.push(e[i]);return r},"fixCorners"),TS=p((e,t,r)=>{const i=e-t-r,o=2,s=2,a=o+s,n=Math.floor(i/a),l=Array(n).fill(`${o} ${s}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),SS=p(function(e,t,r,i,o,s,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:c}=Ct();let h=t.points,d=!1;const f=o;var u=s;const g=[];for(const M in t.cssCompiledStyles)Yf(M)||g.push(t.cssCompiledStyles[M]);if(c==="swimlane"){if(u.intersect&&f.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[f.intersect(h[0]),u.intersect(h[1])];else{const M=h.slice(1,-1),H=M[0],Y=M[M.length-1],ot=.5,Z=Math.abs(h[h.length-1].x-Y.x)!Number.isNaN(M.y));const C=mS(t.curve);C!=="rounded"&&(y=wS(y));let b=Zi;switch(C){case"linear":b=Zi;break;case"basis":b=Qa;break;case"cardinal":b=Gd;break;case"bumpX":b=zd;break;case"bumpY":b=Hd;break;case"catmullRom":b=Vd;break;case"monotoneX":b=eu;break;case"monotoneY":b=ru;break;case"natural":b=ou;break;case"step":b=su;break;case"stepAfter":b=nu;break;case"stepBefore":b=au;break;case"rounded":b=Zi;break;default:b=Qa}const{x:k,y:T}=uS(t),S=Qk().x(k).y(T).curve(b);let B;switch(t.thickness){case"normal":B="edge-thickness-normal";break;case"thick":B="edge-thickness-thick";break;case"invisible":B="edge-thickness-invisible";break;default:B="edge-thickness-normal"}switch(t.pattern){case"solid":B+=" edge-pattern-solid";break;case"dotted":B+=" edge-pattern-dotted";break;case"dashed":B+=" edge-pattern-dashed";break;default:B+=" edge-pattern-solid"}let v,L=C==="rounded"?hm(cm(y,t),5):S(y);const N=Array.isArray(t.style)?t.style:[t.style];let R=N.find(M=>M?.startsWith("stroke:")),D="";t.animate&&(D="edge-animation-fast"),t.animation&&(D="edge-animation-"+t.animation);let U=!1;if(t.look==="handDrawn"){const M=V.svg(e);Object.assign([],y);const H=M.path(L,{roughness:.3,seed:l});B+=" transition",v=ut(H).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+B+(t.classes?" "+t.classes:"")+(D?" "+D:"")).attr("style",N?N.reduce((ot,Z)=>ot+";"+Z,""):"");let Y=v.attr("d");v.attr("d",Y),e.node().appendChild(v.node())}else{const M=g.join(";"),H=N?N.reduce((bt,et)=>bt+et+";",""):"",Y=(M?M+";"+H+";":H)+";"+(N?N.reduce((bt,et)=>bt+";"+et,""):"");v=e.append("path").attr("d",L).attr("id",`${a}-${t.id}`).attr("class"," "+B+(t.classes?" "+t.classes:"")+(D?" "+D:"")).attr("style",Y),R=Y.match(/stroke:([^;]+)/)?.[1],U=t.animate===!0||!!t.animation||M.includes("animation");const ot=v.node(),Z=typeof ot.getTotalLength=="function"?ot.getTotalLength():0,dt=Oc[t.arrowTypeStart]||0,ft=Oc[t.arrowTypeEnd]||0;if(t.look==="neo"&&!U){const et=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?TS(Z,dt,ft):`0 ${dt} ${Z-dt-ft} ${ft}`}; stroke-dashoffset: 0;`;v.attr("style",et+v.attr("style"))}}v.attr("data-edge",!0),v.attr("data-et","edge"),v.attr("data-id",t.id),v.attr("data-points",m),v.attr("data-look",zt(t.look)),t.showPoints&&y.forEach(M=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",M.x).attr("cy",M.y)});let q="";(Ct().flowchart.arrowMarkerAbsolute||Ct().state.arrowMarkerAbsolute)&&(q=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,q=q.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),W.info("arrowTypeStart",t.arrowTypeStart),W.info("arrowTypeEnd",t.arrowTypeEnd);const $=!U&&t?.look==="neo";fS(v,t,q,a,i,$,R);const E=Math.floor(h.length/2),A=h[E];xe.isLabelCoordinateInPath(A,v.attr("d"))||(d=!0);let P={};return d&&(P.updatedPath=h),P.originalPath=t.points,P},"insertEdge");function hm(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let s=0;s({...o}));if(e.length>=2&&Zt[t.arrowTypeStart]){const o=Zt[t.arrowTypeStart],s=e[0],a=e[1],{angle:n}=Fn(s,a),l=o*Math.cos(n),c=o*Math.sin(n);r[0].x=s.x+l,r[0].y=s.y+c}const i=e.length;if(i>=2&&Zt[t.arrowTypeEnd]){const o=Zt[t.arrowTypeEnd],s=e[i-1],a=e[i-2],{angle:n}=Fn(a,s),l=o*Math.cos(n),c=o*Math.sin(n);r[i-1].x=s.x-l,r[i-1].y=s.y-c}return r}p(cm,"applyMarkerOffsetsToPoints");var _S=p((e,t,r,i)=>{t.forEach(o=>{XS[o](e,r,i)})},"insertMarkers"),BS=p((e,t,r)=>{W.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),vS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),LS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),FS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),AS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),ES=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),MS=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),$S=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),OS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),IS=p((e,t,r)=>{const i=At(),{themeVariables:o}=i,{transitionColor:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${s}`)},"barbNeo"),DS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),PS=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),o.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),RS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),NS=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),o.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),qS=p((e,t,r)=>{const i=At(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${s}`)},"only_one_neo"),WS=p((e,t,r)=>{const i=At(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),zS=p((e,t,r)=>{const i=At(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${s}`)},"one_or_more_neo"),HS=p((e,t,r)=>{const i=At(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),YS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 + L20,10 + M20,10 + L0,20`)},"requirement_arrow"),US=p((e,t,r)=>{const i=At(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${s}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 + L20,10 + M20,10 + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),jS=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),GS=p((e,t,r)=>{const i=At(),{themeVariables:o}=i,{strokeWidth:s}=o,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${s}`)},"requirement_contains_neo"),XS={extension:BS,composition:vS,aggregation:LS,dependency:FS,lollipop:AS,point:ES,circle:MS,cross:$S,barb:OS,barbNeo:IS,only_one:DS,zero_or_one:PS,one_or_more:RS,zero_or_more:NS,only_one_neo:qS,zero_or_one_neo:WS,one_or_more_neo:zS,zero_or_more_neo:HS,requirement_arrow:YS,requirement_contains:jS,requirement_arrow_neo:US,requirement_contains_neo:GS},VS=_S,ZS={common:po,getConfig:At,insertCluster:UT,insertEdge:SS,insertEdgeLabel:yS,insertMarkers:VS,insertNode:nm,interpolateToCurve:fl,labelHelper:st,log:W,positionEdgeLabel:CS},ho={},dm=p(e=>{for(const t of e)ho[t.name]=t},"registerLayoutLoaders"),KS=p(()=>{dm([{name:"dagre",loader:p(async()=>await ct(()=>import("./dagre-VZM6K2ZE-Cu6_Xdm1.js"),__vite__mapDeps([0,1,2,3,4,5,6])),"loader")},{name:"swimlane",loader:p(async()=>await ct(()=>import("./swimlanes-SLNWSIFB-ZiI1XT9U.js"),__vite__mapDeps([7,5,1,2,3,6])),"loader")},{name:"cose-bilkent",loader:p(async()=>await ct(()=>import("./cose-bilkent-JH36ORCC-BZgxHURk.js"),__vite__mapDeps([8,9,6,5])),"loader")}])},"registerDefaultLayoutLoaders");KS();var cF=p(async(e,t,r)=>{if(!(e.layoutAlgorithm in ho))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const d of e.nodes){const f=d.domId||d.id;d.domId=`${e.diagramId}-${f}`}const i=ho[e.layoutAlgorithm],o=await i.loader(),{theme:s,themeVariables:a}=e.config,{useGradient:n,gradientStart:l,gradientStop:c}=a,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),n){const d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return o.render(e,t,ZS,{algorithm:i.algorithm},r)},"render"),dF=p((e="",{fallback:t="dagre"}={})=>{if(e in ho)return e;if(t in ho)return W.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),Ol="comm",um="rule",fm="decl",QS="@media",JS="@import",t_="@supports",e_="@namespace",An="@keyframes",pm="@layer",r_="@scope",i_=Math.abs,Qi=String.fromCharCode;function gm(e){return e.trim()}function En(e,t,r){return e.replace(t,r)}function Jr(e,t){return e.charCodeAt(t)|0}function bi(e,t,r){return e.slice(t,r)}function Ae(e){return e.length}function mm(e){return e.length}function Yo(e,t){return t.push(e),e}var Ks=1,ki=1,ym=0,fe=0,It=0,Si="";function Il(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:Ks,column:ki,length:a,return:"",siblings:n}}function o_(){return It}function s_(){return It=fe>0?Jr(Si,--fe):0,ki--,It===10&&(ki=1,Ks--),It}function ke(){return It=fe2||co(It)>3?"":" "}function h_(e,t){for(;--t&&ke()&&!(It<48||It>102||It>57&&It<65||It>70&&It<97););return Qs(e,is()+(t<6&&sr()==32&&ke()==32))}function Mn(e){for(;ke();)switch(It){case e:return fe;case 34:case 39:e!==34&&e!==39&&Mn(It);break;case 40:e===41&&Mn(e);break;case 92:ke();break}return fe}function c_(e,t){for(;ke()&&e+It!==57;)if(e+It===84&&sr()===47)break;return"/*"+Qs(t,fe-1)+"*"+Qi(e===47?e:ke())}function d_(e){for(;!co(sr());)ke();return Qs(e,fe)}function u_(e){return n_(os("",null,null,null,[""],e=a_(e),0,[0],e))}function os(e,t,r,i,o,s,a,n,l){for(var c=0,h=0,d=a,f=0,u=0,g=0,m=1,y=1,C=1,b=0,k=0,T="",S=o,B=s,v=i,L=T;y;)switch(g=k,k=ke()){case 40:g!=108&&Jr(L,d-1)==58?(b++,L+="("):L+=$a(k);break;case 41:b--,L+=")";break;case 34:case 39:case 91:L+=$a(k);break;case 9:case 10:case 13:case 32:if(b>0){L+=Qi(k);break}L+=l_(g);break;case 92:L+=h_(is()-1,7);continue;case 47:switch(sr()){case 42:case 47:Yo(f_(c_(ke(),is()),t,r,l),l),(co(g||1)==5||co(sr()||1)==5)&&Ae(L)&&bi(L,-1,void 0)!==" "&&(L+=" ");break;default:L+="/"}break;case 123*m:n[c++]=Ae(L)*C;case 125*m:case 59:case 0:if(b>0&&k){L+=Qi(k);break}switch(k){case 0:case 125:y=0;case 59+h:C==-1&&(L=En(L,/\f/g,"")),u>0&&(Ae(L)-d||m===0)&&Yo(u>32?Nc(L+";",i,r,d-1,l):Nc(En(L," ","")+";",i,r,d-2,l),l);break;case 59:L+=";";default:if(Yo(v=Rc(L,t,r,c,h,o,n,T,S=[],B=[],d,s),s),k===123)if(h===0)os(L,t,v,v,S,s,d,n,B);else{switch(f){case 99:if(Jr(L,3)===110)break;case 108:if(Jr(L,2)===97)break;default:h=0;case 100:case 109:case 115:}h?os(e,v,v,i&&Yo(Rc(e,v,v,0,0,o,n,T,o,S=[],d,B),B),o,B,d,n,i?S:B):os(L,v,v,v,[""],B,0,n,B)}}c=h=u=0,m=C=1,T=L="",d=a;break;case 58:d=1+Ae(L),u=g;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&s_()==125)continue}switch(L+=Qi(k),k*m){case 38:C=h>0?1:(L+="\f",-1);break;case 44:if(b>0)break;n[c++]=(Ae(L)-1)*C,C=1;break;case 64:sr()===45&&(L+=$a(ke())),f=sr(),h=d=Ae(T=L+=d_(is())),k++;break;case 45:g===45&&Ae(L)==2&&(m=0)}}return s}function Rc(e,t,r,i,o,s,a,n,l,c,h,d){for(var f=o-1,u=o===0?s:[""],g=mm(u),m=0,y=0,C=0;m0?u[b]+" "+k:En(k,/&\f/g,u[b])))&&(l[C++]=T);return Il(e,t,r,o===0?um:n,l,c,h,d)}function f_(e,t,r,i){return Il(e,t,r,Ol,Qi(o_()),bi(e,2,-2),0,i)}function Nc(e,t,r,i,o){return Il(e,t,r,fm,bi(e,0,i),bi(e,i+1,-1),i,o)}function $n(e,t){for(var r="",i=0;i/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),y_=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./c4Diagram-5PPSVZJV-oXGTev51.js");return{diagram:t}},__vite__mapDeps([10,11,5,6]));return{id:Cm,diagram:e}},"loader"),C_={id:Cm,detector:m_,loader:y_},x_=C_,xm="flowchart",b_=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),k_=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./flowDiagram-UKHOOZJN-XwdembEj.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([12,13,14,15,11,16]));return{id:xm,diagram:e}},"loader"),w_={id:xm,detector:b_,loader:k_},T_=w_,bm="flowchart-v2",S_=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),__=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./flowDiagram-UKHOOZJN-XwdembEj.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([12,13,14,15,11,16]));return{id:bm,diagram:e}},"loader"),B_={id:bm,detector:S_,loader:__},v_=B_,km="swimlane",L_=p(e=>/^\s*swimlane-beta\b/.test(e),"detector"),F_=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./swimlanesDiagram-ULZ7WXOC-Bgk3ILUh.js");return{diagram:t}},__vite__mapDeps([17,12,13,14,15,11,16,5,6]));return{id:km,diagram:e}},"loader"),A_={id:km,detector:L_,loader:F_},E_=A_,wm="er",M_=p(e=>/^\s*erDiagram/.test(e),"detector"),$_=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./erDiagram-JOGREHBK-BkNwaUcA.js");return{diagram:t}},__vite__mapDeps([18,14,15,16,5,6]));return{id:wm,diagram:e}},"loader"),O_={id:wm,detector:M_,loader:$_},I_=O_,Tm="gitGraph",D_=p(e=>/^\s*gitGraph/.test(e),"detector"),P_=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./gitGraphDiagram-DS77QQ5N-BAf_Q-WY.js");return{diagram:t}},__vite__mapDeps([19,20,21,22,5,6]));return{id:Tm,diagram:e}},"loader"),R_={id:Tm,detector:D_,loader:P_},N_=R_,Sm="gantt",q_=p(e=>/^\s*gantt/.test(e),"detector"),W_=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./ganttDiagram-PKOTCBZU-lpLvMD-8.js");return{diagram:t}},__vite__mapDeps([23,6,24,25,26,5]));return{id:Sm,diagram:e}},"loader"),z_={id:Sm,detector:q_,loader:W_},H_=z_,_m="info",Y_=p(e=>/^\s*info/.test(e),"detector"),U_=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./infoDiagram-6WML65LV-DQHnLHTt.js");return{diagram:t}},__vite__mapDeps([27,22,5,6]));return{id:_m,diagram:e}},"loader"),j_={id:_m,detector:Y_,loader:U_},Bm="pie",G_=p(e=>/^\s*pie/.test(e),"detector"),X_=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./pieDiagram-7S7Q4E2Y-BqNckD7-.js");return{diagram:t}},__vite__mapDeps([28,21,22,5,29,30,25,6]));return{id:Bm,diagram:e}},"loader"),V_={id:Bm,detector:G_,loader:X_},vm="quadrantChart",Z_=p(e=>/^\s*quadrantChart/.test(e),"detector"),K_=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./quadrantDiagram-CIZ2JOQS-D_d0CTwl.js");return{diagram:t}},__vite__mapDeps([31,24,25,26,5,6]));return{id:vm,diagram:e}},"loader"),Q_={id:vm,detector:Z_,loader:K_},J_=Q_,Lm="xychart",tB=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),eB=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./xychartDiagram-ELKLHX3M-Bj9wLhGR.js");return{diagram:t}},__vite__mapDeps([32,25,30,24,26,5,6]));return{id:Lm,diagram:e}},"loader"),rB={id:Lm,detector:tB,loader:eB},iB=rB,Fm="requirement",oB=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),sB=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./requirementDiagram-LRYGKXZP-CG2rrsXg.js");return{diagram:t}},__vite__mapDeps([33,14,15,5,6]));return{id:Fm,diagram:e}},"loader"),aB={id:Fm,detector:oB,loader:sB},nB=aB,Am="sequence",lB=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),hB=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./sequenceDiagram-SI44F4Z6-Bu_K6Hei.js");return{diagram:t}},__vite__mapDeps([34,20,11,5,6]));return{id:Am,diagram:e}},"loader"),cB={id:Am,detector:lB,loader:hB},dB=cB,Em="class",uB=p((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),fB=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./classDiagram-JCYQIIEL-Bca3rNfW.js");return{diagram:t}},__vite__mapDeps([35,36,13,14,15,11,5,6]));return{id:Em,diagram:e}},"loader"),pB={id:Em,detector:uB,loader:fB},gB=pB,Mm="classDiagram",mB=p((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),yB=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./classDiagram-v2-OCEON4UE-Bca3rNfW.js");return{diagram:t}},__vite__mapDeps([37,36,13,14,15,11,5,6]));return{id:Mm,diagram:e}},"loader"),CB={id:Mm,detector:mB,loader:yB},xB=CB,$m="state",bB=p((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),kB=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./stateDiagram-OKZ733FA-BZDeXRMs.js");return{diagram:t}},__vite__mapDeps([38,39,14,15,11,2,4,3,5,6]));return{id:$m,diagram:e}},"loader"),wB={id:$m,detector:bB,loader:kB},TB=wB,Om="stateDiagram",SB=p((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),_B=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./stateDiagram-v2-UEYNNEHI-DDDMcBM_.js");return{diagram:t}},__vite__mapDeps([40,39,14,15,11,5,6]));return{id:Om,diagram:e}},"loader"),BB={id:Om,detector:SB,loader:_B},vB=BB,Im="journey",LB=p(e=>/^\s*journey/.test(e),"detector"),FB=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./journeyDiagram-NVQOT4AX-B8O8DORL.js");return{diagram:t}},__vite__mapDeps([41,13,11,29,5,6]));return{id:Im,diagram:e}},"loader"),AB={id:Im,detector:LB,loader:FB},EB=AB,MB=p((e,t,r)=>{W.debug(`rendering svg for syntax error +`);const i=n1(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),dd(i,100,512,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),Dm={draw:MB},$B=Dm,OB={db:{},renderer:Dm,parser:{parse:p(()=>{},"parse")}},IB=OB,Pm="flowchart-elk",DB=p((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),PB=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./flowDiagram-UKHOOZJN-XwdembEj.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([12,13,14,15,11,16]));return{id:Pm,diagram:e}},"loader"),RB={id:Pm,detector:DB,loader:PB},NB=RB,Rm="timeline",qB=p(e=>/^\s*timeline/.test(e),"detector"),WB=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./timeline-definition-Z64GVDOM-CIeFn7nE.js");return{diagram:t}},__vite__mapDeps([42,29,5,6]));return{id:Rm,diagram:e}},"loader"),zB={id:Rm,detector:qB,loader:WB},HB=zB,Nm="mindmap",YB=p(e=>/^\s*mindmap/.test(e),"detector"),UB=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./mindmap-definition-FAOFIHXS-Oe0Lo_1t.js");return{diagram:t}},__vite__mapDeps([43,14,15,5,6]));return{id:Nm,diagram:e}},"loader"),jB={id:Nm,detector:YB,loader:UB},GB=jB,qm="kanban",XB=p(e=>/^\s*kanban/.test(e),"detector"),VB=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./kanban-definition-27J2QSJJ-BMVnCc0h.js");return{diagram:t}},__vite__mapDeps([44,13,5,6]));return{id:qm,diagram:e}},"loader"),ZB={id:qm,detector:XB,loader:VB},KB=ZB,Wm="sankey",QB=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),JB=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./sankeyDiagram-W5VNT64P-C-79o6vc.js");return{diagram:t}},__vite__mapDeps([45,30,25,5,6]));return{id:Wm,diagram:e}},"loader"),tv={id:Wm,detector:QB,loader:JB},ev=tv,zm="packet",rv=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),iv=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./diagram-LBJQPF4R-Cj_6Wlkl.js");return{diagram:t}},__vite__mapDeps([46,21,22,5,6]));return{id:zm,diagram:e}},"loader"),ov={id:zm,detector:rv,loader:iv},Hm="radar",sv=p(e=>/^\s*radar-beta/.test(e),"detector"),av=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./diagram-UB23O5K3-BjKBIl7q.js");return{diagram:t}},__vite__mapDeps([47,21,22,5,6]));return{id:Hm,diagram:e}},"loader"),nv={id:Hm,detector:sv,loader:av},Ym="block",lv=p(e=>/^\s*block(-beta)?/.test(e),"detector"),hv=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./blockDiagram-VBNYF7ZC-Cp8Mn4lx.js");return{diagram:t}},__vite__mapDeps([48,13,2,16,5,6]));return{id:Ym,diagram:e}},"loader"),cv={id:Ym,detector:lv,loader:hv},dv=cv,Um="treeView",uv=p(e=>/^\s*treeView-beta/.test(e),"detector"),fv=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./diagram-7IWD3JNH-CsOlUumf.js");return{diagram:t}},__vite__mapDeps([49,20,21,22,5,6]));return{id:Um,diagram:e}},"loader"),pv={id:Um,detector:uv,loader:fv},gv=pv,jm="architecture",mv=p(e=>/^\s*architecture/.test(e),"detector"),yv=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./architectureDiagram-T3A2C74G-CcMONCBR.js");return{diagram:t}},__vite__mapDeps([50,21,22,5,9,6]));return{id:jm,diagram:e}},"loader"),Cv={id:jm,detector:mv,loader:yv},xv=Cv,Gm="eventmodeling",bv=p(e=>/^\s*eventmodeling/.test(e),"detector"),kv=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./diagram-B4RE2ZJO-D1KNNV8U.js");return{diagram:t}},__vite__mapDeps([51,21,22,5,6]));return{id:Gm,diagram:e}},"loader"),wv={id:Gm,detector:bv,loader:kv},Tv=wv,Xm="ishikawa",Sv=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),_v=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./ishikawaDiagram-WSZJBQD7-BmYBJRyL.js");return{diagram:t}},__vite__mapDeps([52,5,6]));return{id:Xm,diagram:e}},"loader"),Bv={id:Xm,detector:Sv,loader:_v},Vm="venn",vv=p(e=>/^\s*venn-beta/.test(e),"detector"),Lv=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./vennDiagram-T6HMQDX7-bdo599Ik.js");return{diagram:t}},__vite__mapDeps([53,5,6]));return{id:Vm,diagram:e}},"loader"),Fv={id:Vm,detector:vv,loader:Lv},Av=Fv,Zm="treemap",Ev=p(e=>/^\s*treemap/.test(e),"detector"),Mv=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./diagram-Q27KOJAE-CveaUqzz.js");return{diagram:t}},__vite__mapDeps([54,21,15,22,5,26,30,25,6]));return{id:Zm,diagram:e}},"loader"),$v={id:Zm,detector:Ev,loader:Mv},Km="wardley",Ov=p(e=>/^\s*wardley-beta/i.test(e),"detector"),Iv=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./wardleyDiagram-T6FBY63Y-B_l7B-CB.js");return{diagram:t}},__vite__mapDeps([55,21,22,5,6]));return{id:Km,diagram:e}},"loader"),Dv={id:Km,detector:Ov,loader:Iv},Pv=Dv,Qm="cynefin",Rv=p(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),Nv=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./cynefinDiagram-MW4NZA55-DzpNWex9.js");return{diagram:t}},__vite__mapDeps([56,21,22,5,6]));return{id:Qm,diagram:e}},"loader"),qv={id:Qm,detector:Rv,loader:Nv},Jm="railroad",Wv=p(e=>/^\s*railroad-beta/i.test(e),"detector"),zv=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./railroadDiagram-AXF67PYL-DH5n6ePI.js");return{diagram:t}},__vite__mapDeps([57,58,21,22,5,6]));return{id:Jm,diagram:e}},"loader"),Hv={id:Jm,detector:Wv,loader:zv},ty="railroadEbnf",Yv=p(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),Uv=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./ebnfDiagram-BXEA7PRR-DV-beFnC.js");return{diagram:t}},__vite__mapDeps([59,58,21,22,5,6]));return{id:ty,diagram:e}},"loader"),jv={id:ty,detector:Yv,loader:Uv},ey="railroadAbnf",Gv=p(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),Xv=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./abnfDiagram-N423BO3Z-CQHRlmDB.js");return{diagram:t}},__vite__mapDeps([60,58,21,22,5,6]));return{id:ey,diagram:e}},"loader"),Vv={id:ey,detector:Gv,loader:Xv},ry="railroadPeg",Zv=p(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),Kv=p(async()=>{const{diagram:e}=await ct(async()=>{const{diagram:t}=await import("./pegDiagram-VL7TDLO6-DgoYitu3.js");return{diagram:t}},__vite__mapDeps([61,58,21,22,5,6]));return{id:ry,diagram:e}},"loader"),Qv={id:ry,detector:Zv,loader:Kv},qc=!1,Js=p(()=>{qc||(qc=!0,hs("error",IB,e=>e.toLowerCase().trim()==="error"),hs("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Ra(NB,GB,xv),Ra(x_,KB,xB,gB,I_,H_,j_,V_,nB,dB,E_,v_,T_,HB,N_,vB,TB,EB,J_,ev,ov,iB,dv,Tv,gv,nv,Bv,$v,Hv,jv,Vv,Qv,Av,Pv,qv))},"addDiagrams"),Jv=p(async()=>{W.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(vr).map(async([r,{detector:i,loader:o}])=>{if(o)try{za(r)}catch{try{const{diagram:s,id:a}=await o();hs(a,s,i)}catch(s){throw W.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete vr[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){W.error(`Failed to load ${t.length} external diagrams`);for(const r of t)W.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),tL="graphics-document document";function iy(e,t){e.attr("role",tL),t!==""&&e.attr("aria-roledescription",t)}p(iy,"setA11yDiagramInfo");function oy(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}p(oy,"addSVGa11yTitleDescription");var _r,On=(_r=class{constructor(t,r,i,o,s){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=s}static async fromText(t,r={}){const i=At(),o=Pn(t,i);t=fw(t)+` +`;try{za(o)}catch{const c=eC(o);if(!c)throw new sd(`Diagram ${o} not found.`);const{id:h,diagram:d}=await c();hs(h,d)}const{db:s,parser:a,renderer:n,init:l}=za(o);return a.parser&&(a.parser.yy=s),s.clear?.(),l?.(i),r.title&&s.setDiagramTitle?.(r.title),await a.parse(t),new _r(o,t,s,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},p(_r,"Diagram"),_r),Wc=[],eL=p(()=>{Wc.forEach(e=>{e()}),Wc=[]},"attachFunctions"),rL=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function sy(e){const t=e.match(od);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(` +`).map(a=>a.startsWith(r)?a.slice(r.length):a).join(` +`):t[2];let o=p2(i,{schema:f2})??{};o=typeof o=="object"&&!Array.isArray(o)?o:{};const s={};return o.displayMode&&(s.displayMode=o.displayMode.toString()),o.title&&(s.title=o.title.toString()),o.config&&(s.config=o.config),{text:e.slice(t[0].length),metadata:s}}p(sy,"extractFrontMatter");var iL=p(e=>e.replace(/\r\n?/g,` +`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),oL=p(e=>{const{text:t,metadata:r}=sy(e),{displayMode:i,title:o,config:s={}}=r;return i&&(s.gantt||(s.gantt={}),s.gantt.displayMode=i),{title:o,config:s,text:t}},"processFrontmatter"),sL=p(e=>{const t=xe.detectInit(e)??{},r=xe.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:tw(e),directive:t}},"processDirectives");function Dl(e){const t=iL(e),r=oL(t),i=sL(r.text),o=Cl(r.config,i.directive);return e=rL(i.text),{code:e,title:r.title,config:o}}p(Dl,"preprocessDiagram");function ay(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}p(ay,"toBase64");var aL=5e4,nL="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",lL="sandbox",hL="loose",cL="http://www.w3.org/2000/svg",dL="http://www.w3.org/1999/xlink",uL="http://www.w3.org/1999/xhtml",fL="100%",pL="100%",gL="border:0;margin:0;",mL="margin:0",yL="allow-top-navigation-by-user-activation allow-popups",CL='The "iframe" tag is not supported by your browser.',xL=["foreignobject"],bL=["dominant-baseline"];function Pl(e){const t=Dl(e);return ns(),K0(t.config??{}),t}p(Pl,"processAndSetConfigs");async function ny(e,t){Js();try{const{code:r,config:i}=Pl(e);return{diagramType:(await hy(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}p(ny,"parse");var zc=p((e,t,r=[])=>{const i=Jc(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),kL=p((e,t=new Map)=>{const r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){const n=re(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{ec(l.styles)||n.forEach(c=>{r.insertRule(zc(l.id,c,l.styles),r.cssRules.length)}),ec(l.textStyles)||r.insertRule(zc(l.id,"tspan",(l?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const o=new CSSStyleSheet;o.replaceSync(e.themeCSS),i=Wa(o)+` +`}else i+=`${e.themeCSS} +`;return i+Wa(r)},"createCssStyles"),wL=p((e,t)=>$n(u_(`${e}{${t}}`),g_([p(function(i,o,s,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===An)return;i.props=i.props.map(n=>n===e&&Array.isArray(i.children)&&i.children.every(c=>c.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(c.props))||(n.startsWith(`${e} `)||n.startsWith(`${e}>`))&&!n.startsWith(`${e} ||`)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[QS,t_,pm,r_,"@container","@starting-style"],An].includes(i.type)||(W.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=Ol))},"addNamespace"),p_])),"compileCSS"),TL=p((e,t,r,i)=>{const o=kL(e,r),s=xC(t,o,{...e.themeVariables,theme:e.theme,look:e.look},i);return wL(i,s)},"createUserStyles"),SL=p((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=Ar(i),i=i.replace(/
    /g,"
    "),i},"cleanUpSvgCode"),_L=p((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":pL,i=ay(`${e}`);return``},"putIntoIFrame"),Hc=p((e,t,r,i,o)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const a=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",cL);return o&&a.attr("xmlns:xlink",o),a.append("g"),e},"appendDivSvgG");function In(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}p(In,"sandboxedIframe");var BL=p((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),vL=p(async function(e,t,r){Js();const i=Pl(t);t=i.code;const o=At();W.debug(o),t.length>(o?.maxTextSize??aL)&&(t=nL);const s=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=p(()=>{const q=ut(f?n:c).node();q&&"remove"in q&&q.remove()},"removeTempElements");let d=ut(document.body);const f=o.securityLevel===lL,u=o.securityLevel===hL,g=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const U=In(ut(r),a);d=ut(U.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=ut(r);Hc(d,e,l,`font-family: ${g}`,dL)}else{if(BL(document,e,l,a),f){const U=In(ut(document.body),a);d=ut(U.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=ut("body");Hc(d,e,l)}let m,y;try{m=await On.fromText(t,{title:i.title})}catch(U){if(o.suppressErrorRendering)throw h(),U;m=await On.fromText("error"),y=U}const C=d.select(c).node(),b=m.type,k=C.firstChild,T=k.firstChild,S=m.renderer.getClasses?.(t,m),B=TL(o,b,S,s),v=document.createElement("style");v.innerHTML=B,k.insertBefore(v,T);try{await m.renderer.draw(t,e,"11.16.1",m)}catch(U){throw o.suppressErrorRendering?h():$B.draw(t,e,"11.16.1"),U}const L=d.select(`${c} svg`),N=m.db.getAccTitle?.(),R=m.db.getAccDescription?.();cy(b,L,N,R),d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",uL);let D=d.select(c).node().innerHTML;if(W.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),D=SL(D,f,De(o.arrowMarkerAbsolute)),f){const U=d.select(c+" svg").node();D=_L(D,U)}else u||(D=pi.sanitize(D,{ADD_TAGS:xL,ADD_ATTR:bL,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(eL(),y)throw y;return h(),{diagramType:b,svg:D,bindFunctions:m.db.bindFunctions}},"render");function ly(e={}){const t=Wt({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),V0(t),t?.theme&&t.theme in Ye?t.themeVariables=Ye[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Ye.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?X0(t):td();Dn(r.logLevel),Js()}p(ly,"initialize");var hy=p((e,t={})=>{const{code:r}=Dl(e);return On.fromText(r,t)},"getDiagramFromText");function cy(e,t,r,i){iy(t,e),oy(t,r,i,t.attr("id"))}p(cy,"addA11yInfo");var Mr=Object.freeze({render:vL,parse:ny,getDiagramFromText:hy,initialize:ly,getConfig:At,setConfig:ed,getSiteConfig:td,updateSiteConfig:Z0,reset:p(()=>{ns()},"reset"),globalReset:p(()=>{ns(gi)},"globalReset"),defaultConfig:gi});Dn(At().logLevel);ns(At());var LL=p((e,t,r)=>{W.warn(e),yl(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),dy=p(async function(e={querySelector:".mermaid"}){try{await FL(e)}catch(t){if(yl(t)&&W.error(t.str),Xe.parseError&&Xe.parseError(t),!e.suppressErrors)throw W.error("Use the suppressErrors option to suppress these errors"),t}},"run"),FL=p(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=Mr.getConfig();W.debug(`${e?"":"No "}Callback function found`);let o;if(r)o=r;else if(t)o=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");W.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(W.debug("Start On Load: "+i?.startOnLoad),Mr.updateSiteConfig({startOnLoad:i?.startOnLoad}));const s=new xe.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const l of Array.from(o)){if(W.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;a=l.innerHTML,a=kp(xe.entityDecode(a)).trim().replace(//gi,"
    ");const h=xe.detectInit(a);h&&W.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await gy(c,a,l);l.innerHTML=d,e&&await e(c),f&&f(l)}catch(d){LL(d,n,Xe.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),uy=p(function(e){Mr.initialize(e)},"initialize"),AL=p(async function(e,t,r){W.warn("mermaid.init is deprecated. Please use run instead."),e&&uy(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await dy(i)},"init"),EL=p(async(e,{lazyLoad:t=!0}={})=>{Js(),Ra(...e),t===!1&&await Jv()},"registerExternalDiagrams"),fy=p(function(){if(Xe.startOnLoad){const{startOnLoad:e}=Mr.getConfig();e&&Xe.run().catch(t=>W.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",fy,!1);var ML=p(function(e){Xe.parseError=e},"setParseErrorHandler"),Is=[],Oa=!1,py=p(async()=>{if(!Oa){for(Oa=!0;Is.length>0;){const e=Is.shift();if(e)try{await e()}catch(t){W.error("Error executing queue",t)}}Oa=!1}},"executeQueue"),$L=p(async(e,t)=>new Promise((r,i)=>{const o=p(()=>new Promise((s,a)=>{Mr.parse(e,t).then(n=>{s(n),r(n)},n=>{W.error("Error parsing",n),Xe.parseError?.(n),a(n),i(n)})}),"performCall");Is.push(o),py().catch(i)}),"parse"),gy=p((e,t,r)=>new Promise((i,o)=>{const s=p(()=>new Promise((a,n)=>{Mr.render(e,t,r).then(l=>{a(l),i(l)},l=>{W.error("Error parsing",l),Xe.parseError?.(l),n(l),o(l)})}),"performCall");Is.push(s),py().catch(o)}),"render"),OL=p(()=>Object.keys(vr).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),Xe={startOnLoad:!0,mermaidAPI:Mr,parse:$L,render:gy,init:AL,run:dy,registerExternalDiagrams:EL,registerLayoutLoaders:dm,initialize:uy,parseError:void 0,contentLoaded:fy,setParseErrorHandler:ML,detectType:Pn,registerIconPacks:Ow,getRegisteredDiagramsMetadata:OL},IL=Xe;const uF=Object.freeze(Object.defineProperty({__proto__:null,default:IL},Symbol.toStringTag,{value:"Module"}));export{Zn as $,Cl as A,Qc as B,sw as C,n1 as D,L0 as E,qL as F,p2 as G,Ji as H,NL as I,f2 as J,Ys as K,lC as L,cd as M,pi as N,Sh as O,Qk as P,Qa as Q,ow as R,fo as S,Te as T,O as U,I as V,mC as W,ud as X,Xk as Y,Z2 as Z,p as _,wC as a,Re as a$,UL as a0,XL as a1,zr as a2,Yh as a3,Hh as a4,ZL as a5,VL as a6,GL as a7,HL as a8,YL as a9,dl as aA,hl as aB,Jo as aC,O2 as aD,$2 as aE,M2 as aF,E2 as aG,T2 as aH,jf as aI,B2 as aJ,w2 as aK,F2 as aL,Gf as aM,_2 as aN,P2 as aO,D2 as aP,I2 as aQ,N2 as aR,R2 as aS,S2 as aT,Xf as aU,A2 as aV,L2 as aW,v2 as aX,Vf as aY,uS as aZ,re as a_,jL as aa,QL as ab,KL as ac,UT as ad,nm as ae,lF as af,lt as ag,Me as ah,xo as ai,Ow as aj,ml as ak,V as al,VS as am,nF as an,hF as ao,sF as ap,Q as aq,aF as ar,xl as as,SS as at,CS as au,yS as av,Os as aw,Ut as ax,Zt as ay,xT as az,kC as b,Di as b0,rp as b1,Ar as b2,ap as b3,jc as b4,Vk as b5,RL as b6,$w as b7,WL as b8,jn as b9,rr as ba,ro as bb,Ph as bc,Lb as bd,K as be,Yf as bf,le as bg,kb as bh,Un as bi,Bd as bj,mo as bk,Fd as bl,zL as bm,Py as bn,dS as bo,uF as bp,Ct as c,ut as d,dd as e,Wt as f,SC as g,Ge as h,we as i,b2 as j,po as k,W as l,op as m,_C as n,BC as o,bC as p,JL as q,ar as r,TC as s,$y as t,dF as u,cF as v,lw as w,xe as x,At as y,LC as z}; diff --git a/internal/webapp/static/assets/mindmap-definition-FAOFIHXS-Oe0Lo_1t.js b/internal/webapp/static/assets/mindmap-definition-FAOFIHXS-Oe0Lo_1t.js new file mode 100644 index 0000000..4e3835a --- /dev/null +++ b/internal/webapp/static/assets/mindmap-definition-FAOFIHXS-Oe0Lo_1t.js @@ -0,0 +1,96 @@ +import{g as ae}from"./chunk-XXDRQBXY-BXTWinaX.js";import{s as ce}from"./chunk-KBJHAD2P-CHI3y1em.js";import{_ as h,l as I,u as le,v as he,y as de,B as j,c as P,i as G,b6 as ge,T as ue,U as pe,V as fe}from"./mermaid.core-B7WVQkyL.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";const _=[];for(let t=0;t<256;++t)_.push((t+256).toString(16).slice(1));function me(t,e=0){return(_[t[e+0]]+_[t[e+1]]+_[t[e+2]]+_[t[e+3]]+"-"+_[t[e+4]]+_[t[e+5]]+"-"+_[t[e+6]]+_[t[e+7]]+"-"+_[t[e+8]]+_[t[e+9]]+"-"+_[t[e+10]]+_[t[e+11]]+_[t[e+12]]+_[t[e+13]]+_[t[e+14]]+_[t[e+15]]).toLowerCase()}const ye=new Uint8Array(16);function Ee(){return crypto.getRandomValues(ye)}function _e(t,e,a){return crypto.randomUUID?crypto.randomUUID():be(t)}function be(t,e,a){t=t||{};const l=t.random??t.rng?.()??Ee();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,me(l)}var q=(function(){var t=h(function(L,s,i,o){for(i=i||{},o=L.length;o--;i[L[o]]=s);return i},"o"),e=[1,4],a=[1,13],l=[1,12],n=[1,15],d=[1,16],f=[1,20],y=[1,19],E=[6,7,8],b=[1,26],v=[1,24],R=[1,25],g=[6,7,11],A=[1,6,13,15,16,19,22],J=[1,33],K=[1,34],$=[1,6,7,11,13,15,16,19,22],H={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:h(function(s,i,o,c,p,r,B){var u=r.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[u].id),c.addNode(r[u-1].length,r[u].id,r[u].descr,r[u].type);break;case 16:c.getLogger().trace("Icon: ",r[u]),c.decorateNode({icon:r[u]});break;case 17:case 21:c.decorateNode({class:r[u]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[u].id),c.addNode(0,r[u].id,r[u].descr,r[u].type);break;case 20:c.decorateNode({icon:r[u]});break;case 25:c.getLogger().trace("node found ..",r[u-2]),this.$={id:r[u-1],descr:r[u-1],type:c.getType(r[u-2],r[u])};break;case 26:this.$={id:r[u],descr:r[u],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[u-3]),this.$={id:r[u-3],descr:r[u-1],type:c.getType(r[u-2],r[u])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:a,7:[1,10],9:9,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:f,22:y},t(E,[2,3]),{1:[2,2]},t(E,[2,4]),t(E,[2,5]),{1:[2,6],6:a,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:f,22:y},{6:a,9:22,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:f,22:y},{6:b,7:v,10:23,11:R},t(g,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:f,22:y}),t(g,[2,18]),t(g,[2,19]),t(g,[2,20]),t(g,[2,21]),t(g,[2,23]),t(g,[2,24]),t(g,[2,26],{19:[1,30]}),{20:[1,31]},{6:b,7:v,10:32,11:R},{1:[2,7],6:a,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:f,22:y},t(A,[2,14],{7:J,11:K}),t($,[2,8]),t($,[2,9]),t($,[2,10]),t(g,[2,15]),t(g,[2,16]),t(g,[2,17]),{20:[1,35]},{21:[1,36]},t(A,[2,13],{7:J,11:K}),t($,[2,11]),t($,[2,12]),{21:[1,37]},t(g,[2,25]),t(g,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:h(function(s){var i=this,o=[0],c=[],p=[null],r=[],B=this.table,u="",U=0,Q=0,ie=2,Z=1,se=r.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(T.yy[W]=this.yy[W]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var z=m.yylloc;r.push(z);var re=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function oe(S){o.length=o.length-2*S,p.length=p.length-S,r.length=r.length-S}h(oe,"popStack");function ee(){var S;return S=c.pop()||m.lex()||Z,typeof S!="number"&&(S instanceof Array&&(c=S,S=c.pop()),S=i.symbols_[S]||S),S}h(ee,"lex");for(var k,O,x,X,C={},V,N,te,F;;){if(O=o[o.length-1],this.defaultActions[O]?x=this.defaultActions[O]:((k===null||typeof k>"u")&&(k=ee()),x=B[O]&&B[O][k]),typeof x>"u"||!x.length||!x[0]){var Y="";F=[];for(V in B[O])this.terminals_[V]&&V>ie&&F.push("'"+this.terminals_[V]+"'");m.showPosition?Y="Parse error on line "+(U+1)+`: +`+m.showPosition()+` +Expecting `+F.join(", ")+", got '"+(this.terminals_[k]||k)+"'":Y="Parse error on line "+(U+1)+": Unexpected "+(k==Z?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(Y,{text:m.match,token:this.terminals_[k]||k,line:m.yylineno,loc:z,expected:F})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+k);switch(x[0]){case 1:o.push(k),p.push(m.yytext),r.push(m.yylloc),o.push(x[1]),k=null,Q=m.yyleng,u=m.yytext,U=m.yylineno,z=m.yylloc;break;case 2:if(N=this.productions_[x[1]][1],C.$=p[p.length-N],C._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},re&&(C._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),X=this.performAction.apply(C,[u,Q,U,T.yy,x[1],p,r].concat(se)),typeof X<"u")return X;N&&(o=o.slice(0,-1*N*2),p=p.slice(0,-1*N),r=r.slice(0,-1*N)),o.push(this.productions_[x[1]][0]),p.push(C.$),r.push(C._$),te=B[o[o.length-2]][o[o.length-1]],o.push(te);break;case 3:return!0}}return!0},"parse")},ne=(function(){var L={EOF:1,parseError:h(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:h(function(s,i){return this.yy=i||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:h(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:h(function(s){var i=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:h(function(s){this.unput(this.match.slice(s))},"less"),pastInput:h(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+` +`+i+"^"},"showPosition"),test_match:h(function(s,i){var o,c,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),c=s[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],o=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var r in p)this[r]=p[r];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,i,o,c;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),r=0;ri[0].length)){if(i=o,c=r,this.options.backtrack_lexer){if(s=this.test_match(o,p[r]),s!==!1)return s;if(this._backtrack){i=!1;continue}else return!1}else if(!this.options.flex)break}return i?(s=this.test_match(i,p[c]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:h(function(){var i=this.next();return i||this.lex()},"lex"),begin:h(function(i){this.conditionStack.push(i)},"begin"),popState:h(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:h(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:h(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:h(function(i){this.begin(i)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:h(function(i,o,c,p){switch(c){case 0:return i.getLogger().trace("Found comment",o.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:i.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return i.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:i.getLogger().trace("end icon"),this.popState();break;case 10:return i.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return i.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return i.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return i.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:i.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return i.getLogger().trace("description:",o.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),i.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),i.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),i.getLogger().trace("node end ...",o.yytext),"NODE_DEND";case 30:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 35:return i.getLogger().trace("Long description:",o.yytext),20;case 36:return i.getLogger().trace("Long description:",o.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return L})();H.lexer=ne;function M(){this.yy={}}return h(M,"Parser"),M.prototype=H,H.Parser=M,new M})();q.parser=q;var ke=q,Se=12,D={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},w,xe=(w=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=D,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let a=this.nodes.length-1;a>=0;a--)if(this.nodes[a].level0?this.nodes[0]:null}addNode(e,a,l,n){I.info("addNode",e,a,l,n);let d=!1;this.nodes.length===0?(this.baseLevel=e,e=0,d=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,d=!1);const f=P();let y=f.mindmap?.padding??j.mindmap.padding;switch(n){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:y*=2;break}const E={id:this.count++,nodeId:G(a,f),level:e,descr:G(l,f),type:n,children:[],width:f.mindmap?.maxNodeWidth??j.mindmap.maxNodeWidth,padding:y,isRoot:d},b=this.getParent(e);if(b)b.children.push(E),this.nodes.push(E);else if(d)this.nodes.push(E);else throw new Error(`There can be only one root. No parent could be found for ("${E.descr}")`)}getType(e,a){switch(I.debug("In get type",e,a),e){case"[":return this.nodeType.RECT;case"(":return a===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,a){this.elements[e]=a}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const a=P(),l=this.nodes[this.nodes.length-1];e.icon&&(l.icon=G(e.icon,a)),e.class&&(l.class=G(e.class,a))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,a){if(e.level===0?e.section=void 0:e.section=a,e.children)for(const[l,n]of e.children.entries()){const d=e.level===0?l%(Se-1):a;this.assignSections(n,d)}}flattenNodes(e,a){const l=P(),n=["mindmap-node"];e.isRoot===!0?n.push("section-root","section--1"):e.section!==void 0&&n.push(`section-${e.section}`),e.class&&n.push(e.class);const d=n.join(" "),f=h(E=>{const v=(l.theme?.toLowerCase()??"").includes("redux");switch(E){case D.CIRCLE:return"mindmapCircle";case D.RECT:return"rect";case D.ROUNDED_RECT:return"rounded";case D.CLOUD:return"cloud";case D.BANG:return"bang";case D.HEXAGON:return"hexagon";case D.DEFAULT:return v?"rounded":"defaultMindmapNode";case D.NO_BORDER:default:return"rect"}},"getShapeFromType"),y={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:f(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:d,cssStyles:[],look:l.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(a.push(y),e.children)for(const E of e.children)this.flattenNodes(E,a)}generateEdges(e,a){if(!e.children)return;const l=P();for(const n of e.children){let d="edge";n.section!==void 0&&(d+=` section-edge-${n.section}`);const f=e.level+1;d+=` edge-depth-${f}`;const y={id:`edge_${e.id}_${n.id}`,start:e.id.toString(),end:n.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:l.look,classes:d,depth:e.level,section:n.section};a.push(y),this.generateEdges(n,a)}}getData(){const e=this.getMindmap(),a=P(),n=ge().layout!==void 0,d=a;if(n||(d.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:d};I.debug("getData: mindmapRoot",e,a),this.assignSections(e);const f=[],y=[];this.flattenNodes(e,f),this.generateEdges(e,y),I.debug(`getData: processed ${f.length} nodes and ${y.length} edges`);const E=new Map;for(const b of f)E.set(b.id,{shape:b.shape,width:b.width,height:b.height,padding:b.padding});return{nodes:f,edges:y,config:d,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(E),type:"mindmap",diagramId:"mindmap-"+_e()}}getLogger(){return I}},h(w,"MindmapDB"),w),Ne=h(async(t,e,a,l)=>{I.debug(`Rendering mindmap diagram +`+t);const n=l.db,d=n.getData(),f=ae(e,d.config.securityLevel);if(d.type=l.type,d.layoutAlgorithm=le(d.config.layout,{fallback:"cose-bilkent"}),d.diagramId=e,!n.getMindmap())return;d.nodes.forEach(g=>{g.shape==="rounded"?(g.radius=15,g.taper=15,g.stroke="none",g.width=0,g.padding=15):g.shape==="circle"?g.padding=10:g.shape==="rect"?(g.width=0,g.padding=10):g.shape==="hexagon"&&(g.width=0,g.height=0)}),await he(d,f);const{themeVariables:E}=de(),{useGradient:b,gradientStart:v,gradientStop:R}=E;if(b&&v&&R){const g=f.attr("id"),A=f.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");A.append("stop").attr("offset","0%").attr("stop-color",v).attr("stop-opacity",1),A.append("stop").attr("offset","100%").attr("stop-color",R).attr("stop-opacity",1)}ce(f,d.config.mindmap?.padding??j.mindmap.padding,"mindmapDiagram",d.config.mindmap?.useMaxWidth??j.mindmap.useMaxWidth)},"draw"),De={draw:Ne},Le=h(t=>{const{theme:e,look:a}=t;let l="";for(let n=0;n{let l="";for(let n=0;n{const{theme:e}=t,a=t.svgId,l=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${a}-drop-shadow)`):"none";return` + .edge { + stroke-width: 3; + } + ${Le(t)} + .section-root rect, .section-root path, .section-root circle, .section-root polygon { + fill: ${t.git0}; + } + .section-root text { + fill: ${t.gitBranchLabel0}; + } + .section-root span { + color: ${e?.includes("redux")?t.nodeBorder:t.gitBranchLabel0}; + } + .icon-container { + height:100%; + display: flex; + justify-content: center; + align-items: center; + } + .edge { + fill: none; + } + .mindmap-node-label { + dy: 1em; + alignment-baseline: middle; + text-anchor: middle; + dominant-baseline: middle; + text-align: center; + } + [data-look="neo"].mindmap-node { + filter: ${l}; + } + [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon { + fill: ${e?.includes("redux")?t.mainBkg:t.git0}; + } + [data-look="neo"].mindmap-node.section-root .text-inner-tspan { + fill: ${e?.includes("redux")?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:0)]}; + } + ${t.useGradient&&a&&t.mainBkg?ve(t.THEME_COLOR_LIMIT,a,t.mainBkg):""} +`},"getStyles"),Oe=Te,$e={get db(){return new xe},renderer:De,parser:ke,styles:Oe};export{$e as diagram}; diff --git a/internal/webapp/static/assets/ordinal-Cboi1Yqb.js b/internal/webapp/static/assets/ordinal-Cboi1Yqb.js new file mode 100644 index 0000000..de7dd9e --- /dev/null +++ b/internal/webapp/static/assets/ordinal-Cboi1Yqb.js @@ -0,0 +1 @@ +import{i as a}from"./init-Gi6I4Gst.js";class o extends Map{constructor(n,t=g){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),n!=null)for(const[r,s]of n)this.set(r,s)}get(n){return super.get(c(this,n))}has(n){return super.has(c(this,n))}set(n,t){return super.set(l(this,n),t)}delete(n){return super.delete(p(this,n))}}function c({_intern:e,_key:n},t){const r=n(t);return e.has(r)?e.get(r):t}function l({_intern:e,_key:n},t){const r=n(t);return e.has(r)?e.get(r):(e.set(r,t),t)}function p({_intern:e,_key:n},t){const r=n(t);return e.has(r)&&(t=e.get(r),e.delete(r)),t}function g(e){return e!==null&&typeof e=="object"?e.valueOf():e}const f=Symbol("implicit");function h(){var e=new o,n=[],t=[],r=f;function s(u){let i=e.get(u);if(i===void 0){if(r!==f)return r;e.set(u,i=n.push(u)-1)}return t[i%t.length]}return s.domain=function(u){if(!arguments.length)return n.slice();n=[],e=new o;for(const i of u)e.has(i)||e.set(i,n.push(i)-1);return s},s.range=function(u){return arguments.length?(t=Array.from(u),s):t.slice()},s.unknown=function(u){return arguments.length?(r=u,s):r},s.copy=function(){return h(n,t).unknown(r)},a.apply(s,arguments),s}export{h as o}; diff --git a/internal/webapp/static/assets/pegDiagram-VL7TDLO6-DgoYitu3.js b/internal/webapp/static/assets/pegDiagram-VL7TDLO6-DgoYitu3.js new file mode 100644 index 0000000..2fc849d --- /dev/null +++ b/internal/webapp/static/assets/pegDiagram-VL7TDLO6-DgoYitu3.js @@ -0,0 +1 @@ +import{g as l,r as m,d as a}from"./chunk-6Q2QTUOP-C7qNvbCj.js";import{p}from"./chunk-JWPE2WC7-Czg53Rx5.js";import{_ as t,l as o}from"./mermaid.core-B7WVQkyL.js";import{M as u,d as c}from"./cynefin-VYW2F7L2-CdOzebfq.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},L={parser:b,db:a,renderer:m,styles:l};export{L as diagram}; diff --git a/internal/webapp/static/assets/pieDiagram-7S7Q4E2Y-BqNckD7-.js b/internal/webapp/static/assets/pieDiagram-7S7Q4E2Y-BqNckD7-.js new file mode 100644 index 0000000..9b81333 --- /dev/null +++ b/internal/webapp/static/assets/pieDiagram-7S7Q4E2Y-BqNckD7-.js @@ -0,0 +1,39 @@ +import{p as at}from"./chunk-JWPE2WC7-Czg53Rx5.js";import{a2 as T,a5 as B,b5 as rt,g as nt,s as it,a as ot,b as st,o as lt,n as ct,_ as g,l as G,c as ut,A as dt,D as gt,K as pt,e as ht,p as ft,B as mt}from"./mermaid.core-B7WVQkyL.js";import{p as vt}from"./cynefin-VYW2F7L2-CdOzebfq.js";import{d as Z}from"./arc-DQmUyXqg.js";import{o as xt}from"./ordinal-Cboi1Yqb.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function St(t,n){return nt?1:n>=t?0:NaN}function yt(t){return t}function wt(){var t=yt,n=St,y=null,b=T(0),l=T(B),p=T(0);function i(e){var r,s=(e=rt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),E=Math.min(B,Math.max(-B,l.apply(this,arguments)-D)),k,L=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=L*(E<0?-1:1),A;for(r=0;r0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:L};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var At=mt.pie,I={sections:new Map,showData:!1},F=I.sections,V=I.showData,Ct=structuredClone(At),$t=g(()=>structuredClone(Ct),"getConfig"),Dt=g(()=>{F=new Map,V=I.showData,ft()},"clear"),Tt=g(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);F.has(t)||(F.set(t,n),G.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),bt=g(()=>F,"getSections"),kt=g(t=>{V=t},"setShowData"),zt=g(()=>V,"getShowData"),q={getConfig:$t,clear:Dt,setDiagramTitle:ct,getDiagramTitle:lt,setAccTitle:st,getAccTitle:ot,setAccDescription:it,getAccDescription:nt,addSection:Tt,getSections:bt,setShowData:kt,getShowData:zt},Et=g((t,n)=>{at(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Mt={parse:g(async t=>{const n=await vt("pie",t);G.debug(n),Et(n,q)},"parse")},Rt=g(t=>` + .pieCircle{ + stroke: ${t.pieStrokeColor}; + stroke-width : ${t.pieStrokeWidth}; + opacity : ${t.pieOpacity}; + } + .pieCircle.highlighted{ + scale: 1.05; + opacity: 1; + } + .pieCircle.highlightedOnHover:hover{ + transition-duration: 250ms; + scale: 1.05; + opacity: 1; + } + .pieOuterCircle{ + stroke: ${t.pieOuterStrokeColor}; + stroke-width: ${t.pieOuterStrokeWidth}; + fill: none; + } + .pieTitleText { + text-anchor: middle; + font-size: ${t.pieTitleTextSize}; + fill: ${t.pieTitleTextColor}; + font-family: ${t.fontFamily}; + } + .slice { + font-family: ${t.fontFamily}; + fill: ${t.pieSectionTextColor}; + font-size:${t.pieSectionTextSize}; + // fill: white; + } + .legend text { + fill: ${t.pieLegendTextColor}; + font-family: ${t.fontFamily}; + font-size: ${t.pieLegendTextSize}; + } +`,"getStyles"),Lt=Rt,Wt=g(t=>{const n=[...t.values()].reduce((l,p)=>l+p,0),y=[...t.entries()].map(([l,p])=>({label:l,value:p})).filter(l=>l.value/n*100>=1);return wt().value(l=>l.value).sort(null)(y)},"createPieArcs"),_t=g((t,n,y,b)=>{G.debug(`rendering pie chart +`+t);const l=b.db,p=ut(),i=dt(l.getConfig(),p.pie),e=40,r=18,s=4,h=450,w=h,$=gt(n),f=$.append("g");f.attr("transform","translate("+w/2+","+h/2+")");const{themeVariables:o}=p;let[D]=pt(o.pieOuterStrokeWidth);D??=2;const E=i.legendPosition,k=i.textPosition,L=i.donutHole>0&&i.donutHole<=.9?i.donutHole:0,u=Math.min(w,h)/2-e,A=Z().innerRadius(L*u).outerRadius(u),M=Z().innerRadius(u*k).outerRadius(u*k),m=f.append("g");m.append("circle").attr("cx",0).attr("cy",0).attr("r",u+D/2).attr("class","pieOuterCircle");const W=l.getSections(),J=Wt(W),Q=[o.pie1,o.pie2,o.pie3,o.pie4,o.pie5,o.pie6,o.pie7,o.pie8,o.pie9,o.pie10,o.pie11,o.pie12];let H=0;W.forEach(a=>{H+=a});const U=J.filter(a=>(a.data.value/H*100).toFixed(0)!=="0"),N=xt(Q).domain([...W.keys()]);m.selectAll("mySlices").data(U).enter().append("path").attr("d",A).attr("fill",a=>N(a.data.label)).attr("class",a=>{let c="pieCircle";return i.highlightSlice==="hover"?c+=" highlightedOnHover":i.highlightSlice===a.data.label&&(c+=" highlighted"),c}),m.selectAll("mySlices").data(U).enter().append("text").text(a=>(a.data.value/H*100).toFixed(0)+"%").attr("transform",a=>"translate("+M.centroid(a)+")").style("text-anchor","middle").attr("class","slice");const Y=f.append("text").text(l.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),R=[...W.entries()].map(([a,c])=>({label:a,value:c})),C=f.selectAll(".legend").data(R).enter().append("g").attr("class","legend");C.append("rect").attr("width",r).attr("height",r).style("fill",a=>N(a.label)).style("stroke",a=>N(a.label)),C.append("text").attr("x",r+s).attr("y",r-s).text(a=>l.getShowData()?`${a.label} [${a.value}]`:a.label);const z=Math.max(...C.selectAll("text").nodes().map(a=>a?.getBoundingClientRect().width??0));let _=h,O=w+e;const d=r+s,P=R.length*d;switch(E){case"center":C.attr("transform",(a,c)=>{const v=d*R.length/2,x=-z/2-(r+s),S=c*d-v;return"translate("+x+","+S+")"});break;case"top":_+=P,C.attr("transform",(a,c)=>{const v=u,x=-z/2-(r+s),S=c*d-v;return`translate(${x}, ${S})`}),m.attr("transform",()=>`translate(0, ${P+d})`);break;case"bottom":_+=P,C.attr("transform",(a,c)=>{const v=-u-d,x=-z/2-(r+s),S=c*d-v;return"translate("+x+","+S+")"});break;case"left":O+=r+s+z,C.attr("transform",(a,c)=>{const v=d*R.length/2,x=-u-(r+s),S=c*d-v;return"translate("+x+","+S+")"}),m.attr("transform",()=>`translate(${z+r+s}, 0)`);break;default:O+=r+s+z,C.attr("transform",(a,c)=>{const v=d*R.length/2,x=12*r,S=c*d-v;return"translate("+x+","+S+")"});break}const j=Y.node()?.getBoundingClientRect().width??0,tt=w/2-j/2,et=w/2+j/2,K=Math.min(0,tt),X=Math.max(O,et)-K;$.attr("viewBox",`${K} 0 ${X} ${_}`),ht($,_,X,i.useMaxWidth)},"draw"),Ft={draw:_t},jt={parser:Mt,db:q,renderer:Ft,styles:Lt};export{jt as diagram}; diff --git a/internal/webapp/static/assets/quadrantDiagram-CIZ2JOQS-D_d0CTwl.js b/internal/webapp/static/assets/quadrantDiagram-CIZ2JOQS-D_d0CTwl.js new file mode 100644 index 0000000..4161ecb --- /dev/null +++ b/internal/webapp/static/assets/quadrantDiagram-CIZ2JOQS-D_d0CTwl.js @@ -0,0 +1,7 @@ +import{s as Ae,g as ke,o as ae,n as Fe,a as Pe,b as ve,_ as o,c as zt,l as bt,d as Lt,e as Ce,p as Le,B as z,i as Ee,E as De}from"./mermaid.core-B7WVQkyL.js";import{l as ie}from"./linear-DIpgEtso.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-DX6XiGOO.js";var Et=(function(){var t=o(function(Y,r,l,x){for(l=l||{},x=Y.length;x--;l[Y[x]]=r);return l},"o"),n=[1,3],f=[1,4],d=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],_=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],k=[2,36],u=[1,37],T=[1,36],m=[1,38],q=[1,35],b=[1,43],g=[1,41],A=[1,45],ht=[1,14],xt=[1,23],ft=[1,18],gt=[1,19],ct=[1,20],_t=[1,21],dt=[1,22],i=[1,24],Vt=[1,25],It=[1,26],wt=[1,27],Bt=[1,28],Rt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],At=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],kt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,x,c,S,e,ut){var s=e.length-1;switch(S){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],c.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),c.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),c.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),c.setAccDescription(this.$);break;case 46:c.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:c.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:c.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:c.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:c.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:c.setXAxisLeftText(e[s-2]),c.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",c.setXAxisLeftText(e[s-1]);break;case 53:c.setXAxisLeftText(e[s]);break;case 54:c.setYAxisBottomText(e[s-2]),c.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",c.setYAxisBottomText(e[s-1]);break;case 56:c.setYAxisBottomText(e[s]);break;case 57:c.setQuadrant1Text(e[s]);break;case 58:c.setQuadrant2Text(e[s]);break;case 59:c.setQuadrant3Text(e[s]);break;case 60:c.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:f,55:d,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:f,55:d,56:h,57:p},{18:n,26:9,27:2,28:f,55:d,56:h,57:p},t(y,[2,33],{29:10}),t(_,[2,61]),t(_,[2,62]),t(_,[2,63]),{1:[2,30]},{1:[2,31]},t(a,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:T,10:m,12:q,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:Vt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:d,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:u,5:T,10:m,12:q,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:Vt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:m,12:q,13:b,14:g,15:A,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:u,5:T,10:m,12:q,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:u,5:T,10:m,12:q,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:u,5:T,8:H,10:m,12:q,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,102]},t(a,[2,29],{10:At}),t(Zt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:At}),t(a,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:106},t(N,[2,26]),t(a,[2,50],{10:At}),t(Zt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var x=new Error(r);throw x.hash=l,x}},"parseError"),parse:o(function(r){var l=this,x=[0],c=[],S=[null],e=[],ut=this.table,s="",yt=0,Jt=0,qe=2,$t=1,be=e.slice.call(arguments,1),D=Object.create(this.lexer),j={yy:{}};for(var Ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ft)&&(j.yy[Ft]=this.yy[Ft]);D.setInput(r,j.yy),j.yy.lexer=D,j.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Pt=D.yylloc;e.push(Pt);var Se=D.options&&D.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){x.length=x.length-2*R,S.length=S.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=c.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(c=R,R=c.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,G,W,vt,rt={},Tt,M,ee,mt;;){if(G=x[x.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=te()),W=ut[G]&&ut[G][B]),typeof W>"u"||!W.length||!W[0]){var Ct="";mt=[];for(Tt in ut[G])this.terminals_[Tt]&&Tt>qe&&mt.push("'"+this.terminals_[Tt]+"'");D.showPosition?Ct="Parse error on line "+(yt+1)+`: +`+D.showPosition()+` +Expecting `+mt.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Ct="Parse error on line "+(yt+1)+": Unexpected "+(B==$t?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Ct,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Pt,expected:mt})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+B);switch(W[0]){case 1:x.push(B),S.push(D.yytext),e.push(D.yylloc),x.push(W[1]),B=null,Jt=D.yyleng,s=D.yytext,yt=D.yylineno,Pt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],rt.$=S[S.length-M],rt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},Se&&(rt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),vt=this.performAction.apply(rt,[s,Jt,yt,j.yy,W[1],S,e].concat(be)),typeof vt<"u")return vt;M&&(x=x.slice(0,-1*M*2),S=S.slice(0,-1*M),e=e.slice(0,-1*M)),x.push(this.productions_[W[1]][0]),S.push(rt.$),e.push(rt._$),ee=ut[x[x.length-2]][x[x.length-1]],x.push(ee);break;case 3:return!0}}return!0},"parse")},me=(function(){var Y={EOF:1,parseError:o(function(l,x){if(this.yy.parser)this.yy.parser.parseError(l,x);else throw new Error(l)},"parseError"),setInput:o(function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:o(function(r){var l=r.length,x=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===c.length?this.yylloc.first_column:0)+c[c.length-x.length].length-x[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(r){this.unput(this.match.slice(r))},"less"),pastInput:o(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+` +`+l+"^"},"showPosition"),test_match:o(function(r,l){var x,c,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),c=r[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],x=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var e in S)this[e]=S[e];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,l,x,c;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),e=0;el[0].length)){if(l=x,c=e,this.options.backtrack_lexer){if(r=this.test_match(x,S[e]),r!==!1)return r;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(r=this.test_match(l,S[c]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var l=this.next();return l||this.lex()},"lex"),begin:o(function(l){this.conditionStack.push(l)},"begin"),popState:o(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:o(function(l){this.begin(l)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(l,x,c,S){switch(c){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return Y})();kt.lexer=me;function pt(){this.yy={}}return o(pt,"Parser"),pt.prototype=kt,kt.Parser=pt,new pt})();Et.parser=Et;var ze=Et,I=De(),ot,Ve=(ot=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:z.quadrantChart?.chartWidth||500,chartWidth:z.quadrantChart?.chartHeight||500,titlePadding:z.quadrantChart?.titlePadding||10,titleFontSize:z.quadrantChart?.titleFontSize||20,quadrantPadding:z.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:z.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:z.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:z.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:z.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:z.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:z.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:z.quadrantChart?.pointTextPadding||5,pointLabelFontSize:z.quadrantChart?.pointLabelFontSize||12,pointRadius:z.quadrantChart?.pointRadius||5,xAxisPosition:z.quadrantChart?.xAxisPosition||"top",yAxisPosition:z.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:z.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:z.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:I.quadrant1Fill,quadrant2Fill:I.quadrant2Fill,quadrant3Fill:I.quadrant3Fill,quadrant4Fill:I.quadrant4Fill,quadrant1TextFill:I.quadrant1TextFill,quadrant2TextFill:I.quadrant2TextFill,quadrant3TextFill:I.quadrant3TextFill,quadrant4TextFill:I.quadrant4TextFill,quadrantPointFill:I.quadrantPointFill,quadrantPointTextFill:I.quadrantPointTextFill,quadrantXAxisTextFill:I.quadrantXAxisTextFill,quadrantYAxisTextFill:I.quadrantYAxisTextFill,quadrantTitleFill:I.quadrantTitleFill,quadrantInternalBorderStrokeFill:I.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:I.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,bt.info("clear called")}setData(n){this.data={...this.data,...n}}addPoints(n){this.data.points=[...n,...this.data.points]}addClass(n,f){this.classes.set(n,f)}setConfig(n){bt.trace("setConfig called with: ",n),this.config={...this.config,...n}}setThemeConfig(n){bt.trace("setThemeConfig called with: ",n),this.themeConfig={...this.themeConfig,...n}}calculateSpace(n,f,d,h){const p=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,y={top:n==="top"&&f?p:0,bottom:n==="bottom"&&f?p:0},_=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,a={left:this.config.yAxisPosition==="left"&&d?_:0,right:this.config.yAxisPosition==="right"&&d?_:0},k=this.config.titleFontSize+this.config.titlePadding*2,u={top:h?k:0},T=this.config.quadrantPadding+a.left,m=this.config.quadrantPadding+y.top+u.top,q=this.config.chartWidth-this.config.quadrantPadding*2-a.left-a.right,b=this.config.chartHeight-this.config.quadrantPadding*2-y.top-y.bottom-u.top,g=q/2,A=b/2;return{xAxisSpace:y,yAxisSpace:a,titleSpace:u,quadrantSpace:{quadrantLeft:T,quadrantTop:m,quadrantWidth:q,quadrantHalfWidth:g,quadrantHeight:b,quadrantHalfHeight:A}}}getAxisLabels(n,f,d,h){const{quadrantSpace:p,titleSpace:y}=h,{quadrantHalfHeight:_,quadrantHeight:a,quadrantLeft:k,quadrantHalfWidth:u,quadrantTop:T,quadrantWidth:m}=p,q=!!this.data.xAxisRightText,b=!!this.data.yAxisTopText,g=[];return this.data.xAxisLeftText&&f&&g.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:k+(q?u/2:0),y:n==="top"?this.config.xAxisLabelPadding+y.top:this.config.xAxisLabelPadding+T+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:q?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&f&&g.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:k+u+(q?u/2:0),y:n==="top"?this.config.xAxisLabelPadding+y.top:this.config.xAxisLabelPadding+T+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:q?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&d&&g.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+k+m+this.config.quadrantPadding,y:T+a-(b?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:b?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&d&&g.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+k+m+this.config.quadrantPadding,y:T+_-(b?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:b?"center":"left",horizontalPos:"top",rotation:-90}),g}getQuadrants(n){const{quadrantSpace:f}=n,{quadrantHalfHeight:d,quadrantLeft:h,quadrantHalfWidth:p,quadrantTop:y}=f,_=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+p,y,width:p,height:d,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y,width:p,height:d,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y:y+d,width:p,height:d,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+p,y:y+d,width:p,height:d,fill:this.themeConfig.quadrant4Fill}];for(const a of _)a.text.x=a.x+a.width/2,this.data.points.length===0?(a.text.y=a.y+a.height/2,a.text.horizontalPos="middle"):(a.text.y=a.y+this.config.quadrantTextTopPadding,a.text.horizontalPos="top");return _}getQuadrantPoints(n){const{quadrantSpace:f}=n,{quadrantHeight:d,quadrantLeft:h,quadrantTop:p,quadrantWidth:y}=f,_=ie().domain([0,1]).range([h,y+h]),a=ie().domain([0,1]).range([d+p,p]);return this.data.points.map(u=>{const T=this.classes.get(u.className);return T&&(u={...T,...u}),{x:_(u.x),y:a(u.y),fill:u.color??this.themeConfig.quadrantPointFill,radius:u.radius??this.config.pointRadius,text:{text:u.text,fill:this.themeConfig.quadrantPointTextFill,x:_(u.x),y:a(u.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:u.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:u.strokeWidth??"0px"}})}getBorders(n){const f=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:d}=n,{quadrantHalfHeight:h,quadrantHeight:p,quadrantLeft:y,quadrantHalfWidth:_,quadrantTop:a,quadrantWidth:k}=d;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y-f,y1:a,x2:y+k+f,y2:a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y+k,y1:a+f,x2:y+k,y2:a+p-f},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y-f,y1:a+p,x2:y+k+f,y2:a+p},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y,y1:a+f,x2:y,y2:a+p-f},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:y+_,y1:a+f,x2:y+_,y2:a+p-f},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:y+f,y1:a+h,x2:y+k-f,y2:a+h}]}getTitle(n){if(n)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const n=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),f=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),d=this.config.showTitle&&!!this.data.titleText,h=this.data.points.length>0?"bottom":this.config.xAxisPosition,p=this.calculateSpace(h,n,f,d);return{points:this.getQuadrantPoints(p),quadrants:this.getQuadrants(p),axisLabels:this.getAxisLabels(h,n,f,p),borderLines:this.getBorders(p),title:this.getTitle(d)}}},o(ot,"QuadrantBuilder"),ot),lt,qt=(lt=class extends Error{constructor(n,f,d){super(`value for ${n} ${f} is invalid, please use a valid ${d}`),this.name="InvalidStyleError"}},o(lt,"InvalidStyleError"),lt);function Dt(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}o(Dt,"validateHexCode");function ne(t){return!/^\d+$/.test(t)}o(ne,"validateNumber");function se(t){return!/^\d+px$/.test(t)}o(se,"validateSizeInPixels");function O(t){return Ee(t.trim(),zt())}o(O,"textSanitizer");var V=new Ve;function re(t){V.setData({quadrant1Text:O(t.text)})}o(re,"setQuadrant1Text");function oe(t){V.setData({quadrant2Text:O(t.text)})}o(oe,"setQuadrant2Text");function le(t){V.setData({quadrant3Text:O(t.text)})}o(le,"setQuadrant3Text");function he(t){V.setData({quadrant4Text:O(t.text)})}o(he,"setQuadrant4Text");function ce(t){V.setData({xAxisLeftText:O(t.text)})}o(ce,"setXAxisLeftText");function de(t){V.setData({xAxisRightText:O(t.text)})}o(de,"setXAxisRightText");function ue(t){V.setData({yAxisTopText:O(t.text)})}o(ue,"setYAxisTopText");function xe(t){V.setData({yAxisBottomText:O(t.text)})}o(xe,"setYAxisBottomText");function St(t){const n={};for(const f of t){const[d,h]=f.trim().split(/\s*:\s*/);if(d==="radius"){if(ne(h))throw new qt(d,h,"number");n.radius=parseInt(h)}else if(d==="color"){if(Dt(h))throw new qt(d,h,"hex code");n.color=h}else if(d==="stroke-color"){if(Dt(h))throw new qt(d,h,"hex code");n.strokeColor=h}else if(d==="stroke-width"){if(se(h))throw new qt(d,h,"number of pixels (eg. 10px)");n.strokeWidth=h}else throw new Error(`style named ${d} is not supported.`)}return n}o(St,"parseStyles");function fe(t,n,f,d,h){const p=St(h);V.addPoints([{x:f,y:d,text:O(t.text),className:n,...p}])}o(fe,"addPoint");function ge(t,n){V.addClass(t,St(n))}o(ge,"addClass");function pe(t){V.setConfig({chartWidth:t})}o(pe,"setWidth");function ye(t){V.setConfig({chartHeight:t})}o(ye,"setHeight");function Te(){const t=zt(),{themeVariables:n,quadrantChart:f}=t;return f&&V.setConfig(f),V.setThemeConfig({quadrant1Fill:n.quadrant1Fill,quadrant2Fill:n.quadrant2Fill,quadrant3Fill:n.quadrant3Fill,quadrant4Fill:n.quadrant4Fill,quadrant1TextFill:n.quadrant1TextFill,quadrant2TextFill:n.quadrant2TextFill,quadrant3TextFill:n.quadrant3TextFill,quadrant4TextFill:n.quadrant4TextFill,quadrantPointFill:n.quadrantPointFill,quadrantPointTextFill:n.quadrantPointTextFill,quadrantXAxisTextFill:n.quadrantXAxisTextFill,quadrantYAxisTextFill:n.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:n.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:n.quadrantInternalBorderStrokeFill,quadrantTitleFill:n.quadrantTitleFill}),V.setData({titleText:ae()}),V.build()}o(Te,"getQuadrantData");var Ie=o(function(){V.clear(),Le()},"clear"),we={setWidth:pe,setHeight:ye,setQuadrant1Text:re,setQuadrant2Text:oe,setQuadrant3Text:le,setQuadrant4Text:he,setXAxisLeftText:ce,setXAxisRightText:de,setYAxisTopText:ue,setYAxisBottomText:xe,parseStyles:St,addPoint:fe,addClass:ge,getQuadrantData:Te,clear:Ie,setAccTitle:ve,getAccTitle:Pe,setDiagramTitle:Fe,getDiagramTitle:ae,getAccDescription:ke,setAccDescription:Ae},Be=o((t,n,f,d)=>{function h(i){return i==="top"?"hanging":"middle"}o(h,"getDominantBaseLine");function p(i){return i==="left"?"start":"middle"}o(p,"getTextAnchor");function y(i){return`translate(${i.x}, ${i.y}) rotate(${i.rotation||0})`}o(y,"getTransformation");const _=zt();bt.debug(`Rendering quadrant chart +`+t);const a=_.securityLevel;let k;a==="sandbox"&&(k=Lt("#i"+n));const T=(a==="sandbox"?Lt(k.nodes()[0].contentDocument.body):Lt("body")).select(`[id="${n}"]`),m=T.append("g").attr("class","main"),q=_.quadrantChart?.chartWidth??500,b=_.quadrantChart?.chartHeight??500;Ce(T,b,q,_.quadrantChart?.useMaxWidth??!0),T.attr("viewBox","0 0 "+q+" "+b),d.db.setHeight(b),d.db.setWidth(q);const g=d.db.getQuadrantData(),A=m.append("g").attr("class","quadrants"),ht=m.append("g").attr("class","border"),xt=m.append("g").attr("class","data-points"),ft=m.append("g").attr("class","labels"),gt=m.append("g").attr("class","title");g.title&>.append("text").attr("x",0).attr("y",0).attr("fill",g.title.fill).attr("font-size",g.title.fontSize).attr("dominant-baseline",h(g.title.horizontalPos)).attr("text-anchor",p(g.title.verticalPos)).attr("transform",y(g.title)).text(g.title.text),g.borderLines&&ht.selectAll("line").data(g.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);const ct=A.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class","quadrant");ct.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),ct.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text)).text(i=>i.text.text),ft.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>h(i.horizontalPos)).attr("text-anchor",i=>p(i.verticalPos)).attr("transform",i=>y(i));const dt=xt.selectAll("g.data-point").data(g.points).enter().append("g").attr("class","data-point");dt.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),dt.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text))},"draw"),Re={draw:Be},Xe={parser:ze,db:we,renderer:Re,styles:o(()=>"","styles")};export{Xe as diagram}; diff --git a/internal/webapp/static/assets/railroadDiagram-AXF67PYL-DH5n6ePI.js b/internal/webapp/static/assets/railroadDiagram-AXF67PYL-DH5n6ePI.js new file mode 100644 index 0000000..8a32382 --- /dev/null +++ b/internal/webapp/static/assets/railroadDiagram-AXF67PYL-DH5n6ePI.js @@ -0,0 +1 @@ +import{g as s,r as l,d as t}from"./chunk-6Q2QTUOP-C7qNvbCj.js";import{p as m}from"./chunk-JWPE2WC7-Czg53Rx5.js";import{_ as n,l as i}from"./mermaid.core-B7WVQkyL.js";import{M as p,c as u}from"./cynefin-VYW2F7L2-CdOzebfq.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},P={parser:y,db:t,renderer:l,styles:s};export{P as diagram}; diff --git a/internal/webapp/static/assets/requirementDiagram-LRYGKXZP-CG2rrsXg.js b/internal/webapp/static/assets/requirementDiagram-LRYGKXZP-CG2rrsXg.js new file mode 100644 index 0000000..c5a1d83 --- /dev/null +++ b/internal/webapp/static/assets/requirementDiagram-LRYGKXZP-CG2rrsXg.js @@ -0,0 +1,84 @@ +import{g as ze}from"./chunk-XXDRQBXY-BXTWinaX.js";import{s as Xe}from"./chunk-KBJHAD2P-CHI3y1em.js";import{_ as f,y as Be,b as Je,a as Ze,s as et,g as tt,n as st,o as it,c as Ne,l as qe,p as rt,t as nt,u as at,v as lt,x as ct}from"./mermaid.core-B7WVQkyL.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var Ce=(function(){var e=f(function($,i,l,o){for(l=l||{},o=$.length;o--;l[$[o]]=i);return l},"o"),n=[1,3],u=[1,4],h=[1,5],r=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],m=[1,22],p=[2,7],y=[1,26],S=[1,27],k=[1,28],q=[1,29],C=[1,33],A=[1,34],V=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],R=[1,39],g=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ae=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ee=[27,29],Ve=[1,70],ve=[1,71],Le=[1,72],xe=[1,73],Oe=[1,74],we=[1,75],De=[1,76],ee=[1,83],U=[1,80],te=[1,84],se=[1,85],ie=[1,86],re=[1,87],ne=[1,88],ae=[1,89],le=[1,90],ce=[1,91],oe=[1,92],pe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],Me=[1,101],Fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],he=[1,116],ue=[1,117],fe=[1,114],me=[1,115],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:f(function(i,l,o,s,d,t,de){var c=t.length-1;switch(d){case 4:this.$=t[c].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[c].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[c-3],t[c-4]);break;case 22:s.addRequirement(t[c-5],t[c-6]),s.setClass([t[c-5]],t[c-3]);break;case 23:s.setNewReqId(t[c-2]);break;case 24:s.setNewReqText(t[c-2]);break;case 25:s.setNewReqRisk(t[c-2]);break;case 26:s.setNewReqVerifyMethod(t[c-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[c-3]);break;case 43:s.addElement(t[c-5]),s.setClass([t[c-5]],t[c-3]);break;case 44:s.setNewElementType(t[c-2]);break;case 45:s.setNewElementDocRef(t[c-2]);break;case 48:s.addRelationship(t[c-2],t[c],t[c-4]);break;case 49:s.addRelationship(t[c-2],t[c-4],t[c]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[c-2],s.defineClass(t[c-1],t[c]);break;case 58:s.setClass(t[c-1],t[c]);break;case 59:s.setClass([t[c-2]],t[c]);break;case 60:case 62:this.$=[t[c]];break;case 61:case 63:this.$=t[c-2].concat([t[c]]);break;case 64:this.$=t[c-2],s.setCssStyle(t[c-1],t[c]);break;case 65:this.$=[t[c]];break;case 66:t[c-2].push(t[c]),this.$=t[c-2];break;case 68:this.$=t[c-1]+t[c];break}},"anonymous"),table:[{3:1,4:2,6:n,9:u,11:h,13:r},{1:[3]},{3:8,4:2,5:[1,7],6:n,9:u,11:h,13:r},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(a,[2,6]),{3:12,4:2,6:n,9:u,11:h,13:r},{1:[2,2]},{4:17,5:m,7:13,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},e(a,[2,4]),e(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:m,7:42,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:43,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:44,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:45,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:46,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:47,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:48,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:49,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:50,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(E,[2,17]),e(E,[2,18]),e(E,[2,19]),e(E,[2,20]),{30:60,33:62,75:P,89:R,90:g},{30:63,33:62,75:P,89:R,90:g},{30:64,33:62,75:P,89:R,90:g},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ae,[2,81]),e(Ae,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(Ee,[2,79]),e(Ee,[2,80]),{27:[1,67],29:[1,68]},e(Ee,[2,85]),e(Ee,[2,86]),{62:69,65:Ve,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{62:77,65:Ve,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{30:78,33:62,75:P,89:R,90:g},{73:79,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,60]),e(pe,[2,62]),{73:93,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},{30:94,33:62,75:P,76:U,89:R,90:g},{5:[1,95]},{30:96,33:62,75:P,89:R,90:g},{5:[1,97]},{30:98,33:62,75:P,89:R,90:g},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(E,[2,59],{76:U}),e(E,[2,64],{76:Me}),{33:103,75:[1,102],89:R,90:g},e(Fe,[2,65],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),e(T,[2,67]),e(T,[2,69]),e(T,[2,70]),e(T,[2,71]),e(T,[2,72]),e(T,[2,73]),e(T,[2,74]),e(T,[2,75]),e(T,[2,76]),e(T,[2,77]),e(T,[2,78]),e(E,[2,57],{76:Me}),e(E,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:he,40:ue,56:113,57:fe,59:me},{27:[1,118],76:U},{33:119,89:R,90:g},{33:120,89:R,90:g},{75:ee,78:121,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,61]),e(pe,[2,63]),e(T,[2,68]),e(E,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(E,[2,28]),{5:[1,127]},e(E,[2,42]),{32:[1,128]},{32:[1,129]},{5:he,40:ue,56:130,57:fe,59:me},e(E,[2,47]),{5:[1,131]},e(E,[2,48]),e(E,[2,49]),e(Fe,[2,66],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),{33:132,89:R,90:g},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(E,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(E,[2,46]),{5:he,40:ue,56:152,57:fe,59:me},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(E,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(E,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:he,40:ue,56:163,57:fe,59:me},{5:he,40:ue,56:164,57:fe,59:me},e(E,[2,23]),e(E,[2,24]),e(E,[2,25]),e(E,[2,26]),e(E,[2,44]),e(E,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:f(function(i,l){if(l.recoverable)this.trace(i);else{var o=new Error(i);throw o.hash=l,o}},"parseError"),parse:f(function(i){var l=this,o=[0],s=[],d=[null],t=[],de=this.table,c="",ge=0,$e=0,Ke=2,Pe=1,We=t.slice.call(arguments,1),_=Object.create(this.lexer),G={yy:{}};for(var be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,be)&&(G.yy[be]=this.yy[be]);_.setInput(i,G.yy),G.yy.lexer=_,G.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Ie=_.yylloc;t.push(Ie);var je=_.options&&_.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ge(I){o.length=o.length-2*I,d.length=d.length-I,t.length=t.length-I}f(Ge,"popStack");function Ue(){var I;return I=s.pop()||_.lex()||Pe,typeof I!="number"&&(I instanceof Array&&(s=I,I=s.pop()),I=l.symbols_[I]||I),I}f(Ue,"lex");for(var b,z,N,ke,J={},ye,F,Ye,_e;;){if(z=o[o.length-1],this.defaultActions[z]?N=this.defaultActions[z]:((b===null||typeof b>"u")&&(b=Ue()),N=de[z]&&de[z][b]),typeof N>"u"||!N.length||!N[0]){var Te="";_e=[];for(ye in de[z])this.terminals_[ye]&&ye>Ke&&_e.push("'"+this.terminals_[ye]+"'");_.showPosition?Te="Parse error on line "+(ge+1)+`: +`+_.showPosition()+` +Expecting `+_e.join(", ")+", got '"+(this.terminals_[b]||b)+"'":Te="Parse error on line "+(ge+1)+": Unexpected "+(b==Pe?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(Te,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Ie,expected:_e})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+b);switch(N[0]){case 1:o.push(b),d.push(_.yytext),t.push(_.yylloc),o.push(N[1]),b=null,$e=_.yyleng,c=_.yytext,ge=_.yylineno,Ie=_.yylloc;break;case 2:if(F=this.productions_[N[1]][1],J.$=d[d.length-F],J._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},je&&(J._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]]),ke=this.performAction.apply(J,[c,$e,ge,G.yy,N[1],d,t].concat(We)),typeof ke<"u")return ke;F&&(o=o.slice(0,-1*F*2),d=d.slice(0,-1*F),t=t.slice(0,-1*F)),o.push(this.productions_[N[1]][0]),d.push(J.$),t.push(J._$),Ye=de[o[o.length-2]][o[o.length-1]],o.push(Ye);break;case 3:return!0}}return!0},"parse")},He=(function(){var $={EOF:1,parseError:f(function(l,o){if(this.yy.parser)this.yy.parser.parseError(l,o);else throw new Error(l)},"parseError"),setInput:f(function(i,l){return this.yy=l||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var l=i.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:f(function(i){var l=i.length,o=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===s.length?this.yylloc.first_column:0)+s[s.length-o.length].length-o[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(i){this.unput(this.match.slice(i))},"less"),pastInput:f(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var i=this.pastInput(),l=new Array(i.length+1).join("-");return i+this.upcomingInput()+` +`+l+"^"},"showPosition"),test_match:f(function(i,l){var o,s,d;if(this.options.backtrack_lexer&&(d={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(d.yylloc.range=this.yylloc.range.slice(0))),s=i[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],o=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var t in d)this[t]=d[t];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,l,o,s;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),t=0;tl[0].length)){if(l=o,s=t,this.options.backtrack_lexer){if(i=this.test_match(o,d[t]),i!==!1)return i;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(i=this.test_match(l,d[s]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var l=this.next();return l||this.lex()},"lex"),begin:f(function(l){this.conditionStack.push(l)},"begin"),popState:f(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:f(function(l){this.begin(l)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(l,o,s,d){switch(s){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return o.yytext=o.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return $})();Se.lexer=He;function Re(){this.yy={}}return f(Re,"Parser"),Re.prototype=Se,Se.Parser=Re,new Re})();Ce.parser=Ce;var ot=Ce,Z,ht=(Z=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Je,this.getAccTitle=Ze,this.setAccDescription=et,this.getAccDescription=tt,this.setDiagramTitle=st,this.getDiagramTitle=it,this.getConfig=f(()=>Ne().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(n){this.direction=n}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(n,u){return this.requirements.has(n)||this.requirements.set(n,{name:n,type:u,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(n)}getRequirements(){return this.requirements}setNewReqId(n){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=n)}setNewReqText(n){this.latestRequirement!==void 0&&(this.latestRequirement.text=n)}setNewReqRisk(n){this.latestRequirement!==void 0&&(this.latestRequirement.risk=n)}setNewReqVerifyMethod(n){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=n)}addElement(n){return this.elements.has(n)||(this.elements.set(n,{name:n,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),qe.info("Added new element: ",n)),this.resetLatestElement(),this.elements.get(n)}getElements(){return this.elements}setNewElementType(n){this.latestElement!==void 0&&(this.latestElement.type=n)}setNewElementDocRef(n){this.latestElement!==void 0&&(this.latestElement.docRef=n)}addRelationship(n,u,h){this.relations.push({type:n,src:u,dst:h})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,rt()}setCssStyle(n,u){for(const h of n){const r=this.requirements.get(h)??this.elements.get(h);if(!u||!r)return;for(const a of u)a.includes(",")?r.cssStyles.push(...a.split(",")):r.cssStyles.push(a)}}setClass(n,u){for(const h of n){const r=this.requirements.get(h)??this.elements.get(h);if(r)for(const a of u){r.classes.push(a);const m=this.classes.get(a)?.styles;m&&r.cssStyles.push(...m)}}}defineClass(n,u){for(const h of n){let r=this.classes.get(h);r===void 0&&(r={id:h,styles:[],textStyles:[]},this.classes.set(h,r)),u&&u.forEach(function(a){if(/color/.exec(a)){const m=a.replace("fill","bgFill");r.textStyles.push(m)}r.styles.push(a)}),this.requirements.forEach(a=>{a.classes.includes(h)&&a.cssStyles.push(...u.flatMap(m=>m.split(",")))}),this.elements.forEach(a=>{a.classes.includes(h)&&a.cssStyles.push(...u.flatMap(m=>m.split(",")))})}}getClasses(){return this.classes}getData(){const n=Ne(),u=[],h=[];for(const r of this.requirements.values()){const a=r;a.id=r.name,a.cssStyles=r.cssStyles,a.cssClasses=r.classes.join(" "),a.shape="requirementBox",a.look=n.look,a.colorIndex=u.length,u.push(a)}for(const r of this.elements.values()){const a=r;a.shape="requirementBox",a.look=n.look,a.id=r.name,a.cssStyles=r.cssStyles,a.cssClasses=r.classes.join(" "),a.colorIndex=u.length,u.push(a)}for(const r of this.relations){let a=0;const m=r.type===this.Relationships.CONTAINS,p={id:`${r.src}-${r.dst}-${a}`,start:this.requirements.get(r.src)?.name??this.elements.get(r.src)?.name,end:this.requirements.get(r.dst)?.name??this.elements.get(r.dst)?.name,label:`<<${r.type}>>`,classes:"relationshipLine",style:["fill:none",m?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:m?"normal":"dashed",arrowTypeStart:m?"requirement_contains":"",arrowTypeEnd:m?"":"requirement_arrow",look:n.look,labelType:"markdown"};h.push(p),a++}return{nodes:u,edges:h,other:{},config:n,direction:this.getDirection()}}},f(Z,"RequirementDB"),Z),ut=f(e=>{const n=Be(),{themeVariables:u,look:h}=n,{bkgColorArray:r,borderColorArray:a}=u;if(!a?.length)return"";let m="";for(let p=0;p{const n=Be(),{look:u,themeVariables:h}=n,{requirementEdgeLabelBackground:r}=h;return` + ${ut(e)} + marker { + fill: ${e.relationColor}; + stroke: ${e.relationColor}; + } + + marker.cross { + stroke: ${e.lineColor}; + } + + svg { + font-family: ${e.fontFamily}; + font-size: ${e.fontSize}; + } + + .reqBox { + fill: ${e.requirementBackground}; + fill-opacity: 1.0; + stroke: ${e.requirementBorderColor}; + stroke-width: ${e.requirementBorderSize}; + } + + .reqTitle, .reqLabel{ + fill: ${e.requirementTextColor}; + } + .reqLabelBox { + fill: ${e.relationLabelBackground}; + fill-opacity: 1.0; + } + + .req-title-line { + stroke: ${e.requirementBorderColor}; + stroke-width: ${e.requirementBorderSize}; + } + .relationshipLine { + stroke: ${e.relationColor}; + stroke-width: ${u==="neo"?e.strokeWidth:"1px"}; + } + .relationshipLabel { + fill: ${e.relationLabelColor}; + } + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + } + .edgeLabel .label rect { + fill: ${e.edgeLabelBackground}; + } + .edgeLabel .label text { + fill: ${e.relationLabelColor}; + } + .divider { + stroke: ${e.nodeBorder}; + stroke-width: 1; + } + .label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .label text,span { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + .labelBkg { + background-color: ${r??e.edgeLabelBackground}; + } + +`},"getStyles"),mt=ft,Qe={};nt(Qe,{draw:()=>dt});var dt=f(async function(e,n,u,h){qe.info("REF0:"),qe.info("Drawing requirement diagram (unified)",n);const{securityLevel:r,state:a,layout:m,look:p}=Ne(),y=h.db.getData(),S=ze(n,r);y.type=h.type,y.layoutAlgorithm=at(m),y.nodeSpacing=a?.nodeSpacing??50,y.rankSpacing=a?.rankSpacing??50,y.markers=p==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],y.diagramId=n,await lt(y,S);const k=8;ct.insertTitle(S,"requirementDiagramTitleText",a?.titleTopMargin??25,h.db.getDiagramTitle()),Xe(S,k,"requirementDiagram",a?.useMaxWidth??!0)},"draw"),_t={parser:ot,get db(){return new ht},renderer:Qe,styles:mt};export{_t as diagram}; diff --git a/internal/webapp/static/assets/sankeyDiagram-W5VNT64P-C-79o6vc.js b/internal/webapp/static/assets/sankeyDiagram-W5VNT64P-C-79o6vc.js new file mode 100644 index 0000000..365eaa7 --- /dev/null +++ b/internal/webapp/static/assets/sankeyDiagram-W5VNT64P-C-79o6vc.js @@ -0,0 +1,40 @@ +import{n as xt,o as _t,s as vt,g as bt,b as St,a as wt,_ as y,c as lt,b8 as Lt,d as X,W as Et,p as At,k as Tt}from"./mermaid.core-B7WVQkyL.js";import{o as Mt}from"./ordinal-Cboi1Yqb.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Nt(t){for(var n=t.length/6|0,s=new Array(n),a=0;a=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s=u)&&(s=u)}return s}function pt(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s>a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function nt(t,n){let s=0;if(n===void 0)for(let a of t)(a=+a)&&(s+=a);else{let a=-1;for(let u of t)(u=+n(u,++a,t))&&(s+=u)}return s}function Pt(t){return t.target.depth}function It(t){return t.depth}function Ot(t,n){return n-1-t.height}function kt(t,n){return t.sourceLinks.length?t.depth:n-1}function $t(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function q(t){return function(){return t}}function ut(t,n){return Q(t.source,n.source)||t.index-n.index}function ht(t,n){return Q(t.target,n.target)||t.index-n.index}function Q(t,n){return t.y0-n.y0}function it(t){return t.value}function Dt(t){return t.index}function jt(t){return t.nodes}function zt(t){return t.links}function ft(t,n){const s=t.get(n);if(!s)throw new Error("missing: "+n);return s}function yt({nodes:t}){for(const n of t){let s=n.y0,a=s;for(const u of n.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of n.targetLinks)u.y1=a+u.width/2,a+=u.width}}function Bt(){let t=0,n=0,s=1,a=1,u=24,x=8,g,k=Dt,o=kt,l,h,m=jt,_=zt,d=6;function v(){const i={nodes:m.apply(null,arguments),links:_.apply(null,arguments)};return T(i),A(i),M(i),I(i),S(i),yt(i),i}v.update=function(i){return yt(i),i},v.nodeId=function(i){return arguments.length?(k=typeof i=="function"?i:q(i),v):k},v.nodeAlign=function(i){return arguments.length?(o=typeof i=="function"?i:q(i),v):o},v.nodeSort=function(i){return arguments.length?(l=i,v):l},v.nodeWidth=function(i){return arguments.length?(u=+i,v):u},v.nodePadding=function(i){return arguments.length?(x=g=+i,v):x},v.nodes=function(i){return arguments.length?(m=typeof i=="function"?i:q(i),v):m},v.links=function(i){return arguments.length?(_=typeof i=="function"?i:q(i),v):_},v.linkSort=function(i){return arguments.length?(h=i,v):h},v.size=function(i){return arguments.length?(t=n=0,s=+i[0],a=+i[1],v):[s-t,a-n]},v.extent=function(i){return arguments.length?(t=+i[0][0],s=+i[1][0],n=+i[0][1],a=+i[1][1],v):[[t,n],[s,a]]},v.iterations=function(i){return arguments.length?(d=+i,v):d};function T({nodes:i,links:f}){for(const[e,r]of i.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(i.map((e,r)=>[k(e,r,i),e]));for(const[e,r]of f.entries()){r.index=e;let{source:p,target:b}=r;typeof p!="object"&&(p=r.source=ft(c,p)),typeof b!="object"&&(b=r.target=ft(c,b)),p.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of i)e.sort(h),r.sort(h)}function A({nodes:i}){for(const f of i)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function M({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const p of c){p.depth=r;for(const{target:b}of p.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const p of c){p.height=r;for(const{source:b}of p.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:i}){const f=ct(i,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of i){const p=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=p,r.x0=t+p*c,r.x1=r.x0+u,e[p]?e[p].push(r):e[p]=[r]}if(l)for(const r of e)r.sort(l);return e}function D(i){const f=pt(i,c=>(a-n-(c.length-1)*g)/nt(c,it));for(const c of i){let e=n;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+g;for(const p of r.sourceLinks)p.width=p.value*f}e=(a-e+g)/(c.length+1);for(let r=0;rc.length)-1)),D(f);for(let c=0;c0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&p.sort(Q),j(p,c)}}function R(i,f,c){for(let e=i.length,r=e-2;r>=0;--r){const p=i[r];for(const b of p){let L=0,B=0;for(const{target:Y,value:et}of b.sourceLinks){let H=et*(Y.layer-b.layer);L+=E(b,Y)*H,B+=H}if(!(B>0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&p.sort(Q),j(p,c)}}function j(i,f){const c=i.length>>1,e=i[c];O(i,e.y0-g,c-1,f),V(i,e.y1+g,c+1,f),O(i,a,i.length-1,f),V(i,n,0,f)}function V(i,f,c,e){for(;c1e-6&&(r.y0+=p,r.y1+=p),f=r.y1+g}}function O(i,f,c,e){for(;c>=0;--c){const r=i[c],p=(r.y1-f)*e;p>1e-6&&(r.y0-=p,r.y1-=p),f=r.y0-g}}function z({sourceLinks:i,targetLinks:f}){if(h===void 0){for(const{source:{sourceLinks:c}}of f)c.sort(ht);for(const{target:{targetLinks:c}}of i)c.sort(ut)}}function w(i){if(h===void 0)for(const{sourceLinks:f,targetLinks:c}of i)f.sort(ht),c.sort(ut)}function P(i,f){let c=i.y0-(i.sourceLinks.length-1)*g/2;for(const{target:e,width:r}of i.sourceLinks){if(e===f)break;c+=r+g}for(const{source:e,width:r}of f.targetLinks){if(e===i)break;c-=r}return c}function E(i,f){let c=f.y0-(f.targetLinks.length-1)*g/2;for(const{source:e,width:r}of f.targetLinks){if(e===i)break;c+=r+g}for(const{target:e,width:r}of i.sourceLinks){if(e===f)break;c-=r}return c}return v}var rt=Math.PI,st=2*rt,F=1e-6,Ft=st-F;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function mt(){return new ot}ot.prototype=mt.prototype={constructor:ot,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,s,a){this._+="Q"+ +t+","+ +n+","+(this._x1=+s)+","+(this._y1=+a)},bezierCurveTo:function(t,n,s,a,u,x){this._+="C"+ +t+","+ +n+","+ +s+","+ +a+","+(this._x1=+u)+","+(this._y1=+x)},arcTo:function(t,n,s,a,u){t=+t,n=+n,s=+s,a=+a,u=+u;var x=this._x1,g=this._y1,k=s-t,o=a-n,l=x-t,h=g-n,m=l*l+h*h;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(m>F)if(!(Math.abs(h*k-o*l)>F)||!u)this._+="L"+(this._x1=t)+","+(this._y1=n);else{var _=s-x,d=a-g,v=k*k+o*o,T=_*_+d*d,A=Math.sqrt(v),M=Math.sqrt(m),I=u*Math.tan((rt-Math.acos((v+m-T)/(2*A*M)))/2),N=I/M,D=I/A;Math.abs(N-1)>F&&(this._+="L"+(t+N*l)+","+(n+N*h)),this._+="A"+u+","+u+",0,0,"+ +(h*_>l*d)+","+(this._x1=t+D*k)+","+(this._y1=n+D*o)}},arc:function(t,n,s,a,u,x){t=+t,n=+n,s=+s,x=!!x;var g=s*Math.cos(a),k=s*Math.sin(a),o=t+g,l=n+k,h=1^x,m=x?a-u:u-a;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+o+","+l:(Math.abs(this._x1-o)>F||Math.abs(this._y1-l)>F)&&(this._+="L"+o+","+l),s&&(m<0&&(m=m%st+st),m>Ft?this._+="A"+s+","+s+",0,1,"+h+","+(t-g)+","+(n-k)+"A"+s+","+s+",0,1,"+h+","+(this._x1=o)+","+(this._y1=l):m>F&&(this._+="A"+s+","+s+",0,"+ +(m>=rt)+","+h+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=n+s*Math.sin(u))))},rect:function(t,n,s,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +s+"v"+ +a+"h"+-s+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Rt(t){return t[0]}function Vt(t){return t[1]}var Wt=Array.prototype.slice;function Gt(t){return t.source}function Ut(t){return t.target}function Yt(t){var n=Gt,s=Ut,a=Rt,u=Vt,x=null;function g(){var k,o=Wt.call(arguments),l=n.apply(this,o),h=s.apply(this,o);if(x||(x=k=mt()),t(x,+a.apply(this,(o[0]=l,o)),+u.apply(this,o),+a.apply(this,(o[0]=h,o)),+u.apply(this,o)),k)return x=null,k+""||null}return g.source=function(k){return arguments.length?(n=k,g):n},g.target=function(k){return arguments.length?(s=k,g):s},g.x=function(k){return arguments.length?(a=typeof k=="function"?k:dt(+k),g):a},g.y=function(k){return arguments.length?(u=typeof k=="function"?k:dt(+k),g):u},g.context=function(k){return arguments.length?(x=k??null,g):x},g}function Ht(t,n,s,a,u){t.moveTo(n,s),t.bezierCurveTo(n=(n+a)/2,s,n,u,a,u)}function Xt(){return Yt(Ht)}function qt(t){return[t.source.x1,t.y0]}function Qt(t){return[t.target.x0,t.y1]}function Kt(){return Xt().source(qt).target(Qt)}var at=(function(){var t=y(function(k,o,l,h){for(l=l||{},h=k.length;h--;l[k[h]]=o);return l},"o"),n=[1,9],s=[1,10],a=[1,5,10,12],u={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:y(function(o,l,h,m,_,d,v){var T=d.length-1;switch(_){case 7:const A=m.findOrCreateNode(d[T-4].trim().replaceAll('""','"')),M=m.findOrCreateNode(d[T-2].trim().replaceAll('""','"')),I=parseFloat(d[T].trim());m.addLink(A,M,I);break;case 8:case 9:case 11:this.$=d[T];break;case 10:this.$=d[T-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:s},{15:18,16:7,17:8,18:n,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:n,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:y(function(o,l){if(l.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=l,h}},"parseError"),parse:y(function(o){var l=this,h=[0],m=[],_=[null],d=[],v=this.table,T="",A=0,M=0,I=2,N=1,D=d.slice.call(arguments,1),S=Object.create(this.lexer),C={yy:{}};for(var R in this.yy)Object.prototype.hasOwnProperty.call(this.yy,R)&&(C.yy[R]=this.yy[R]);S.setInput(o,C.yy),C.yy.lexer=S,C.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var j=S.yylloc;d.push(j);var V=S.options&&S.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(L){h.length=h.length-2*L,_.length=_.length-L,d.length=d.length-L}y(O,"popStack");function z(){var L;return L=m.pop()||S.lex()||N,typeof L!="number"&&(L instanceof Array&&(m=L,L=m.pop()),L=l.symbols_[L]||L),L}y(z,"lex");for(var w,P,E,i,f={},c,e,r,p;;){if(P=h[h.length-1],this.defaultActions[P]?E=this.defaultActions[P]:((w===null||typeof w>"u")&&(w=z()),E=v[P]&&v[P][w]),typeof E>"u"||!E.length||!E[0]){var b="";p=[];for(c in v[P])this.terminals_[c]&&c>I&&p.push("'"+this.terminals_[c]+"'");S.showPosition?b="Parse error on line "+(A+1)+`: +`+S.showPosition()+` +Expecting `+p.join(", ")+", got '"+(this.terminals_[w]||w)+"'":b="Parse error on line "+(A+1)+": Unexpected "+(w==N?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(b,{text:S.match,token:this.terminals_[w]||w,line:S.yylineno,loc:j,expected:p})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+w);switch(E[0]){case 1:h.push(w),_.push(S.yytext),d.push(S.yylloc),h.push(E[1]),w=null,M=S.yyleng,T=S.yytext,A=S.yylineno,j=S.yylloc;break;case 2:if(e=this.productions_[E[1]][1],f.$=_[_.length-e],f._$={first_line:d[d.length-(e||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(e||1)].first_column,last_column:d[d.length-1].last_column},V&&(f._$.range=[d[d.length-(e||1)].range[0],d[d.length-1].range[1]]),i=this.performAction.apply(f,[T,M,A,C.yy,E[1],_,d].concat(D)),typeof i<"u")return i;e&&(h=h.slice(0,-1*e*2),_=_.slice(0,-1*e),d=d.slice(0,-1*e)),h.push(this.productions_[E[1]][0]),_.push(f.$),d.push(f._$),r=v[h[h.length-2]][h[h.length-1]],h.push(r);break;case 3:return!0}}return!0},"parse")},x=(function(){var k={EOF:1,parseError:y(function(l,h){if(this.yy.parser)this.yy.parser.parseError(l,h);else throw new Error(l)},"parseError"),setInput:y(function(o,l){return this.yy=l||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var l=o.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:y(function(o){var l=o.length,h=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===m.length?this.yylloc.first_column:0)+m[m.length-h.length].length-h[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(o){this.unput(this.match.slice(o))},"less"),pastInput:y(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var o=this.pastInput(),l=new Array(o.length+1).join("-");return o+this.upcomingInput()+` +`+l+"^"},"showPosition"),test_match:y(function(o,l){var h,m,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),m=o[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],h=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var d in _)this[d]=_[d];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,l,h,m;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),d=0;d<_.length;d++)if(h=this._input.match(this.rules[_[d]]),h&&(!l||h[0].length>l[0].length)){if(l=h,m=d,this.options.backtrack_lexer){if(o=this.test_match(h,_[d]),o!==!1)return o;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(o=this.test_match(l,_[m]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var l=this.next();return l||this.lex()},"lex"),begin:y(function(l){this.conditionStack.push(l)},"begin"),popState:y(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:y(function(l){this.begin(l)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:y(function(l,h,m,_){switch(m){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return k})();u.lexer=x;function g(){this.yy={}}return y(g,"Parser"),g.prototype=u,u.Parser=g,new g})();at.parser=at;var K=at,J=[],tt=[],Z=new Map,Zt=y(()=>{J=[],tt=[],Z=new Map,At()},"clear"),W,Jt=(W=class{constructor(n,s,a=0){this.source=n,this.target=s,this.value=a}},y(W,"SankeyLink"),W),te=y((t,n,s)=>{J.push(new Jt(t,n,s))},"addLink"),G,ee=(G=class{constructor(n){this.ID=n}},y(G,"SankeyNode"),G),ne=y(t=>{t=Tt.sanitizeText(t,lt());let n=Z.get(t);return n===void 0&&(n=new ee(t),Z.set(t,n),tt.push(n)),n},"findOrCreateNode"),ie=y(()=>tt,"getNodes"),re=y(()=>J,"getLinks"),se=y(()=>({nodes:tt.map(t=>({id:t.ID})),links:J.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),oe={nodesMap:Z,getConfig:y(()=>lt().sankey,"getConfig"),getNodes:ie,getLinks:re,getGraph:se,addLink:te,findOrCreateNode:ne,getAccTitle:wt,setAccTitle:St,getAccDescription:bt,setAccDescription:vt,getDiagramTitle:_t,setDiagramTitle:xt,clear:Zt},$,gt=($=class{static next(n){return new $(n+ ++$.count)}constructor(n){this.id=n,this.href=`#${n}`}toString(){return"url("+this.href+")"}},y($,"Uid"),$.count=0,$),ae={left:It,right:Ot,center:$t,justify:kt},le=y(t=>{let n=0,s=0;for(const a of t){const u=a.value??0;u>n&&(n=u,s=a.layer??0)}return s},"findCentralNodeLayer"),ce=y(function(t,n,s,a){const{securityLevel:u,sankey:x}=lt(),g=Lt.sankey;let k;u==="sandbox"&&(k=X("#i"+n));const o=u==="sandbox"?X(k.nodes()[0].contentDocument.body):X("body"),l=u==="sandbox"?o.select(`[id="${n}"]`):X(`[id="${n}"]`),h=x?.width??g.width,m=x?.height??g.width,_=x?.useMaxWidth??g.useMaxWidth,d=x?.nodeAlignment??g.nodeAlignment,v=x?.prefix??g.prefix,T=x?.suffix??g.suffix,A=x?.showValues??g.showValues,M=x?.nodeWidth??g.nodeWidth??10,I=x?.nodePadding??g.nodePadding??12,N=x?.labelStyle??g.labelStyle??"legacy",D=x?.nodeColors??{},S=a.db.getGraph(),C=ae[d];Bt().nodeId(e=>e.id).nodeWidth(M).nodePadding(I+(A?15:0)).nodeAlign(C).extent([[0,0],[h,m]])(S);const j=le(S.nodes),V=Mt(Ct),O=y(e=>D[e]??V(e),"getNodeColor");l.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",e=>(e.uid=gt.next("node-")).id).attr("transform",function(e){return"translate("+e.x0+","+e.y0+")"}).attr("x",e=>e.x0).attr("y",e=>e.y0).append("rect").attr("height",e=>e.y1-e.y0).attr("width",e=>e.x1-e.x0).attr("fill",e=>O(e.id));const z=y(({id:e,value:r})=>A?`${e} +${v}${Math.round(r*100)/100}${T}`:e,"getText"),w=y(e=>N==="outlined"?(e.layer??0)P.selectAll(e?`.${e}`:"text").data(S.nodes).join("text").attr("class",e??null).attr("x",r=>w(r).x).attr("y",r=>(r.y1+r.y0)/2).attr("dy",`${A?"0":"0.35"}em`).attr("text-anchor",r=>w(r).anchor).text(z),"appendLabel");N==="outlined"?(E("sankey-label-bg"),E("sankey-label-fg")):E();const i=l.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),f=x?.linkColor??"gradient";if(f==="gradient"){const e=i.append("linearGradient").attr("id",r=>(r.uid=gt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",r=>r.source.x1).attr("x2",r=>r.target.x0);e.append("stop").attr("offset","0%").attr("stop-color",r=>O(r.source.id)),e.append("stop").attr("offset","100%").attr("stop-color",r=>O(r.target.id))}let c;switch(f){case"gradient":c=y(e=>e.uid,"coloring");break;case"source":c=y(e=>O(e.source.id),"coloring");break;case"target":c=y(e=>O(e.target.id),"coloring");break;default:c=f}i.append("path").attr("d",Kt()).attr("stroke",c).attr("stroke-width",e=>Math.max(1,e.width)),Et(void 0,l,0,_)},"draw"),ue={draw:ce},he=y(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` +`).trim(),"prepareTextForParsing"),fe=y(t=>`.label { + font-family: ${t.fontFamily}; + } + + .node-labels { + font-family: ${t.fontFamily}; + } + + /* Outlined label style - background stroke for better readability */ + .sankey-label-bg { + stroke: ${t.mainBkg||t.background||"#fff"}; + stroke-width: 4px; + stroke-linejoin: round; + paint-order: stroke; + } + + /* Foreground label text */ + .sankey-label-fg { + fill: ${t.textColor}; + } + + /* Node styling */ + .node rect { + shape-rendering: crispEdges; + } + + /* Link styling */ + .link { + fill: none; + stroke-opacity: 0.5; + mix-blend-mode: multiply; + } +`,"getStyles"),ye=fe,de=K.parse.bind(K);K.parse=t=>de(he(t));var _e={styles:ye,parser:K,db:oe,renderer:ue};export{_e as diagram}; diff --git a/internal/webapp/static/assets/sequenceDiagram-SI44F4Z6-Bu_K6Hei.js b/internal/webapp/static/assets/sequenceDiagram-SI44F4Z6-Bu_K6Hei.js new file mode 100644 index 0000000..9633689 --- /dev/null +++ b/internal/webapp/static/assets/sequenceDiagram-SI44F4Z6-Bu_K6Hei.js @@ -0,0 +1,162 @@ +import{I as er}from"./chunk-2Q5K7J3B-Krb_H4ce.js";import{_ as x,F as rr,c as $,d as Yt,l as at,j as Me,e as ar,f as sr,k as N,b as De,s as ir,n as nr,a as or,g as cr,o as lr,G as hr,J as dr,p as Tr,i as Wt,x as Z,H as Q,I as kt,K as Be,Z as pr,y as Ft,L as Er,M as Ve}from"./mermaid.core-B7WVQkyL.js";import{a as ur,b as se,g as dt,d as fr,c as ie,e as ne}from"./chunk-2GRJ4B5K-Bng47RDF.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var ee=(function(){var e=x(function(ut,S,v,P){for(v=v||{},P=ut.length;P--;v[ut[P]]=S);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],n=[1,9],s=[1,11],c=[1,12],E=[1,14],h=[1,15],p=[1,17],_=[1,18],u=[1,19],O=[1,25],T=[1,26],g=[1,27],f=[1,28],I=[1,29],L=[1,30],b=[1,31],w=[1,32],A=[1,33],D=[1,34],M=[1,35],V=[1,36],W=[1,37],U=[1,38],G=[1,39],X=[1,40],nt=[1,42],j=[1,43],q=[1,44],st=[1,45],tt=[1,46],Y=[1,47],C=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],St=[1,74],Dt=[1,80],m=[1,81],k=[1,82],lt=[1,83],et=[1,84],K=[1,85],Ot=[1,86],oe=[1,87],ce=[1,88],le=[1,89],he=[1,90],de=[1,91],Te=[1,92],pe=[1,93],Ee=[1,94],ue=[1,95],fe=[1,96],_e=[1,97],ge=[1,98],xe=[1,99],Ie=[1,100],ye=[1,101],Re=[1,102],Oe=[1,103],Le=[1,104],be=[1,105],me=[2,78],wt=[4,5,17,51,53,54],vt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Ae=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Gt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Xt=[5,52],F=[70,71,72,73],ot=[1,151],Jt={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:x(function(S,v,P,y,z,o,Nt){var d=o.length-1;switch(z){case 3:return y.apply(o[d]),o[d];case 4:case 10:this.$=[];break;case 5:case 11:o[d-1].push(o[d]),this.$=o[d-1];break;case 6:case 7:case 12:case 13:this.$=o[d];break;case 8:case 9:case 14:this.$=[];break;case 16:o[d].type="createParticipant",this.$=o[d];break;case 17:o[d-1].unshift({type:"boxStart",boxData:y.parseBoxData(o[d-2])}),o[d-1].push({type:"boxEnd",boxText:o[d-2]}),this.$=o[d-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(o[d-2]),sequenceIndexStep:Number(o[d-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(o[d-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:o[d-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:o[d-1].actor};break;case 30:y.setDiagramTitle(o[d].substring(6)),this.$=o[d].substring(6);break;case 31:y.setDiagramTitle(o[d].substring(7)),this.$=o[d].substring(7);break;case 32:this.$=o[d].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=o[d].trim(),y.setAccDescription(this.$);break;case 35:o[d-1].unshift({type:"loopStart",loopText:y.parseMessage(o[d-2]),signalType:y.LINETYPE.LOOP_START}),o[d-1].push({type:"loopEnd",loopText:o[d-2],signalType:y.LINETYPE.LOOP_END}),this.$=o[d-1];break;case 36:o[d-1].unshift({type:"rectStart",color:y.parseMessage(o[d-2]),signalType:y.LINETYPE.RECT_START}),o[d-1].push({type:"rectEnd",color:y.parseMessage(o[d-2]),signalType:y.LINETYPE.RECT_END}),this.$=o[d-1];break;case 37:o[d-1].unshift({type:"optStart",optText:y.parseMessage(o[d-2]),signalType:y.LINETYPE.OPT_START}),o[d-1].push({type:"optEnd",optText:y.parseMessage(o[d-2]),signalType:y.LINETYPE.OPT_END}),this.$=o[d-1];break;case 38:o[d-1].unshift({type:"altStart",altText:y.parseMessage(o[d-2]),signalType:y.LINETYPE.ALT_START}),o[d-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=o[d-1];break;case 39:o[d-1].unshift({type:"parStart",parText:y.parseMessage(o[d-2]),signalType:y.LINETYPE.PAR_START}),o[d-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=o[d-1];break;case 40:o[d-1].unshift({type:"parStart",parText:y.parseMessage(o[d-2]),signalType:y.LINETYPE.PAR_OVER_START}),o[d-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=o[d-1];break;case 41:o[d-1].unshift({type:"criticalStart",criticalText:y.parseMessage(o[d-2]),signalType:y.LINETYPE.CRITICAL_START}),o[d-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=o[d-1];break;case 42:o[d-1].unshift({type:"breakStart",breakText:y.parseMessage(o[d-2]),signalType:y.LINETYPE.BREAK_START}),o[d-1].push({type:"breakEnd",optText:y.parseMessage(o[d-2]),signalType:y.LINETYPE.BREAK_END}),this.$=o[d-1];break;case 44:this.$=o[d-3].concat([{type:"option",optionText:y.parseMessage(o[d-1]),signalType:y.LINETYPE.CRITICAL_OPTION},o[d]]);break;case 46:this.$=o[d-3].concat([{type:"and",parText:y.parseMessage(o[d-1]),signalType:y.LINETYPE.PAR_AND},o[d]]);break;case 48:this.$=o[d-3].concat([{type:"else",altText:y.parseMessage(o[d-1]),signalType:y.LINETYPE.ALT_ELSE},o[d]]);break;case 49:o[d-3].draw="participant",o[d-3].type="addParticipant",o[d-3].description=y.parseMessage(o[d-1]),this.$=o[d-3];break;case 50:o[d-1].draw="participant",o[d-1].type="addParticipant",this.$=o[d-1];break;case 51:o[d-3].draw="actor",o[d-3].type="addParticipant",o[d-3].description=y.parseMessage(o[d-1]),this.$=o[d-3];break;case 52:case 57:o[d-1].draw="actor",o[d-1].type="addParticipant",this.$=o[d-1];break;case 53:o[d-1].type="destroyParticipant",this.$=o[d-1];break;case 54:o[d-3].draw="participant",o[d-3].type="addParticipant",o[d-3].description=y.parseMessage(o[d-1]),this.$=o[d-3];break;case 55:o[d-1].draw="participant",o[d-1].type="addParticipant",this.$=o[d-1];break;case 56:o[d-3].draw="actor",o[d-3].type="addParticipant",o[d-3].description=y.parseMessage(o[d-1]),this.$=o[d-3];break;case 58:this.$=[o[d-1],{type:"addNote",placement:o[d-2],actor:o[d-1].actor,text:o[d]}];break;case 59:o[d-2]=[].concat(o[d-1],o[d-1]).slice(0,2),o[d-2][0]=o[d-2][0].actor,o[d-2][1]=o[d-2][1].actor,this.$=[o[d-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:o[d-2].slice(0,2),text:o[d]}];break;case 60:this.$=[o[d-1],{type:"addLinks",actor:o[d-1].actor,text:o[d]}];break;case 61:this.$=[o[d-1],{type:"addALink",actor:o[d-1].actor,text:o[d]}];break;case 62:this.$=[o[d-1],{type:"addProperties",actor:o[d-1].actor,text:o[d]}];break;case 63:this.$=[o[d-1],{type:"addDetails",actor:o[d-1].actor,text:o[d]}];break;case 66:this.$=[o[d-2],o[d]];break;case 67:this.$=o[d];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[o[d-4],o[d-1],{type:"addMessage",from:o[d-4].actor,to:o[d-1].actor,signalType:o[d-3],msg:o[d],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:o[d-1].actor}];break;case 71:this.$=[o[d-4],o[d-1],{type:"addMessage",from:o[d-4].actor,to:o[d-1].actor,signalType:o[d-3],msg:o[d]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:o[d-4].actor}];break;case 72:this.$=[o[d-4],o[d-1],{type:"addMessage",from:o[d-4].actor,to:o[d-1].actor,signalType:o[d-3],msg:o[d],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:o[d-1].actor}];break;case 73:this.$=[o[d-4],o[d-1],{type:"addMessage",from:o[d-4].actor,to:o[d-1].actor,signalType:o[d-2],msg:o[d],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:o[d-4].actor}];break;case 74:this.$=[o[d-5],o[d-1],{type:"addMessage",from:o[d-5].actor,to:o[d-1].actor,signalType:o[d-3],msg:o[d],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:o[d-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:o[d-5].actor}];break;case 75:this.$=[o[d-3],o[d-1],{type:"addMessage",from:o[d-3].actor,to:o[d-1].actor,signalType:o[d-2],msg:o[d]}];break;case 76:this.$={type:"addParticipant",actor:o[d-1],config:o[d]};break;case 77:this.$=o[d-1].trim();break;case 78:this.$={type:"addParticipant",actor:o[d]};break;case 79:this.$=y.LINETYPE.SOLID_OPEN;break;case 80:this.$=y.LINETYPE.DOTTED_OPEN;break;case 81:this.$=y.LINETYPE.SOLID;break;case 82:this.$=y.LINETYPE.SOLID_TOP;break;case 83:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=y.LINETYPE.STICK_TOP;break;case 85:this.$=y.LINETYPE.STICK_BOTTOM;break;case 86:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=y.LINETYPE.DOTTED;break;case 100:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=y.LINETYPE.SOLID_CROSS;break;case 102:this.$=y.LINETYPE.DOTTED_CROSS;break;case 103:this.$=y.LINETYPE.SOLID_POINT;break;case 104:this.$=y.LINETYPE.DOTTED_POINT;break;case 105:this.$=y.parseMessage(o[d].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:s,8:8,9:10,10:c,13:13,14:E,15:h,18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},e(C,[2,5]),{9:48,13:13,14:E,15:h,18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},e(C,[2,7]),e(C,[2,8]),e(C,[2,9]),e(C,[2,15]),{13:49,51:U,53:G,54:X},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:Y},{23:56,73:Y},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(C,[2,30]),e(C,[2,31]),{33:[1,62]},{35:[1,63]},e(C,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:St},{23:75,55:76,73:St},{23:77,73:Y},{69:78,72:[1,79],78:Dt,79:m,80:k,81:lt,82:et,83:K,84:Ot,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:Y},{23:111,73:Y},{23:112,73:Y},{23:113,73:Y},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],me),e(C,[2,6]),e(C,[2,16]),e(wt,[2,10],{11:114}),e(C,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(C,[2,22]),{5:[1,118]},{5:[1,119]},e(C,[2,25]),e(C,[2,26]),e(C,[2,27]),e(C,[2,28]),e(C,[2,29]),e(C,[2,32]),e(C,[2,33]),e(vt,i,{7:120}),e(vt,i,{7:121}),e(vt,i,{7:122}),e(Ae,i,{41:123,7:124}),e(Gt,i,{43:125,7:126}),e(Gt,i,{7:126,43:127}),e(Se,i,{46:128,7:129}),e(vt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Xt,me,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:Y},{69:146,78:Dt,79:m,80:k,81:lt,82:et,83:K,84:Ot,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},e(F,[2,79]),e(F,[2,80]),e(F,[2,81]),e(F,[2,82]),e(F,[2,83]),e(F,[2,84]),e(F,[2,85]),e(F,[2,86]),e(F,[2,87]),e(F,[2,88]),e(F,[2,89]),e(F,[2,90]),e(F,[2,91]),e(F,[2,92]),e(F,[2,93]),e(F,[2,94]),e(F,[2,95]),e(F,[2,96]),e(F,[2,97]),e(F,[2,98]),e(F,[2,99]),e(F,[2,100]),e(F,[2,101]),e(F,[2,102]),e(F,[2,103]),e(F,[2,104]),{23:147,73:Y},{23:149,60:148,73:Y},{73:[2,68]},{73:[2,69]},{58:150,104:ot},{58:152,104:ot},{58:153,104:ot},{58:154,104:ot},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:U,53:G,54:X},{5:[1,160]},e(C,[2,20]),e(C,[2,21]),e(C,[2,23]),e(C,[2,24]),{4:n,5:s,8:8,9:10,10:c,13:13,14:E,15:h,17:[1,161],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:c,13:13,14:E,15:h,17:[1,162],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:c,13:13,14:E,15:h,17:[1,163],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{17:[1,164]},{4:n,5:s,8:8,9:10,10:c,13:13,14:E,15:h,17:[2,47],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,50:[1,165],51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{17:[1,166]},{4:n,5:s,8:8,9:10,10:c,13:13,14:E,15:h,17:[2,45],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,49:[1,167],51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{17:[1,168]},{17:[1,169]},{4:n,5:s,8:8,9:10,10:c,13:13,14:E,15:h,17:[2,43],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,48:[1,170],51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:c,13:13,14:E,15:h,17:[1,171],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{16:[1,172]},e(C,[2,50]),{16:[1,173]},e(C,[2,55]),e(Xt,[2,76]),{76:[1,174]},{16:[1,175]},e(C,[2,52]),{16:[1,176]},e(C,[2,57]),e(C,[2,53]),{23:177,73:Y},{23:178,73:Y},{23:179,73:Y},{58:180,104:ot},{23:181,72:[1,182],73:Y},{58:183,104:ot},{58:184,104:ot},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(C,[2,17]),e(wt,[2,11]),{13:186,51:U,53:G,54:X},e(wt,[2,13]),e(wt,[2,14]),e(C,[2,19]),e(C,[2,35]),e(C,[2,36]),e(C,[2,37]),e(C,[2,38]),{16:[1,187]},e(C,[2,39]),{16:[1,188]},e(C,[2,40]),e(C,[2,41]),{16:[1,189]},e(C,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ot},{58:196,104:ot},{58:197,104:ot},{5:[2,75]},{58:198,104:ot},{23:199,73:Y},{5:[2,58]},{5:[2,59]},{23:200,73:Y},e(wt,[2,12]),e(Ae,i,{7:124,41:201}),e(Gt,i,{7:126,43:202}),e(Se,i,{7:129,46:203}),e(C,[2,49]),e(C,[2,54]),e(Xt,[2,77]),e(C,[2,51]),e(C,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ot},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:x(function(S,v){if(v.recoverable)this.trace(S);else{var P=new Error(S);throw P.hash=v,P}},"parseError"),parse:x(function(S){var v=this,P=[0],y=[],z=[null],o=[],Nt=this.table,d="",Mt=0,we=0,Qe=2,Ne=1,$e=o.slice.call(arguments,1),J=Object.create(this.lexer),gt={yy:{}};for(var Zt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Zt)&&(gt.yy[Zt]=this.yy[Zt]);J.setInput(S,gt.yy),gt.yy.lexer=J,gt.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Qt=J.yylloc;o.push(Qt);var je=J.options&&J.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tr(it){P.length=P.length-2*it,z.length=z.length-it,o.length=o.length-it}x(tr,"popStack");function Pe(){var it;return it=y.pop()||J.lex()||Ne,typeof it!="number"&&(it instanceof Array&&(y=it,it=y.pop()),it=v.symbols_[it]||it),it}x(Pe,"lex");for(var rt,xt,ct,$t,Lt={},Bt,Tt,ke,Vt;;){if(xt=P[P.length-1],this.defaultActions[xt]?ct=this.defaultActions[xt]:((rt===null||typeof rt>"u")&&(rt=Pe()),ct=Nt[xt]&&Nt[xt][rt]),typeof ct>"u"||!ct.length||!ct[0]){var jt="";Vt=[];for(Bt in Nt[xt])this.terminals_[Bt]&&Bt>Qe&&Vt.push("'"+this.terminals_[Bt]+"'");J.showPosition?jt="Parse error on line "+(Mt+1)+`: +`+J.showPosition()+` +Expecting `+Vt.join(", ")+", got '"+(this.terminals_[rt]||rt)+"'":jt="Parse error on line "+(Mt+1)+": Unexpected "+(rt==Ne?"end of input":"'"+(this.terminals_[rt]||rt)+"'"),this.parseError(jt,{text:J.match,token:this.terminals_[rt]||rt,line:J.yylineno,loc:Qt,expected:Vt})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xt+", token: "+rt);switch(ct[0]){case 1:P.push(rt),z.push(J.yytext),o.push(J.yylloc),P.push(ct[1]),rt=null,we=J.yyleng,d=J.yytext,Mt=J.yylineno,Qt=J.yylloc;break;case 2:if(Tt=this.productions_[ct[1]][1],Lt.$=z[z.length-Tt],Lt._$={first_line:o[o.length-(Tt||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(Tt||1)].first_column,last_column:o[o.length-1].last_column},je&&(Lt._$.range=[o[o.length-(Tt||1)].range[0],o[o.length-1].range[1]]),$t=this.performAction.apply(Lt,[d,we,Mt,gt.yy,ct[1],z,o].concat($e)),typeof $t<"u")return $t;Tt&&(P=P.slice(0,-1*Tt*2),z=z.slice(0,-1*Tt),o=o.slice(0,-1*Tt)),P.push(this.productions_[ct[1]][0]),z.push(Lt.$),o.push(Lt._$),ke=Nt[P[P.length-2]][P[P.length-1]],P.push(ke);break;case 3:return!0}}return!0},"parse")},Ze=(function(){var ut={EOF:1,parseError:x(function(v,P){if(this.yy.parser)this.yy.parser.parseError(v,P);else throw new Error(v)},"parseError"),setInput:x(function(S,v){return this.yy=v||this.yy||{},this._input=S,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var v=S.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),S},"input"),unput:x(function(S){var v=S.length,P=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),P.length-1&&(this.yylineno-=P.length-1);var z=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:P?(P.length===y.length?this.yylloc.first_column:0)+y[y.length-P.length].length-P[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[z[0],z[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(S){this.unput(this.match.slice(S))},"less"),pastInput:x(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var S=this.match;return S.length<20&&(S+=this._input.substr(0,20-S.length)),(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var S=this.pastInput(),v=new Array(S.length+1).join("-");return S+this.upcomingInput()+` +`+v+"^"},"showPosition"),test_match:x(function(S,v){var P,y,z;if(this.options.backtrack_lexer&&(z={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(z.yylloc.range=this.yylloc.range.slice(0))),y=S[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+S[0].length},this.yytext+=S[0],this.match+=S[0],this.matches=S,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(S[0].length),this.matched+=S[0],P=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),P)return P;if(this._backtrack){for(var o in z)this[o]=z[o];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var S,v,P,y;this._more||(this.yytext="",this.match="");for(var z=this._currentRules(),o=0;ov[0].length)){if(v=P,y=o,this.options.backtrack_lexer){if(S=this.test_match(P,z[o]),S!==!1)return S;if(this._backtrack){v=!1;continue}else return!1}else if(!this.options.flex)break}return v?(S=this.test_match(v,z[y]),S!==!1?S:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var v=this.next();return v||this.lex()},"lex"),begin:x(function(v){this.conditionStack.push(v)},"begin"),popState:x(function(){var v=this.conditionStack.length-1;return v>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(v){return v=this.conditionStack.length-1-Math.abs(v||0),v>=0?this.conditionStack[v]:"INITIAL"},"topState"),pushState:x(function(v){this.begin(v)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(v,P,y,z){switch(y){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return P.yytext=P.yytext.trim(),73;case 12:return P.yytext=P.yytext.trim(),this.begin("ALIAS"),73;case 13:return P.yytext=P.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return P.yytext=P.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return P.yytext=P.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return ut})();Jt.lexer=Ze;function Ct(){this.yy={}}return x(Ct,"Parser"),Ct.prototype=Jt,Jt.Parser=Ct,new Ct})();ee.parser=ee;var _r=ee,gr={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},xr={FILLED:0,OPEN:1},Ir={LEFTOF:0,RIGHTOF:1,OVER:2},Kt={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},mt,yr=(mt=class{constructor(){this.state=new er(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=De,this.setAccDescription=ir,this.setDiagramTitle=nr,this.getAccTitle=or,this.getAccDescription=cr,this.getDiagramTitle=lr,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap($().wrap),this.LINETYPE=gr,this.ARROWTYPE=xr,this.PLACEMENT=Ir}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,a,r,i,n){let s=this.state.records.currentBox,c;if(n!==void 0){let h;n.includes(` +`)?h=n+` +`:h=`{ +`+n+` +}`,c=hr(h,{schema:dr})}i=c?.type??i,c?.alias&&(!r||r.text===a)&&(r={text:c.alias,wrap:r?.wrap,type:i});const E=this.state.records.actors.get(t);if(E){if(this.state.records.currentBox&&E.box&&this.state.records.currentBox!==E.box)throw new Error(`A same participant should only be defined in one Box: ${E.name} can't be in '${E.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(s=E.box?E.box:this.state.records.currentBox,E.box=s,E&&a===E.name&&r==null)return}if(r?.text==null&&(r={text:a,type:i}),(i==null||r.text==null)&&(r={text:a,type:i}),this.state.records.actors.set(t,{box:s,name:a,description:r.text,wrap:r.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const h=this.state.records.actors.get(this.state.records.prevActor);h&&(h.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let a,r=0;if(!t)return 0;for(a=0;a>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},E}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:a,message:r?.text??"",wrap:r?.wrap??this.autoWrap(),type:i,activate:n,centralConnection:s??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(t=>t.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(t===void 0)return{};t=t.trim();const a=/^:?wrap:/.exec(t)!==null?!0:/^:?nowrap:/.exec(t)!==null?!1:void 0;return{cleanedText:(a===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:a}}autoWrap(){return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:$().sequence?.wrap??!1}clear(){this.state.reset(),Tr()}parseMessage(t){const a=t.trim(),{wrap:r,cleanedText:i}=this.extractWrap(a),n={text:i,wrap:r};return at.debug(`parseMessage: ${JSON.stringify(n)}`),n}parseBoxData(t){const a=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let r=a?.[1]?a[1].trim():"transparent",i=a?.[2]?a[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",r)||(r="transparent",i=t.trim());else{const c=new Option().style;c.color=r,c.color!==r&&(r="transparent",i=t.trim())}const{wrap:n,cleanedText:s}=this.extractWrap(i);return{text:s?Wt(s,$()):void 0,color:r,wrap:n}}addNote(t,a,r){const i={actor:t,placement:a,message:r.text,wrap:r.wrap??this.autoWrap()},n=[].concat(t,t);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:n[0],to:n[1],message:r.text,wrap:r.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:a})}addLinks(t,a){const r=this.getActor(t);try{let i=Wt(a.text,$());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const n=JSON.parse(i);this.insertLinks(r,n)}catch(i){at.error("error while parsing actor link text",i)}}addALink(t,a){const r=this.getActor(t);try{const i={};let n=Wt(a.text,$());const s=n.indexOf("@");n=n.replace(/=/g,"="),n=n.replace(/&/g,"&");const c=n.slice(0,s-1).trim(),E=n.slice(s+1).trim();i[c]=E,this.insertLinks(r,i)}catch(i){at.error("error while parsing actor link text",i)}}insertLinks(t,a){if(t.links==null)t.links=a;else for(const r in a)t.links[r]=a[r]}addProperties(t,a){const r=this.getActor(t);try{const i=Wt(a.text,$()),n=JSON.parse(i);this.insertProperties(r,n)}catch(i){at.error("error while parsing actor properties text",i)}}insertProperties(t,a){if(t.properties==null)t.properties=a;else for(const r in a)t.properties[r]=a[r]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,a){const r=this.getActor(t),i=document.getElementById(a.text);try{const n=i.innerHTML,s=JSON.parse(n);s.properties&&this.insertProperties(r,s.properties),s.links&&this.insertLinks(r,s.links)}catch(n){at.error("error while parsing actor details text",n)}}getActorProperty(t,a){if(t?.properties!==void 0)return t.properties[a]}apply(t){if(Array.isArray(t))t.forEach(a=>{this.apply(a)});else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw,t.config);break;case"createParticipant":if(this.state.records.actors.has(t.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw,t.config),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"centralConnection":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"centralConnectionReverse":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate,t.centralConnection);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":De(t.text);break;case"parStart":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break}}getConfig(){return $().sequence}},x(mt,"SequenceDB"),mt),Rr=x(e=>{const t=e.dropShadow??"none",{look:a}=$();return`.actor { + stroke: ${e.actorBorder}; + fill: ${e.actorBkg}; + stroke-width: ${e.strokeWidth??1}; + } + + rect.actor.outer-path[data-look="neo"] { + filter: ${t}; + } + + rect.note[data-look="neo"] { + stroke:${e.noteBorderColor}; + fill:${e.noteBkgColor}; + filter: ${t}; + } + + text.actor > tspan { + fill: ${e.actorTextColor}; + stroke: none; + } + + .actor-line { + stroke: ${e.actorLineColor}; + } + + .innerArc { + stroke-width: 1.5; + stroke-dasharray: none; + } + + .messageLine0 { + stroke-width: 1.5; + stroke-dasharray: none; + stroke: ${e.signalColor}; + } + + .messageLine1 { + stroke-width: 1.5; + stroke-dasharray: 2, 2; + stroke: ${e.signalColor}; + } + + [id$="-arrowhead"] path { + fill: ${e.signalColor}; + stroke: ${e.signalColor}; + } + + .sequenceNumber { + fill: ${e.sequenceNumberColor}; + } + + [id$="-sequencenumber"] { + fill: ${e.signalColor}; + } + + [id$="-crosshead"] path { + fill: ${e.signalColor}; + stroke: ${e.signalColor}; + } + + .messageText { + fill: ${e.signalTextColor}; + stroke: none; + } + + .labelBox { + stroke: ${e.labelBoxBorderColor}; + fill: ${e.labelBoxBkgColor}; + filter: ${a==="neo"?t:"none"}; + } + + .labelText, .labelText > tspan { + fill: ${e.labelTextColor}; + stroke: none; + } + + .loopText, .loopText > tspan { + fill: ${e.loopTextColor}; + stroke: none; + } + + .sectionTitle, .sectionTitle > tspan { + fill: ${e.loopTextColor}; + stroke: none; + } + + .loopLine { + stroke-width: 2px; + stroke-dasharray: 2, 2; + stroke: ${e.labelBoxBorderColor}; + fill: ${e.labelBoxBorderColor}; + } + + .note { + //stroke: #decc93; + stroke: ${e.noteBorderColor}; + fill: ${e.noteBkgColor}; + } + + .noteText, .noteText > tspan { + fill: ${e.noteTextColor}; + stroke: none; + ${e.noteFontWeight?`font-weight: ${e.noteFontWeight};`:""} + } + + .activation0 { + fill: ${e.activationBkgColor}; + stroke: ${e.activationBorderColor}; + } + + .activation1 { + fill: ${e.activationBkgColor}; + stroke: ${e.activationBorderColor}; + } + + .activation2 { + fill: ${e.activationBkgColor}; + stroke: ${e.activationBorderColor}; + } + + .actorPopupMenu { + position: absolute; + } + + .actorPopupMenuPanel { + position: absolute; + fill: ${e.actorBkg}; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4)); +} + .actor-man circle, line { + fill: ${e.actorBkg}; + stroke-width: 2px; + } + + g rect.rect { + filter: ${t}; + stroke: ${e.nodeBorder}; + } +`},"getStyles"),Or=Rr,It=36,ft="actor-top",_t="actor-bottom",qt="actor-box",yt="actor-man",pt=new Set(["redux-color","redux-dark-color"]),Pt=x(function(e,t){const a=fr(e,t);return Ft().look==="neo"&&a.attr("data-look","neo"),a},"drawRect"),Lr=x(function(e,t,a,r,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};const n=t.links,s=t.actorCnt,c=t.rectData;var E="none";i&&(E="block !important");const h=e.append("g");h.attr("id","actor"+s+"_popup"),h.attr("class","actorPopupMenu"),h.attr("display",E);var p="";c.class!==void 0&&(p=" "+c.class);let _=c.width>a?c.width:a;const u=h.append("rect");if(u.attr("class","actorPopupMenuPanel"+p),u.attr("x",c.x),u.attr("y",c.height),u.attr("fill",c.fill),u.attr("stroke",c.stroke),u.attr("width",_),u.attr("height",c.height),u.attr("rx",c.rx),u.attr("ry",c.ry),n!=null){var O=20;for(let f in n){var T=h.append("a"),g=Me.sanitizeUrl(n[f]);T.attr("xlink:href",g),T.attr("target","_blank"),Gr(r)(f,T,c.x+10,c.height+O,_,20,{class:"actor"},r),O+=30}}return u.attr("height",O),{height:c.height+O,width:_}},"drawPopup"),zt=x(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Ht=x(async function(e,t,a=null){let r=e.append("foreignObject");const i=await Ve(t.text,Ft()),s=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(r.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),t.class==="noteText"){const c=e.node().firstChild;c.setAttribute("height",s.height+2*t.textMargin);const E=c.getBBox();r.attr("x",Math.round(E.x+E.width/2-s.width/2)).attr("y",Math.round(E.y+E.height/2-s.height/2))}else if(a){let{startx:c,stopx:E,starty:h}=a;if(c>E){const p=c;c=E,E=p}r.attr("x",Math.round(c+Math.abs(c-E)/2-s.width/2)),t.class==="loopText"?r.attr("y",Math.round(h)):r.attr("y",Math.round(h-s.height))}return[r]},"drawKatex"),At=x(function(e,t){let a=0,r=0;const i=t.text.split(N.lineBreakRegex),[n,s]=Be(t.fontSize);let c=[],E=0,h=x(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":h=x(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":h=x(()=>Math.round(t.y+(a+r+t.textMargin)/2),"yfunc");break;case"bottom":case"end":h=x(()=>Math.round(t.y+(a+r+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[p,_]of i.entries()){t.textMargin!==void 0&&t.textMargin===0&&n!==void 0&&(E=p*n);const u=e.append("text");u.attr("x",t.x),u.attr("y",h()),t.anchor!==void 0&&u.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&u.style("font-family",t.fontFamily),s!==void 0&&u.style("font-size",s),t.fontWeight!==void 0&&u.style("font-weight",t.fontWeight),t.fill!==void 0&&u.attr("fill",t.fill),t.class!==void 0&&u.attr("class",t.class),t.dy!==void 0?u.attr("dy",t.dy):E!==0&&u.attr("dy",E);const O=_||pr;if(t.tspan){const T=u.append("tspan");T.attr("x",t.x),t.fill!==void 0&&T.attr("fill",t.fill),T.text(O)}else u.text(O);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(r+=(u._groups||u)[0][0].getBBox().height,a=r),c.push(u)}return c},"drawText"),Ye=x(function(e,t){function a(i,n,s,c,E){return i+","+n+" "+(i+s)+","+n+" "+(i+s)+","+(n+c-E)+" "+(i+s-E*1.2)+","+(n+c)+" "+i+","+(n+c)}x(a,"genPoints");const r=e.append("polygon");return r.attr("points",a(t.x,t.y,t.width,t.height,7)),r.attr("class","labelBox"),t.y=t.y+t.height/2,At(e,t),r},"drawLabel"),B=-1,We=x((e,t,a,r)=>{e.select&&a.forEach(i=>{const n=t.get(i),s=e.select("#actor"+n.actorCnt);!r.mirrorActors&&n.stopy?s.attr("y2",n.stopy+n.height/2):r.mirrorActors&&s.attr("y2",n.stopy)})},"fixLifeLineHeights"),br=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+t.height,{look:E,theme:h,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:u}=p,O=e.append("g").lower();var T=O;r||(B++,Object.keys(t.links||{}).length&&!a.forceMenus&&T.attr("onclick",zt(`actor${B}_popup`)).attr("cursor","pointer"),T.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),T=O.append("g"),t.actorCnt=B,t.links!=null&&T.attr("id","root-"+B),E==="neo"&&T.attr("data-look","neo"));const g=dt();var f="actor";t.properties?.class?f=t.properties.class:g.fill="#eaeaea",r?f+=` ${_t}`:f+=` ${ft}`,g.x=t.x,g.y=n,g.width=t.width,g.height=t.height,g.class=f,g.rx=3,g.ry=3,g.name=t.name,E==="neo"&&(g.rx=6,g.ry=6);const I=Pt(T,g),L=i.get(t.name)??0;if(pt.has(h)&&(I.style("stroke",u[L%u.length]),I.style("fill",_[L%u.length])),E==="neo"&&I.attr("filter","url(#drop-shadow)"),t.rectData=g,t.properties?.icon){const w=t.properties.icon.trim();w.charAt(0)==="@"?ie(T,g.x+g.width-20,g.y+10,w.substr(1)):ne(T,g.x+g.width-20,g.y+10,w)}r||(T.attr("data-et","participant"),T.attr("data-type","participant"),T.attr("data-id",t.name)),Et(a,Q(t.description))(t.description,T,g.x,g.y,g.width,g.height,{class:`actor ${qt}`},a);let b=t.height;if(I.node){const w=I.node().getBBox();t.height=w.height,b=w.height}return b},"drawActorTypeParticipant"),mr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+t.height,{look:E,theme:h,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:u}=p,O=e.append("g").lower();var T=O;r||(B++,Object.keys(t.links||{}).length&&!a.forceMenus&&T.attr("onclick",zt(`actor${B}_popup`)).attr("cursor","pointer"),T.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),T=O.append("g"),t.actorCnt=B,t.links!=null&&T.attr("id","root-"+B),E==="neo"&&T.attr("data-look","neo"));const g=dt();var f="actor";t.properties?.class?f=t.properties.class:g.fill="#eaeaea",r?f+=` ${_t}`:f+=` ${ft}`,g.x=t.x,g.y=n,g.width=t.width,g.height=t.height,g.class=f,g.name=t.name;const I=6,L={...g,x:g.x+-I,y:g.y+ +I,class:"actor"},b=Pt(T,g),w=Pt(T,L);t.rectData=g,E==="neo"&&T.attr("filter","url(#drop-shadow)");const A=i.get(t.name)??0;if(pt.has(h)&&(b.style("stroke",u[A%u.length]),b.style("fill",_[A%u.length]),w.style("stroke",u[A%u.length]),w.style("fill",_[A%u.length])),t.properties?.icon){const M=t.properties.icon.trim();M.charAt(0)==="@"?ie(T,g.x+g.width-20,g.y+10,M.substr(1)):ne(T,g.x+g.width-20,g.y+10,M)}Et(a,Q(t.description))(t.description,T,g.x-I,g.y+I,g.width,g.height,{class:`actor ${qt}`},a);let D=t.height;if(b.node){const M=b.node().getBBox();t.height=M.height,D=M.height}return r||(T.attr("data-et","participant"),T.attr("data-type","collections"),T.attr("data-id",t.name)),D},"drawActorTypeCollections"),Ar=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+t.height,{look:E,theme:h,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:u}=p,O=e.append("g").lower();let T=O;r||(B++,Object.keys(t.links||{}).length&&!a.forceMenus&&T.attr("onclick",zt(`actor${B}_popup`)).attr("cursor","pointer"),T.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),T=O.append("g"),t.actorCnt=B,t.links!=null&&T.attr("id","root-"+B),E==="neo"&&T.attr("data-look","neo"));const g=dt();let f="actor";t.properties?.class?f=t.properties.class:g.fill="#eaeaea",r?f+=` ${_t}`:f+=` ${ft}`,T.attr("class",f),g.x=t.x,g.y=n,g.width=t.width,g.height=t.height,g.name=t.name;const I=g.height/2,L=I/(2.5+g.height/50),b=T.append("g"),w=T.append("g"),A=`M ${g.x},${g.y+I} + a ${L},${I} 0 0 0 0,${g.height} + h ${g.width-2*L} + a ${L},${I} 0 0 0 0,-${g.height} + Z + `;b.append("path").attr("d",A),w.append("path").attr("d",`M ${g.x},${g.y+I} + a ${L},${I} 0 0 0 0,${g.height}`),b.attr("transform",`translate(${L}, ${-(g.height/2)})`),w.attr("transform",`translate(${g.width-L}, ${-g.height/2})`),t.rectData=g,E==="neo"&&b.attr("filter","url(#drop-shadow)");const D=i.get(t.name)??0;if(pt.has(h)&&(b.style("stroke",u[D%u.length]),b.style("fill",_[D%u.length]),w.style("stroke",u[D%u.length]),w.style("fill",_[D%u.length])),t.properties?.icon){const W=t.properties.icon.trim(),U=g.x+g.width-20,G=g.y+10;W.charAt(0)==="@"?ie(T,U,G,W.substr(1)):ne(T,U,G,W)}Et(a,Q(t.description))(t.description,T,g.x,g.y,g.width,g.height,{class:`actor ${qt}`},a);let M=t.height;const V=b.select("path:last-child");if(V.node()){const W=V.node().getBBox();t.height=W.height,M=W.height}return r||(T.attr("data-et","participant"),T.attr("data-type","queue"),T.attr("data-id",t.name)),M},"drawActorTypeQueue"),Sr=x(function(e,t,a,r,i,n){const s=r?t.stopy:t.starty,c=t.x+t.width/2,E=s+75,{look:h,theme:p,themeVariables:_}=a,{bkgColorArray:u,borderColorArray:O,actorBorder:T,actorBkg:g}=_,f=e.append("g").lower();r||(B++,f.append("line").attr("id","actor"+B).attr("x1",c).attr("y1",E).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);const I=e.append("g");let L=yt;r?L+=` ${_t}`:L+=` ${ft}`,I.attr("class",L),I.attr("name",t.name);const b=dt();b.x=t.x,b.y=s,b.fill="#eaeaea",b.width=t.width,b.height=t.height,b.class="actor";const w=t.x+t.width/2,A=s+32,D=22;I.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),I.append("circle").attr("cx",w).attr("cy",A).attr("r",D).attr("filter",`${h==="neo"?"url(#drop-shadow)":""}`),I.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${A-D})`);const M=n.get(t.name)??0;pt.has(p)?(I.style("stroke",O[M%O.length]),I.style("fill",u[M%O.length])):(I.style("stroke",T),I.style("fill",g));const V=I.node().getBBox();return t.height=V.height+2*(a?.sequence?.labelBoxHeight??0),Et(a,Q(t.description))(t.description,I,b.x,b.y+D+(r?5:12),b.width,b.height,{class:`actor ${yt}`},a),r||(I.attr("data-et","participant"),I.attr("data-type","control"),I.attr("data-id",t.name)),t.height},"drawActorTypeControl"),wr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+75,{look:E,theme:h,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:u}=p,O=e.append("g").lower(),T=e.append("g");let g="actor";r?g+=` ${_t}`:g+=` ${ft}`,T.attr("class",g),T.attr("name",t.name);const f=dt();f.x=t.x,f.y=n,f.fill="#eaeaea",f.width=t.width,f.height=t.height,f.class="actor";const I=t.x+t.width/2,L=n+(r?10:25),b=22;T.append("circle").attr("cx",I).attr("cy",L).attr("r",b).attr("width",t.width).attr("height",t.height),T.append("line").attr("x1",I-b).attr("x2",I+b).attr("y1",L+b).attr("y2",L+b).attr("stroke-width",2),E==="neo"&&T.attr("filter","url(#drop-shadow)");const w=i.get(t.name)??0;pt.has(h)&&(T.style("stroke",u[w%u.length]),T.style("fill",_[w%u.length]));const A=T.node().getBBox();return t.height=A.height+(a?.sequence?.labelBoxHeight??0),r||(B++,O.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B),Et(a,Q(t.description))(t.description,T,f.x,f.y+(r?15:30),f.width,f.height,{class:`actor ${yt}`},a),r?T.attr("transform",`translate(0, ${b})`):(T.attr("transform",`translate(0, ${b/2-5})`),T.attr("data-et","participant"),T.attr("data-type","entity"),T.attr("data-id",t.name)),t.height},"drawActorTypeEntity"),Nr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+t.height+2*a.boxTextMargin,{theme:E,themeVariables:h,look:p}=a,{bkgColorArray:_,borderColorArray:u,actorBorder:O}=h,T=e.append("g").lower();let g=T;r||(B++,Object.keys(t.links||{}).length&&!a.forceMenus&&g.attr("onclick",zt(`actor${B}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),g=T.append("g"),t.actorCnt=B,t.links!=null&&g.attr("id","root-"+B),p==="neo"&&g.attr("data-look","neo"));const f=dt();let I="actor";t.properties?.class?I=t.properties.class:f.fill="#eaeaea",r?I+=` ${_t}`:I+=` ${ft}`,f.x=t.x,f.y=n,f.width=t.width,f.height=t.height,f.class=I,f.name=t.name,f.x=t.x,f.y=n;const L=f.width/3,b=f.width/3,w=L/2,A=w/(2.5+L/50),D=g.append("g");D.attr("class",I);const M=` + M ${f.x},${f.y+A} + a ${w},${A} 0 0 0 ${L},0 + a ${w},${A} 0 0 0 -${L},0 + l 0,${b-2*A} + a ${w},${A} 0 0 0 ${L},0 + l 0,-${b-2*A} +`;D.append("path").attr("d",M),p==="neo"&&D.attr("filter","url(#drop-shadow)");const V=i.get(t.name)??0;pt.has(E)?(D.style("stroke",u[V%u.length]),D.style("fill",_[V%u.length])):D.style("stroke",O),D.attr("transform",`translate(${L}, ${A})`),t.rectData=f,Et(a,Q(t.description))(t.description,g,f.x,f.y+35,f.width,f.height,{class:`actor ${qt}`},a);const W=D.select("path:last-child");if(W.node()){const U=W.node().getBBox();t.height=U.height+(a.sequence.labelBoxHeight??0)}return r||(g.attr("data-et","participant"),g.attr("data-type","database"),g.attr("data-id",t.name)),t.height},"drawActorTypeDatabase"),Pr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+80,E=22,h=e.append("g").lower(),{look:p,theme:_,themeVariables:u}=a,{bkgColorArray:O,borderColorArray:T,actorBorder:g}=u;r||(B++,h.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);const f=e.append("g");let I=yt;r?I+=` ${_t}`:I+=` ${ft}`,f.attr("class",I),f.attr("name",t.name);const L=dt();L.x=t.x,L.y=n,L.fill="#eaeaea",L.width=t.width,L.height=t.height,L.class="actor",f.append("line").attr("id","actor-man-torso"+B).attr("x1",t.x+t.width/2-E*2.5).attr("y1",n+12).attr("x2",t.x+t.width/2-15).attr("y2",n+12),f.append("line").attr("id","actor-man-arms"+B).attr("x1",t.x+t.width/2-E*2.5).attr("y1",n+2).attr("x2",t.x+t.width/2-E*2.5).attr("y2",n+22),f.append("circle").attr("cx",t.x+t.width/2).attr("cy",n+12).attr("r",E),p==="neo"&&f.attr("filter","url(#drop-shadow)");const b=i.get(t.name)??0;pt.has(_)?(f.style("stroke",T[b%T.length]),f.style("fill",O[b%T.length])):f.style("stroke",g);const w=f.node().getBBox();return t.height=w.height+(a.sequence.labelBoxHeight??0),Et(a,Q(t.description))(t.description,f,L.x,L.y+15,L.width,L.height,{class:`actor ${yt}`},a),f.attr("transform",`translate(0,${E/2+10})`),r||(f.attr("data-et","participant"),f.attr("data-type","boundary"),f.attr("data-id",t.name)),t.height},"drawActorTypeBoundary"),kr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+80,{look:E,theme:h,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:u,actorBorder:O}=p,T=e.append("g").lower();r||(B++,T.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);const g=e.append("g");let f=yt;r?f+=` ${_t}`:f+=` ${ft}`,g.attr("class",f),g.attr("name",t.name),r||g.attr("data-et","participant").attr("data-type","actor").attr("data-id",t.name);const I=E==="neo"?.5:1,L=E==="neo"?n+(1-I)*30:n;g.append("line").attr("id","actor-man-torso"+B).attr("x1",s).attr("y1",L+25*I).attr("x2",s).attr("y2",L+45*I),g.append("line").attr("id","actor-man-arms"+B).attr("x1",s-It/2*I).attr("y1",L+33*I).attr("x2",s+It/2*I).attr("y2",L+33*I),g.append("line").attr("x1",s-It/2*I).attr("y1",L+60*I).attr("x2",s).attr("y2",L+45*I),g.append("line").attr("x1",s).attr("y1",L+45*I).attr("x2",s+(It/2-2)*I).attr("y2",L+60*I);const b=g.append("circle");b.attr("cx",t.x+t.width/2),b.attr("cy",L+10*I),b.attr("r",15*I),b.attr("width",t.width*I),b.attr("height",t.height*I);const w=g.node().getBBox();t.height=w.height;const A=dt();A.x=t.x,A.y=L,A.fill="#eaeaea",A.width=t.width,A.height=t.height/I,A.class="actor",A.rx=3,A.ry=3;const D=i.get(t.name)??0;return pt.has(h)?(g.style("stroke",u[D%u.length]),g.style("fill",_[D%u.length])):g.style("stroke",O),Et(a,Q(t.description))(t.description,g,A.x,L+35*I-(E==="neo"?10:0),A.width,A.height,{class:`actor ${yt}`},a),t.height},"drawActorTypeActor"),Dr=x(async function(e,t,a,r,i,n,s){const c=s??new Map([...n.db.getActors().values()].map((E,h)=>[E.name,h]));switch(t.type){case"actor":return await kr(e,t,a,r,c);case"participant":return await br(e,t,a,r,c);case"boundary":return await Pr(e,t,a,r,c);case"control":return await Sr(e,t,a,r,i,c);case"entity":return await wr(e,t,a,r,c);case"database":return await Nr(e,t,a,r,c);case"collections":return await mr(e,t,a,r,c);case"queue":return await Ar(e,t,a,r,c)}},"drawActor"),vr=x(function(e,t,a){const i=e.append("g");Ke(i,t),t.name&&Et(a)(t.name,i,t.x,t.y+a.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},a),i.lower()},"drawBox"),Cr=x(function(e){return e.append("g")},"anchorElement"),Mr=x(function(e,t,a,r,i,n,s){const{theme:c,themeVariables:E}=r,{bkgColorArray:h,borderColorArray:p,mainBkg:_}=E,u=dt(),O=t.anchored,T=t.actor;u.x=t.startx,u.y=t.starty,u.class="activation"+i%3,u.width=t.stopx-t.startx,u.height=a-t.starty;const g=Pt(O,u),I=(s??new Map([...n.db.getActors().values()].map((L,b)=>[L.name,b]))).get(T)??0;pt.has(c)&&(g.style("stroke",p[I%p.length]),g.style("fill",h[I%p.length]??_))},"drawActivation"),Br=x(async function(e,t,a,r,i){const{boxMargin:n,boxTextMargin:s,labelBoxHeight:c,labelBoxWidth:E,messageFontFamily:h,messageFontSize:p,messageFontWeight:_}=r,u=e.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),O=x(function(f,I,L,b){return u.append("line").attr("x1",f).attr("y1",I).attr("x2",L).attr("y2",b).attr("class","loopLine")},"drawLoopLine");O(t.startx,t.starty,t.stopx,t.starty),O(t.stopx,t.starty,t.stopx,t.stopy),O(t.startx,t.stopy,t.stopx,t.stopy),O(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(f){O(t.startx,f.y,t.stopx,f.y).style("stroke-dasharray","3, 3")});let T=se();T.text=a,T.x=t.startx,T.y=t.starty,T.fontFamily=h,T.fontSize=p,T.fontWeight=_,T.anchor="middle",T.valign="middle",T.tspan=!1,T.width=Math.max(E??0,50),T.height=c+(r.look==="neo"?15:0)||20,T.textMargin=s,T.class="labelText",Ye(u,T),T=Fe(),T.text=t.title,T.x=t.startx+E/2+(t.stopx-t.startx)/2,T.y=t.starty+n+s,T.anchor="middle",T.valign="middle",T.textMargin=s,T.class="loopText",T.fontFamily=h,T.fontSize=p,T.fontWeight=_,T.wrap=!0;let g=Q(T.text)?await Ht(u,T,t):At(u,T);if(t.sectionTitles!==void 0){for(const[f,I]of Object.entries(t.sectionTitles))if(I.message){T.text=I.message,T.x=t.startx+(t.stopx-t.startx)/2,T.y=t.sections[f].y+n+s,T.class="sectionTitle",T.anchor="middle",T.valign="middle",T.tspan=!1,T.fontFamily=h,T.fontSize=p,T.fontWeight=_,T.wrap=t.wrap,Q(T.text)?(t.starty=t.sections[f].y,await Ht(u,T,t)):At(u,T);let L=Math.round(g.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,w)=>b+w));t.sections[f].height+=L-(n+s)}}return t.height=Math.round(t.stopy-t.starty),u},"drawLoop"),Ke=x(function(e,t){ur(e,t)},"drawBackgroundRect"),Vr=x(function(e,t){e.append("defs").append("symbol").attr("id",t+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Yr=x(function(e,t){e.append("defs").append("symbol").attr("id",t+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Wr=x(function(e,t){e.append("defs").append("symbol").attr("id",t+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Kr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),Fr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Hr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),qr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),zr=x(function(e,t){const{theme:a}=t;e.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a==="redux"||a==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),Fe=x(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),Ur=x(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Et=(function(){function e(n,s,c,E,h,p,_){const u=s.append("text").attr("x",c+h/2).attr("y",E+p/2+5).style("text-anchor","middle").text(n);i(u,_)}x(e,"byText");function t(n,s,c,E,h,p,_,u){const{actorFontSize:O,actorFontFamily:T,actorFontWeight:g}=u,[f,I]=Be(O),L=n.split(N.lineBreakRegex);for(let b=0;be.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:x(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:x(function(e){this.boxes.push(e)},"addBox"),addActor:x(function(e){this.actors.push(e)},"addActor"),addLoop:x(function(e){this.loops.push(e)},"addLoop"),addMessage:x(function(e){this.messages.push(e)},"addMessage"),addNote:x(function(e){this.notes.push(e)},"addNote"),lastActor:x(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:x(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:x(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:x(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:x(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,ze($())},"init"),updateVal:x(function(e,t,a,r){e[t]===void 0?e[t]=a:e[t]=r(a,e[t])},"updateVal"),updateBounds:x(function(e,t,a,r){const i=this;let n=0;function s(c){return x(function(h){n++;const p=i.sequenceItems.length-n+1;i.updateVal(h,"starty",t-p*l.boxMargin,Math.min),i.updateVal(h,"stopy",r+p*l.boxMargin,Math.max),i.updateVal(R.data,"startx",e-p*l.boxMargin,Math.min),i.updateVal(R.data,"stopx",a+p*l.boxMargin,Math.max),c!=="activation"&&(i.updateVal(h,"startx",e-p*l.boxMargin,Math.min),i.updateVal(h,"stopx",a+p*l.boxMargin,Math.max),i.updateVal(R.data,"starty",t-p*l.boxMargin,Math.min),i.updateVal(R.data,"stopy",r+p*l.boxMargin,Math.max))},"updateItemBounds")}x(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:x(function(e,t,a,r){const i=N.getMin(e,a),n=N.getMax(e,a),s=N.getMin(t,r),c=N.getMax(t,r);this.updateVal(R.data,"startx",i,Math.min),this.updateVal(R.data,"starty",s,Math.min),this.updateVal(R.data,"stopx",n,Math.max),this.updateVal(R.data,"stopy",c,Math.max),this.updateBounds(i,s,n,c)},"insert"),newActivation:x(function(e,t,a){const r=a.get(e.from),i=Ut(e.from).length||0,n=r.x+r.width/2+(i-1)*l.activationWidth/2;this.activations.push({startx:n,starty:this.verticalPos+2,stopx:n+l.activationWidth,stopy:void 0,actor:e.from,anchored:H.anchorElement(t)})},"newActivation"),endActivation:x(function(e){const t=this.activations.map(function(a){return a.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:x(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},"createLoop"),newLoop:x(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:x(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:x(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:x(function(e){const t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:R.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:x(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:x(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:x(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=N.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return{bounds:this.data,models:this.models}},"getBounds")},$r=x(async function(e,t,a){R.bumpVerticalPos(l.boxMargin),t.height=l.boxMargin,t.starty=R.getVerticalPos();const r=dt();r.x=t.startx,r.y=t.starty,r.width=t.width||l.width,r.class="note";const i=e.append("g");i.attr("data-et","note"),i.attr("data-id","i"+a);const n=H.drawRect(i,r),s=se();s.x=t.startx,s.y=t.starty,s.width=r.width,s.dy="1em",s.text=t.message,s.class="noteText",s.fontFamily=l.noteFontFamily,s.fontSize=l.noteFontSize,s.fontWeight=l.noteFontWeight,s.anchor=l.noteAlign,s.textMargin=l.noteMargin,s.valign="center";const c=Q(s.text)?await Ht(i,s):At(i,s),E=Math.round(c.map(h=>(h._groups||h)[0][0].getBBox().height).reduce((h,p)=>h+p));n.attr("height",E+2*l.noteMargin),t.height+=E+2*l.noteMargin,R.bumpVerticalPos(E+2*l.noteMargin),t.stopy=t.starty+E+2*l.noteMargin,t.stopx=t.startx+r.width,R.insert(t.startx,t.starty,t.stopx,t.stopy),R.models.addNote(t)},"drawNote"),ve=x(function(e,t,a,r,i,n,s){const c=r.db.getActors(),E=c.get(t.from),h=c.get(t.to),p=a.sequenceVisible;let _=E.x+E.width/2,u=h.x+h.width/2;const O=_<=u,T=Je(t,r),g=e.append("g"),f=16.5,I=x((D,M)=>{const V=D?f:-f;return M?-V:V},"getCircleOffset"),L=x(D=>{g.append("circle").attr("cx",D).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:w,CENTRAL_CONNECTION_DUAL:A}=r.db.LINETYPE;if(p)switch(t.centralConnection){case b:T&&(u+=I(O,!0));break;case w:T||(_+=I(O,!1));break;case A:T?u+=I(O,!0):_+=I(O,!1);break}switch(t.centralConnection){case b:L(u);break;case w:L(_);break;case A:L(_),L(u);break}},"drawCentralConnection"),Rt=x(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),bt=x(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),re=x(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function He(e,t){R.bumpVerticalPos(10);const{startx:a,stopx:r,message:i}=t,n=N.splitBreaks(i).length,s=Q(i),c=s?await kt(i,$()):Z.calculateTextDimensions(i,Rt(l));if(!s){const _=c.height/n;t.height+=_,R.bumpVerticalPos(_)}let E,h=c.height-10;const p=c.width;if(a===r){E=R.getVerticalPos()+h,l.rightAngles||(h+=l.boxMargin,E=R.getVerticalPos()+h),h+=30;const _=N.getMax(p/2,l.width/2);R.insert(a-_,R.getVerticalPos()-10+h,r+_,R.getVerticalPos()+30+h)}else h+=l.boxMargin,E=R.getVerticalPos()+h,R.insert(a,E-10,r,E);return R.bumpVerticalPos(h),t.height+=h,t.stopy=t.starty+t.height,R.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),E}x(He,"boundMessage");var jr=x(async function(e,t,a,r,i,n){const{startx:s,stopx:c,starty:E,message:h,type:p,sequenceIndex:_,sequenceVisible:u}=t,O=Z.calculateTextDimensions(h,Rt(l)),T=se();T.x=Math.min(s,c),T.y=E+10,T.width=Math.abs(c-s),T.class="messageText",T.dy="1em",T.text=h,T.fontFamily=l.messageFontFamily,T.fontSize=l.messageFontSize,T.fontWeight=l.messageFontWeight,T.anchor=l.messageAlign,T.valign="center",T.textMargin=l.wrapPadding,T.tspan=!1,Q(T.text)?await Ht(e,T,{startx:s,stopx:c,starty:a}):At(e,T);const g=O.width;let f;if(s===c){const L=u||l.showSequenceNumbers,b=Je(i,r),w=na(i,r),A=s+(L&&(b||w)?10:0);l.rightAngles?f=e.append("path").attr("d",`M ${A},${a} H ${s+N.getMax(l.width/2,g/2)} V ${a+25} H ${s}`):f=e.append("path").attr("d","M "+A+","+a+" C "+(A+60)+","+(a-10)+" "+(s+60)+","+(a+30)+" "+s+","+(a+20)),te(i,r)&&ve(e,i,t,r,s,c,a)}else f=e.append("line"),f.attr("x1",s),f.attr("y1",a),f.attr("x2",c),f.attr("y2",a),te(i,r)&&ve(e,i,t,r,s,c,a);p===r.db.LINETYPE.DOTTED||p===r.db.LINETYPE.DOTTED_CROSS||p===r.db.LINETYPE.DOTTED_POINT||p===r.db.LINETYPE.DOTTED_OPEN||p===r.db.LINETYPE.BIDIRECTIONAL_DOTTED||p===r.db.LINETYPE.SOLID_TOP_DOTTED||p===r.db.LINETYPE.SOLID_BOTTOM_DOTTED||p===r.db.LINETYPE.STICK_TOP_DOTTED||p===r.db.LINETYPE.STICK_BOTTOM_DOTTED||p===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||p===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||p===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||p===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(f.style("stroke-dasharray","3, 3"),f.attr("class","messageLine1")):f.attr("class","messageLine0"),f.attr("data-et","message"),f.attr("data-id","i"+t.id),f.attr("data-from",t.from),f.attr("data-to",t.to);let I="";if(l.arrowMarkerAbsolute&&(I=Er(!0)),f.attr("stroke-width",2),f.attr("stroke","none"),f.style("fill","none"),(p===r.db.LINETYPE.SOLID_TOP||p===r.db.LINETYPE.SOLID_TOP_DOTTED)&&f.attr("marker-end","url("+I+"#"+n+"-solidTopArrowHead)"),(p===r.db.LINETYPE.SOLID_BOTTOM||p===r.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&f.attr("marker-end","url("+I+"#"+n+"-solidBottomArrowHead)"),(p===r.db.LINETYPE.STICK_TOP||p===r.db.LINETYPE.STICK_TOP_DOTTED)&&f.attr("marker-end","url("+I+"#"+n+"-stickTopArrowHead)"),(p===r.db.LINETYPE.STICK_BOTTOM||p===r.db.LINETYPE.STICK_BOTTOM_DOTTED)&&f.attr("marker-end","url("+I+"#"+n+"-stickBottomArrowHead)"),(p===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||p===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&f.attr("marker-start","url("+I+"#"+n+"-solidBottomArrowHead)"),(p===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||p===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&f.attr("marker-start","url("+I+"#"+n+"-solidTopArrowHead)"),(p===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||p===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&f.attr("marker-start","url("+I+"#"+n+"-stickBottomArrowHead)"),(p===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||p===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&f.attr("marker-start","url("+I+"#"+n+"-stickTopArrowHead)"),(p===r.db.LINETYPE.SOLID||p===r.db.LINETYPE.DOTTED)&&f.attr("marker-end","url("+I+"#"+n+"-arrowhead)"),(p===r.db.LINETYPE.BIDIRECTIONAL_SOLID||p===r.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(f.attr("marker-start","url("+I+"#"+n+"-arrowhead)"),f.attr("marker-end","url("+I+"#"+n+"-arrowhead)")),(p===r.db.LINETYPE.SOLID_POINT||p===r.db.LINETYPE.DOTTED_POINT)&&f.attr("marker-end","url("+I+"#"+n+"-filled-head)"),(p===r.db.LINETYPE.SOLID_CROSS||p===r.db.LINETYPE.DOTTED_CROSS)&&f.attr("marker-end","url("+I+"#"+n+"-crosshead)"),u||l.showSequenceNumbers){const L=p===r.db.LINETYPE.BIDIRECTIONAL_SOLID||p===r.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=p===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||p===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||p===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||p===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||p===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||p===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||p===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||p===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,w=6,A=te(i,r);let D=s,M=c;L?(ss?M=c-2*w:(M=c-w,D+=i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),M+=A?15:0,f.attr("x2",M),f.attr("x1",D)):f.attr("x1",s+w);let V=0;const W=s===c,U=s<=c;W?V=t.fromBounds+1:b?V=U?t.toBounds-1:t.fromBounds+1:V=U?t.fromBounds+1:t.toBounds-1;let G="12px";const X=_.toString().length;X>5?G="7px":X>3&&(G="9px"),e.append("line").attr("x1",V).attr("y1",a).attr("x2",V).attr("y2",a).attr("stroke-width",0).attr("marker-start","url("+I+"#"+n+"-sequencenumber)"),e.append("text").attr("x",V).attr("y",a+4).attr("font-family","sans-serif").attr("font-size",G).attr("text-anchor","middle").attr("class","sequenceNumber").text(_)}},"drawMessage"),ta=x(function(e,t,a,r,i,n,s){let c=0,E=0,h,p=0;for(const _ of r){const u=t.get(_),O=u.box;h&&h!=O&&(s||R.models.addBox(h),E+=l.boxMargin+h.margin),O&&O!=h&&(s||(O.x=c+E,O.y=i),E+=O.margin),u.width=N.getMax(u.width||l.width,l.width),u.height=N.getMax(u.height||l.height,l.height),u.margin=u.margin||l.actorMargin,p=N.getMax(p,u.height),a.get(u.name)&&(E+=u.width/2),u.x=c+E,u.starty=R.getVerticalPos(),R.insert(u.x,i,u.x+u.width,u.height),c+=u.width+E,u.box&&(u.box.width=c+O.margin-u.box.x),E=u.margin,h=u.box,R.models.addActor(u)}h&&!s&&R.models.addBox(h),R.bumpVerticalPos(p)},"addActorRenderingData"),ae=x(async function(e,t,a,r,i,n,s){if(r){let c=0;R.bumpVerticalPos(l.boxMargin*2);for(const E of a){const h=t.get(E);h.stopy||(h.stopy=R.getVerticalPos());const p=await H.drawActor(e,h,l,!0,i,n,s);c=N.getMax(c,p)}R.bumpVerticalPos(c+l.boxMargin)}else for(const c of a){const E=t.get(c);await H.drawActor(e,E,l,!1,i,n,s)}},"drawActors"),qe=x(function(e,t,a,r){let i=0,n=0;for(const s of a){const c=t.get(s),E=ra(c),h=H.drawPopup(e,c,E,l,l.forceMenus,r);h.height>i&&(i=h.height),h.width+c.x>n&&(n=h.width+c.x)}return{maxHeight:i,maxWidth:n}},"drawActorsPopup"),ze=x(function(e){sr(l,e),e.fontFamily&&(l.actorFontFamily=l.noteFontFamily=l.messageFontFamily=e.fontFamily),e.fontSize&&(l.actorFontSize=l.noteFontSize=l.messageFontSize=e.fontSize),e.fontWeight&&(l.actorFontWeight=l.noteFontWeight=l.messageFontWeight=e.fontWeight)},"setConf"),Ut=x(function(e){return R.activations.filter(function(t){return t.actor===e})},"actorActivations"),Ce=x(function(e,t){const a=t.get(e),r=Ut(e),i=r.reduce(function(s,c){return N.getMin(s,c.startx)},a.x+a.width/2-1),n=r.reduce(function(s,c){return N.getMax(s,c.stopx)},a.x+a.width/2+1);return[i,n]},"activationBounds");function ht(e,t,a,r,i){R.bumpVerticalPos(a);let n=r;if(t.id&&t.message&&e[t.id]){const s=e[t.id].width,c=Rt(l);t.message=Z.wrapLabel(`[${t.message}]`,s-2*l.wrapPadding,c),t.width=s,t.wrap=!0;const E=Z.calculateTextDimensions(t.message,c),h=N.getMax(E.height,l.labelBoxHeight);n=r+h,at.debug(`${h} - ${t.message}`)}i(t),R.bumpVerticalPos(n)}x(ht,"adjustLoopHeightForWrap");function Ue(e,t,a,r,i,n,s){function c(p,_){p.x{m.add(k.from),m.add(k.to)}),f=f.filter(k=>m.has(k))}const D=new Map(f.map((m,k)=>[u.get(m)?.name??m,k]));ta(_,u,O,f,0,I,!1);const M=await ca(I,u,A,r);H.insertArrowHead(_,t),H.insertArrowCrossHead(_,t),H.insertArrowFilledHead(_,t),H.insertSequenceNumber(_,t),H.insertSolidTopArrowHead(_,t),H.insertSolidBottomArrowHead(_,t),H.insertStickTopArrowHead(_,t),H.insertStickBottomArrowHead(_,t),s==="neo"&&H.insertDropShadow(_,l);function V(m,k){const lt=R.endActivation(m);lt.starty+18>k&&(lt.starty=k-6,k+=12),H.drawActivation(_,lt,k,l,Ut(m.from).length,r,D),R.insert(lt.startx,k-10,lt.stopx,k)}x(V,"activeEnd");let W=1,U=1;const G=[],X=[];let nt=0;for(const m of I){let k,lt,et;switch(m.type){case r.db.LINETYPE.NOTE:R.resetVerticalPos(),lt=m.noteModel,await $r(_,lt,m.id);break;case r.db.LINETYPE.ACTIVE_START:R.newActivation(m,_,u);break;case r.db.LINETYPE.CENTRAL_CONNECTION:R.newActivation(m,_,u);break;case r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:R.newActivation(m,_,u);break;case r.db.LINETYPE.ACTIVE_END:V(m,R.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:ht(M,m,l.boxMargin,l.boxMargin+l.boxTextMargin,K=>R.newLoop(K));break;case r.db.LINETYPE.LOOP_END:k=R.endLoop(),await H.drawLoop(_,k,"loop",l,m),R.bumpVerticalPos(k.stopy-R.getVerticalPos()),R.models.addLoop(k);break;case r.db.LINETYPE.RECT_START:ht(M,m,l.boxMargin,l.boxMargin,K=>{let Ot=K.message;Ot||(Ot=c?.rectBkgColor||c?.actorBkg||"rgba(128, 128, 128, 0.5)"),R.newLoop(void 0,Ot)});break;case r.db.LINETYPE.RECT_END:k=R.endLoop(),X.push(k),R.models.addLoop(k),R.bumpVerticalPos(k.stopy-R.getVerticalPos());break;case r.db.LINETYPE.OPT_START:ht(M,m,l.boxMargin,l.boxMargin+l.boxTextMargin,K=>R.newLoop(K));break;case r.db.LINETYPE.OPT_END:k=R.endLoop(),await H.drawLoop(_,k,"opt",l,m),R.bumpVerticalPos(k.stopy-R.getVerticalPos()),R.models.addLoop(k);break;case r.db.LINETYPE.ALT_START:ht(M,m,l.boxMargin,l.boxMargin+l.boxTextMargin,K=>R.newLoop(K));break;case r.db.LINETYPE.ALT_ELSE:ht(M,m,l.boxMargin+l.boxTextMargin,l.boxMargin,K=>R.addSectionToLoop(K));break;case r.db.LINETYPE.ALT_END:k=R.endLoop(),await H.drawLoop(_,k,"alt",l,m),R.bumpVerticalPos(k.stopy-R.getVerticalPos()),R.models.addLoop(k);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:ht(M,m,l.boxMargin,l.boxMargin+l.boxTextMargin,K=>R.newLoop(K)),R.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:ht(M,m,l.boxMargin+l.boxTextMargin,l.boxMargin,K=>R.addSectionToLoop(K));break;case r.db.LINETYPE.PAR_END:k=R.endLoop(),await H.drawLoop(_,k,"par",l,m),R.bumpVerticalPos(k.stopy-R.getVerticalPos()),R.models.addLoop(k);break;case r.db.LINETYPE.AUTONUMBER:W=m.message.start||W,U=m.message.step||U,m.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:ht(M,m,l.boxMargin,l.boxMargin+l.boxTextMargin,K=>R.newLoop(K));break;case r.db.LINETYPE.CRITICAL_OPTION:ht(M,m,l.boxMargin+l.boxTextMargin,l.boxMargin,K=>R.addSectionToLoop(K));break;case r.db.LINETYPE.CRITICAL_END:k=R.endLoop(),await H.drawLoop(_,k,"critical",l,m),R.bumpVerticalPos(k.stopy-R.getVerticalPos()),R.models.addLoop(k);break;case r.db.LINETYPE.BREAK_START:ht(M,m,l.boxMargin,l.boxMargin+l.boxTextMargin,K=>R.newLoop(K));break;case r.db.LINETYPE.BREAK_END:k=R.endLoop(),await H.drawLoop(_,k,"break",l,m),R.bumpVerticalPos(k.stopy-R.getVerticalPos()),R.models.addLoop(k);break;default:try{et=m.msgModel,et.starty=R.getVerticalPos(),et.sequenceIndex=W,et.sequenceVisible=r.db.showSequenceNumbers(),et.id=m.id,et.from=m.from,et.to=m.to;const K=await He(_,et);Ue(m,et,K,nt,u,O,T),G.push({messageModel:et,lineStartY:K,msg:m}),R.models.addMessage(et)}catch(K){at.error("error while drawing message",K)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.SOLID_TOP,r.db.LINETYPE.SOLID_BOTTOM,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.SOLID_TOP_DOTTED,r.db.LINETYPE.SOLID_BOTTOM_DOTTED,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(m.type)&&(W=Math.round((W+U)*100)/100),nt++}at.debug("createdActors",O),at.debug("destroyedActors",T),await ae(_,u,f,!1,t,r,D);for(const m of G)await jr(_,m.messageModel,m.lineStartY,r,m.msg,t);l.mirrorActors&&await ae(_,u,f,!0,t,r,D),X.forEach(m=>H.drawBackgroundRect(_,m)),We(_,u,f,l);for(const m of R.models.boxes){m.height=R.getVerticalPos()-m.y,R.insert(m.x,m.y,m.x+m.width,m.height);const k=l.boxMargin*2;m.startx=m.x-k,m.starty=m.y-k*.25,m.stopx=m.startx+m.width+2*k,m.stopy=m.starty+m.height+k*.75,m.stroke="rgb(0,0,0, 0.5)",H.drawBox(_,m,l)}b&&R.bumpVerticalPos(l.boxMargin);const j=qe(_,u,f,p),{bounds:q}=R.getBounds();q.startx===void 0&&(q.startx=0),q.starty===void 0&&(q.starty=0),q.stopx===void 0&&(q.stopx=0),q.stopy===void 0&&(q.stopy=0);let st=q.stopy-q.starty;st{const s=Rt(l);let c=n.actorKeys.reduce((_,u)=>_+=e.get(u).width+(e.get(u).margin||0),0);const E=l.boxMargin*8;c+=E,c-=2*l.boxTextMargin,n.wrap&&(n.name=Z.wrapLabel(n.name,c-2*l.wrapPadding,s));const h=Z.calculateTextDimensions(n.name,s);i=N.getMax(h.height,i);const p=N.getMax(c,h.width+2*l.wrapPadding);if(n.margin=l.boxTextMargin,cn.textMaxHeight=i),N.getMax(r,l.height)}x(Xe,"calculateActorMargins");var aa=x(async function(e,t,a){const r=t.get(e.from),i=t.get(e.to),n=r.x,s=i.x,c=e.wrap&&e.message;let E=Q(e.message)?await kt(e.message,$()):Z.calculateTextDimensions(c?Z.wrapLabel(e.message,l.width,bt(l)):e.message,bt(l));const h={width:c?l.width:N.getMax(l.width,E.width+2*l.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===a.db.PLACEMENT.RIGHTOF?(h.width=c?N.getMax(l.width,E.width):N.getMax(r.width/2+i.width/2,E.width+2*l.noteMargin),h.startx=n+(r.width+l.actorMargin)/2):e.placement===a.db.PLACEMENT.LEFTOF?(h.width=c?N.getMax(l.width,E.width+2*l.noteMargin):N.getMax(r.width/2+i.width/2,E.width+2*l.noteMargin),h.startx=n-h.width+(r.width-l.actorMargin)/2):e.to===e.from?(E=Z.calculateTextDimensions(c?Z.wrapLabel(e.message,N.getMax(l.width,r.width),bt(l)):e.message,bt(l)),h.width=c?N.getMax(l.width,r.width):N.getMax(r.width,l.width,E.width+2*l.noteMargin),h.startx=n+(r.width-h.width)/2):(h.width=Math.abs(n+r.width/2-(s+i.width/2))+l.actorMargin,h.startx=n2,u=x(f=>E?-f:f,"adjustValue");e.from===e.to?p=h:(e.activate&&!_&&(p+=u(l.activationWidth/2-1)),[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.STICK_TOP,a.db.LINETYPE.STICK_BOTTOM,a.db.LINETYPE.STICK_TOP_DOTTED,a.db.LINETYPE.STICK_BOTTOM_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)||(p+=u(3)),[a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)&&(h-=u(3)));const O=[i,n,s,c],T=Math.abs(h-p);e.wrap&&e.message&&(e.message=Z.wrapLabel(e.message,N.getMax(T+2*l.wrapPadding,l.width),Rt(l)));const g=Z.calculateTextDimensions(e.message,Rt(l));return{width:N.getMax(e.wrap?0:g.width+2*l.wrapPadding,T+2*l.wrapPadding,l.width),height:0,startx:h,stopx:p,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,O),toBounds:Math.max.apply(null,O)}},"buildMessageModel"),ca=x(async function(e,t,a,r){const i={},n=[];let s,c,E;for(const h of e){switch(h.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:n.push({id:h.id,msg:h.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:h.message&&(s=n.pop(),i[s.id]=s,i[h.id]=s,n.push(s));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:s=n.pop(),i[s.id]=s;break;case r.db.LINETYPE.ACTIVE_START:{const _=t.get(h.from?h.from:h.to.actor),u=Ut(h.from?h.from:h.to.actor).length,O=_.x+_.width/2+(u-1)*l.activationWidth/2,T={startx:O,stopx:O+l.activationWidth,actor:h.from,enabled:!0};R.activations.push(T)}break;case r.db.LINETYPE.ACTIVE_END:{const _=R.activations.map(u=>u.actor).lastIndexOf(h.from);R.activations.splice(_,1).splice(0,1)}break}h.placement!==void 0?(c=await aa(h,t,r),h.noteModel=c,n.forEach(_=>{s=_,s.from=N.getMin(s.from,c.startx),s.to=N.getMax(s.to,c.startx+c.width),s.width=N.getMax(s.width,Math.abs(s.from-s.to))-l.labelBoxWidth})):(E=oa(h,t,r),h.msgModel=E,E.startx&&E.stopx&&n.length>0&&n.forEach(_=>{if(s=_,E.startx===E.stopx){const u=t.get(h.from),O=t.get(h.to);s.from=N.getMin(u.x-E.width/2,u.x-u.width/2,s.from),s.to=N.getMax(O.x+E.width/2,O.x+u.width/2,s.to),s.width=N.getMax(s.width,Math.abs(s.to-s.from))-l.labelBoxWidth}else s.from=N.getMin(E.startx,s.from),s.to=N.getMax(E.stopx,s.to),s.width=N.getMax(s.width,E.width)-l.labelBoxWidth}))}return R.activations=[],at.debug("Loop type widths:",i),i},"calculateLoopBounds"),la={bounds:R,drawActors:ae,drawActorsPopup:qe,setConf:ze,draw:ea},ua={parser:_r,get db(){return new yr},renderer:la,styles:Or,init:x(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,rr({sequence:{wrap:e.wrap}}))},"init")};export{ua as diagram}; diff --git a/internal/webapp/static/assets/sizeCapture-X5ZJPWSS-7fV3Kxoy.js b/internal/webapp/static/assets/sizeCapture-X5ZJPWSS-7fV3Kxoy.js new file mode 100644 index 0000000..4b3c041 --- /dev/null +++ b/internal/webapp/static/assets/sizeCapture-X5ZJPWSS-7fV3Kxoy.js @@ -0,0 +1 @@ +import{_ as o}from"./mermaid.core-B7WVQkyL.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var p=1;function i(){if(!(typeof globalThis>"u"))return globalThis}o(i,"getCaptureGlobal");function c(){return!!i()?.mermaidCaptureSizes}o(c,"shouldCaptureSizes");function u(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}o(u,"capturedFromLocation");function d(n,r){const t=i();if(!t)return;const e=r.node(),s=((e&&"ownerSVGElement"in e?e.ownerSVGElement:null)??e)?.id??"(unknown)";t.mermaidCapturedSizes??=[];const a={svgId:s,sizes:n};t.mermaidCapturedSizes.push(a),t.mermaidLastCapturedSizes=a}o(d,"emitCapturedSizes");function m(n,r){const t=[];for(const e of r.nodes)e.isGroup||t.push({id:e.id,width:e.width??0,height:e.height??0});t.length!==0&&d({metadata:{captureVersion:p,capturedAt:new Date().toISOString(),capturedFrom:u()},nodes:t},n)}o(m,"captureNodeSizes");export{m as captureNodeSizes,c as shouldCaptureSizes}; diff --git a/internal/webapp/static/assets/stateDiagram-OKZ733FA-BZDeXRMs.js b/internal/webapp/static/assets/stateDiagram-OKZ733FA-BZDeXRMs.js new file mode 100644 index 0000000..fb79a21 --- /dev/null +++ b/internal/webapp/static/assets/stateDiagram-OKZ733FA-BZDeXRMs.js @@ -0,0 +1 @@ +import{s as P,a as R,S as N}from"./chunk-5RXB4S5H-D-7tWSyr.js";import{_ as f,c as t,d as H,l as S,e as W,k as z,P as _,Q as U,L as C,x as F}from"./mermaid.core-B7WVQkyL.js";import{G as O}from"./graph-DOmOIIwC.js";import{l as J}from"./layout-D-LzfAck.js";import"./chunk-XXDRQBXY-BXTWinaX.js";import"./chunk-KBJHAD2P-CHI3y1em.js";import"./chunk-2GRJ4B5K-Bng47RDF.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";import"./map-DxJ2ADlA.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Q=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),Z=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"
    ");p=p.replace(/\n/g,"
    ");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),j=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=Z(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Q(n,i),i.type==="note"&&j(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,K=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=_().x(function(s){return s.x}).y(function(s){return s.y}).curve(U),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=F.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,v=B*1.75;W(s,y,v,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new O({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),K(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*b.padding,k.height=v.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},xt={parser:R,get db(){return new N(1)},renderer:it,styles:P,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{xt as diagram}; diff --git a/internal/webapp/static/assets/stateDiagram-v2-UEYNNEHI-DDDMcBM_.js b/internal/webapp/static/assets/stateDiagram-v2-UEYNNEHI-DDDMcBM_.js new file mode 100644 index 0000000..0188910 --- /dev/null +++ b/internal/webapp/static/assets/stateDiagram-v2-UEYNNEHI-DDDMcBM_.js @@ -0,0 +1 @@ +import{s as r,b as e,a,S as s}from"./chunk-5RXB4S5H-D-7tWSyr.js";import{_ as i}from"./mermaid.core-B7WVQkyL.js";import"./chunk-XXDRQBXY-BXTWinaX.js";import"./chunk-KBJHAD2P-CHI3y1em.js";import"./chunk-2GRJ4B5K-Bng47RDF.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var n={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{n as diagram}; diff --git a/internal/webapp/static/assets/swimlanes-SLNWSIFB-ZiI1XT9U.js b/internal/webapp/static/assets/swimlanes-SLNWSIFB-ZiI1XT9U.js new file mode 100644 index 0000000..4b608f6 --- /dev/null +++ b/internal/webapp/static/assets/swimlanes-SLNWSIFB-ZiI1XT9U.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sizeCapture-X5ZJPWSS-7fV3Kxoy.js","assets/mermaid.core-B7WVQkyL.js","assets/mermaid-CP2pUOT9.js","assets/_commonjsHelpers-CqkleIqs.js"])))=>i.map(i=>d[i]); +import{_ as Er}from"./mermaid-CP2pUOT9.js";import{c as Tr}from"./chunk-RYQCIY6F-xkrp9DIm.js";import{am as wr,an as Ar,ao as Rr,ap as Nr,l as Ke,c as Or,ae as Pr,ad as Br,af as kr,at as _r,av as Fr,y as Dr,as as Hr,aw as Xr,x as Oe,ax as Ye,_ as d,ay as Ao}from"./mermaid.core-B7WVQkyL.js";import{G as Yr}from"./graph-DOmOIIwC.js";import"./map-DxJ2ADlA.js";import"./_commonjsHelpers-CqkleIqs.js";async function _o(t,e){const n=new Yr({multigraph:!0,compound:!0}),o=[...e.edges],s=Or(),r=t.insert("g").attr("class","root"),i=r.insert("g").attr("class","clusters"),c=r.insert("g").attr("class","edges edgePath"),a=r.insert("g").attr("class","edgeLabels"),l=r.insert("g").attr("class","nodes"),g=new Map,x=t.node()!=null;await Promise.all(e.nodes.map(async I=>{if(I.isGroup)n.setNode(I.id,{...I});else{if(x){const u=await Pr(l,I,{config:s,dir:I.dir}),p=u.node()?.getBBox()??{width:0,height:0};g.set(I.id,u),I.width=p.width,I.height=p.height}n.setNode(I.id,{...I})}}));for(const I of o)n.setEdge(I.start,I.end,{...I},I.id),e.edges.some(p=>p.id===I.id)||e.edges.push(I);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:I}=await Er(async()=>{const{captureNodeSizes:u}=await import("./sizeCapture-X5ZJPWSS-7fV3Kxoy.js");return{captureNodeSizes:u}},__vite__mapDeps([0,1,2,3]));I(t,e)}return{graph:n,groups:{clusters:i,edgePaths:c,edgeLabels:a,nodes:l,rootGroups:r},nodeElements:g}}d(_o,"createGraphWithElements");var Ro=5,Ge=1e-5,$e=1e-6;function qe(t){const e=[];for(let n=0;n=1-$e||I<=$e||I>=1-$e?null:{point:{x:t.x+x*s,y:t.y+x*r},tA:x,tB:I}}d(Fo,"segmentIntersection");function vn(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}d(vn,"isHorizontalSeg");function Do(t){const e=[];for(let n=0;n=Math.abs(n)?e>=0?1:0:n>=0?1:0}d(Ho,"getArcSweepFlag");var Gr=.001;function Xo(t,e){if(t.length<2)return t.map(r=>({...r}));const n=t.map(r=>({...r})),o=e.arrowTypeStart&&Ao[e.arrowTypeStart];if(o){const r=t[0],i=t[1],c=Math.atan2(i.y-r.y,i.x-r.x);n[0].x=r.x+o*Math.cos(c),n[0].y=r.y+o*Math.sin(c)}const s=e.arrowTypeEnd&&Ao[e.arrowTypeEnd];if(s){const r=t.length,i=t[r-2],c=t[r-1],a=Math.atan2(c.y-i.y,c.x-i.x);n[r-1].x=c.x-s*Math.cos(a),n[r-1].y=c.y-s*Math.sin(a)}return n}d(Xo,"applyMarkerOffsets");function Yo(t,e,n,o,s){const r=t.point.x,i=t.point.y,c={x:r-e*t.r,y:i-n*t.r},a={x:r+e*t.r,y:i+n*t.r},l=[`L${we(c)}`];return s==="arc"?l.push(`A${re(t.r)},${re(t.r)} 0 0 ${o} ${we(a)}`):l.push(`M${we(a)}`),l}d(Yo,"emitJump");function Ln(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=n.x-e.x,c=n.y-e.y,a=Math.hypot(s,r),l=Math.hypot(i,c);if(a0){const E=Ln(s[l-1],s[l],s[l+1]??s[l],Ro);E&&(f=E.cutLen)}let y=x,v=null;r&&lE.t-T.t);for(const E of M)E.r=Math.min(E.r,E.d-f,y-E.d);for(let E=0;ET){const m=T/2;M[E].r=Math.min(M[E].r,m),M[E+1].r=Math.min(M[E+1].r,m)}}for(const E of M)E.r=2?o:null}catch{return null}}d(Vo,"decodeDataPoints");function jo(t,e,n){if(!n.enabled)return;const o=t.node();if(!o)return;const s=new Map;for(const l of e)s.set(l.id,l);const r=[],i=new Map;for(const l of e){const g=typeof CSS<"u"&&CSS.escape?CSS.escape(l.id):l.id,x=o.querySelector(`path[data-id="${g}"]`);if(!x)continue;i.set(l.id,x);const u=Vo(x.getAttribute("data-points"))??l.points;r.push({...l,points:u})}const c=Do(r);if(c.length===0)return;const a=new Map;for(const l of c){const g=a.get(l.jumpEdgeId)??[];g.push(l),a.set(l.jumpEdgeId,g)}for(const l of r){const g=a.get(l.id);if(!g||g.length===0)continue;const I=s.get(l.id)?.curve;if(I!==void 0&&!zo(I))continue;const u=i.get(l.id);if(!u)continue;if(I===void 0){const E=u.getAttribute("d")??"";if(!$o(E))continue}const p=u.getAttribute("style")??"",f=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(p),y=f?Number.parseFloat(f[1]):null,v=f?Number.parseFloat(f[2]):null,M=Go(l,g,n);if(u.setAttribute("d",M),y!==null&&v!==null&&typeof u.getTotalLength=="function"){const E=u.getTotalLength(),T=Math.max(0,E-y-v),m=`0 ${y} ${T} ${v}`,S=p.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${m};`).replace(/;\s*;+/g,";");u.setAttribute("style",S)}}}d(jo,"applyLineJumpsToSvg");async function Uo(t,e){for(const s of t.nodes)s.isGroup?await Br(e.clusters,s):kr(s);const n=new Map;for(const s of t.nodes)s?.id&&n.set(s.id,s);for(const s of t.edges){const r=s.start?n.get(s.start)??{}:{},i=s.end?n.get(s.end)??{}:{},c=_r(e.edgePaths,{...s},{},t.type,r,i,t.diagramId);s.label&&await Fr(e.rootGroups,s),s.label&&Wo(s,c)}const o=t.config?.swimlane?.lineHops;if(o!==!1){const s=o==="gap"?"gap":"arc",r=t.edges.filter(i=>Array.isArray(i.points)&&i.points.length>=2).map(i=>({id:i.id,points:i.points,curve:i.curve,arrowTypeStart:i.arrowTypeStart,arrowTypeEnd:i.arrowTypeEnd}));jo(e.edgePaths,r,{enabled:!0,jumpRadius:6,jumpStyle:s})}}d(Uo,"adjustLayout");function Wo(t,e){const n=e?.updatedPath??e?.originalPath,o=Dr(),{subGraphTitleTotalMargin:s}=Hr({flowchart:o.flowchart??{}});if(t.label){const r=Xr.get(t.id);let i=t.x,c=t.y;if(n){const a=Oe.calcLabelPosition(n);Ke.debug("Moving label "+t.label+" from (",i,",",c,") to (",a.x,",",a.y,") abc88"),e&&(i=a.x,c=a.y)}r.attr("transform",`translate(${i}, ${c+s/2})`)}if(t?.startLabelLeft){const r=Ye.get(t.id).startLeft;let i=t?.x,c=t?.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}if(t.startLabelRight){const r=Ye.get(t.id).startRight;let i=t.x,c=t.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}if(t.endLabelLeft){const r=Ye.get(t.id).endLeft;let i=t.x,c=t.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}if(t.endLabelRight){const r=Ye.get(t.id).endRight;let i=t.x,c=t.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}}d(Wo,"positionEdgeLabel");var Mn="__swimlane_default__",$r=21,No=20;function En(t){return Math.max(t.padding??No,No)}d(En,"topLaneHorizontalPadding");function Ko(t){const{x:e,y:n,width:o,height:s}=t,r=t.swimlaneContentTop;if(typeof e!="number"||typeof n!="number"||typeof o!="number"||typeof s!="number"||typeof r!="number"||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(r)||o<=0||s<=0){delete t.groupTitleRect;return}const i=n-s/2,c=Math.min(r,n+s/2),a=Math.min($r,Math.max(0,c-i)),l=i+a;if(l<=i){delete t.groupTitleRect;return}t.groupTitleRect={left:e-o/2,right:e+o/2,top:i,bottom:l}}d(Ko,"assignTopLaneTitleRect");function qo(t){const e=t.direction,n=t.nodes??=[];for(const r of t.nodes??[])r.isGroup&&!r.parentId&&(r.shape="swimlane",e&&(r.direction=e));const o=n.filter(r=>!r.isGroup&&!r.parentId);if(o.length===0)return;let s=n.find(r=>r.id===Mn);s?s.isGroup&&(s.shape="swimlane",e&&(s.direction=e)):(s={id:Mn,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},n.push(s));for(const r of o)r.parentId=Mn}d(qo,"prepareLayoutForSwimlanes");function Jo(t){const e=new Map;for(const a of t.nodes??[])e.set(a.id,a);const n=[];for(const a of t.edges??[]){const l=typeof a.start=="string"?a.start:void 0,g=typeof a.end=="string"?a.end:void 0;!l||!g||a.labelNodeId||n.push({id:a.id,src:l,dst:g,ref:a})}const o=t.nodes??[],s=o.filter(a=>a.isGroup),r=o.filter(a=>!a.isGroup);return{nodes:[...[...s].reverse(),...r].map(a=>a.id),edges:n,layout:t,nodeById:e}}d(Jo,"toGraphView");function Zo(t,e,n,o){const{layout:s}=t,r=t.nodeById,i=o?.layerGap??100,c=o?.nodeGap??40;let a=0;for(const I of e.layers){let u=0;for(const p of I){const f=r.get(p);if(!f){u++;continue}f.layer=a,f.order=u;const y=n.x[p]??u*c,v=n.y[p]??a*i;f.x=y,f.y=v,u++}a++}const l=s.nodes??[],g=new Map,x=[];for(const I of l){if(!I?.isGroup)continue;I.parentId||x.push(I);const u=l.filter(M=>M.parentId===I.id);let p=1/0,f=-1/0,y=1/0,v=-1/0;for(const M of u){const E=M.x??n.x[M.id],T=M.y??n.y[M.id],m=M.width??0,S=M.height??0;E!=null&&T!=null&&(p=Math.min(p,E-m/2),f=Math.max(f,E+m/2),y=Math.min(y,T-S/2),v=Math.max(v,T+S/2))}if(p===1/0||y===1/0)I.x=I.x??0,I.y=I.y??0,I.width=I.width??0,I.height=I.height??0;else{const M=I.padding??20,E=I.parentId?M:2*En(I),T=M,m=Math.max(0,f-p)+E,S=Math.max(0,v-y)+T,A=(p+f)/2,R=(y+v)/2;I.x=A,I.y=R,I.width=m,I.height=S,g.set(I.id,{minX:p,maxX:f,minY:y,maxY:v})}}if(x.length>0&&g.size>0){let I=1/0,u=-1/0,p=0;for(const f of x){const y=f.padding??20;y>p&&(p=y);const v=g.get(f.id);v&&(I=Math.min(I,v.minY),u=Math.max(u,v.maxY))}if(I!==1/0&&u!==-1/0){const f=Math.max(0,u-I),v=Math.max(p,36),M=f+2*v,E=(I+u)/2;for(const k of x)k.y=E,k.height=M,k.swimlaneContentTop=I;const T=[...x].sort((k,O)=>{const _=k.x??0,H=O.x??0;return _-H}),m=[],S=[],A=[];for(const k of T){const O=g.get(k.id);if(!O)continue;const _=Math.max(0,O.maxX-O.minX)+2*En(k),H=(O.minX+O.maxX)/2;m.push(k.id),S.push(H),A.push(_)}const R=m.length;if(R>0){const k=new Map;if(R===1)k.set(m[0],A[0]);else{const O=[];for(let j=0;j0&&s>0?{cx:e,cy:n,rect:Ae(e,n,o,s)}:void 0}d(oo,"measuredNodeRect");function so(t){if(t.isGroup)return;const e=oo(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}d(so,"nodeBoundsInfoFor");function oe(t,e,n=Ft){return Math.abs(t.x-e.x)n}d(Tt,"isHorizontalSegment");function wt(t,e,n=Ft){return ft(t,e,n)&&Math.abs(t.y-e.y)>n}d(wt,"isVerticalSegment");function zt(t,e,n,o){return Math.max(0,Math.min(Math.max(t,e),Math.max(n,o))-Math.max(Math.min(t,e),Math.min(n,o)))}d(zt,"overlapLength");function ce(t,e,n=Ft){return t.horizontal&&e.horizontal&&ht(t.a,e.a,n)?zt(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&ft(t.a,e.a,n)?zt(t.a.y,t.b.y,e.a.y,e.b.y):0}d(ce,"sameAxisSegmentOverlapLength");function Re(t,e=Ft){const n=[];for(let o=0;o0?n[n.length-1]:void 0;(!s||!oe(s,o,e))&&n.push({x:o.x,y:o.y})}return n}d(pt,"dedupeConsecutivePoints");function ro(t,e=Ft){if(!t||t.length!==4)return;const[n,o,s,r]=t;return Tt(n,o,e)&&wt(o,s,e)&&Tt(s,r,e)?{kind:"HVH",p0:n,p1:o,p2:s,p3:r}:wt(n,o,e)&&Tt(o,s,e)&&wt(s,r,e)?{kind:"VHV",p0:n,p1:o,p2:s,p3:r}:void 0}d(ro,"classifyThreeSegmentRoute");function cn(t,e,n,o=0){const s=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),c=Math.max(t.y,e.y);return r>n.left-o&&sn.top-o&&ie.left+n&&t.xe.top+n&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}d(ts,"rectContainsRect");function Je(t,e){return t.lefte.left&&t.tope.top}d(Je,"rectsOverlap");function Tn(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}d(Tn,"inflateRect");function Ae(t,e,n,o){return{left:t-n/2,right:t+n/2,top:e-o/2,bottom:e+o/2}}d(Ae,"rectFromCenterSize");function qt(t){return oo(t)?.rect}d(qt,"rectOfNodeBounds");function Ie(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}d(Ie,"portForRectSide");function co(t,e,n,o,s,r=Ft){const i=e==="left"||e==="right",c=o==="left"||o==="right";if(i&&c){if(e==="right"&&o==="left"&&t.xn.x){if(ht(t,n,r))return[t,n];const x=(t.x+n.x)/2;return[t,{x,y:t.y},{x,y:n.y},n]}if(e===o){if(ht(t,n,r))return;const x=e==="left"?Math.min(t.x,n.x)-s:Math.max(t.x,n.x)+s;return[t,{x,y:t.y},{x,y:n.y},n]}return}if(!i&&!c){if(e===o){if(ft(t,n,r))return;const I=e==="top"?Math.min(t.y,n.y)-s:Math.max(t.y,n.y)+s;return[t,{x:t.x,y:I},{x:n.x,y:I},n]}if(!(e==="bottom"&&o==="top"&&t.yn.y))return;if(ft(t,n,r))return[t,n];const x=(t.y+n.y)/2;return[t,{x:t.x,y:x},{x:n.x,y:x},n]}if(i&&!c){const g=e==="right"&&n.x>t.x||e==="left"&&n.xn.y;return g&&x?[t,{x:n.x,y:t.y},n]:void 0}const a=e==="bottom"&&n.y>t.y||e==="top"&&n.yn.x;return a&&l?[t,{x:t.x,y:n.y},n]:void 0}d(co,"buildOrthogonalPortPath");function ao(t,e,n,o){return e==="left"||e==="right"?[t,{x:o,y:t.y},{x:o,y:n.y},n]:[t,{x:t.x,y:o},{x:n.x,y:o},n]}d(ao,"buildSameSideTrackPath");function an(t){const e=new Map,n=[];for(const o of t){if(o.isEdgeLabel)continue;const s=so(o);s&&(e.set(s.id,s),n.push({id:s.id,rect:s.rect}))}return{nodeInfoById:e,realNodeRects:n}}d(an,"collectRealNodeBounds");function me(t){const e=[],n=[];for(const o of t){const s=so(o);if(!s)continue;const r={id:s.id,rect:s.rect};o.isEdgeLabel?n.push(r):e.push(r)}return{realNodeRects:e,labelNodeRects:n}}d(me,"collectNodeRectEntries");function es(t,{includeEdgeLabels:e=!0}={}){const n=[];for(const o of t){if(o.isGroup||!e&&o.isEdgeLabel)continue;const s=o.x??0,r=o.y??0,i=o.width??0,c=o.height??0;n.push({nodeId:o.id,...Ae(s,r,i,c)})}return n}d(es,"collectLayoutNodeRects");function lo(t,e,n=Ft){const o=t.start,s=t.end;if(!o||!s)return;const r=e.get(o),i=e.get(s);if(!(!r||!i))return{srcId:o,dstId:s,srcInfo:r,dstInfo:i,collinearX:Math.abs(r.cx-i.cx)p||Iv)return!1;const M=Math.abs(f-g.a.x)s:r&&c&&ht(t,n,s)?zt(t.x,e.x,n.x,o.x)>s:!1}d(ns,"sameAxisSegmentsOverlap");function Ze(t,e,n,o,{epsilon:s=Ft,skipDegenerateOther:r=!1}={}){for(const i of n){if(i===o||i.isLayoutOnly)continue;const c=i.points;if(!(!c||c.length<2))for(let a=0;aI+s&&pf+s&&xo+Ft&&t=2?e[e.length-2]:void 0,a=(i?ft(i,s):!1)?{x:s.x,y:r.y}:{x:r.x,y:s.y};e.push(a)}e.push(r)}const n=[];for(const o of e){const s=n[n.length-1];(!s||!oe(s,o))&&n.push(o)}return n}d(Qe,"orthogonalizePolyline");function ae(t){if(t.length<3)return t;let e=[...t];for(let n=0;n<32;n++){const o=ss(e);if(e=o.points,!o.changed)break}return e}d(ae,"simplifyPolyline");var nt=.001,Vr=.5,Oo=4;function uo(t,e,n){const o=t;if(o.isLayoutOnly||!o.points||o.points.length=0&&s=t.length)return t;const r=s-o;if(r<0||r>=t.length)return t;const i=rs(t[s],t[r],e);return n?[i,...t.slice(s)]:[...t.slice(0,s+1),i]}d(An,"clipEndpoint");function is(t,e){for(const n of t){const o=uo(n,e,2);if(!o)continue;let s=[...o.points];o.srcRect&&(s=An(s,o.srcRect,!0)),o.dstRect&&(s=An(s,o.dstRect,!1)),s=ae(Qe(s)),s=ho(s,o.srcRect,o.dstRect),o.edge.points=ae(Qe(s))}}d(is,"clipEdgeEndpointsToNodeBoundaries");function Rn(t,e,n,o=!1){if(ht(t,e,nt)){if(e.yn.bottom+nt)return e;if(o){if(t.xn.right+nt)return{x:n.right,y:t.y}}return{x:Math.abs(e.x-n.left)<=Math.abs(e.x-n.right)?n.left:n.right,y:t.y}}if(ft(t,e,nt)){if(e.xn.right+nt)return e;if(o){if(t.yn.bottom+nt)return{x:t.x,y:n.bottom}}const s=Math.abs(e.y-n.top)<=Math.abs(e.y-n.bottom);return{x:t.x,y:s?n.top:n.bottom}}return e}d(Rn,"snapEndpointToBoundary");function tn(t,e,n){const o=t[e];for(let s=e+n;s>=0&&so.lo)),n=Math.min(...t.map(o=>o.hi));if(!(e>n))return{lo:e,hi:n}}d(cs,"intersectRanges");function On(t,e){return e==="left"||e==="right"?en(t.top,t.bottom):en(t.left,t.right)}d(On,"clearanceRangeForSide");function nn(t,e,n){const o=t.y>=n.top-nt&&t.y<=n.bottom+nt,s=t.x>=n.left-nt&&t.x<=n.right+nt;if(ht(t,e,nt)&&o){if(Math.abs(t.x-n.left)0?cs(r):void 0}d(as,"straightClearanceRange");function Pn(t,e,n,o,s){const r=as(t,e,n,o,s);if(!r)return;const i=s?t.y:t.x,c=Math.min(r.hi,Math.max(r.lo,i));if(!(Math.abs(c-i)({...c}));for(let c=e;c>=0&&c=n.left-nt&&Math.max(t.x,e.x)<=n.right+nt,s=Math.min(t.y,e.y)>=n.top-nt&&Math.max(t.y,e.y)<=n.bottom+nt;if(Math.abs(t.y-n.top)o.bottom+nt;case"left":return ht(e,n,nt)&&n.xo.right+nt}}d(_n,"leavesOutward");function Fn(t,e,n){if(t.length<3)return t;if(n){const r=kn(t[0],t[1],e);return r&&_n(r,t[1],t[2],e)?t.slice(1):t}const o=t.length-1,s=kn(t[o-1],t[o],e);return s&&_n(s,t[o-1],t[o-2],e)?t.slice(0,o):t}d(Fn,"collapseOwnBorderStub");function ds(t,e,n){let o=t;if(e){const r=tn(o,0,1);if(r){const i=Rn(r,o[0],e);i!==o[0]&&(o=[i,...o.slice(1)])}o=Fn(o,e,!0)}if(n){const r=o.length-1,i=tn(o,r,-1);if(i){const c=Rn(i,o[r],n,!0);c!==o[r]&&(o=[...o.slice(0,r),c])}o=Fn(o,n,!1)}const s=ho(o,e,n);return s!==o||o.length===2?s:(e&&(o=Bn(o,e,!0)),n&&(o=Bn(o,n,!1)),o)}d(ds,"snapAndCollapseEndpoints");function Dn(t,e){for(const n of t){const o=uo(n,e,2);if(!o)continue;const s=pt(o.points,nt),r=ds(s,o.srcRect,o.dstRect);if(r.length<3){o.edge.points=r;continue}const i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];o.edge.points=i}}d(Dn,"prepareEdgeEndpointsForRenderer");function go(t){return new Map(t.map(e=>[e.id,e]))}d(go,"buildNodeMap");function us(t,e){let n=t.parentId,o=null;for(;n;){const s=e.get(n);if(!s?.isGroup)break;o=s.id,n=s.parentId}return o}d(us,"resolveTopLevelGroupId");function Hn(t,e){let n=0,o=t.parentId;for(;o;){const s=e.get(o);if(!s?.isGroup)break;n++,o=s.parentId}return n}d(Hn,"groupDepth");function po(t){let e=1/0,n=-1/0,o=1/0,s=-1/0;for(const r of t){const i=r.x,c=r.y;if(typeof i!="number"||typeof c!="number")continue;const a=r.width??0,l=r.height??0;e=Math.min(e,i-a/2),n=Math.max(n,i+a/2),o=Math.min(o,c-l/2),s=Math.max(s,c+l/2)}return e===1/0||o===1/0?null:{minX:e,maxX:n,minY:o,maxY:s}}d(po,"boundsForChildren");function hs(t,e){const n=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+n,t.height=Math.max(0,e.maxY-e.minY)+n}d(hs,"applyGroupBounds");function gs(t){const e=go(t),n=t.filter(o=>o.isGroup&&o.parentId).sort((o,s)=>Hn(s,e)-Hn(o,e));for(const o of n){const s=t.filter(i=>i.parentId===o.id),r=po(s);r&&hs(o,r)}}d(gs,"recomputeNestedGroupBounds");function on(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(a=>!a.isGroup);let r=1/0,i=-1/0;for(const a of s){const l=a[e];typeof l=="number"&&(r=Math.min(r,l),i=Math.max(i,l))}if(!Number.isFinite(r)||!Number.isFinite(i))return!1;const c=d(a=>r+i-a,"mirror");for(const a of n){const l=a[e];typeof l=="number"&&(a[e]=c(l));const g=a.groupTitleRect;g&&(a.groupTitleRect=e==="x"?{...g,left:c(g.right),right:c(g.left)}:{...g,top:c(g.bottom),bottom:c(g.top)})}for(const a of o)for(const l of a.points??[])l[e]=c(l[e]);return!0}d(on,"mirrorAxis");function ps(t){return(t.nodes??[]).some(n=>!n.isGroup)?on(t,"y"):!0}d(ps,"applyBtDirectionTransform");function ms(t,e="LR"){const n=t.nodes??[],o=t.edges??[],s=n.filter(P=>!P.isGroup);let r=1/0,i=1/0;for(const P of s){const G=P.x??0,j=P.y??0;G0?Math.max(1,g/x):1;for(const P of s){const G=P.x??0,J=((P.y??0)-i)*I+c,dt=G-r;P.x=J,P.y=dt}for(const P of o)if(P.points)for(const G of P.points){const j=G.x,dt=(G.y-i)*I+c,mt=j-r;G.x=dt,G.y=mt}gs(n);const u=n.filter(P=>P.isGroup&&!P.parentId);if(u.length===0)return e==="RL"&&on(t,"x"),!0;const p=go(n),f=new Map;for(const P of n){if(P.isGroup)continue;const G=us(P,p);if(!G)continue;const j=f.get(G)??[];j.push(P),f.set(G,j)}let y=0;for(const P of u){const G=P.padding??0;G>y&&(y=G)}const v=[];let M=1/0,E=-1/0;for(const P of u){const G=f.get(P.id)??[],j=po(G);j&&(M=Math.min(M,j.minX),E=Math.max(E,j.maxX),v.push({lane:P,contentTop:j.minY,contentBottom:j.maxY,centerY:(j.minY+j.maxY)/2}))}if(M===1/0||E===-1/0)return!0;const T=Math.max(0,E-M),m=Math.max(y,10),S=T+2*m,A=c+S,O=(M+E)/2-S/2-c,_=O+A/2,H=Math.max(y,c);v.sort((P,G)=>P.centerY-G.centerY);for(let P=0;PI.cy?v.bottom:v.top,H=I.cx+M;if(H<=v.left+se||H>=v.right-se)continue;E={x:H,y:_},T={x:H,y:c.y},m={x:c.x,y:c.y}}else{const _=u.cx>I.cx?v.right:v.left,H=I.cy+M;if(H<=v.top+se||H>=v.bottom-se)continue;E={x:_,y:H},T={x:c.x,y:H},m={x:c.x,y:c.y}}const S=oe(E,T,se),A=oe(T,m,se);if(S&&A||!S&&At(E,T,o,[g],1)||!A&&At(T,m,o,[x],1))continue;const R=!S&&Ze(E,T,t,s,{epsilon:se,skipDegenerateOther:!0}),k=!A&&Ze(T,m,t,s,{epsilon:se,skipDegenerateOther:!0});if(!(R||k)){S?y=[T,m]:A?y=[E,T]:y=[E,T,m];break}}y&&(s.points=y)}}d(ys,"portSwapToLShape");function xs(t,e){const{realNodeRects:r,labelNodeRects:i}=me(e.values());for(const c of t){if(c.isLayoutOnly)continue;const a=c.points;if(!a||a.length<4)continue;const l=pt(a,.001);if(l.length<4)continue;const g=l.length-1,x=l[g],I=l[g-1],u=l[g-2],p=x.x-I.x,f=x.y-I.y,y=Math.hypot(p,f);if(y>=10||y<.001)continue;const v=I.x-u.x,M=I.y-u.y;if(Math.hypot(v,M)<.001)continue;const T=Tt(I,x,.001),m=wt(I,x,.001),S=Tt(u,I,.001),A=wt(u,I,.001);if(!(T&&A||m&&S))continue;const R=c.end,k=c.start,O=R?e.get(R):void 0;if(!O)continue;const _=O.x??0,H=O.y??0,P=qt(O);if(!P)continue;let G,j;if(A){const W=M<0;G={x:_,y:u.y},j={x:_,y:W?P.bottom:P.top}}else{const W=v>0;G={x:u.x,y:H},j={x:W?P.right:P.left,y:H}}if(At(G,j,r,R?[R]:[],-2)||At(G,j,i,[],-2))continue;if(k){const W=e.get(k),et=W?qt(W):void 0;if(et&&io(G,et,2))continue}const J=d((W,et)=>`${W.x.toFixed(3)},${W.y.toFixed(3)}|${et.x.toFixed(3)},${et.y.toFixed(3)}`,"ownSegmentKey"),dt=new Set;for(let W=0;W{for(const at of t){if(at===c||at.isLayoutOnly)continue;const gt=at.points;if(!(!gt||gt.length<2))for(let xt=0;xt=0){const W=l[g-3],et=[k,R].filter(at=>!!at);if(At(W,G,r,et,-2)||mt(W,G))continue}const Pt=[...l.slice(0,g-2),G,j];c.points=Pt;const Q=c.labelNodeId;if(Q){const W=e.get(Q);if(W){const et=W.width??0,at=W.height??0;if(et>0&&at>0){let gt,xt,vt=-1;for(let Vt=0;Vt=et+2||de&&te>=at+2)&&te>vt&&(vt=te,gt=(jt.x+Ut.x)/2,xt=(jt.y+Ut.y)/2)}gt!==void 0&&xt!==void 0&&(W.x=gt,W.y=xt)}}}}}d(xs,"collapseShortTerminalStub");var Z=.001,_t=8,it=Re,In=d((t,e)=>ft(t,e,Z)||ht(t,e,Z),"orthogonallyAligned");function bs(t,e){const s=d((u,p)=>{const f=u.x??0,y=u.y??0,v=p.x-f,M=p.y-y;let E=(u.width??0)/2,T=(u.height??0)/2;return Math.abs(M)*E>Math.abs(v)*T?(M<0&&(T=-T),{x:f+(M===0?0:T*v/M),y:y+T}):(v<0&&(E=-E),{x:f+E,y:y+(v===0?0:E*M/v)})},"rectIntersect"),r=d((u,p)=>{const f=pt(u.points??[]);if(f.length<2)return;const y=p?u.start:u.end,v=y?e.get(y):void 0,M=v?qt(v):void 0;if(!v||!y||!M)return;const E=p?f[0]:f[f.length-1],T=p?f[1]:f[f.length-2],m=s(v,E);let S=E;if(In(T,m)&&(S=T),ft(m,S,Z))return{edge:u,edgeId:String(u.id??""),nodeId:y,atStart:p,orientation:"V",coord:m.x,min:Math.min(m.y,S.y),max:Math.max(m.y,S.y),boundary:m,railEnd:S,rect:M};if(ht(m,S,Z))return{edge:u,edgeId:String(u.id??""),nodeId:y,atStart:p,orientation:"H",coord:m.y,min:Math.min(m.x,S.x),max:Math.max(m.x,S.x),boundary:m,railEnd:S,rect:M}},"terminalLaneFor"),i=d((u,p)=>Math.max(0,Math.min(u.max,p.max)-Math.max(u.min,p.min)),"projectedOverlapLength"),c=d((u,p)=>u.nodeId!==p.nodeId||u.orientation!==p.orientation?!1:u.orientation==="H"?(Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1)&&ft(u.boundary,p.boundary,1):(Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1)&&ht(u.boundary,p.boundary,1),"sameTerminalFace"),a=d((u,p)=>u.nodeId!==p.nodeId||u.orientation!==p.orientation?!1:i(u,p)>=_t&&Math.abs(u.coord-p.coord)<.5,"exactTerminalLaneConflict"),l=d((u,p)=>{if(u.nodeId!==p.nodeId||u.orientation!==p.orientation||u.orientation!=="H"||u.atStart===p.atStart)return!1;const f=i(u,p);if(f<_t)return!1;const y=u.rect.bottom-u.rect.top;return f2*y?!1:c(u,p)&&Math.abs(u.coord-p.coord)<16},"nearTerminalLaneConflict"),g=d((u,p)=>{const f=pt(u.edge.points??[]);if(f.length<2)return;const y=u.orientation==="V"?{x:u.boundary.x+p,y:u.boundary.y}:{x:u.boundary.x,y:u.boundary.y+p},v=u.orientation==="V"?{x:u.railEnd.x+p,y:u.railEnd.y}:{x:u.railEnd.x,y:u.railEnd.y+p};if(!d(()=>Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1?ht(y,u.boundary,Z)&&y.x>=u.rect.left+1&&y.x<=u.rect.right-1:Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1?ft(y,u.boundary,Z)&&y.y>=u.rect.top+1&&y.y<=u.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(u.atStart){const S=f.length>1&&oe(f[1],u.railEnd,Z),A=f.slice(S?2:1),R=A[0];return R&&!In(R,v)?void 0:[y,v,...A]}const E=f.length>1&&oe(f[f.length-2],u.railEnd,Z),T=f.slice(0,E?-2:-1),m=T[T.length-1];if(!(m&&!In(m,v)))return[...T,v,y]},"shiftedCandidate"),x=d(u=>{const p=u.edge,f=pt(p.points??[]);if(f.length!==2)return!1;const y=p.start,v=p.end,M=y?e.get(y):void 0,E=v?e.get(v):void 0;if(!M||!E)return!1;const T=M.x??0,m=M.y??0,S=E.x??0,A=E.y??0,[R,k]=f;return ht(R,k,Z)&&Math.abs(m-A)<1&&Math.abs(T-S)>1||ft(R,k,Z)&&Math.abs(T-S)<1&&Math.abs(m-A)>1},"laneIsStraightCollinearConnector"),I=[-7,7,-14,14,-21,21];for(let u=0;u<8;u++){const p=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[r(y,!0),r(y,!1)]).filter(y=>!!y);let f=!1;for(let y=0;y{const R=x(S),k=x(A);return R!==k?Number(R)-Number(k):+!A.atStart-+!S.atStart});for(const S of m){for(const A of I){const R=g(S,A);if(!R)continue;const k=r({...S.edge,points:R},S.atStart);if(!(!k||p.some(O=>O.edge!==S.edge&&(a(k,O)||T&&l(k,O))))){S.edge.points=R,f=!0;break}}if(f)break}}if(!f)return}}d(bs,"separateSharedRenderedTerminalLanes");function Ms(t,e){const{realNodeRects:o,labelNodeRects:s}=me(e.values()),r=d((c,a)=>{const l=c.start,g=c.end,x=it(a);if(x.length!==a.length-1)return!1;const I=[l,g].filter(u=>!!u);for(const u of x)if(At(u.a,u.b,o,I,-2)||At(u.a,u.b,s,[],-2))return!1;for(const u of t){if(u===c||u.isLayoutOnly)continue;const p=u.points;if(!(!p||p.length<2)){for(const f of x)for(const y of it(pt(p)))if(ce(f,y,.5)>=_t||le(f.a,f.b,y.a,y.b,Z))return!1}}return!0},"candidateIsSafe"),i=d((c,a)=>{if(a+4>=c.length)return;const l=c[a],g=c[a+1],x=c[a+2],I=c[a+3],u=c[a+4],p=Tt(l,g)&&wt(g,x)&&Tt(x,I)&&wt(I,u)&&ft(l,I,Z)&&ft(l,u,Z)&&ft(g,x,Z)&&(g.x-l.x)*(I.x-x.x)<0,f=wt(l,g)&&Tt(g,x)&&wt(x,I)&&Tt(I,u)&&ht(l,I,Z)&&ht(l,u,Z)&&ht(g,x,Z)&&(g.y-l.y)*(I.y-x.y)<0;if(p||f)return pt([...c.slice(0,a+1),u,...c.slice(a+5)]);if(a+5>=c.length)return;const y=c[a+5],v=wt(l,g)&&Tt(g,x)&&wt(x,I)&&Tt(I,u)&&wt(u,y)&&ft(l,u,Z)&&ft(l,y,Z)&&ft(x,I,Z)&&(x.x-g.x)*(u.x-I.x)<0,M=Tt(l,g)&&wt(g,x)&&Tt(x,I)&&wt(I,u)&&Tt(u,y)&&ht(l,u,Z)&&ht(l,y,Z)&&ht(x,I,Z)&&(x.y-g.y)*(u.y-I.y)<0;if(!(!v&&!M))return pt([...c.slice(0,a+1),y,...c.slice(a+6)])},"withoutDogleg");for(let c=0;c<8;c++){let a=!1;for(const l of t){if(l.isLayoutOnly)continue;const g=pt(l.points??[]);for(let x=0;x<=g.length-5;x++){const I=i(g,x);if(!(!I||!r(l,I))){l.points=I,a=!0;break}}if(a)break}if(!a)return}}d(Ms,"collapseRedundantRectangularDoglegs");function Xn(t,e){const{realNodeRects:r,labelNodeRects:i}=me(e.values()),c=t.filter(p=>!p.isLayoutOnly),a=d((p,f,y)=>pt(p===f?y??[]:p.points??[]),"pointsFor"),l=d((p,f)=>{let y=0;for(let v=0;v{const f=it(p);if(f.length!==3)return;const y=f[1];if(!(f[0].horizontal===y.horizontal||f[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),x=d((p,f)=>{const y=[p.start,p.end].filter(v=>!!v);return r.filter(v=>{if(y.includes(v.id))return!1;const M=v.rect;return f.horizontal?zt(f.a.x,f.b.x,M.left,M.right)>=_t&&f.a.y>=M.top-2&&f.a.y<=M.bottom+2:zt(f.a.y,f.b.y,M.top,M.bottom)>=_t&&f.a.x>=M.left-2&&f.a.x<=M.right+2})},"blockingRectsFor"),I=d((p,f,y)=>{const v=p.map(E=>({...E}));if(f.horizontal)v[f.index].y=y,v[f.index+1].y=y;else if(f.vertical)v[f.index].x=y,v[f.index+1].x=y;else return;const M=ae(pt(v));return it(M).length===M.length-1?M:void 0},"candidateByMovingRail"),u=d((p,f,y)=>{const v=[p.start,p.end].filter(E=>!!E),M=it(f);if(M.length!==f.length-1)return!1;for(const E of M)if(At(E.a,E.b,r,v,-2)||At(E.a,E.b,i,[],-2))return!1;for(const E of c)if(E!==p){for(const T of M)for(const m of it(a(E)))if(ce(T,m,.5)>=_t)return!1}return l(p,f)<=y},"candidateIsSafe");for(let p=0;p<8;p++){const f=l();let y=!1;for(const v of c){const M=a(v),E=g(M);if(!E)continue;const T=x(v,E.segment);if(T.length===0)continue;const m=E.horizontal?[Math.min(...T.map(S=>S.rect.top))-20,Math.max(...T.map(S=>S.rect.bottom))+20]:[Math.min(...T.map(S=>S.rect.left))-20,Math.max(...T.map(S=>S.rect.right))+20];for(const S of m){const A=I(M,E.segment,S);if(!(!A||!u(v,A,f))){v.points=A,y=!0;break}}if(y)break}if(!y)return}}d(Xn,"liftObstacleHuggingSameSideRails");function Yn(t,e){const o=d(a=>{const l=a.groupTitleRect;if(!(!l||typeof l.left!="number"||typeof l.right!="number"||typeof l.top!="number"||typeof l.bottom!="number"||!Number.isFinite(l.left)||!Number.isFinite(l.right)||!Number.isFinite(l.top)||!Number.isFinite(l.bottom)||l.right<=l.left||l.bottom<=l.top))return{left:l.left,right:l.right,top:l.top,bottom:l.bottom}},"validTitleRect"),s=d(a=>{if(!a.isGroup||a.parentId)return;const l=a.direction,g=typeof l=="string"?l.toUpperCase():"";if(g==="LR"||g==="RL"||g==="BT")return;const x=o(a),I=a.y,u=a.height;if(!x||typeof I!="number"||typeof u!="number"||!Number.isFinite(I)||!Number.isFinite(u)||u<=0)return;const p=x.right-x.left,f=x.bottom-x.top;if(!(f<=0||p{if(!a.horizontal)return!1;const g=a.a.y;return g<=l.top+Z||g>=l.bottom-Z?!1:zt(a.a.x,a.b.x,l.left,l.right)>=_t},"horizontalSegmentIntersectsTitle"),i=[...e.values()].map(s).filter(a=>!!a);if(i.length===0)return;let c=0;for(const a of t){if(a.isLayoutOnly)continue;const l=pt(a.points??[]);for(const g of it(l))for(const x of i)r(g,x.rect)&&(c=Math.max(c,x.rect.bottom-g.a.y+4))}if(!(c<=Z))for(const a of i){const l=a.node.y,g=a.node.height;typeof l!="number"||typeof g!="number"||!Number.isFinite(l)||!Number.isFinite(g)||g<=0||(a.node.y=l-c/2,a.node.height=g+c,a.node.groupTitleRect={...a.rect,top:a.rect.top-c,bottom:a.rect.bottom-c})}}d(Yn,"liftTopLaneTitleBandsAboveRails");function Gn(t,e){const o=d(l=>{const g=l.groupTitleRect;if(!(!g||typeof g.left!="number"||typeof g.right!="number"||typeof g.top!="number"||typeof g.bottom!="number"||!Number.isFinite(g.left)||!Number.isFinite(g.right)||!Number.isFinite(g.top)||!Number.isFinite(g.bottom)||g.right<=g.left||g.bottom<=g.top))return{left:g.left,right:g.right,top:g.top,bottom:g.bottom}},"validTitleRect"),s=d(l=>{if(!l.isGroup||l.parentId||l.direction!=="LR")return;const x=o(l),I=l.x,u=l.width;if(!x||typeof I!="number"||typeof u!="number"||!Number.isFinite(I)||!Number.isFinite(u)||u<=0)return;const p=x.right-x.left,f=x.bottom-x.top;if(!(p<=0||f{if(!l.vertical)return!1;const x=l.a.x;return x<=g.left+Z||x>=g.right-Z?!1:zt(l.a.y,l.b.y,g.top,g.bottom)>=_t},"verticalSegmentIntersectsTitle"),i=d((l,g)=>{if(!l.horizontal)return!1;const x=l.a.y;return x<=g.top+Z||x>=g.bottom-Z?!1:zt(l.a.x,l.b.x,g.left,g.right)>=_t},"horizontalSegmentIntersectsTitle"),c=[...e.values()].map(s).filter(l=>!!l);if(c.length===0)return;let a=0;for(const l of t){if(l.isLayoutOnly)continue;const g=pt(l.points??[]);for(const x of it(g))for(const I of c)if(r(x,I.rect))a=Math.max(a,I.rect.right-x.a.x+4);else if(i(x,I.rect)){const u=Math.min(x.a.x,x.b.x);a=Math.max(a,I.rect.right-u+4)}}if(!(a<=Z))for(const l of c){const g=l.node.x,x=l.node.width;typeof g!="number"||typeof x!="number"||!Number.isFinite(g)||!Number.isFinite(x)||x<=0||(l.node.x=g-a/2,l.node.width=x+a,l.node.groupTitleRect={...l.rect,left:l.rect.left-a,right:l.rect.right-a})}}d(Gn,"shiftLeftLaneTitleBandsLeftOfRails");function Is(t,e){const{realNodeRects:o}=me(e.values()),s=t.filter(p=>!p.isLayoutOnly),r=d((p,f=new Map)=>pt(f.get(p)??p.points??[]),"replacementPointsFor"),i=d((p=new Map)=>{let f=0;for(let y=0;ys.reduce((f,y)=>f+Qt(r(y,p)),0),"totalBends"),a=d(p=>{const f=r(p);if(f.length<4)return;const y=f[f.length-2],v=f[f.length-1];if(!(!Tt(y,v,Z)&&!wt(y,v,Z)))return{tailStart:y,terminal:v}},"terminalTailFor"),l=d((p,f)=>{const y=r(p);if(y.length<3)return;const v=y[0],M=y[1];let E;if(Tt(v,M,Z))E={x:M.x,y:f.tailStart.y};else if(wt(v,M,Z))E={x:f.tailStart.x,y:M.y};else return;const T=ae(pt([v,M,E,f.tailStart,f.terminal]));return it(T).length===T.length-1?T:void 0},"candidateWithDestinationTail"),g=d((p,f)=>{const y=[p.start,p.end].filter(v=>!!v);for(const v of it(f))if(At(v.a,v.b,o,y,-2))return!0;return!1},"pathHasNodeHit"),x=d((p,f,y)=>{for(const v of s)if(v!==p){for(const M of it(f))for(const E of it(r(v,y)))if(ce(M,E,.5)>=_t)return!0}return!1},"pathHasSharedTrack"),I=d((p,f,y)=>!g(p,f)&&!x(p,f,y),"candidateIsSafe"),u=d(()=>{const p=new Map;for(const f of s){const y=f.end;if(!y||!e.has(y)||r(f).length<4)continue;const M=p.get(y)??[];M.push(f),p.set(y,M)}return p},"edgesByDestination");for(let p=0;p<4;p++){const f=i();if(f===0)return;const y=c();let v,M=f,E=y;for(const T of u().values())for(let m=0;m=f||G>M||G===M&&j>=E||(v=P,M=G,E=j)}if(!v)return;for(const[T,m]of v)T.points=m}}d(Is,"swapDestinationTerminalTailsToReduceCrossings");function Ss(t,e){const{realNodeRects:r,labelNodeRects:i}=me(e.values()),c=t.filter(T=>!T.isLayoutOnly),a=d((T,m=new Map)=>pt(m.get(T)??T.points??[]),"replacementPointsFor"),l=d((T=new Map)=>{let m=0;for(let S=0;Sc.reduce((m,S)=>m+Qt(a(S,T)),0),"totalBends"),x=d(T=>{const m=T.start,S=T.end,A=m?e.get(m):void 0,R=S?e.get(S):void 0,k=A?qt(A):void 0,O=R?qt(R):void 0;return k&&O?{src:k,dst:O}:void 0},"endpointRectsFor"),I=d((T,m,S)=>{if(S.index<=0||S.index+1>=m.length-1)return;const A=x(T);if(A){if(S.vertical){const R=S.a.x,k=Math.min(A.src.left,A.dst.left),O=Math.max(A.src.right,A.dst.right),_=RO+Z?"right":void 0;return _?{edge:T,points:m,segmentIndex:S.index,axis:"vertical",side:_,coord:R,min:Math.min(S.a.y,S.b.y),max:Math.max(S.a.y,S.b.y)}:void 0}if(S.horizontal){const R=S.a.y,k=Math.min(A.src.top,A.dst.top),O=Math.max(A.src.bottom,A.dst.bottom),_=RO+Z?"bottom":void 0;return _?{edge:T,points:m,segmentIndex:S.index,axis:"horizontal",side:_,coord:R,min:Math.min(S.a.x,S.b.x),max:Math.max(S.a.x,S.b.x)}:void 0}}},"externalRailForSegment"),u=d(()=>{const T=[];for(const m of c){const S=a(m);for(const A of it(S)){const R=I(m,S,A);R&&T.push(R)}}return T},"collectExternalRails"),p=d((T,m)=>T.edge!==m.edge&&T.axis===m.axis&&T.side===m.side&&zt(T.min,T.max,m.min,m.max)>=_t,"railsInteract"),f=d(T=>{const m=[],S=new Set;for(const A of T){if(S.has(A))continue;const R=[A],k=[];for(S.add(A);R.length>0;){const O=R.pop();k.push(O);for(const _ of T)!S.has(_)&&p(O,_)&&(S.add(_),R.push(_))}k.length>1&&m.push(k)}return m},"connectedComponents"),y=d(T=>{const m=[];for(const S of T)m.some(A=>Math.abs(A-S.coord){const m=T.map(R=>R.coord),S=y(T),A=[];if(T.length<=6){const R=new Array(S.length).fill(!1),k=[],O=d(()=>{if(k.length===T.length){k.some((_,H)=>Math.abs(_-m[H])>=Z)&&A.push([...k]);return}for(const[_,H]of S.entries())R[_]||(R[_]=!0,k.push(H),O(),k.pop(),R[_]=!1)},"visit");return O(),A}for(let R=0;R{const S=new Map;for(const[R,k]of T.entries()){const O=m[R],_=S.get(k.edge)??k.points.map(H=>({x:H.x,y:H.y}));k.axis==="vertical"?(_[k.segmentIndex].x=O,_[k.segmentIndex+1].x=O):(_[k.segmentIndex].y=O,_[k.segmentIndex+1].y=O),S.set(k.edge,_)}const A=new Map;for(const[R,k]of S){const O=ae(pt(k));if(it(O).length!==O.length-1)return;A.set(R,O)}return A},"replacementsForAssignment"),E=d(T=>{for(const[m,S]of T){const A=[m.start,m.end].filter(R=>!!R);for(const R of it(S))if(At(R.a,R.b,r,A,-2)||At(R.a,R.b,i,[],-2))return!1}for(let m=0;m=_t)return!1}}return!0},"candidateIsSafe");for(let T=0;T<4;T++){const m=l();if(m===0)return;let S,A=m,R=g(),k=Number.POSITIVE_INFINITY;for(const O of f(u()))for(const _ of v(O)){const H=M(O,_);if(!H||!E(H))continue;const P=l(H);if(P>=m)continue;const G=g(H),j=O.reduce((J,dt,mt)=>J+Math.abs(_[mt]-dt.coord),0);P>A||P===A&&(G>R||G===R&&j>=k)||(S=H,A=P,R=G,k=j)}if(!S)return;for(const[O,_]of S)O.points=_}}d(Ss,"reassignCrossingExternalRailChannels");function Cs(t,e){const{realNodeRects:o,labelNodeRects:s}=me(e.values()),r=t.filter(u=>!u.isLayoutOnly),i=d((u,p,f)=>pt(u===p?f??[]:u.points??[]),"pointsFor"),c=d(u=>it(u).reduce((p,f)=>{const y=f.a.x-f.b.x,v=f.a.y-f.b.y;return p+Math.hypot(y,v)},0),"pathLength"),a=d((u,p)=>{let f=0;for(let y=0;y{if(u.horizontal){const f=u.a.y;return(Math.abs(f-p.top)<1||Math.abs(f-p.bottom)<1)&&zt(u.a.x,u.b.x,p.left,p.right)>=_t}if(u.vertical){const f=u.a.x;return(Math.abs(f-p.left)<1||Math.abs(f-p.right)<1)&&zt(u.a.y,u.b.y,p.top,p.bottom)>=_t}return!1},"segmentRunsAlongRectBorder"),g=d(u=>{const p=[u.start,u.end].filter(y=>!!y),f=[];for(const y of p){const v=e.get(y),M=v?qt(v):void 0;M&&f.push(M)}return f},"endpointRectsFor"),x=d((u,p)=>{if(p+3>=u.length)return[];const f=u[p],y=u[p+1],v=u[p+2],M=u[p+3],E=Tt(f,y,Z)&&wt(y,v,Z)&&Tt(v,M,Z),T=wt(f,y,Z)&&Tt(y,v,Z)&&wt(v,M,Z);if(!E&&!T)return[];if(!(E?Math.sign(y.x-f.x)!==Math.sign(M.x-v.x):Math.sign(y.y-f.y)!==Math.sign(M.y-v.y)))return[];const S=ft(f,M,Z)||ht(f,M,Z)?[]:[{x:f.x,y:M.y},{x:M.x,y:f.y}],A=S.length===0?[[...u.slice(0,p+1),...u.slice(p+3)]]:S.map(k=>[...u.slice(0,p+1),k,...u.slice(p+3)]),R=new Set;return A.map(k=>ae(pt(k))).filter(k=>{if(it(k).length!==k.length-1||!k.some(_=>oe(_,M,Z)))return!1;const O=k.map(_=>`${_.x.toFixed(3)},${_.y.toFixed(3)}`).join("|");return R.has(O)?!1:(R.add(O),!0)})},"shortcutCandidatesAt"),I=d((u,p,f)=>{const y=[u.start,u.end].filter(M=>!!M),v=g(u);for(const M of it(p))if(At(M.a,M.b,o,y,-2)||At(M.a,M.b,s,[],-2)||v.some(E=>l(M,E)))return!1;for(const M of r)if(M!==u){for(const E of it(p))for(const T of it(i(M)))if(ce(E,T,.5)>=_t)return!1}return a(u,p)<=f},"candidateIsSafe");for(let u=0;u<8;u++){const p=a();let f,y,v=p,M=Number.POSITIVE_INFINITY,E=Number.POSITIVE_INFINITY;for(const T of r){const m=i(T),S=Qt(m,Z),A=c(m);for(let R=0;R<=m.length-4;R++)for(const k of x(m,R)){const O=Qt(k,Z),_=c(k);if(!(Ov||P===v&&(O>M||O===M&&_>=E)||(f=T,y=k,v=P,M=O,E=_)}}if(!f||!y)return;f.points=y}}d(Cs,"shortcutRedundantOrthogonalJogs");function vs(t,e){const i=[];for(const N of e.values()){if(N.isGroup||N.isEdgeLabel)continue;const F=N.x??0,D=N.y??0,V=qt(N);V&&i.push({id:String(N.id??""),cx:F,cy:D,rect:V})}if(i.length===0)return;const c=new Map(i.map(N=>[N.id,N])),a=i.map(N=>({id:N.id,rect:N.rect})),l=["top","bottom","left","right"],g={top:Math.min(...i.map(N=>N.rect.top))-20,bottom:Math.max(...i.map(N=>N.rect.bottom))+20,left:Math.min(...i.map(N=>N.rect.left))-20,right:Math.max(...i.map(N=>N.rect.right))+20},x=t.filter(N=>!N.isLayoutOnly),I=new Map(x.map((N,F)=>[N,F])),u=d(N=>{const F=N==="left"||N==="top"?-1:1,D=[];for(let V=0;V<=2;V++)D.push(g[N]+F*20*V);return D},"outwardTracksForSide"),p=d((N,F=new Map)=>pt(F.get(N)??N.points??[]),"replacementPointsFor"),f=d((N,F)=>{let D=0;for(const V of N)for(const h of F)le(V.a,V.b,h.a,h.b,Z)&&D++;return D},"crossingCountBetweenSegments"),y=d((N,F)=>f(it(N),it(F)),"crossingCountBetweenPaths"),v=d((N=new Map)=>{let F=0;const D=[],V=new Set,h=[],b=d(C=>{V.has(C)||(V.add(C),h.push(C))},"addEdge");for(let C=0;C0&&(F+=q,D.push({first:L,second:U,count:q}),b(L),b(U))}}return h.sort((C,L)=>(I.get(C)??0)-(I.get(L)??0)),{count:F,pairs:D,edgeSet:V,edges:h}},"crossingSnapshot"),M=d((N,F)=>{const D=new Set(F.keys());if(D.size===0)return N.count;let V=0;for(const b of N.pairs)(D.has(b.first)||D.has(b.second))&&(V+=b.count);let h=0;for(let b=0;b{const F=new Map;for(const h of N.pairs){const b=F.get(h.first)??new Set;b.add(h.second),F.set(h.first,b);const C=F.get(h.second)??new Set;C.add(h.first),F.set(h.second,C)}const D=[],V=new Set;for(const h of N.edges){if(V.has(h))continue;const b=[h],C=[];for(V.add(h);b.length>0;){const L=b.pop();C.push(L);for(const w of F.get(L)??[])V.has(w)||(V.add(w),b.push(w))}C.sort((L,w)=>(I.get(L)??0)-(I.get(w)??0)),C.length>1&&D.push(C)}return D},"crossingComponents"),T=d(N=>[N.start,N.end].filter(F=>!!F),"endpointIdsFor"),m=d(N=>{const F=[];for(const D of E(N)){const V=new Set(D),h=new Set(D.flatMap(C=>T(C))),b=[...D];for(const C of x)V.has(C)||T(C).some(L=>h.has(L))&&b.push(C);b.sort((C,L)=>(I.get(C)??0)-(I.get(L)??0)),F.push(b)}return F},"pairSearchGroups"),S=d((N,F,D)=>M(N,new Map([[F,D]])),"crossingCountWithSingleReplacement"),A=d(N=>{const F=new Map;for(const D of N.pairs)F.set(D.first,(F.get(D.first)??0)+D.count),F.set(D.second,(F.get(D.second)??0)+D.count);return F},"currentCrossingsByEdge"),R=d(N=>N.slice(1).reduce((F,D,V)=>{const h=N[V];return F+Math.abs(D.x-h.x)+Math.abs(D.y-h.y)},0),"pathLength"),k=d((N=new Map)=>x.reduce((F,D)=>F+Qt(p(D,N)),0),"totalBends"),O=d((N=new Map)=>x.reduce((F,D)=>F+R(p(D,N)),0),"totalLength"),_=d((N,F,D=new Map)=>{const V=it(F);for(const h of x)if(h!==N){for(const b of V)for(const C of it(p(h,D)))if(ce(b,C,.5)>=_t)return!0}return!1},"pathHasSegmentConflict"),H=d((N,F)=>{const D=[N.start,N.end].filter(V=>!!V);for(const V of it(F))if(At(V.a,V.b,a,D,-2))return!0;return!1},"pathHitsNode"),P=d((N,F)=>{const D=ae(pt(F));it(D).length===D.length-1&&N.push(D)},"pushOrthogonalCandidate"),G=d(N=>N==="left"||N==="right","sideIsHorizontal"),j=d((N,F,D)=>{switch(F){case"left":return Math.min(N.x,D.x)-20;case"right":return Math.max(N.x,D.x)+20;case"top":return Math.min(N.y,D.y)-20;case"bottom":return Math.max(N.y,D.y)+20}},"localTrackForSameSide"),J=d((N,F,D,V)=>{const h=D==="left"||D==="top"?-1:1,b=[j(F,D,V),g[D]];for(const C of b)for(let L=0;L<=2;L++)P(N,ao(F,D,V,C+h*20*L))},"addSameSideCandidates"),dt=d((N,F,D,V,h)=>{for(const b of u(D))for(const C of u(h))P(N,[F,{x:b,y:F.y},{x:b,y:C},{x:V.x,y:C},V])},"addHorizontalToVerticalCandidates"),mt=d((N,F,D,V,h)=>{for(const b of u(D))for(const C of u(h))P(N,[F,{x:F.x,y:b},{x:C,y:b},{x:C,y:V.y},V])},"addVerticalToHorizontalCandidates"),kt=d((N,F,D,V,h)=>{const b=[...u("top"),...u("bottom")];for(const C of u(D))for(const L of u(h))for(const w of b)P(N,[F,{x:C,y:F.y},{x:C,y:w},{x:L,y:w},{x:L,y:V.y},V])},"addHorizontalPairCandidates"),Pt=d((N,F,D,V,h)=>{const b=[...u("left"),...u("right")];for(const C of u(D))for(const L of u(h))for(const w of b)P(N,[F,{x:F.x,y:C},{x:w,y:C},{x:w,y:L},{x:V.x,y:L},V])},"addVerticalPairCandidates"),Q=d(N=>{const F=new Set;return N.map(D=>pt(D)).filter(D=>{const V=D.map(h=>`${h.x.toFixed(3)},${h.y.toFixed(3)}`).join("|");return F.has(V)||D.length<2?!1:(F.add(V),!0)})},"dedupeCandidatePaths"),W=d((N,F,D,V)=>{const h=[],b=co(N,F,D,V,20,Z);b&&P(h,b),F===V&&J(h,N,F,D);const C=G(F),L=G(V);return C&&!L?dt(h,N,F,D,V):!C&&L?mt(h,N,F,D,V):C?kt(h,N,F,D,V):Pt(h,N,F,D,V),Q(h)},"buildCandidatesForSides"),et=d((N,F,D,V)=>{const h=[...u("left"),...u("right")],b=[...u("top"),...u("bottom")];for(const C of l){const L=Ie(V,C),w=C==="top"||C==="bottom"?u(C):b;for(const B of h){P(N,[F,D,{x:B,y:D.y},{x:B,y:L.y},L]);for(const U of w)P(N,[F,D,{x:B,y:D.y},{x:B,y:U},{x:L.x,y:U},L])}}},"addVerticalDepartureOuterTrackCandidates"),at=d((N,F,D,V)=>{const h=[...u("left"),...u("right")],b=[...u("top"),...u("bottom")];for(const C of l){const L=Ie(V,C),w=C==="left"||C==="right"?u(C):h;for(const B of b){P(N,[F,D,{x:D.x,y:B},{x:L.x,y:B},L]);for(const U of w)P(N,[F,D,{x:D.x,y:B},{x:U,y:B},{x:U,y:L.y},L])}}},"addHorizontalDepartureOuterTrackCandidates"),gt=d(N=>{const F=N.start,D=N.end,V=D?c.get(D):void 0;if(!F||!V)return[];const h=pt(N.points??[]);if(h.length<4)return[];const b=h[0],C=h[1],L=[];return wt(b,C,Z)?et(L,b,C,V):Tt(b,C,Z)&&at(L,b,C,V),L},"terminalPreservingOuterTrackCandidates"),xt=d(N=>{const F=N.start,D=N.end,V=F?c.get(F):void 0,h=D?c.get(D):void 0;if(!V||!h)return[];const b=[];for(const C of l){const L=Ie(V,C);for(const w of l)b.push(...W(L,C,Ie(h,w),w))}return b.push(...gt(N)),b},"candidatePathsFor"),vt=d(()=>new Map(x.map(N=>[N,it(p(N))])),"currentSegmentsByEdge"),Vt=d((N,F,D)=>{const V=new Set;for(const h of x){if(h===N)continue;const b=D.get(h)??it(p(h));F.some(C=>b.some(L=>ce(C,L,.5)>=_t))&&V.add(h)}return V},"sharedTrackConflictsFor"),jt=d((N,F,D,V)=>{const h=new Set;return xt(N).map(C=>ae(pt(C))).filter(C=>{if(H(N,C))return!1;const L=C.map(w=>`${w.x.toFixed(3)},${w.y.toFixed(3)}`).join("|");return h.has(L)||C.length<2?!1:(h.add(L),!0)}).map(C=>{const L=it(C);let w=0;for(const B of x)B!==N&&(w+=f(L,D.get(B)??it(p(B))));return{candidate:C,candidateSegments:L,crossings:F.count-(V.get(N)??0)+w,bends:Qt(C,Z),totalBends:Qt(C),length:R(C)}}).filter(({crossings:C})=>C<=F.count).sort((C,L)=>C.crossings-L.crossings||C.bends-L.bends||C.length-L.length).slice(0,48).map(C=>({path:C.candidate,segments:C.candidateSegments,sharedTrackConflicts:Vt(N,C.candidateSegments,D),totalBends:C.totalBends,length:C.length}))},"pairCandidatesFor"),Ut=d((N,F,D,V,h,b)=>{let C=0;for(const w of N.pairs)(w.first===F||w.second===F||w.first===V||w.second===V)&&(C+=w.count);let L=f(D.segments,h.segments);for(const w of x){if(w===F||w===V)continue;const B=b.get(w)??it(p(w));L+=f(D.segments,B)+f(h.segments,B)}return N.count-C+L},"pairCrossingCount"),te=d((N,F)=>{for(const D of N.sharedTrackConflicts)if(D!==F)return!1;return!0},"conflictsOnlyWith"),Se=d((N,F)=>N.segments.some(D=>F.segments.some(V=>ce(D,V,.5)>=_t)),"candidatesShareTrack"),de=d((N,F,D,V)=>te(F,D.edge)&&te(V,N.edge)&&!Se(F,V),"pairCandidatesAreCompatible"),Ce=d((N,F,D,V,h)=>{const b=Ut(N.current,F.edge,D,V.edge,h,N.baseSegments);if(!(b>=N.current.count))return{replacements:new Map([[F.edge,D.path],[V.edge,h.path]]),crossings:b,bends:N.currentBends-(N.baseBendsByEdge.get(F.edge)??0)-(N.baseBendsByEdge.get(V.edge)??0)+D.totalBends+h.totalBends,length:N.currentLength-(N.baseLengthByEdge.get(F.edge)??0)-(N.baseLengthByEdge.get(V.edge)??0)+D.length+h.length}},"scorePairReplacement"),dn=d((N,F)=>N.crossings{let h=V;for(const b of F.candidates)for(const C of D.candidates){if(!de(F,b,D,C))continue;const L=Ce(N,F,b,D,C);L&&dn(L,h)&&(h=L)}return h},"bestScoreForOptionPair"),hn=d(N=>{const F=k(),D=O(),V=vt(),h=A(N),b=new Map(x.map(q=>[q,Qt(p(q))])),C=new Map(x.map(q=>[q,R(p(q))])),L=new Map,w=m(N);for(const q of w)for(const z of q){if(L.has(z))continue;const Y=jt(z,N,V,h);Y.length>0&&L.set(z,{edge:z,candidates:Y})}let B={replacements:new Map,crossings:N.count,bends:F,length:D};const U={current:N,currentBends:F,currentLength:D,baseBendsByEdge:b,baseLengthByEdge:C,baseSegments:V};for(const q of w){const z=new Set(q.filter(ot=>N.edgeSet.has(ot))),Y=q.map(ot=>L.get(ot)).filter(ot=>!!ot);for(let ot=0;ot0?B.replacements:void 0},"bestPairedReplacement");for(let N=0;N<4;N++){const F=v(),D=F.count;if(D===0)return;let V,h,b=D,C=Number.POSITIVE_INFINITY;for(const w of F.edges){const B=Qt(p(w),Z);for(const U of xt(w)){const q=H(w,U),z=!q&&_(w,U),Y=S(F,w,U),ot=Qt(U,Z);q||z||!(Yb||Y===b&&ot>=C||(V=w,h=U,b=Y,C=ot)}}if(V&&h){V.points=h;continue}const L=hn(F);if(!L)return;for(const[w,B]of L)w.points=B}}d(vs,"resolveRenderedOrthogonalCrossings");var pe=.001,Wr=8;function Ls(t,e){const{nodeInfoById:n,realNodeRects:o}=an(e),s=["top","bottom","left","right"],r=20,i={top:Math.min(...o.map(f=>f.rect.top))-r,bottom:Math.max(...o.map(f=>f.rect.bottom))+r,left:Math.min(...o.map(f=>f.rect.left))-r,right:Math.max(...o.map(f=>f.rect.right))+r},c=d((f,y,v,M)=>{const E=[],T=co(f,y,v,M,r,pe);return T&&E.push(T),y===M&&E.push(ao(f,y,v,i[y])),E},"buildOrthogonalPathCandidates"),a=d((f,y)=>{for(let v=0;v{let M=0;const E=Re(f,pe),T=y.start,m=y.end;for(const S of t){if(S===y||S.isLayoutOnly)continue;const A=S.start,R=S.end;if(!v&&T&&m&&(A===T||A===m||R===T||R===m))continue;const k=S.points;if(!(!k||k.length<2))for(const O of E)for(const _ of Re(k,pe)){if(fo(O.a,O.b,_.a,_.b,pe,pe)){M++;continue}ce(O,_,pe)>=Wr&&M++}}return M},"pathConflictCount"),g=4,x=d((f,y)=>{const v=Math.abs(f.y-y.rect.top),M=Math.abs(f.y-y.rect.bottom),E=Math.abs(f.x-y.rect.left),T=Math.abs(f.x-y.rect.right);let m="top",S=v;return M{const M=I.get(f)??[];M.push({side:y,edgeId:v}),I.set(f,M)},"addFaceClaim");for(const f of t){if(f.isLayoutOnly)continue;const y=f.points??[];if(y.length<1)continue;const v=f.id??"",M=f.start,E=f.end;if(M){const T=n.get(M);T&&u(M,x(y[0],T),v)}if(E){const T=n.get(E);T&&u(E,x(y[y.length-1],T),v)}}const p=d((f,y,v)=>I.get(f)?.some(M=>M.edgeId!==v&&M.side===y)??!1,"faceIsClaimed");for(const f of t){if(f.isLayoutOnly)continue;const y=f.points;if(!y||y.length<2)continue;const v=Qt(y,pe);if(v0){const mt=l(J,f,!0);if(mt>O||mt===O&&dt>=_)continue;O=mt,_=dt,k=J;continue}l(J,f)>R||dt<_&&(_=dt,k=J)}}}if(k){f.points=k;const H=I.get(M);H&&I.set(M,H.filter(G=>G.edgeId!==S));const P=I.get(E);P&&I.set(E,P.filter(G=>G.edgeId!==S)),u(M,x(k[0],T),S),u(E,x(k[k.length-1],m),S)}}}d(Ls,"simplifyDetouredEdges");var Kt=.001,Po=10,Ve=7;function $n(t,e){const n=e?0:t.length-1,o=e?1:-1,s=t[n],r=t[n+o];if(!s||!r)return;const i=r.x-s.x,c=r.y-s.y;if(!(Math.abs(i)+Math.abs(c)r&&Je(t,Es(r)))}d(zn,"labelOverlapsOwnMarker");function Ue(t,e){const n=[];for(const p of t){if(p.isLayoutOnly)continue;const f=p.points;if(!(!f||f.length<2))for(let y=0;y{const y=Tn(f,r);for(const{nodeId:v,rect:M}of o)if(v!==p&&Je(y,M))return!0;return!1},"labelOverlapsForeignNode"),l=d((p,f)=>{const y=Tn(f,r);for(const v of n)if(v.edgeId!==p&&cn(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),g=d((p,f,y)=>a(p,y)||l(f,y),"labelOverlapsAnything"),x=[],I=d(p=>{for(const{id:f,rect:y}of s)if(ts(y,p))return f},"findContainingLane"),u=d((p,f)=>x.some(y=>y.labelId!==p&&Je(f,y.rect)),"overlapsPlacedLabel");for(const p of t){if(p.isLayoutOnly)continue;const f=p.labelNodeId;if(!f)continue;const y=e.get(f);if(!y)continue;const v=p.points;if(!v||v.length<2)continue;const M=y.width??0,E=y.height??0;if(M<=0||E<=0)continue;const T=[];for(let Q=0;Q=Kt&>>=Kt||T.push({idx:Q,length:at+gt,orientation:at>=Kt?"horizontal":"vertical",midX:(W.x+et.x)/2,midY:(W.y+et.y)/2})}if(T.length===0)continue;const m=T.length>=3?T.filter(Q=>Q.idx>0&&Q.idx0?m:T,A=M>=E?"horizontal":"vertical",R=d(Q=>[...Q].sort((W,et)=>{const at=W.orientation===A,gt=et.orientation===A;if(at!==gt)return at?-1:1;const xt=W.length>=(W.orientation==="horizontal"?M:E)+2,vt=et.length>=(et.orientation==="horizontal"?M:E)+2;return xt!==vt?xt?-1:1:et.length-W.length}),"rankSegments"),k=T[0],O=T[T.length-1],_=[.5,.25,.75,.05,.95,.15,.85,.1,.9],H=d((Q,W)=>{const et=v[Q.idx],at=v[Q.idx+1];return{midX:et.x+(at.x-et.x)*W,midY:et.y+(at.y-et.y)*W}},"anchorAtT"),P=d((Q,W,et)=>Math.min(et,Math.max(W,Q)),"clamp"),G=d((Q,W)=>Q.midX>=W.left-Kt&&Q.midX<=W.right+Kt&&Q.midY>=W.top-Kt&&Q.midY<=W.bottom+Kt,"pointInsideRectInclusive"),j=d(Q=>{const W=Ae(Q.midX,Q.midY,M,E),et=I(W);if(et)return{laneId:et,anchor:Q,rect:W};const at=s.find(({rect:te})=>G(Q,te));if(!at)return;const gt=at.rect.left+M/2+i,xt=at.rect.right-M/2-i,vt=at.rect.top+E/2+i,Vt=at.rect.bottom-E/2-i;if(gt>xt||vt>Vt)return;const jt={midX:P(Q.midX,gt,xt),midY:P(Q.midY,vt,Vt)},Ut=Ae(jt.midX,jt.midY,M,E);return G(Q,Ut)?{laneId:at.id,anchor:jt,rect:Ut}:void 0},"placementForAnchor"),J=d((Q,W,et)=>Q.orientation==="horizontal"?Math.abs(W.midX-et.x):Math.abs(W.midY-et.y),"distanceAlongSegment"),dt=d((Q,W)=>{const at=(Q.orientation==="horizontal"?M/2:E/2)+c;if(Q===k){const gt=v[Q.idx];if(J(Q,W,gt)+Kt{const W=R(Q);for(const et of W)for(const at of _){const gt=H(et,at);if(!dt(et,gt))continue;const xt=j(gt);if(xt&&!zn(xt.rect,v)&&!u(f,xt.rect)&&!g(f,p.id,xt.rect))return{laneId:xt.laneId,anchor:xt.anchor}}},"tryPool"),kt=d((Q,W,et=!1)=>{const at=R(Q);for(const gt of at){const xt={midX:gt.midX,midY:gt.midY};if(W&&!dt(gt,xt))continue;const vt=j(xt);if(vt&&!zn(vt.rect,v)&&!u(f,vt.rect)&&!a(f,vt.rect)&&(et||!l(p.id,vt.rect)))return{laneId:vt.laneId,anchor:vt.anchor}}},"findLaneContainingFallback"),Pt=mt(S)??(S.lengthet.labelId===f);W>=0?x[W]={labelId:f,rect:Q}:x.push({labelId:f,rect:Q})}}}d(Ue,"anchorLabelsToPolyline");var Sn=1e-6,Kr=8,Bo=Kr/2,qr=3;function Vn(t,e){return t{const g=Vn(c,a);let x=0;const I=d(u=>{if(!u)return;const p=s.get(u);if(!p)return;const f=l==="x"?p.w/2:p.h/2;f>x&&(x=f)},"consider");I(i.labelNodeId);for(const u of t){if(u===i||u.isLayoutOnly)continue;const p=u.start,f=u.end;!p||!f||Vn(p,f)===g&&I(u.labelNodeId)}return x>0?x+qr:0},"labelClearanceFor");for(const i of t){if(i.isLayoutOnly)continue;const c=i.points;if(!ro(c,Sn))continue;const a=lo(i,n,Sn);if(!a)continue;const{srcId:l,dstId:g,srcInfo:x,dstInfo:I,collinearX:u,collinearY:p}=a;if(u===p)continue;let f,y;if(u){const m=I.cy>x.cy;f={x:x.cx,y:m?x.rect.bottom:x.rect.top},y={x:I.cx,y:m?I.rect.top:I.rect.bottom}}else{const m=I.cx>x.cx;f={x:m?x.rect.right:x.rect.left,y:x.cy},y={x:m?I.rect.left:I.rect.right,y:I.cy}}if(At(f,y,o,[l,g],1))continue;const M=r(i,l,g,u?"x":"y"),E=M>Bo?M:Bo,T=[0,E,-E];for(const m of T){const S={...f},A={...y};if(u){if(S.x+=m,A.x+=m,S.x<=x.rect.left||S.x>=x.rect.right||A.x<=I.rect.left||A.x>=I.rect.right)continue}else if(S.y+=m,A.y+=m,S.y<=x.rect.top||S.y>=x.rect.bottom||A.y<=I.rect.top||A.y>=I.rect.bottom)continue;if(!At(S,A,o,[l,g],1)&&!Ze(S,A,t,i,{epsilon:Sn})){i.points=[S,A];break}}}}d(Ts,"straightenCollinearSiblingDetours");function jn(t,e){const{realNodeRects:a,labelNodeRects:l}=me(e.values()),g=d((m,S)=>Re(S,.001).map(A=>({...A,edge:m,interior:A.index>=1&&A.index<=S.length-3})),"segmentsFor"),x=d(()=>{const m=[];for(const S of t){if(S.isLayoutOnly)continue;const A=S.points;!A||A.length<2||m.push(...g(S,pt(A)))}return m},"allSegments"),I=d((m,S)=>m.horizontal&&S.horizontal?zt(m.a.x,m.b.x,S.a.x,S.b.x)>=8&&Math.abs(m.a.y-S.a.y)<7:m.vertical&&S.vertical?zt(m.a.y,m.b.y,S.a.y,S.b.y)>=8&&Math.abs(m.a.x-S.a.x)<7:!1,"hasCrowdedParallelTrack"),u=d((m,S)=>{const A=m.start,R=m.end,k=g(m,S);if(k.length!==S.length-1)return!1;const O=[A,R].filter(H=>!!H),_=m.labelNodeId?[m.labelNodeId]:[];for(const H of k)if(At(H.a,H.b,a,O,-2)||At(H.a,H.b,l,_,-2))return!1;for(const H of t){if(H===m||H.isLayoutOnly)continue;const P=H.points;if(!(!P||P.length<2)){for(const G of k)for(const j of g(H,pt(P)))if(I(G,j)||le(G.a,G.b,j.a,j.b,.001))return!1}}return!0},"candidateIsSafe"),p=d((m,S)=>{const A=pt(m.edge.points??[]);if(A.length<4||m.index>=A.length-1)return;const R=A.map(k=>({...k}));if(m.horizontal)R[m.index].y+=S,R[m.index+1].y+=S;else if(m.vertical)R[m.index].x+=S,R[m.index+1].x+=S;else return;return g(m.edge,R).length===R.length-1?R:void 0},"shiftedCandidate"),f=d((m,S)=>({x:m.x??(S.left+S.right)/2,y:m.y??(S.top+S.bottom)/2}),"nodeCenter"),y=d(m=>{const S=m.edge,A=pt(S.points??[]);if(A.length!==4||m.index!==1)return;const R=S.start?e.get(S.start):void 0,k=S.end?e.get(S.end):void 0,O=R?qt(R):void 0,_=k?qt(k):void 0,H=A.slice(m.index+2);if(!(!R||!k||!O||!_||H.length===0))return{sourceCenter:f(R,O),targetCenter:f(k,_),sourceRect:O,tail:H}},"sourceDetourContextFor"),v=d((m,S,A,R,k,O)=>{const _=R.y>=A.y,H=_?k.bottom:k.top,P=H+(_?20:-20);if(_&&m.b.y<=P+.001||!_&&m.b.y>=P-.001)return;const G=m.a.x+S;return pt([{x:A.x,y:H},{x:A.x,y:P},{x:G,y:P},{x:G,y:m.b.y},...O],.001)},"verticalSourceDetour"),M=d((m,S,A,R,k,O)=>{const _=R.x>=A.x,H=_?k.right:k.left,P=H+(_?20:-20);if(_&&m.b.x<=P+.001||!_&&m.b.x>=P-.001)return;const G=m.a.y+S;return pt([{x:H,y:A.y},{x:P,y:A.y},{x:P,y:G},{x:m.b.x,y:G},...O],.001)},"horizontalSourceDetour"),E=d((m,S)=>{const A=y(m);if(A){if(m.vertical)return v(m,S,A.sourceCenter,A.targetCenter,A.sourceRect,A.tail);if(m.horizontal)return M(m,S,A.sourceCenter,A.targetCenter,A.sourceRect,A.tail)}},"sourceDetourCandidate"),T=[-7,7,-14,14,-21,21];for(let m=0;m<12;m++){const S=x();let A=!1;for(let R=0;RP.interior);for(const P of H){for(const G of T){const j=p(P,G);if(j&&u(P.edge,j)){P.edge.points=j,A=!0;break}const J=E(P,G);if(J&&u(P.edge,J)){P.edge.points=J,A=!0;break}}if(A)break}}if(!A)return}}d(jn,"nudgeSharedInteriorSubpaths");function ws(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=o.x-n.x,c=o.y-n.y,a=s*c-r*i;if(Math.abs(a)<1e-10)return!1;const l=n.x-t.x,g=n.y-t.y,x=(l*c-g*i)/a,I=(l*r-g*s)/a,u=.01;return x>u&&x<1-u&&I>u&&I<1-u}d(ws,"segmentsIntersect");function As(t){const e=t.nodes??[],n=t.edges??[],o=[];if(!n.length||!e.length)return o;const s=es(e),r=[];for(const c of n){if(c.isLayoutOnly)continue;const a=c.points;if(!a||a.length<2)continue;const l=c.start,g=c.end,x=c.labelNodeId,I=c.id??`${l}->${g}`;for(const u of s)if(!(u.nodeId===l||u.nodeId===g)&&!(x&&u.nodeId===x)){for(let p=0;p0){const c=o.filter(l=>l.type==="edge-node-overlap").length,a=o.filter(l=>l.type==="edge-edge-crossing").length;Ke.warn(`[SWIMLANE_VALIDATE] ${o.length} issue(s) detected: ${c} edge-node overlap(s), ${a} edge crossing(s)`);for(const l of o)Ke.warn(`[SWIMLANE_VALIDATE] ${l.type}: ${l.detail}`)}return o}d(As,"validateSwimlanesLayout");function Rs(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(c=>!c.isGroup);if((e==="LR"||e==="RL")&&s.length>0&&!ms(t,e)||e==="BT"&&s.length>0&&!ps(t))return;for(const c of o){if(c.isLayoutOnly)continue;const a=c.points;!a||a.length<2||(c.points=ae(Qe(a)))}Ls(o,n),Ts(o,n),ys(o,n);const r=new Map;for(const c of n)r.set(String(c.id),c);Ue(o,r),is(o,r),xs(o,r),jn(o,r),bs(o,r),Ms(o,r),Xn(o,r),Is(o,r);const i=d(()=>{vs(o,r),Ss(o,r),Cs(o,r),Ue(o,r),Dn(o,r),Xn(o,r),Ue(o,r),Dn(o,r)},"finalizeRenderedEdges");i(),jn(o,r),i(),Yn(o,r),Gn(o,r),Yn(o,r),Gn(o,r)}d(Rs,"postProcessSwimlaneLayout");function ye(t){const e=new Map(t.nodeById),n=new Set,o=[];for(const r of t.edges){if(!e.has(r.src)||!e.has(r.dst))continue;const i=`${r.id}:${r.src}->${r.dst}`;n.has(i)||(n.add(i),o.push(r))}return{nodes:[...e.keys()],edges:o,layout:t.layout,nodeById:e}}d(ye,"normalizeGraph");function mo(t,e){return t.edges.filter(n=>n.dst===e)}d(mo,"incoming");function Ns(t){const e=new Map;for(const n of t.nodes)e.set(n,[]);for(const n of t.edges)e.get(n.src).push(n.dst);return e}d(Ns,"buildSuccessorMap");function yo(t){const e=Ns(t);for(const n of e.values())n.sort((o,s)=>o.localeCompare(s));return e}d(yo,"buildSortedSuccessorMap");function xo(t){const e=new Map;for(const n of t.nodes)e.set(n,0);for(const n of t.edges)e.set(n.dst,(e.get(n.dst)??0)+1);return e}d(xo,"buildInDegreeMap");function bo(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,n)=>e.localeCompare(n))}d(bo,"sortedZeroInDegreeNodes");function ln(t,e=()=>!0){const n=new Map,o=new Map;for(const s of t.nodes)n.set(s,[]),o.set(s,[]);for(const s of t.edges)e(s)&&(o.get(s.src).push(s.dst),n.get(s.dst).push(s.src));return{preds:n,succs:o}}d(ln,"buildPredecessorSuccessorMaps");function Mo(t,e,n,o){let s=0;for(const i of t.nodes)o?.skipGroups&&t.nodeById.get(i)?.isGroup||(s=Math.max(s,n[i]??0));const r=Array.from({length:s+1},()=>[]);for(const i of e)o?.skipGroups&&t.nodeById.get(i)?.isGroup||r[Math.max(0,n[i]??0)].push(i);return r}d(Mo,"buildLayersFromRanks");function Be(t){const e=xo(t),n=bo(e),o=[],s=yo(t);for(;n.length;){const r=n.shift();o.push(r);for(const i of s.get(r)??[])if(e.set(i,(e.get(i)??0)-1),(e.get(i)??0)===0){let c=0;for(;c{if(s-o<=1)return 0;const r=o+s>>1;let i=n(o,r)+n(r,s),c=o,a=r,l=o;for(;c=s||cx.dst===I.dst?x.id.localeCompare(I.id):x.dst.localeCompare(I.dst));const o=Object.create(null);for(const g of e.nodes)o[g]=0;const s=[],r=d(g=>{o[g]=1;for(const x of n.get(g)??[]){const I=x.dst;o[I]===0?r(I):o[I]===1&&s.push(x)}o[g]=2},"dfs"),i=[...e.nodes].sort((g,x)=>g.localeCompare(x));for(const g of i)o[g]===0&&r(g);const c=new Set(s.map(g=>`${g.id}:${g.src}->${g.dst}`)),a=e.edges.map(g=>c.has(`${g.id}:${g.src}->${g.dst}`)?{id:g.id,src:g.dst,dst:g.src,weight:g.weight,ref:g.ref}:g);return{acyclic:{nodes:[...e.nodes],edges:a,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:s}}d(Os,"removeCycles_DFS");function Ps(t){const e=new Map,n=d(o=>{if(e.has(o))return e.get(o);const s=t.nodeById.get(o);if(!s)return e.set(o,null),null;const r=s.parentId;if(!r)return e.set(o,null),null;const c=n(r)??r;return e.set(o,c),c},"resolve");for(const o of t.nodes)n(o);return e}d(Ps,"buildTopLaneMap");function fe(t){const e=Ps(t);return n=>e.get(n)??null}d(fe,"createTopLaneResolver");function fn(t){const e=[];for(const n of t.layout.nodes??[])n.isGroup&&!n.parentId&&e.push(n.id);return[...new Set(e)].reverse()}d(fn,"buildTopLaneOrder");function So(t,e){const n=fn(t);if(!e||e.length===0)return n;const o=new Set(n),s=new Set,r=[];for(const i of e)!o.has(i)||s.has(i)||(s.add(i),r.push(i));for(const i of n)s.has(i)||r.push(i);return r}d(So,"resolveTopLaneOrder");var Jr={EPSILON:1e-6},sn={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},ko={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Bs(t,e){const n=ye(t),o=e?.laneOf??(()=>null),s=e?.rankHint,{preds:r}=ln(n);for(const m of r.values())m.sort((S,A)=>S.localeCompare(A));const i=Be(n)??[...n.nodes].sort((m,S)=>m.localeCompare(S)),c=new Map;for(const[m,S]of i.entries())c.set(S,m);const a=new Map,l=new Map;for(const m of n.nodes)l.set(m,[]);for(const m of i){const S=(r.get(m)??[]).filter(A=>a.has(A));if(S.length>0){const A=ks(m,S,{laneOf:o,rankHint:s,topoIndex:c});a.set(m,A),l.get(A).push(m)}else a.has(m)||a.set(m,null)}for(const m of n.nodes)a.has(m)||a.set(m,null);const g=new Set;for(const m of n.nodes)(a.get(m)??null)===null&&g.add(m);const x=[...g].sort((m,S)=>{const A=c.get(m)??0,R=c.get(S)??0;return A===R?m.localeCompare(S):A-R}),I=_s(n),u=new Map;for(const[m,S]of I.entries())u.set(m,[...S].sort((A,R)=>A.localeCompare(R)));const p=Fs(u),f=Ds(u),y=new Map;for(const m of n.nodes)y.set(m,[]);for(const m of f)for(const S of m.nodes){const A=y.get(S);A?A.push(m.id):y.set(S,[m.id])}const v=[],M=[],E=new Set,T=d(m=>{if(!E.has(m)){E.add(m),v.push(m);for(const S of l.get(m)??[])T(S);M.push(m)}},"walk");for(const m of x)T(m);for(const m of i)T(m);return{parent:a,children:l,roots:x,componentOf:p,blocks:f,nodeBlocks:y,adjacency:u,preorder:v,postorder:M,topologicalOrder:i}}d(Bs,"buildDrivingTree");function ks(t,e,n){const o=n.laneOf(t);return[...e].sort((r,i)=>{const c=n.laneOf(r),a=n.laneOf(i),l=c!=null&&c===o,g=a!=null&&a===o;if(l!==g)return l?-1:1;const x=n.rankHint?.[r],I=n.rankHint?.[i];if(x!=null&&I!=null&&x!==I)return I-x;const u=n.topoIndex.get(r)??0,p=n.topoIndex.get(i)??0;return u!==p?u-p:r.localeCompare(i)})[0]}d(ks,"chooseParent");function _s(t){const e=new Map;for(const n of t.nodes)e.set(n,new Set);for(const n of t.edges)e.get(n.src).add(n.dst),e.get(n.dst).add(n.src);return e}d(_s,"buildAdjacency");function Fs(t){const e=new Map;let n=0;for(const o of t.keys()){if(e.has(o))continue;const s=[o];for(;s.length>0;){const r=s.pop();if(!e.has(r)){e.set(r,n);for(const i of t.get(r)??[])e.has(i)||s.push(i)}}n++}return e}d(Fs,"assignComponents");function Ds(t){const e=new Map,n=new Map,o=[],s=[];let r=0;const i=d((c,a)=>{e.set(c,++r),n.set(c,r);for(const l of t.get(c)??[])l!==a&&(e.has(l)?(e.get(l)??0)<(e.get(c)??0)&&(o.push([c,l]),n.set(c,Math.min(n.get(c)??r,e.get(l)??r))):(o.push([c,l]),i(l,c),n.set(c,Math.min(n.get(c)??r,n.get(l)??r)),(n.get(l)??0)>=(e.get(c)??0)&&s.push(Hs(c,l,o,s.length))))},"visit");for(const c of t.keys())e.has(c)||i(c,null);return s}d(Ds,"computeBlocks");function Hs(t,e,n,o){const s=[],r=new Set;for(;n.length>0;){const i=n.pop();if(s.push(i),r.add(i[0]),r.add(i[1]),i[0]===t&&i[1]===e||i[0]===e&&i[1]===t)break}return{id:o,edges:s,nodes:[...r]}}d(Hs,"popBlock");function Xs(t,e,n){const o=[...t.nodes],s=new Map;for(const[M,E]of o.entries())s.set(E,M);const r=o.length,i=new Array(r).fill(-1),c=new Array(r).fill(0),a=[],l=new Set;for(const M of o){const E=n.parent.get(M)??null,T=s.get(M);T!=null&&E==null&&(i[T]=-1,c[T]=0,l.has(M)||(l.add(M),a.push(M)))}for(;a.length>0;){const M=a.shift(),E=s.get(M);if(E==null)continue;const T=n.children.get(M)??[];for(const m of T){if(l.has(m))continue;const S=s.get(m);S!=null&&(i[S]=E,c[S]=c[E]+1,l.add(m),a.push(m))}}for(const M of o){if(l.has(M))continue;const E=s.get(M);E!=null&&(i[E]=-1,c[E]=0,l.add(M))}const g=Math.max(1,Math.ceil(Math.log2(Math.max(1,r)))+1),x=Array.from({length:g},()=>new Array(r).fill(-1));for(let M=0;M{if(M===-1||E===-1)return-1;c[M]>m&1&&(M=x[m][M],M===-1))return-1;if(M===E)return M;for(let m=g-1;m>=0;m--){const S=x[m][M],A=x[m][E];S===-1||A===-1||S!==A&&(M=S,E=A)}return x[0][M]},"lcaIndex"),u=Array.from({length:r},()=>new Map);for(const M of t.edges){let E=M.src,T=M.dst,m=e[E],S=e[T];if(m==null||S==null||(m>S&&([E,T]=[T,E],[m,S]=[S,m]),m==null||S==null||m===S))continue;const A=s.get(E),R=s.get(T);if(A==null||R==null)continue;const k=I(A,R);if(k===-1)continue;const O=u[k];for(let _=m;_{if(E.size!==0)for(const[T,m]of E)M.set(T,(M.get(T)??0)+m)},"mergeInto"),y=new Set,v=d(M=>{const E=s.get(M);y.add(M);const T=E==null?void 0:u[E],m=T?new Map(T):new Map,S=n.children.get(M)??[];for(const A of S){const R=v(A),k=e[M];if(k!=null){let O=p.get(M);O||(O=new Map,p.set(M,O));let _=R.get(k)??0;const H=e[A];H!=null&&H>k&&(_+=1),O.set(A,_)}f(m,R)}return m},"dfs");for(const M of n.roots)y.has(M)||v(M);for(const M of o)y.has(M)||v(M);return p}d(Xs,"computeSubtreeCrossCounts");function Ys(t,e,n){const o=new Map,s=d(r=>{let i=n[r]??0;const c=[...e.get(r)??[]];c.sort(Co(n));for(const a of c){s(a);const l=o.get(a);l!=null&&(i=Math.min(i,l))}o.set(r,i)},"annotate");for(const r of t)s(r);return o}d(Ys,"annotateMinimumLayers");function Co(t){return(e,n)=>{const o=t[e]??0,s=t[n]??0;return o===s?e.localeCompare(n):o-s}}d(Co,"compareByRankThenId");function Gs(t,e,n,o){let s=0;for(const a of e){const l=n[a]??0;l>s&&(s=l)}const r=Array.from({length:s+1},()=>[]),i=new Set,c=d(a=>{if(i.has(a))return;i.add(a);const l=n[a]??0;r[l]||(r[l]=[]),r[l].push(a);for(const g of o(a))c(g)},"emit");for(const a of t)c(a);for(const a of e)if(!i.has(a)){const l=n[a]??0;r[l]||(r[l]=[]),r[l].push(a),i.add(a)}return r}d(Gs,"emitNodesInTreeOrder");function $s(t){const e=[];for(const n of t){const o=new Set,s=[];for(const r of n)o.has(r)||(o.add(r),s.push(r));e.push(s)}return e}d($s,"deduplicateLayers");function zs(t,e,n,o){return s=>{const r=t.get(s)??[];if(r.length===0)return[];const i=e[s]??0,c=[],a=[],l=n.get(s);for(const g of r){const x=o.get(g)??i;x>i?c.push({child:g,min:x}):a.push(g)}return c.sort((g,x)=>g.min===x.min?g.child.localeCompare(x.child):g.min-x.min),a.sort((g,x)=>{const I=l?.get(g)??0,u=l?.get(x)??0;if(I!==u)return I-u;const p=o.get(g)??i,f=o.get(x)??i;return p!==f?p-f:g.localeCompare(x)}),[...c.map(g=>g.child),...a]}}d(zs,"createChildOrderer");function rn(t,e,n){const o=Bs(t,{rankHint:e,laneOf:n}),{children:s,roots:r}=o;for(const x of t.nodes)s.has(x)||s.set(x,[]);const i=Xs(t,e,o),c=[...r].sort(Co(e)),a=Ys(c,s,e),l=zs(s,e,i,a);let g=Gs(c,t.nodes,e,l);return g=$s(g),g}d(rn,"buildMultitreeLayerOrder");function Vs(t,e,n){const o=new Set(t),s=new Set(e),r=Ne(e),i=[];for(const c of n)o.has(c.src)&&s.has(c.dst)&&i.push(r.get(c.dst));return Io(i)}d(Vs,"countCrossingsBetweenAdjacent");function Un(t,e,n){const o=[];for(const r of e){const i=n[r.src],c=n[r.dst];if(i==null||c==null||i===c)continue;let a=r.src,l=r.dst,g=i,x=c;i>c&&(a=r.dst,l=r.src,g=c,x=i);for(let I=g;I(n[I]??0)-(n[x]??0));for(const x of g){const I=n[x]??0;if(I===0)continue;let u=0;for(const v of o.get(x)??[])u=Math.max(u,(n[v]??0)+1);if(u>=I)continue;const p=I;n[x]=u;const f=rn(t,n,s),y=Un(f,t.edges,n);y(e[s]??0)-(e[r]??0)||s.localeCompare(r));for(const s of o){const r=n(s);if(!r)continue;const i=t.edges.filter(f=>f.src===s);if(i.length===0)continue;let c=!1,a=0;for(const f of i){const y=n(f.dst);y==null||y===r?c=!0:a++}if(a===0||c)continue;let l=0,g=!1;for(const f of t.edges){if(f.dst!==s)continue;const y=n(f.src);y&&(y===r?g=!0:l++)}if(l>0||!g)continue;const x=e[s]??0,I=x+a;let u=0;for(const f of t.edges)f.dst===s&&(u=Math.max(u,(e[f.src]??0)+1));const p=Math.max(x,u,I);p!==x&&(e[s]=p)}}d(Us,"adjustCrossLaneSources");function Ws(t,e){const n=ye(t),o=Be(n)??[...n.nodes].sort(),s=e?.compactSingleInput??!1,r=fe(n);let i=Object.create(null);for(const a of o){const l=mo(n,a),g=e?.ignoreCrossLaneEdges?l.filter(x=>{const I=r(x.src),u=r(a);return!I||!u?!0:I===u}):l;if(g.length===0)i[a]=0;else if(s&&g.length===1){const x=g[0].src,I=r(x),u=r(a);I!==u?i[a]=i[x]??0:i[a]=(i[x]??0)+1}else{let x=-1/0;for(const I of g)x=Math.max(x,(i[I.src]??0)+1);i[a]=x===-1/0?0:x}}return(e?.optimizeRanksByCrossings??!1)&&(i=js(n,i)),e?.ignoreCrossLaneEdges&&Us(n,i),{layers:rn(n,i,r),rankOf:i,dummy:new Set}}d(Ws,"assignLayers_LongestPath");function Ks(t,e){const n=ye(t),s={...Ws(n,{compactSingleInput:e?.compactSingleInput,ignoreCrossLaneEdges:e?.ignoreCrossLaneEdges,optimizeRanksByCrossings:e?.optimizeRanksByCrossings}).rankOf},r=fe(n),{preds:i,succs:c}=ln(n,p=>{if(e?.ignoreCrossLaneEdges){const f=r(p.src),y=r(p.dst);if(f&&y&&f!==y)return!1}return!0}),a=Be(n)??[...n.nodes],l=[...a].reverse(),g=d((p,f)=>{let y=0;for(const E of i.get(p)??[])y=Math.max(y,(s[E]??0)+1);let v=Number.POSITIVE_INFINITY;const M=c.get(p)??[];return M.length>0&&(v=Math.min(...M.map(E=>(s[E]??0)-1))),Number.isFinite(v)||(v=Math.max(y,f)),Math.min(Math.max(f,y),v)},"clampFeasible"),x=sn.GRAVITY_ITERATIONS,I=d(p=>{let f=!1;for(const y of p){const v=i.get(y)??[],M=c.get(y)??[];if(v.length===0&&M.length===0)continue;const E=v.length>0?v.reduce((A,R)=>A+(s[R]??0)+1,0)/v.length:s[y]??0,T=M.length>0?M.reduce((A,R)=>A+(s[R]??0)-1,0)/M.length:s[y]??0,m=Math.round((E+T)/2),S=g(y,m);S!==s[y]&&(s[y]=S,f=!0)}return f},"relaxOrder");for(let p=0;p0){const y=Math.min(...f.map(v=>(s[v]??0)-1));(s[p]??0)>y&&(s[p]=y)}}return{layers:Mo(n,a,s),rankOf:s,dummy:new Set}}d(Ks,"assignLayers_Gravity");function qs(t){const e=xo(t),n=yo(t);let o=bo(e);const s=[];for(;o.length>0;){const r=[];for(const i of o){s.push(i);for(const c of n.get(i)??[])e.set(c,(e.get(c)??0)-1),(e.get(c)??0)===0&&r.push(c)}o=r.sort((i,c)=>i.localeCompare(c))}return s.length===t.nodes.length?s:null}d(qs,"topoSortByGenerationIfAcyclic");function Js(t,e){const n=ye(t),o=e?.direction==="LR"?qs(n)??[...n.nodes].sort():Be(n)??[...n.nodes].sort(),s=fe(n),r=d(g=>s(g)??g,"laneOf"),i=Object.create(null),c=new Map,a=d((g,x)=>e?.ignoreCrossLaneEdges??!0?r(g)===r(x)?1:0:1,"edgeWeight");for(const g of o){if(n.nodeById.get(g)?.isGroup)continue;const I=mo(n,g);let u=0;if(I.length>0)for(const v of I){const M=v.src,E=i[M]??0;u=Math.max(u,E+a(M,g))}const p=r(g),f=c.get(p)??0,y=Math.max(u,f);i[g]=y,c.set(p,y+1)}return{layers:Mo(n,o,i,{skipGroups:!0}),rankOf:i,dummy:new Set}}d(Js,"assignLayers_LaneAwareCompact");function Zs(t,e){const n=ye(e),{rankOf:o}=t,s=t.layers.map(u=>[...u]),r=new Set(t.dummy?[...t.dummy]:[]);let i=0;const c=new Map(n.nodeById),a=d(u=>{const p=`placeholder-${i++}`,f={id:p,isGroup:!1,isDummy:!0,width:0,height:0};for(c.set(p,f),r.add(p);s.length<=u;)s.push([]);return s[u].push(p),o[p]=u,p},"addDummyAt"),l=[...n.edges].sort((u,p)=>u.id===p.id?u.src===p.src?u.dst.localeCompare(p.dst):u.src.localeCompare(p.src):u.id.localeCompare(p.id)),g=[];for(const u of l){const p=o[u.src]??0,f=o[u.dst]??0;if(f-p<=1){g.push(u);continue}let y=u.src;for(let M=p+1,E=0;M!n.nodes.includes(u))],edges:g,layout:n.layout,nodeById:c};return{layering:{layers:s,rankOf:o,dummy:r},graphWithDummies:I}}d(Zs,"makeProperLayering");function Wn(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const n=[...t].sort((o,s)=>o-s);return e%2===1?n[(e-1)/2]:.5*(n[e/2-1]+n[e/2])}d(Wn,"median");function Kn(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((n,o)=>n+o,0)/t.length}d(Kn,"barycenter");function Qs(t,e,n,o){const s=new Map;for(const r of t)s.set(r,[]);for(const r of n)o==="down"?e.has(r.src)&&s.has(r.dst)&&s.get(r.dst).push(e.get(r.src)):e.has(r.dst)&&s.has(r.src)&&s.get(r.src).push(e.get(r.dst));return s}d(Qs,"neighborPositionsFor");function tr(t,e,n){const o=n.get(t)??0,s=n.get(e)??0;return o!==s?o-s:t.localeCompare(e)}d(tr,"currentOrderTieBreak");function qn(t,e,n){const o=new Set(t),s=new Set(e),r=Ne(t),i=Ne(e),c=[];for(const l of n)o.has(l.src)&&s.has(l.dst)&&c.push({u:r.get(l.src),v:i.get(l.dst)});c.sort((l,g)=>l.u===g.u?l.v-g.v:l.u-g.u);const a=c.map(l=>l.v);return Io(a)}d(qn,"countCrossingsBetweenAdjacent");function We(t,e,n){return[...t].sort((o,s)=>{const r=Wn(e.get(o)??[]),i=Wn(e.get(s)??[]);return r===i?tr(o,s,n):isFinite(r)?isFinite(i)?r-i:-1:1})}d(We,"sortByHeuristic");function Jn(t,e,n,o,s,r){const i=Ne(t),c=Ne(e),a=Qs(e,i,n,o);if(!s||!r||r.length===0)return We(e,a,c);const l=new Map;for(const I of e){const u=s(I),p=l.get(u)??[];p.push(I),l.set(u,p)}const g=[];for(const I of r){const u=l.get(I);if(!u||u.length===0)continue;const p=We(u,a,c);g.push(...p)}const x=l.get(null);if(x&&x.length>0){const I=We(x,a,c);for(const u of I){const p=Kn(a.get(u)??[]);let f=g.length;if(isFinite(p))for(const[y,v]of g.entries()){const M=Kn(a.get(v)??[]);if(pi.has(f.src)&&c.has(f.dst)),g=a?n.filter(f=>c.has(f.src)&&a.has(f.dst)):void 0,x=d(f=>{let y=qn(t,f,l);return g&&o&&(y+=qn(f,o,g)),y},"crossingScore"),I=s?new Map:null;if(s&&I)for(const f of e)I.set(f,s(f));let u=!0,p=x(r);for(;u;){u=!1;for(let f=0;f+1[...c]),s=e.edges,r=fe(e),i=So(e,n?.laneOrder);for(let c=0;c<3;c++){for(let a=1;a=0;a--)o[a]=Jn(o[a+1],o[a],s,"up",r,i),o[a]=Zn(o[a+1],o[a],s,o[a-1],r)}return{layers:o}}d(er,"orderLayers");function nr(t,e,n){const o=n?.layerGap??ko.DEFAULT_LAYER_GAP,s=n?.nodeGap??ko.DEFAULT_NODE_GAP,r=n?.laneGap??s*2,i=n?.direction??"TB",c=i==="LR"||i==="RL",a=t.layers,l=Object.create(null),g=Object.create(null),x=d(O=>e.nodeById.get(O),"getNode"),I=d(O=>x(O)?.width??0,"getWidth"),u=d(O=>x(O)?.height??0,"getHeight"),p=fe(e),f=So(e,n?.laneOrder),y=a.map(O=>O.reduce((_,H)=>Math.max(_,u(H)),0)),v=[];if(c)for(let O=0;O+1Math.max(mt,I(kt)),0),H=a[O+1].reduce((mt,kt)=>Math.max(mt,I(kt)),0),P=y[O],G=y[O+1],j=P/2+G/2,J=(_+H)/2,dt=Math.max(0,J-j-o);v.push(dt)}const M=new Set;for(const O of a)for(const _ of O)M.add(p(_));const E=M.has(null),T=f.filter(O=>M.has(O)),m=[...E?[null]:[],...T],S=Object.create(null);for(const O of T)S[O]=0;E&&(S.null=0);for(const O of a){const _=Object.create(null),H=[];for(const P of O){const G=p(P);G===null?H.push(P):(_[G]||=[]).push(P)}for(const[P,G]of Object.entries(_)){const j=G.reduce((J,dt)=>J+I(dt),0)+s*Math.max(0,G.length-1);S[P]=Math.max(S[P]??0,j)}if(E&&H.length){const P=H.reduce((G,j)=>G+I(j),0)+s*Math.max(0,H.length-1);S.null=Math.max(S.null??0,P)}}const A=new Map;{const O=m.map(P=>(P===null?S.null:S[P])??0);let H=-(O.reduce((P,G)=>P+G,0)+r*Math.max(0,m.length-1))/2;for(let P=0;PI(Q)),kt=mt.reduce((Q,W)=>Q+W,0)+s*(J.length-1);let Pt=dt-kt/2;for(const[Q,W]of J.entries()){const et=mt[Q];l[W]=Pt+et/2,g[W]=R+H/2,Pt+=et+s}}}const G=v[O]??0;R+=H+o+G}const k=new Map;for(const O of e.edges){const _=O.ref.id;k.has(_)||k.set(_,[]),k.get(_).push(O)}for(const[,O]of k){if(O.length===0)continue;const _=O[0].ref,H=_.start,P=_.end;if(H==null||P==null)continue;const G=Math.round(((l[H]??0)+(l[P]??0))/2),j=new Set;for(const J of O)j.add(J.src),j.add(J.dst);for(const J of j){if(J===H||J===P)continue;e.nodeById.get(J)?.isDummy&&(l[J]=G)}}return{x:l,y:g}}d(nr,"assignCoordinates");var or=8;function sr(t){let e=2166136261;for(let n=0;n>>0}d(sr,"hashString");function rr(t){let e=t>>>0;return()=>{e+=1831565813;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}d(rr,"mulberry32");function ir(t,e){const n=[...t],o=rr(e);for(let s=n.length-1;s>0;s--){const r=Math.floor(o()*(s+1));[n[s],n[r]]=[n[r],n[s]]}return n}d(ir,"deterministicShuffle");function cr(t,e){let n=0;for(const[o,s]of t.entries())n+=Math.abs(o-(e.get(s)??o));return n}d(cr,"sourceDistance");function Qn(t,e){const n=new Map;for(const[s,r]of t.entries())n.set(r,s);let o=0;for(const{a:s,b:r,weight:i}of e){const c=n.get(s),a=n.get(r);c==null||a==null||(o+=i*Math.abs(c-a))}return o}d(Qn,"laneArrangementCost");function ar(t){const e=fn(t);if(e.length<2)return[];const n=new Map(e.map((r,i)=>[r,i])),o=fe(t),s=new Map;for(const r of t.layout.edges??[]){if(r.isLayoutOnly)continue;const i=typeof r.start=="string"?r.start:void 0,c=typeof r.end=="string"?r.end:void 0;if(!i||!c||!t.nodeById.has(i)||!t.nodeById.has(c))continue;const a=o(i),l=o(c);if(!a||!l||a===l)continue;const g=n.get(a),x=n.get(l);if(g==null||x==null)continue;const[I,u]=g<=x?[a,l]:[l,a],p=`${I}\0${u}`,f=s.get(p);f?f.weight++:s.set(p,{a:I,b:u,weight:1})}return[...s.values()]}d(ar,"buildWeightedLaneEdges");function to(t,e,n){const o=[...t];let s=Qn(o,e),r=!0,i=0;const c=Math.max(1,o.length);for(;r&&is.a===r.a?s.b.localeCompare(r.b):s.a.localeCompare(r.a)).map(({a:s,b:r,weight:i})=>`${s}:${r}:${i}`).join("|");return sr(`${t.join("|")}#${o}#${n}`)}d(fr,"seedForRestart");function dr(t,e={}){const n=fn(t);if(n.length<2)return n;const o=ar(t);if(o.length===0)return n;const s=new Map(n.map((c,a)=>[c,a]));let r=to(n,o,s);const i=Math.max(0,e.restarts??or);for(let c=0;cct&&a*3>=c?i>0?"bottom":"top":c>ct?r>0?"right":"left":n}d(eo,"chooseOrthogonalSide");function no(t,e){return Math.abs(t.to-e.from)h.isGroup&&!h.parentId);for(const h of l){const b={id:h.id},C=d(L=>{i.set(L.id,b),n.filter(w=>w.parentId===L.id).forEach(C)},"assignLane");C(h)}const g=n.filter(h=>!h.isGroup&&!h.isEdgeLabel).map(h=>{const b=h.width??10,C=h.height??10,L=h.x??0,w=h.y??0,B=Zr;return{nodeId:h.id,minX:L-b/2-B,maxX:L+b/2+B,minY:w-C/2-B,maxY:w+C/2+B,visualXHalfExtent:a?C/2+B:b/2+B}}),x=d((h,b,C,L)=>{let w=c.find(B=>B.orientation===h&&Math.abs(B.coord-b)<1);return w||(w={id:`pipe-${h}-${b.toFixed(0)}`,orientation:h,coord:b,spanMin:C,spanMax:L,tracks:[]},c.push(w)),w.spanMin=Math.min(w.spanMin,C),w.spanMax=Math.max(w.spanMax,L),w},"getOrAddPipe"),I=d((h,b)=>{const C=h.width??10,L=h.height??10,w=h.x??0,B=h.y??0;switch(b){case"top":return{x:w,y:B-L/2};case"bottom":return{x:w,y:B+L/2};case"left":return{x:w-C/2,y:B};case"right":return{x:w+C/2,y:B}}},"portForSide"),u=d((h,b,C)=>I(h,eo(h,b,C?"bottom":"top")),"getOrthogonalPort"),p=[],f=[],y=new Set,v=1e3,M=d((h,b,C)=>{if(p.length===0)return 0;const L=Math.abs(b.y-C.y)z||Y.from-ct<=U&&Y.to+ct>=U&&(B+=v)}else if(w){const U=b.x,q=Math.min(b.y,C.y)-ct,z=Math.max(b.y,C.y)+ct;if(z<=q)return 0;for(const Y of p)Y.edgeIndex===h||Y.orientation!=="horizontal"||Y.pipe.coordz||Y.from-ct<=U&&Y.to+ct>=U&&(B+=v)}return B},"crossingPenalty"),E=s.map((h,b)=>{if(!h.start||!h.end)return{idx:b,crossLane:0,dx:0,dy:0};const C=r.get(h.start),L=r.get(h.end),w=i.get(h.start),B=i.get(h.end),U=w&&B&&w.id!==B.id?1:0,q=C&&L?Math.abs((L.x??0)-(C.x??0)):0,z=C&&L?Math.abs((L.y??0)-(C.y??0)):0;return{idx:b,crossLane:U,dx:q,dy:z}}).sort((h,b)=>{if(h.crossLane!==b.crossLane)return b.crossLane-h.crossLane;const C=h.dx+h.dy,L=b.dx+b.dy;return Math.abs(C-L)>1?C-L:h.idx-b.idx}).map(h=>h.idx),T=d((h,b,C,L)=>{const w=Math.min(h.x,b.x),B=Math.max(h.x,b.x),U=Math.min(h.y,b.y),q=Math.max(h.y,b.y);return!!g.find(Y=>C&&Y.nodeId===C||L&&Y.nodeId===L?!1:Math.abs(h.x-b.x)>ct?Y.minYh.y&&Y.maxX>w&&Y.minXh.x&&Y.maxY>U&&Y.minYeo(h,b,"bottom"),"determineSide"),R=new Map;for(const[h,b]of s.entries()){if(!b.start||!b.end||b.start===b.end||b.points&&b.points.length>0)continue;const C=r.get(b.start),L=r.get(b.end);if(!C||!L)continue;const w=(L.x??0)-(C.x??0),B=(L.y??0)-(C.y??0);R.set(h,{edgeIdx:h,srcId:b.start,dstId:b.end,srcSide:A(C,{x:L.x??0,y:L.y??0}),dstSide:A(L,{x:C.x??0,y:C.y??0}),absDx:Math.abs(w),absDy:Math.abs(B),dxSign:Math.sign(w),dySign:Math.sign(B)})}const k=d(h=>h.srcSide==="top"||h.srcSide==="bottom"?h.absDx===0?1/0:h.absDy/h.absDx:h.absDy===0?1/0:h.absDx/h.absDy,"preferenceStrength"),O=d(h=>h.srcSide==="top"||h.srcSide==="bottom"?h.dxSign>=0?"right":"left":h.dySign>=0?"bottom":"top","secondarySide"),_=new Map;for(const h of R.values()){const b=`${h.srcId}:${h.srcSide}`;_.has(b)||_.set(b,[]),_.get(b).push(h)}const H=new Map,P=d((h,b)=>`${h}:${b}`,"loadKey");for(const h of R.values())H.set(P(h.srcId,h.srcSide),(H.get(P(h.srcId,h.srcSide))??0)+1),H.set(P(h.dstId,h.dstSide),(H.get(P(h.dstId,h.dstSide))??0)+1);for(const h of _.values())if(!(h.length<2)){h.sort((b,C)=>{const L=k(b),w=k(C);return Math.abs(L-w)>1e-9?w-L:b.edgeIdx-C.edgeIdx});for(let b=1;b=w||(H.set(P(C.srcId,C.srcSide),w-1),H.set(P(C.srcId,L),B+1),C.srcSide=L)}}const G=d(h=>{const b=h?.shape;return b==="question"||b==="diamond"},"isDiamondNode"),j=new Map;for(const h of R.values())j.has(h.dstId)||j.set(h.dstId,new Set),j.get(h.dstId).add(h.dstSide);for(const h of R.values()){if(!G(r.get(h.srcId)))continue;const b=j.get(h.srcId);if(!b?.has(h.srcSide))continue;const C=O(h);if(b.has(C)||(H.get(P(h.srcId,C))??0)>0)continue;const L=H.get(P(h.srcId,h.srcSide))??0;H.set(P(h.srcId,h.srcSide),Math.max(0,L-1)),H.set(P(h.srcId,C),1),h.srcSide=C}for(const h of R.values()){const{edgeIdx:b,srcId:C,dstId:L,srcSide:w,dstSide:B}=h,U=r.get(C),q=r.get(L),z=`${C}:${w}:src`,Y=w==="top"||w==="bottom"?q.x??0:q.y??0;m.has(z)||m.set(z,[]),m.get(z).push({edgeIdx:b,oppositeCoord:Y});const ot=`${L}:${B}:dst`,rt=B==="top"||B==="bottom"?U.x??0:U.y??0;m.has(ot)||m.set(ot,[]),m.get(ot).push({edgeIdx:b,oppositeCoord:rt})}const J=new Map,dt=8;for(const[h,b]of m){if(b.length<2)continue;b.sort((Lt,Dt)=>Lt.oppositeCoord-Dt.oppositeCoord);const C=h.split(":"),L=C.slice(0,-2).join(":"),w=C[C.length-2],B=C[C.length-1],U=r.get(L);if(!U)continue;const z=w==="left"||w==="right"?U.height??10:U.width??10,Y=U.shape,rt=Y==="question"||Y==="diamond"?z*.3:z,tt=Math.min(20,Math.max(dt,rt/(b.length+1))),Rt=-(tt*(b.length-1))/2;for(const[Lt,Dt]of b.entries()){const Jt=Rt+Lt*tt,gn=`${Dt.edgeIdx}:${B}`;J.set(gn,Jt)}}const mt=d(h=>!!s[h]?.labelNodeId,"edgeHasLabelNode"),kt=d((h,b)=>h?(m.get(`${h}:${b}:src`)??[]).some(({edgeIdx:C})=>mt(C))||(m.get(`${h}:${b}:dst`)??[]).some(({edgeIdx:C})=>mt(C)):!1,"faceHasLabelNode"),Pt=d((h,b,C)=>b==="top"||b==="bottom"?{x:h.x+C,y:h.y}:{x:h.x,y:h.y+C},"applyPortOffset"),Q=d((h,b,C)=>{const L=R.get(h),w={x:C.x??0,y:C.y??0},B={x:b.x??0,y:b.y??0},U=L?.srcSide??A(b,w),q=L?.dstSide??A(C,B);let z=L?I(b,L.srcSide):u(b,w,!0),Y=L?I(C,L.dstSide):u(C,B,!1);const ot=J.get(`${h}:src`),rt=J.get(`${h}:dst`);return ot!==void 0&&(z=Pt(z,U,ot)),rt!==void 0&&(Y=Pt(Y,q,rt)),{pSrcPort:z,pDstPort:Y,srcSide:U,dstSide:q}},"portsForEdge");for(const h of E){const b=s[h];if(f[h]=[],!b.start||!b.end||b.points&&b.points.length>0||b.start===b.end)continue;const C=r.get(b.start),L=r.get(b.end);if(!C||!L)continue;const{pSrcPort:w,pDstPort:B,srcSide:U,dstSide:q}=Q(h,C,L),z={...w},Y={...B},ot=U==="top"||U==="bottom",rt=q==="top"||q==="bottom";if(ot){const X=w.y>(C.y??0);z.y=X?w.y+ne:w.y-ne}else{const X=w.x>(C.x??0);z.x=X?w.x+ne:w.x-ne}if(rt){const X=B.y>(L.y??0);Y.y=X?B.y+ne:B.y-ne}else{const X=B.x>(L.x??0);Y.x=X?B.x+ne:B.x-ne}const st=d((X,$)=>{for(const K of g)if(!$.includes(K.nodeId)&&X.x>K.minX&&X.xK.minY&&X.y{if(Ct){const Nt=X.y>($.y??0);return{x:(K.x??0)>=X.x?lt.maxX+be:lt.minX-be,y:Nt?lt.maxY+Te:lt.minY-Te,leavesPositiveSide:Nt}}const bt=X.x>($.x??0),Et=(K.y??0)>=X.y;return{x:bt?lt.maxX+be:lt.minX-be,y:Et?lt.maxY+Te:lt.minY-Te,leavesPositiveSide:bt}},"obstacleDetour");let yt=[];const Rt=[b.start,b.end],Lt=st(z,Rt);if(Lt.inside&&Lt.obstacle){const X=Lt.obstacle;if(ot){const $=tt(w,C,L,X,!0);z.x=$.x,z.y=$.y;const K=$.leavesPositiveSide?Math.min(X.minY-2,w.y+ne):Math.max(X.maxY+2,w.y-ne);yt=[{x:w.x,y:K},{x:$.x,y:K},{x:$.x,y:$.y}]}else{const $=tt(w,C,L,X,!1),K=$.leavesPositiveSide?Math.min(X.minX-2,w.x+ne):Math.max(X.maxX+2,w.x-ne);z.x=$.x,z.y=$.y,yt=[{x:K,y:w.y},{x:K,y:$.y},{x:$.x,y:$.y}]}}let Dt=[];const Jt=st(Y,Rt);if(Jt.inside&&Jt.obstacle){const X=Jt.obstacle;if(rt){const $=tt(B,L,C,X,!0);Y.x=$.x,Y.y=$.y,Dt=[{x:$.x,y:$.y},{x:B.x,y:$.y}]}else{const $=tt(B,L,C,X,!1);Y.x=$.x,Y.y=$.y,Dt=[{x:$.x,y:$.y},{x:$.x,y:B.y}]}}if(yt.length===0&&Dt.length===0){const X=be,$=Math.abs(z.x-Y.x)1||bt>1,Nt=S.get(b.start??"")??0,ut=S.get(b.end??"")??0,Yt=Ct>1&&kt(b.start,U)||bt>1&&kt(b.end,q),ee=Ct<=1||Nt<=2,Bt=bt<=1||ut<=2;if(($||K)&&!lt&&(!Et||Et&&!Yt&&ee&&Bt)&&!T(w,B,b.start,b.end)){b.points=[{...w},{...z},{...Y},{...B}],y.add(h);const Mt=K?"horizontal":"vertical",$t=K?w.y:w.x,It=K?Math.min(w.x,B.x):Math.min(w.y,B.y),St=K?Math.max(w.x,B.x):Math.max(w.y,B.y),Wt={id:`fast-path-${Mt}-${$t.toFixed(0)}-${h}`,orientation:Mt,coord:$t,spanMin:It,spanMax:St,tracks:[]};p.push({edgeIndex:h,segmentIndex:0,orientation:Mt,pipe:Wt,trackIndex:0,from:It,to:St});continue}}const gn=x("vertical",z.x,z.y,z.y);z.x=gn.coord;const mr=x("vertical",Y.x,Y.y,Y.y);Y.x=mr.coord;let ue=Math.min(z.x,Y.x)-50,he=Math.max(z.x,Y.x)+50,ve=Math.min(z.y,Y.y)-50,Le=Math.max(z.y,Y.y)+50;for(const X of g){const $=Math.min(z.x,Y.x),K=Math.max(z.x,Y.x),lt=Math.min(z.y,Y.y),Ct=Math.max(z.y,Y.y);X.minX$&&X.minYlt&&(ue=Math.min(ue,X.minX-je),he=Math.max(he,X.maxX+je),ve=Math.min(ve,X.minY-je),Le=Math.max(Le,X.maxY+je))}for(const X of g){if(X.maxXhe||X.maxYLe)continue;const $=be;x("horizontal",X.minY-$,ue,he),x("horizontal",X.maxY+$,ue,he);const K=Te;x("vertical",X.minX-K,ve,Le),x("vertical",X.maxX+K,ve,Le)}x("horizontal",z.y,ue,he),x("horizontal",Y.y,ue,he);const yr=c.filter(X=>X.orientation==="horizontal"&&X.coord>=ve&&X.coord<=Le),xr=c.filter(X=>X.orientation==="vertical"&&X.coord>=ue&&X.coord<=he),ke=d((X,$)=>`${X.toFixed(1)},${$.toFixed(1)}`,"getKey"),_e=ke(z.x,z.y),vo=ke(Y.x,Y.y),Fe=new Map,pn=new Map,mn=new Map,De=new Set,xe=[];Fe.set(_e,0),mn.set(_e,"n"),xe.push({key:_e,f:Math.hypot(Y.x-z.x,Y.y-z.y),pt:z}),De.add(_e);let Ht=[];const ge=d((X,$)=>T(X,$,b.start,b.end),"checkSegmentBlocked"),yn={x:Y.x,y:z.y},br=ge(z,yn),Mr=ge(yn,Y),Ir=br||Mr,xn={x:z.x,y:Y.y},Sr=ge(z,xn),Cr=ge(xn,Y);if(Ir?Sr||Cr||(Math.abs(z.x-Y.x)0;){xe.sort((ut,Yt)=>ut.f-Yt.f);const X=xe.shift();if(De.delete(X.key),X.key===vo){let ut=vo,Yt=Y;for(Ht=[Yt];pn.has(ut);){const ee=pn.get(ut);Ht.unshift(ee),Yt=ee,ut=ke(ee.x,ee.y)}break}const $=X.pt.x,K=X.pt.y,lt=xr.sort((ut,Yt)=>ut.coord-Yt.coord),Ct=lt.findIndex(ut=>Math.abs(ut.coord-$)<1),bt=yr.sort((ut,Yt)=>ut.coord-Yt.coord),Et=bt.findIndex(ut=>Math.abs(ut.coord-K)<1),Nt=[];Ct>0&&Nt.push({x:lt[Ct-1].coord,y:K}),Ct>=0&&Ct0&&Nt.push({x:$,y:bt[Et-1].coord}),Et>=0&&EtZt.nodeId===b.start||Zt.nodeId===b.end?!1:Yt!==ee?Zt.minYK&&Zt.maxX>Yt&&Zt.minX$&&Zt.maxY>Bt&&Zt.minY10&&bn<-5||Ee<-10&&bn>5)&&(St=Math.abs(bn)*100),(Wt>10&&He<-5||Wt<-10&&He>5)&&(St+=Math.abs(He)*50);let Lo=0;const Eo=mn.get(X.key)??"n",To=Math.abs(He)>ct?"h":"v";Eo!=="n"&&Eo!==To&&(Lo=50);const vr=$t+It+St+Lo,Xe=(Fe.get(X.key)??1/0)+vr,wo=Math.abs(Y.x-ut.x)+Math.abs(Y.y-ut.y);if(Xe<(Fe.get(Mt)??1/0))if(pn.set(Mt,X.pt),Fe.set(Mt,Xe),mn.set(Mt,To),!De.has(Mt))xe.push({key:Mt,f:Xe+wo,pt:ut}),De.add(Mt);else{const Zt=xe.findIndex(Lr=>Lr.key===Mt);Zt!==-1&&(xe[Zt].f=Xe+wo)}}}if(Ht.length===0&&(Ht=[z,{x:z.x,y:Y.y},Y]),Ht.length>4){const X=Ht[0],$=Ht[Ht.length-1];let K=Math.min(X.x,$.x),lt=Math.max(X.x,$.x),Ct=Math.min(X.y,$.y),bt=Math.max(X.y,$.y);for(const Bt of Ht)K=Math.min(K,Bt.x),lt=Math.max(lt,Bt.x),Ct=Math.min(Ct,Bt.y),bt=Math.max(bt,Bt.y);const Et=lt>Math.max(X.x,$.x),Nt=KIt.minXGt&&It.minYOt);if($t.length>0){let It=Math.max(X.x,$.x);for(const St of $t){const Wt=(St.minX+St.maxX)/2;if(St.visualXHalfExtent===void 0||isNaN(St.visualXHalfExtent))continue;const Ee=Wt+St.visualXHalfExtent+Bt;It=Math.max(It,Ee)}isNaN(It)||(lt=It)}}if(Nt){const Gt=g.filter(Ot=>Ot.minXMath.min(X.y,$.y));if(Gt.length>0){let Ot=Math.min(X.x,$.x);for(const Mt of Gt){const It=(Mt.minX+Mt.maxX)/2-Mt.visualXHalfExtent-Bt;Ot=Math.min(Ot,It)}K=Ot}}}const ut=d(Bt=>{const Gt=$.y>X.y,Ot=g.filter(It=>{const St=Math.min(X.x,$.x)It.minX,Wt=Math.min(X.y,$.y)It.minY;return St&&Wt});let Mt=Ot;if(a&&Ot.length>0){const It=Ot.filter(St=>St.minXBt);It.length>0&&(Mt=It)}if(Mt.length===0)return $.y;const $t=be;if(Gt){const St=Math.max(...Mt.map(Wt=>Wt.maxY))+$t;if(St<$.y-ct)return St}else{const St=Math.min(...Mt.map(Wt=>Wt.minY))-$t;if(St>$.y+ct)return St}return $.y},"findBestReturnY"),Yt=d(Bt=>{const Gt=ut(Bt),Ot={x:Bt,y:X.y},Mt={x:Bt,y:Gt},$t={x:$.x,y:Gt},It=ge(X,Ot),St=ge(Ot,Mt),Wt=ge(Mt,$t),Ee=Gt!==$.y?ge($t,$):!1;return!It&&!St&&!Wt&&!Ee?Math.abs(Gt-$.y)=3){const X=Xt[Xt.length-1],$=Xt[Xt.length-2],K=Xt[Xt.length-3],lt=Math.abs(K.y-$.y)Math.abs(X.x-K.x)&&Xt.splice(-2,1)}else if(Ct){const bt=Math.sign($.y-K.y),Et=Math.sign(X.y-K.y);bt!==0&&bt===Et&&Math.abs($.y-K.y)>Math.abs(X.y-K.y)&&Xt.splice(-2,1)}}const ie=[Xt[0]];for(let X=1;X$.x,bt=lt.x>K.x;if(Ct!==bt){ie.push(K);continue}continue}if(Math.abs($.x-K.x)$.y,bt=lt.y>K.y;if(Ct!==bt){ie.push(K);continue}continue}ie.push(K)}ie.push(Xt[Xt.length-1]);for(let X=0;Xh.from{const w=!L.segments.some(U=>(U.edgeIndex!==b.edgeIndex||U.segmentIndex!==b.segmentIndex)&&W(U,h)),B=!C.segments.some(U=>(U.edgeIndex!==h.edgeIndex||U.segmentIndex!==h.segmentIndex)&&W(U,b));return w&&B?(h.trackIndex=L.index,b.trackIndex=C.index,C.segments=[...C.segments.filter(U=>U.edgeIndex!==h.edgeIndex||U.segmentIndex!==h.segmentIndex),{edgeIndex:b.edgeIndex,segmentIndex:b.segmentIndex,from:b.from,to:b.to}],L.segments=[...L.segments.filter(U=>U.edgeIndex!==b.edgeIndex||U.segmentIndex!==b.segmentIndex),{edgeIndex:h.edgeIndex,segmentIndex:h.segmentIndex,from:h.from,to:h.to}],!0):!1},"trySwapSegmentsAcrossTracks"),at=d(h=>{const b=h.tracks.length;return h.tracks[b]={index:b,coord:h.coord,segments:[]},b},"createNewTrack"),gt=d((h,b)=>{const C=h.pipe.tracks[h.trackIndex];C.segments=C.segments.filter(w=>w.edgeIndex!==h.edgeIndex||w.segmentIndex!==h.segmentIndex),h.trackIndex=b,h.pipe.tracks[b].segments.push({edgeIndex:h.edgeIndex,segmentIndex:h.segmentIndex,from:h.from,to:h.to})},"moveSegmentToTrack"),xt=d((h,b)=>{const C=f[h.edgeIndex];for(const L of C){const w=p[L];w.pipe===h.pipe&>(w,b)}},"moveSegmentChainToTrack"),vt=d(h=>{const b=f[h.edgeIndex],C=b.indexOf(p.indexOf(h)),L=[];return C>0&&L.push(p[b[C-1]]),C{if(h.orientation===b.orientation)return!1;const C=h.orientation==="horizontal"?h:b,L=h.orientation==="horizontal"?b:h;return L.pipe.coord>C.from&&L.pipe.coordL.from&&C.pipe.coord{for(const C of h.tracks)if(!C.segments.some(w=>(w.edgeIndex!==b.edgeIndex||w.segmentIndex!==b.segmentIndex)&&W(w,b)))return C.index;return-1},"findAvailableTrack"),Ut=d((h,b)=>{if(h.trackIndex===b.trackIndex)return W(h,b);const C=vt(h),L=vt(b);return C.some(w=>L.some(B=>Vt(w,B)))},"segmentsConflict"),te=d((h,b,C)=>{if(et(h,b,h.pipe.tracks[h.trackIndex],b.pipe.tracks[b.trackIndex]))return;const L=jt(h.pipe,b);C(b,L!==-1?L:at(h.pipe))},"resolveTrackConflict"),Se=d(h=>{let b=0;for(let C=0;C{if(de.has(h))return de.get(h);const b=f[h];if(b.length===0){const q={dest:0,deviation:0,base:0,delta:0};return de.set(h,q),q}const L=p[b[0]].pipe.coord;let w=L;for(let q=1;qMath.abs(ot-L)?Y:ot;break}}const B=Math.abs(w-L),U={dest:w,deviation:B,base:L,delta:w-L};return de.set(h,U),U},"getDestInfo"),dn=d(()=>{let h=0;const b=new Map;for(const[L,w]of s.entries())f[L].length!==0&&w.start&&(b.has(w.start)||b.set(w.start,[]),b.get(w.start).push(L));const C=d(L=>{const w=s[L];if(!w.start||!w.end)return 0;const B=r.get(w.start),U=r.get(w.end);if(!B||!U)return 0;const q=(U.x??0)-(B.x??0),z=(U.y??0)-(B.y??0);return Math.abs(q)+Math.abs(z)},"getEdgeDistance");for(const L of b.values()){L.sort((B,U)=>{const q=Ce(B),z=Ce(U);if(Math.abs(q.deviation-z.deviation)>1)return q.deviation-z.deviation;if(Math.abs(q.dest-z.dest)>1)return q.dest-z.dest;const Y=C(B),ot=C(U);if(Math.abs(Y-ot)>1)return ot-Y;const rt=f[B].length,st=f[U].length;if(rt!==st)return rt-st;if(rt===1){const tt=f[B][0],yt=f[U][0];if(p[tt]&&p[yt]){const Rt=p[tt],Lt=p[yt],Dt=Math.abs(Rt.to-Rt.from),Jt=Math.abs(Lt.to-Lt.from);if(Math.abs(Dt-Jt)>1)return Dt-Jt}}return 0});const w=L.map(B=>p[f[B][0]]);h+=Se(w)}return h},"fixSourceHandleCrossings"),un=d(()=>{let h=0;const b=new Map;for(const[C,L]of s.entries())f[C].length!==0&&L.end&&(b.has(L.end)||b.set(L.end,[]),b.get(L.end).push(C));for(const C of b.values()){C.sort((w,B)=>{const U=d(Y=>{const ot=f[Y];if(ot.length<2)return 0;const rt=p[ot[ot.length-2]];return Math.abs(rt.to-rt.from)},"getDist"),q=U(w),z=U(B);return Math.abs(q-z)>.1?q-z:w-B});const L=C.map(w=>p[f[w][f[w].length-1]]);h+=Se(L)}return h},"fixTargetHandleCrossings"),hn=d(()=>{let h=0;for(const b of c){const C=[];for(const L of b.tracks)for(const w of L.segments){const B=f[w.edgeIndex].find(U=>p[U].segmentIndex===w.segmentIndex);B!==void 0&&C.push(p[B])}C.sort((L,w)=>L.edgeIndex-w.edgeIndex||L.segmentIndex-w.segmentIndex);for(let L=0;L{L.segments.forEach(w=>{b.push({edgeIndex:w.edgeIndex,segmentIndex:w.segmentIndex,trackIndex:L.index,from:w.from,to:w.to})})}),b.sort((L,w)=>L.from-w.from);const C=[];if(b.length>0){let L=[b[0]],w=b[0].to;for(let B=1;Bw.add(tt.trackIndex));const B=new Map;L.forEach(tt=>{const yt=Ce(tt.edgeIndex);B.set(tt.trackIndex,(B.get(tt.trackIndex)??0)+yt.delta)});const U=[...w].filter(tt=>(B.get(tt)??0)<-1),q=[...w].filter(tt=>(B.get(tt)??0)>1),z=[...w].filter(tt=>Math.abs(B.get(tt)??0)<=1);U.sort((tt,yt)=>(B.get(yt)??0)-(B.get(tt)??0)),q.sort((tt,yt)=>(B.get(tt)??0)-(B.get(yt)??0));const Y=d((tt,yt)=>{L.filter(Rt=>Rt.trackIndex===tt).forEach(Rt=>{const Lt=y.has(Rt.edgeIndex)?h.coord:yt;D.set(`${Rt.edgeIndex}-${Rt.segmentIndex}`,Lt)})},"assignCoord");let ot=0;for(const tt of U)ot++,Y(tt,h.coord-ot*Cn);if(z.length===0&&w.size>0){const tt=[...w].sort((Lt,Dt)=>Math.abs(B.get(Lt)??0)-Math.abs(B.get(Dt)??0))[0],yt=U.indexOf(tt);yt!==-1&&U.splice(yt,1);const Rt=q.indexOf(tt);Rt!==-1&&q.splice(Rt,1),z.push(tt)}let rt=0;for(const tt of z){if(rt===0)Y(tt,h.coord);else{const yt=rt%2===1?1:-1,Rt=Math.ceil(rt/2);Y(tt,h.coord+yt*Rt*Cn*.5)}rt++}let st=0;for(const tt of q)st++,Y(tt,h.coord+st*Cn)}}for(const[h,b]of s.entries()){const C=f[h]??[];if(C.length===0)continue;const L=[],w=r.get(b.start),B=r.get(b.end),{pSrcPort:U,pDstPort:q}=Q(h,w,B),z=C.map(rt=>{const st=p[rt],tt=D.get(`${st.edgeIndex}-${st.segmentIndex}`)??st.pipe.coord;return{orient:st.orientation,coord:tt,from:st.from,to:st.to}});L.push(U);for(let rt=0;rtct&&L.push(Me(st,yt)),Dt&&Lt.orient===st.orient)if(Math.abs(st.coord-Lt.coord)>ct){const Jt=st.orient==="vertical"?(yt+Lt.from)/2:no(st,Lt);L.push(Me(st,Jt),Me(Lt,Jt))}else(rt===0||rt===z.length-2)&&L.push(Me(st,no(st,Lt)));else if(Dt)L.push(Me(st,Lt.coord));else{const Jt=Math.abs(st.from-yt)ct||Math.abs(Y.y-q.y)>ct)&&L.push(q);const ot=[];L.length>0&&ot.push(L[0]);for(let rt=1;rtct||Math.abs(st.y-tt.y)>ct)&&ot.push(st)}b.points=ot}for(const h of s){const b=h.__originalEdge;b&&h.points&&(b.points=h.points)}t.edges=(t.edges??[]).filter(h=>!h.isLayoutOnly);const V=d((h,b)=>{const C=b.x??0,L=b.y??0,w=b.width??0,B=b.height??0;if(w<=0||B<=0)return h;const U=C-w/2,q=C+w/2,z=L-B/2,Y=L+B/2;if(h.xq||h.yY)return h;const ot=h.x-U,rt=q-h.x,st=h.y-z,tt=Y-h.y,yt=Math.min(ot,rt,st,tt);return yt===ot?{x:U,y:h.y}:yt===rt?{x:q,y:h.y}:yt===st?{x:h.x,y:z}:{x:h.x,y:Y}},"nodeBoundaryClamp");for(const h of t.edges){const b=h.points;if(!b||b.length<2)continue;const C=h.start,L=h.end,w=C?r.get(C):void 0,B=L?r.get(L):void 0;w&&(b[0]=V(b[0],w)),B&&(b[b.length-1]=V(b[b.length-1],B))}return t}d(hr,"routeEdgesOrthogonal");function gr(t){return t.direction??"TB"}d(gr,"getSwimlaneDirection");function pr(t){const e=Jo(t),n=t.config.flowchart?.nodeSpacing??40,o=t.config.flowchart?.rankSpacing??100,s=t.config.swimlane?.ignoreCrossLaneEdges??!0,r=t.config.swimlane?.optimizeRanksByCrossings??!0,i=t.config.swimlane?.automaticLaneOrdering??!1,c=gr(t),{ordered:a,coordinates:l}=ur(e,{nodeGap:n,layerGap:o,ignoreCrossLaneEdges:s,optimizeRanksByCrossings:r,automaticLaneOrdering:i,direction:c});Zo(e,a,l,{nodeGap:n,layerGap:o});for(const g of t.edges??[])delete g.points;hr(t,c);for(const g of t.edges??[])(!g.curve||g.curve==="basis")&&(g.curve="rounded");return Rs(t,c),As(t),c}d(pr,"runSwimlaneLayoutCore");async function Qr(t,e){const n=e.select("g");wr(n,t.markers,t.type,t.diagramId),Ar(),Rr(),Nr(),Tr(),qo(t);const o=Qo(t);t.nodes=o.nodes,t.edges=o.edges;const{groups:s}=await _o(n,t);pr(t),await Uo(t,s)}d(Qr,"render");export{Qr as render}; diff --git a/internal/webapp/static/assets/swimlanesDiagram-ULZ7WXOC-Bgk3ILUh.js b/internal/webapp/static/assets/swimlanesDiagram-ULZ7WXOC-Bgk3ILUh.js new file mode 100644 index 0000000..e0b76cc --- /dev/null +++ b/internal/webapp/static/assets/swimlanesDiagram-ULZ7WXOC-Bgk3ILUh.js @@ -0,0 +1,8 @@ +import{c as r,s as e}from"./flowDiagram-UKHOOZJN-XwdembEj.js";import{_ as a}from"./mermaid.core-B7WVQkyL.js";import"./chunk-5VM5RSS4-DJhOL3Lj.js";import"./chunk-XXDRQBXY-BXTWinaX.js";import"./chunk-KBJHAD2P-CHI3y1em.js";import"./chunk-2GRJ4B5K-Bng47RDF.js";import"./channel-BphRH4Sr.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var o=a(t=>`${e(t)} + .swimlane.cluster rect { + stroke: ${t.clusterBorder} !important; + } + [data-look="neo"].cluster rect { + filter: none; + } +`,"getStyles"),m=o,y=r({defaultLayout:"swimlane",styles:m});export{y as diagram}; diff --git a/internal/webapp/static/assets/timeline-definition-Z64GVDOM-CIeFn7nE.js b/internal/webapp/static/assets/timeline-definition-Z64GVDOM-CIeFn7nE.js new file mode 100644 index 0000000..aa98194 --- /dev/null +++ b/internal/webapp/static/assets/timeline-definition-Z64GVDOM-CIeFn7nE.js @@ -0,0 +1,120 @@ +import{_ as o,y as pt,T as Rt,U as Ct,V as Wt,c as gt,l as E,D as Pt,K as Bt,W as ft,d as X,t as Vt,X as Ft,p as zt}from"./mermaid.core-B7WVQkyL.js";import{d as ot}from"./arc-DQmUyXqg.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var tt=(function(){var e=o(function(k,s,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],h=[1,15],c=[1,16],a=[1,19],f=[1,20],g={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(s,d,l,p,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(s,d){if(d.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=d,l}},"parseError"),parse:o(function(s){var d=this,l=[0],p=[],x=[null],u=[],S=this.table,v="",I=0,R=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(s,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var U=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=p.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(p=A,A=p.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,C={},G,B,Z,j;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";j=[];for(G in S[$])this.terminals_[G]&&G>W&&j.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`: +`+w.showPosition()+` +Expecting `+j.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Y="Parse error on line "+(I+1)+": Unexpected "+(_==O?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Y,{text:w.match,token:this.terminals_[_]||_,line:w.yylineno,loc:F,expected:j})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+_);switch(T[0]){case 1:l.push(_),x.push(w.yytext),u.push(w.yylloc),l.push(T[1]),_=null,R=w.yyleng,v=w.yytext,I=w.yylineno,F=w.yylloc;break;case 2:if(B=this.productions_[T[1]][1],C.$=x[x.length-B],C._$={first_line:u[u.length-(B||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(B||1)].first_column,last_column:u[u.length-1].last_column},U&&(C._$.range=[u[u.length-(B||1)].range[0],u[u.length-1].range[1]]),P=this.performAction.apply(C,[v,R,I,H.yy,T[1],x,u].concat(L)),typeof P<"u")return P;B&&(l=l.slice(0,-1*B*2),x=x.slice(0,-1*B),u=u.slice(0,-1*B)),l.push(this.productions_[T[1]][0]),x.push(C.$),u.push(C._$),Z=S[l[l.length-2]][l[l.length-1]],l.push(Z);break;case 3:return!0}}return!0},"parse")},m=(function(){var k={EOF:1,parseError:o(function(d,l){if(this.yy.parser)this.yy.parser.parseError(d,l);else throw new Error(d)},"parseError"),setInput:o(function(s,d){return this.yy=d||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:o(function(s){var d=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(s){this.unput(this.match.slice(s))},"less"),pastInput:o(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+` +`+d+"^"},"showPosition"),test_match:o(function(s,d){var l,p,x;if(this.options.backtrack_lexer&&(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),p=s[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],l=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var u in x)this[u]=x[u];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,d,l,p;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),u=0;ud[0].length)){if(d=l,p=u,this.options.backtrack_lexer){if(s=this.test_match(l,x[u]),s!==!1)return s;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(s=this.test_match(d,x[p]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var d=this.next();return d||this.lex()},"lex"),begin:o(function(d){this.conditionStack.push(d)},"begin"),popState:o(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:o(function(d){this.begin(d)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(d,l,p,x){switch(p){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return k})();g.lexer=m;function y(){this.yy={}}return o(y,"Parser"),y.prototype=g,g.Parser=y,new y})();tt.parser=tt;var Ot=tt,yt={};Vt(yt,{addEvent:()=>Tt,addSection:()=>_t,addTask:()=>Et,addTaskOrg:()=>$t,clear:()=>kt,default:()=>Gt,getCommonDb:()=>xt,getDirection:()=>bt,getSections:()=>wt,getTasks:()=>St,setDirection:()=>vt});var D="",mt=0,nt="LR",rt=[],q=[],K=[],xt=o(()=>Ft,"getCommonDb"),kt=o(function(){rt.length=0,q.length=0,D="",K.length=0,nt="LR",zt()},"clear"),vt=o(function(e){nt=e},"setDirection"),bt=o(function(){return nt},"getDirection"),_t=o(function(e){D=e,rt.push(e)},"addSection"),wt=o(function(){return rt},"getSections"),St=o(function(){let e=ct();const t=100;let n=0;for(;!e&&nn.id===mt-1).events.push(e)},"addEvent"),$t=o(function(e){const t={section:D,type:D,description:e,task:e,classes:[]};q.push(t)},"addTaskOrg"),ct=o(function(){const e=o(function(n){return K[n].processed},"compileTask");let t=!0;for(const[n,i]of K.entries())e(n),t=t&&i.processed;return t},"compileTasks"),Gt={clear:kt,getCommonDb:xt,getDirection:bt,setDirection:vt,addSection:_t,getSections:wt,getTasks:St,addTask:Et,addTaskOrg:$t,addEvent:Tt},Nt=0,J=o(function(e,t){const n=e.append("rect");return n.attr("x",t.x),n.attr("y",t.y),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("width",t.width),n.attr("height",t.height),n.attr("rx",t.rx),n.attr("ry",t.ry),t.class!==void 0&&n.attr("class",t.class),n},"drawRect"),Dt=o(function(e,t){const i=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),r=e.append("g");r.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function h(f){const g=ot().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",g).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}o(h,"smile");function c(f){const g=ot().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",g).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}o(c,"sad");function a(f){f.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return o(a,"ambivalent"),t.score>3?h(r):t.score<3?c(r):a(r),i},"drawFace"),Kt=o(function(e,t){const n=e.append("circle");return n.attr("cx",t.cx),n.attr("cy",t.cy),n.attr("class","actor-"+t.pos),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("r",t.r),n.class!==void 0&&n.attr("class",n.class),t.title!==void 0&&n.append("title").text(t.title),n},"drawCircle"),It=o(function(e,t){const n=t.text.replace(//gi," "),i=e.append("text");i.attr("x",t.x),i.attr("y",t.y),i.attr("class","legend"),i.style("text-anchor",t.anchor),t.class!==void 0&&i.attr("class",t.class);const r=i.append("tspan");return r.attr("x",t.x+t.textMargin*2),r.text(n),i},"drawText"),Ut=o(function(e,t){function n(r,h,c,a,f){return r+","+h+" "+(r+c)+","+h+" "+(r+c)+","+(h+a-f)+" "+(r+c-f*1.2)+","+(h+a)+" "+r+","+(h+a)}o(n,"genPoints");const i=e.append("polygon");i.attr("points",n(t.x,t.y,50,20,7)),i.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,It(e,t)},"drawLabel"),Xt=o(function(e,t,n){const i=e.append("g"),r=st();r.x=t.x,r.y=t.y,r.fill=t.fill,r.width=n.width,r.height=n.height,r.class="journey-section section-type-"+t.num,r.rx=3,r.ry=3,J(i,r),Ht(n)(t.text,i,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+t.num},n,t.colour)},"drawSection"),et=-1,Zt=o(function(e,t,n,i){const r=t.x+n.width/2,h=e.append("g");et++,h.append("line").attr("id",i+"-task"+et).attr("x1",r).attr("y1",t.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Dt(h,{cx:r,cy:300+(5-t.score)*30,score:t.score});const a=st();a.x=t.x,a.y=t.y,a.fill=t.fill,a.width=n.width,a.height=n.height,a.class="task task-type-"+t.num,a.rx=3,a.ry=3,J(h,a),Ht(n)(t.task,h,a.x,a.y,a.width,a.height,{class:"task"},n,t.colour)},"drawTask"),jt=o(function(e,t){J(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),qt=o(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),st=o(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Ht=(function(){function e(r,h,c,a,f,g,m,y){const k=h.append("text").attr("x",c+f/2).attr("y",a+g/2+5).style("font-color",y).style("text-anchor","middle").text(r);i(k,m)}o(e,"byText");function t(r,h,c,a,f,g,m,y,k){const{taskFontSize:s,taskFontFamily:d}=y,l=r.split(//gi);for(let p=0;p)/).reverse(),r,h=[],c=1.1,a=n.attr("y"),f=parseFloat(n.attr("dy")),g=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",f+"em");for(let m=0;mt||r==="
    ")&&(h.pop(),g.text(h.join(" ").trim()),r==="
    "?h=[""]:h=[r],g=n.append("tspan").attr("x",0).attr("y",a).attr("dy",c+"em").text(r))})}o(it,"wrap");var Qt=o(function(e,t,n,i,r,h=!1){const{theme:c,look:a}=i,f=c?.includes("redux"),g=i?.themeVariables?.THEME_COLOR_LIMIT??12,m=n%g-1,y=e.append("g");t.section=m,y.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+m));const k=y.append("g"),s=y.append("g"),l=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(it,t.width).node().getBBox(),p=i.fontSize?.replace?i.fontSize.replace("px",""):i.fontSize;if(t.height=l.height+p*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,s.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),f&&s.attr("transform",`translate(${t.width/2}, ${h?t.padding/2+3:t.padding})`),te(k,t,m,r,i),a==="neo"&&(y.attr("data-look","neo"),f)){const x=c.includes("dark"),u=e.node()?.ownerSVGElement??e.node(),S=X(u),v=S.attr("id")??"",I=v?`${v}-drop-shadow`:"drop-shadow";if(S.select(`#${I}`).empty()){const R=S.select("defs");(R.empty()?S.append("defs"):R).append("filter").attr("id",I).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",x?"0.2":"0.06").attr("flood-color",x?"#FFFFFF":"#000000")}}return t},"drawNode"),Yt=o(function(e,t,n){const i=e.append("g"),h=i.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(it,t.width).node().getBBox(),c=n.fontSize?.replace?n.fontSize.replace("px",""):n.fontSize;return i.remove(),h.height+c*1.1*.5+t.padding},"getVirtualNodeHeight"),te=o(function(e,t,n,i,r){const{theme:h}=r,c=h?.includes("redux")?0:5,a=5,f=c>0?`M0 ${t.height-a} v${-t.height+2*a} q0,-${c},${c},-${c} h${t.width-2*a} q${c},0,${c},${c} v${t.height-a} H0 Z`:`M0 ${t.height-a} v${-(t.height-a)} h${t.width} v${t.height} H0 Z`;e.append("path").attr("id",i+"-node-"+Nt++).attr("class","node-bkg node-"+t.type).attr("d",f),h?.includes("redux")||e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),M={drawRect:J,drawCircle:Kt,drawSection:Xt,drawText:It,drawLabel:Ut,drawTask:Zt,drawBackgroundRect:jt,getTextObj:qt,getNoteRect:st,initGraphics:Jt,drawNode:Qt,getVirtualNodeHeight:Yt},ee=o(function(e,t,n,i){const r=gt(),{look:h,theme:c,themeVariables:a}=r,{useGradient:f,gradientStart:g,gradientStop:m}=a,y=r.timeline?.leftMargin??50;E.debug("timeline",i.db);const k=r.securityLevel;let s;k==="sandbox"&&(s=X("#i"+t));const l=(k==="sandbox"?X(s.nodes()[0].contentDocument.body):X("body")).select("#"+t);l.append("g");const p=i.db.getTasks(),x=i.db.getCommonDb().getDiagramTitle();E.debug("task",p),M.initGraphics(l,t);const u=i.db.getSections();E.debug("sections",u);let S=0,v=0,I=0,R=0,W=50+y,O=50;R=50;let L=0,w=!0;u.forEach(function(N){const b={number:L,descr:N,section:L,width:150,padding:20,maxHeight:S},_=M.getVirtualNodeHeight(l,b,r);E.debug("sectionHeight before draw",_),S=Math.max(S,_+20)});let H=0,V=0;E.debug("tasks.length",p.length);for(const[N,b]of p.entries()){const _={number:N,descr:b,section:b.section,width:150,padding:20,maxHeight:v},$=M.getVirtualNodeHeight(l,_,r);E.debug("taskHeight before draw",$),v=Math.max(v,$+20),H=Math.max(H,b.events.length);let T=0;for(const P of b.events){const C={descr:P,section:b.section,number:b.section,width:150,padding:20,maxHeight:50};T+=M.getVirtualNodeHeight(l,C,r)}b.events.length>0&&(T+=(b.events.length-1)*10),V=Math.max(V,T)}E.debug("maxSectionHeight before draw",S),E.debug("maxTaskHeight before draw",v),u&&u.length>0?u.forEach(N=>{const b=p.filter(P=>P.section===N),_={number:L,descr:N,section:L,width:200*Math.max(b.length,1)-50,padding:20,maxHeight:S};E.debug("sectionNode",_);const $=l.append("g"),T=M.drawNode($,_,L,r,t);E.debug("sectionNode output",T),$.attr("transform",`translate(${W}, ${R})`),O+=S+50,b.length>0&<(l,b,L,W,O,v,r,H,V,S,!1,t),W+=200*Math.max(b.length,1),O=R,L++}):(w=!1,lt(l,p,L,W,O,v,r,H,V,S,!0,t));const F=l.node().getBBox();if(E.debug("bounds",F),x&&l.append("text").text(x).attr("x",h==="neo"?F.x*2+y:F.width/2-y).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),I=w?S+v+150:v+100,l.append("g").attr("class","lineWrapper").append("line").attr("x1",y).attr("y1",I).attr("x2",F.width+3*y).attr("y2",I).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${t}-arrowhead)`),h==="neo"&&f&&c!=="neutral"){const N=l.select("defs"),_=(N.empty()?l.append("defs"):N).append("linearGradient").attr("id",l.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");_.append("stop").attr("offset","0%").attr("stop-color",g).attr("stop-opacity",1),_.append("stop").attr("offset","100%").attr("stop-color",m).attr("stop-opacity",1)}ft(void 0,l,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),lt=o(function(e,t,n,i,r,h,c,a,f,g,m,y){for(const k of t){const s={descr:k.task,section:n,number:n,width:150,padding:20,maxHeight:h};E.debug("taskNode",s);const d=e.append("g").attr("class","taskWrapper"),p=M.drawNode(d,s,n,c,y).height;if(E.debug("taskHeight after draw",p),d.attr("transform",`translate(${i}, ${r})`),h=Math.max(h,p),k.events){const x=e.append("g").attr("class","lineWrapper");let u=h;r+=100,u=u+ne(e,k.events,n,i,r,c,y),r-=100,x.append("line").attr("x1",i+190/2).attr("y1",r+h).attr("x2",i+190/2).attr("y2",r+h+100+f+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${y}-arrowhead)`).attr("stroke-dasharray","5,5")}i=i+200,m&&!c.timeline?.disableMulticolor&&n++}r=r-10},"drawTasks"),ne=o(function(e,t,n,i,r,h,c){let a=0;const f=r;r=r+100;for(const g of t){const m={descr:g,section:n,number:n,width:150,padding:20,maxHeight:50};E.debug("eventNode",m);const y=e.append("g").attr("class","eventWrapper"),s=M.drawNode(y,m,n,h,c,!0).height;a=a+s,y.attr("transform",`translate(${i}, ${r})`),r=r+10+s}return r=f,a},"drawEvents"),re={setConf:o(()=>{},"setConf"),draw:ee},Q=200,z=5,se=Q+z*2,at=Q+100,ie=at+z*2,Lt=10,ae=0,ht=20,Mt=20,dt=30,At=50,oe=o(function(e,t,n,i){const r=gt(),h=r.timeline?.leftMargin??50;E.debug("timeline",i.db);const c=Pt(t);c.append("g");const a=i.db.getTasks(),f=i.db.getCommonDb().getDiagramTitle();E.debug("task",a),M.initGraphics(c);const g=i.db.getSections();E.debug("sections",g);let m=0,y=0;const k=50+h;let s=50;const d=s,l=k,p=se+Mt,x=ie+At,u=l+p;let S=0;const v=g&&g.length>0,I=v?u:k+p,R=Math.max(50,p+x-z*2);g.forEach(function(N){const b={number:S,descr:N,section:S,width:R,padding:z,maxHeight:m},_=M.getVirtualNodeHeight(c,b,r);E.debug("sectionHeight before draw",_),m=Math.max(m,_)});let W=0;E.debug("tasks.length",a.length);for(const[N,b]of a.entries()){const _={number:N,descr:b,section:b.section,width:Q,padding:z,maxHeight:y},$=M.getVirtualNodeHeight(c,_,r);E.debug("taskHeight before draw",$),y=Math.max(y,$);let T=0;for(const P of b.events){const C={descr:P,section:b.section,number:b.section,width:at,padding:z,maxHeight:50};T+=M.getVirtualNodeHeight(c,C,r)}b.events.length>0&&(T+=(b.events.length-1)*Lt),W=Math.max(W,T)+ae}E.debug("maxSectionHeight before draw",m),E.debug("maxTaskHeight before draw",y);const L=Math.max(y,W)+dt;v?g.forEach(N=>{const b=a.filter(Z=>Z.section===N),_={number:S,descr:N,section:S,width:R,padding:z,maxHeight:m};E.debug("sectionNode",_);const $=c.append("g"),T=M.drawNode($,_,S,r);E.debug("sectionNode output",T);const P=I-p;$.attr("transform",`translate(${P}, ${s})`);const C=s+T.height+ht;b.length>0&&ut(c,b,S,I,C,y,r,L,!1);const G=b.length,B=T.height+ht+L*Math.max(G,1)-(G>0?dt*2:0);s+=B,S++}):ut(c,a,S,I,s,y,r,L,!0);let w=c.node()?.getBBox();if(!w)throw new Error("bbox not found");if(E.debug("bounds",w),f){if(c.append("text").text(f).attr("x",w.width/2-h).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),w=c.node()?.getBBox(),!w)throw new Error("bbox not found");E.debug("bounds after title",w)}const[H]=Bt(r.fontSize),V=(H??16)*2,F=(H??16)*.5+20,U=c.append("g").attr("class","lineWrapper");U.append("line").attr("x1",I).attr("y1",d-V).attr("x2",I).attr("y2",w.y+w.height+F).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),U.lower(),ft(void 0,c,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),ut=o(function(e,t,n,i,r,h,c,a,f){for(const g of t){const m={descr:g.task,section:n,number:n,width:Q,padding:z,maxHeight:h};E.debug("taskNode",m);const y=e.append("g").attr("class","taskWrapper"),k=M.drawNode(y,m,n,c),s=k.height;E.debug("taskHeight after draw",s);const d=i-Mt-k.width;if(y.attr("transform",`translate(${d}, ${r})`),h=Math.max(h,s),g.events&&g.events.length>0){const l=r,p=i+At;ce(e,g.events,n,i,p,l,c)}r=r+a,f&&!c.timeline?.disableMulticolor&&n++}},"drawTasks"),ce=o(function(e,t,n,i,r,h,c){let a=h;for(const f of t){const g={descr:f,section:n,number:n,width:at,padding:z,maxHeight:0};E.debug("eventNode",g);const m=e.append("g").attr("class","eventWrapper"),k=M.drawNode(m,g,n,c).height;m.attr("transform",`translate(${r}, ${a})`);const s=e.append("g").attr("class","lineWrapper"),d=a+k/2;s.append("line").attr("x1",i).attr("y1",d).attr("x2",r).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),a=a+k+Lt}return a-h},"drawEvents"),le={setConf:o(()=>{},"setConf"),draw:oe},he=o(e=>{const{theme:t}=pt(),n=t?.includes("dark"),i=t?.includes("color"),r=e.svgId?.replace(/^#/,"")??"",h=r?`url(#${r}-drop-shadow)`:e.dropShadow??"none";let c="";for(let a=0;a{let t="";for(let n=0;n{const{theme:t}=pt(),n=t?.includes("redux"),i=t==="neutral",r=e.svgId?.replace(/^#/,"")??"";let h="";if(e.useGradient&&r&&e.THEME_COLOR_LIMIT&&!i)for(let c=0;c{},"setConf"),draw:o((e,t,n,i)=>(i?.db?.getDirection?.()??"LR")==="TD"?le.draw(e,t,n,i):re.draw(e,t,n,i),"draw")},ke={db:yt,renderer:ge,parser:Ot,styles:pe};export{ke as diagram}; diff --git a/internal/webapp/static/assets/vennDiagram-T6HMQDX7-bdo599Ik.js b/internal/webapp/static/assets/vennDiagram-T6HMQDX7-bdo599Ik.js new file mode 100644 index 0000000..a24e516 --- /dev/null +++ b/internal/webapp/static/assets/vennDiagram-T6HMQDX7-bdo599Ik.js @@ -0,0 +1,34 @@ +import{b4 as Wt,s as Kt,g as Ht,o as Yt,n as Xt,a as Zt,b as Jt,_ as w,y as wt,D as Qt,d as ot,al as $t,T as te,U as ee,V as ne,e as se,p as ie,A as oe,B as re}from"./mermaid.core-B7WVQkyL.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;ua.angle-u.angle);let f=e[e.length-1];for(let u=0;up.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;uMath.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>U(t,s)=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=U(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u=0&&(n=a),Math.abs(f)ct(n))}function $(t,n){let s=0;for(let e=0;ev.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});x.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx=1)break;for(let d=1;dl+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a{const y={};for(let h=0;hxt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;ul===f?0:lo.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;hy.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;bt[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,U(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&U(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const D=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&D.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(F=>D.has(F)));let I={},C={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Ct(k,r,h)),I=Nt(k,s,e,i,f),C=Lt(I,d,M)}const q={};d.forEach(k=>{k.label&&(q[k.sets]=k.label)});function V(k){if(k.sets in q)return q[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const O=x.select("svg");n?O.attr("viewBox",`0 0 ${s} ${e}`):O.attr("width",s).attr("height",e);const R={};let T=!1;O.selectAll(".venn-area path").each(function(k){const F=this.getAttribute("d");k.sets.length==1&&F&&!b&&(T=!0,R[k.sets[0]]=Me(F))});function A(k){return F=>{const H=k.sets.map(et=>{let Y=R[et],Z=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-F)+Z.x*F,y:Y.y*(1-F)+Z.y*F,radius:Y.radius*(1-F)+Z.radius*F}});return St(H,p)}}const G=O.selectAll(".venn-area").data(d,k=>k.sets),P=G.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),L=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),L.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function K(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;T&&typeof z.transition=="function"?(z=K(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(F=>I[F])),p);const N=z.selectAll("text").filter(k=>k.sets in C).text(k=>V(k)).attr("x",k=>Math.floor(C[k.sets].x)).attr("y",k=>Math.floor(C[k.sets].y));u&&(T?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const j=K(G.exit()).remove();typeof G.transition=="function"&&j.selectAll("path").attrTween("d",A);const X=j.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(L.style("font-size","0px"),N.style("font-size",y),X.style("font-size","0px")),{circles:I,textCentres:C,nodes:G,enter:P,update:z,exit:j}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Dt:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-U(n[0],t);for(let i=1;i=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(U(l,a)>a.radius){f=!1;break}for(const a of n)if(U(l,a)a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(` +M`,t,n),e.push(` +m`,-s,0),e.push(` +a`,s,s,0,1,0,s*2,0),e.push(` +a`,s,s,0,1,0,-s*2,0),e.join(" ")}function Me(t){const n=t.split(" ");return{x:Number.parseFloat(n[1]),y:Number.parseFloat(n[2]),radius:-Number.parseFloat(n[4])}}function Pt(t){if(t.length===0)return[];const n={};return st(t,n),n.arcs}function Bt(t,n){if(t.length===0)return"M 0 0";const s=Math.pow(10,n||0),e=n!=null?o=>Math.round(o*s)/s:o=>o;if(t.length==1){const o=t[0].circle;return ke(e(o.x),e(o.y),e(o.radius))}const i=[` +M`,e(t[0].p2.x),e(t[0].p2.y)];for(const o of t){const r=e(o.circle.radius);i.push(` +A`,r,r,0,o.large?1:0,o.sweep?1:0,e(o.p1.x),e(o.p1.y))}return i.join(" ")}function St(t,n){return Bt(Pt(t),n)}function Se(t,n={}){const{lossFunction:s,layoutFunction:e=At,normalize:i=!0,orientation:o=Math.PI/2,orientationOrder:r,width:l=600,height:f=350,padding:u=15,scaleToFit:a=!1,symmetricalTextCentre:y=!1,distinct:h,round:b=2}=n;let p=e(t,{lossFunction:s==="default"||!s?tt:s==="logRatio"?Dt:s,distinct:h});i&&(p=Ct(p,o,r));const M=Nt(p,l,f,u,a),E=Lt(M,t,y),_=new Map(Object.keys(M).map(m=>[m,{set:m,x:M[m].x,y:M[m].y,radius:M[m].radius}])),S=t.map(m=>{const v=m.sets.map(d=>_.get(d)),c=Pt(v),x=Bt(c,b);return{circles:v,arcs:c,path:x,area:m,has:new Set(m.sets)}});function g(m){let v="";for(const c of S)c.has.size>m.length&&m.every(x=>c.has.has(x))&&(v+=" "+c.path);return v}return S.map(({circles:m,arcs:v,path:c,area:x})=>({data:x,text:E[x.sets],circles:m,arcs:v,path:c,distinctPath:c+g(x.sets)}))}var gt=(function(){var t=w(function(S,g,m,v){for(m=m||{},v=S.length;v--;m[S[v]]=g);return m},"o"),n=[5,8],s=[7,8,11,12,17,19,22,24],e=[1,17],i=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],r=[1,31],l=[1,39],f=[7,8,11,12,17,19,22,24,27],u=[1,57],a=[1,56],y=[1,58],h=[1,59],b=[1,60],p=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],M={trace:w(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:w(function(g,m,v,c,x,d,D){var I=d.length-1;switch(x){case 1:return d[I-1];case 2:case 3:case 4:this.$=[];break;case 5:d[I-1].push(d[I]),this.$=d[I-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=d[I];break;case 8:c.setDiagramTitle(d[I].substr(6)),this.$=d[I].substr(6);break;case 9:c.addSubsetData([d[I]],void 0,void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 10:c.addSubsetData([d[I-1]],d[I],void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 11:c.addSubsetData([d[I-2]],void 0,parseFloat(d[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 12:c.addSubsetData([d[I-3]],d[I-2],parseFloat(d[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 13:if(d[I].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(d[I]),c.addSubsetData(d[I],void 0,void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 14:if(d[I-1].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(d[I-1]),c.addSubsetData(d[I-1],d[I],void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 15:if(d[I-2].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(d[I-2]),c.addSubsetData(d[I-2],void 0,parseFloat(d[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 16:if(d[I-3].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(d[I-3]),c.addSubsetData(d[I-3],d[I-2],parseFloat(d[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 17:case 18:case 19:c.addTextData(d[I-1],d[I],void 0);break;case 20:case 21:c.addTextData(d[I-2],d[I-1],d[I]);break;case 23:c.addStyleData(d[I-1],d[I]);break;case 24:case 25:case 26:var C=c.getCurrentSets();if(!C)throw new Error("text requires set");c.addTextData(C,d[I],void 0);break;case 27:case 28:var C=c.getCurrentSets();if(!C)throw new Error("text requires set");c.addTextData(C,d[I-1],d[I]);break;case 29:case 41:this.$=[d[I]];break;case 30:case 42:this.$=[...d[I-2],d[I]];break;case 31:this.$=[d[I-2],d[I]];break;case 33:this.$=d[I].join(" ");break;case 34:this.$=[d[I]];break;case 35:d[I-1].push(d[I]),this.$=d[I-1];break;case 43:case 44:this.$=d[I];break}},"anonymous"),table:[t(n,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(s,[2,4],{6:5}),t(n,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(s,[2,5]),t(s,[2,6]),t(s,[2,7]),t(s,[2,8]),{13:16,20:e,21:i},{13:20,18:19,20:e,21:i},{13:20,18:21,20:e,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:e,21:i},t(s,[2,9],{14:[1,27],15:[1,28]}),t(o,[2,43]),t(o,[2,44]),t(s,[2,13],{14:[1,29],15:[1,30],27:r}),t(o,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:r},t(s,[2,22]),t(s,[2,24],{14:[1,35]}),t(s,[2,25],{14:[1,36]}),t(s,[2,26]),{20:l,25:37,26:38,27:r},t(s,[2,10],{15:[1,40]}),{16:[1,41]},t(s,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:e,21:i},t(s,[2,17],{14:[1,45]}),t(s,[2,18],{14:[1,46]}),t(s,[2,19]),t(s,[2,27]),t(s,[2,28]),t(s,[2,23],{27:[1,47]}),t(f,[2,29]),{15:[1,48]},{16:[1,49]},t(s,[2,11]),{16:[1,50]},t(s,[2,15]),t(o,[2,42]),t(s,[2,20]),t(s,[2,21]),{20:l,26:51},{16:u,20:a,21:[1,53],28:52,29:54,30:55,31:y,32:h,33:b},t(s,[2,12]),t(s,[2,16]),t(f,[2,30]),t(f,[2,31]),t(f,[2,32]),t(f,[2,33],{30:61,16:u,20:a,31:y,32:h,33:b}),t(p,[2,34]),t(p,[2,36]),t(p,[2,37]),t(p,[2,38]),t(p,[2,39]),t(p,[2,40]),t(p,[2,35])],defaultActions:{6:[2,1]},parseError:w(function(g,m){if(m.recoverable)this.trace(g);else{var v=new Error(g);throw v.hash=m,v}},"parseError"),parse:w(function(g){var m=this,v=[0],c=[],x=[null],d=[],D=this.table,I="",C=0,q=0,V=2,O=1,R=d.slice.call(arguments,1),T=Object.create(this.lexer),A={yy:{}};for(var G in this.yy)Object.prototype.hasOwnProperty.call(this.yy,G)&&(A.yy[G]=this.yy[G]);T.setInput(g,A.yy),A.yy.lexer=T,A.yy.parser=this,typeof T.yylloc>"u"&&(T.yylloc={});var P=T.yylloc;d.push(P);var B=T.options&&T.options.ranges;typeof A.yy.parseError=="function"?this.parseError=A.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function L(W){v.length=v.length-2*W,x.length=x.length-W,d.length=d.length-W}w(L,"popStack");function K(){var W;return W=c.pop()||T.lex()||O,typeof W!="number"&&(W instanceof Array&&(c=W,W=c.pop()),W=m.symbols_[W]||W),W}w(K,"lex");for(var z,N,j,X,k={},F,H,et,Y;;){if(N=v[v.length-1],this.defaultActions[N]?j=this.defaultActions[N]:((z===null||typeof z>"u")&&(z=K()),j=D[N]&&D[N][z]),typeof j>"u"||!j.length||!j[0]){var Z="";Y=[];for(F in D[N])this.terminals_[F]&&F>V&&Y.push("'"+this.terminals_[F]+"'");T.showPosition?Z="Parse error on line "+(C+1)+`: +`+T.showPosition()+` +Expecting `+Y.join(", ")+", got '"+(this.terminals_[z]||z)+"'":Z="Parse error on line "+(C+1)+": Unexpected "+(z==O?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(Z,{text:T.match,token:this.terminals_[z]||z,line:T.yylineno,loc:P,expected:Y})}if(j[0]instanceof Array&&j.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+z);switch(j[0]){case 1:v.push(z),x.push(T.yytext),d.push(T.yylloc),v.push(j[1]),z=null,q=T.yyleng,I=T.yytext,C=T.yylineno,P=T.yylloc;break;case 2:if(H=this.productions_[j[1]][1],k.$=x[x.length-H],k._$={first_line:d[d.length-(H||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(H||1)].first_column,last_column:d[d.length-1].last_column},B&&(k._$.range=[d[d.length-(H||1)].range[0],d[d.length-1].range[1]]),X=this.performAction.apply(k,[I,q,C,A.yy,j[1],x,d].concat(R)),typeof X<"u")return X;H&&(v=v.slice(0,-1*H*2),x=x.slice(0,-1*H),d=d.slice(0,-1*H)),v.push(this.productions_[j[1]][0]),x.push(k.$),d.push(k._$),et=D[v[v.length-2]][v[v.length-1]],v.push(et);break;case 3:return!0}}return!0},"parse")},E=(function(){var S={EOF:1,parseError:w(function(m,v){if(this.yy.parser)this.yy.parser.parseError(m,v);else throw new Error(m)},"parseError"),setInput:w(function(g,m){return this.yy=m||this.yy||{},this._input=g,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:w(function(){var g=this._input[0];this.yytext+=g,this.yyleng++,this.offset++,this.match+=g,this.matched+=g;var m=g.match(/(?:\r\n?|\n).*/g);return m?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),g},"input"),unput:w(function(g){var m=g.length,v=g.split(/(?:\r\n?|\n)/g);this._input=g+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-m),this.offset-=m;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),v.length-1&&(this.yylineno-=v.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:v?(v.length===c.length?this.yylloc.first_column:0)+c[c.length-v.length].length-v[0].length:this.yylloc.first_column-m},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-m]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:w(function(g){this.unput(this.match.slice(g))},"less"),pastInput:w(function(){var g=this.matched.substr(0,this.matched.length-this.match.length);return(g.length>20?"...":"")+g.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var g=this.match;return g.length<20&&(g+=this._input.substr(0,20-g.length)),(g.substr(0,20)+(g.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var g=this.pastInput(),m=new Array(g.length+1).join("-");return g+this.upcomingInput()+` +`+m+"^"},"showPosition"),test_match:w(function(g,m){var v,c,x;if(this.options.backtrack_lexer&&(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),c=g[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+g[0].length},this.yytext+=g[0],this.match+=g[0],this.matches=g,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(g[0].length),this.matched+=g[0],v=this.performAction.call(this,this.yy,this,m,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),v)return v;if(this._backtrack){for(var d in x)this[d]=x[d];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var g,m,v,c;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),d=0;dm[0].length)){if(m=v,c=d,this.options.backtrack_lexer){if(g=this.test_match(v,x[d]),g!==!1)return g;if(this._backtrack){m=!1;continue}else return!1}else if(!this.options.flex)break}return m?(g=this.test_match(m,x[c]),g!==!1?g:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var m=this.next();return m||this.lex()},"lex"),begin:w(function(m){this.conditionStack.push(m)},"begin"),popState:w(function(){var m=this.conditionStack.length-1;return m>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:w(function(m){return m=this.conditionStack.length-1-Math.abs(m||0),m>=0?this.conditionStack[m]:"INITIAL"},"topState"),pushState:w(function(m){this.begin(m)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(m,v,c,x){switch(c){case 0:break;case 1:break;case 2:break;case 3:if(m.getIndentMode&&m.getIndentMode())return m.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:m.setIndentMode&&m.setIndentMode(!1),this.begin("INITIAL"),this.unput(v.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(m.consumeIndentText)m.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return v.yytext=v.yytext.slice(2,-2),14;case 17:return v.yytext=v.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return S})();M.lexer=E;function _(){this.yy={}}return w(_,"Parser"),_.prototype=M,M.Parser=_,new _})();gt.parser=gt;var we=gt,yt=[],pt=[],mt=[],bt=new Set,vt,It=!1,_e=w((t,n,s)=>{const e=it(t).sort(),i=s??10/Math.pow(t.length,2);vt=e,e.length===1&&bt.add(e[0]),yt.push({sets:e,size:i,label:n?nt(n):void 0})},"addSubsetData"),Te=w(()=>yt,"getSubsetData"),nt=w(t=>{const n=t.trim();return n.length>=2&&n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):n},"normalizeText"),Ee=w(t=>t&&nt(t),"normalizeStyleValue"),ze=w((t,n,s)=>{const e=nt(n);pt.push({sets:it(t).sort(),id:e,label:s?nt(s):void 0})},"addTextData"),Ae=w((t,n)=>{const s=it(t).sort(),e={};for(const[i,o]of n)e[i]=Ee(o)??o;mt.push({targets:s,styles:e})},"addStyleData"),Re=w(()=>mt,"getStyleData"),it=w(t=>t.map(n=>nt(n)),"normalizeIdentifierList"),De=w(t=>{const s=it(t).filter(e=>!bt.has(e));if(s.length>0)throw new Error(`unknown set identifier: ${s.join(", ")}`)},"validateUnionIdentifiers"),Ce=w(()=>pt,"getTextData"),Ne=w(()=>vt,"getCurrentSets"),Oe=w(()=>It,"getIndentMode"),Fe=w(t=>{It=t},"setIndentMode"),je=re.venn;function Vt(){return oe(je,wt().venn)}w(Vt,"getConfig");var Le=w(()=>{ie(),yt.length=0,pt.length=0,mt.length=0,bt.clear(),vt=void 0,It=!1},"customClear"),Pe={getConfig:Vt,clear:Le,setAccTitle:Jt,getAccTitle:Zt,setDiagramTitle:Xt,getDiagramTitle:Yt,getAccDescription:Ht,setAccDescription:Kt,addSubsetData:_e,getSubsetData:Te,addTextData:ze,addStyleData:Ae,validateUnionIdentifiers:De,getTextData:Ce,getStyleData:Re,getCurrentSets:Ne,getIndentMode:Oe,setIndentMode:Fe},Be=w(t=>` + .venn-title { + font-size: 32px; + fill: ${t.vennTitleTextColor}; + font-family: ${t.fontFamily}; + } + + .venn-circle text { + font-size: 48px; + font-family: ${t.fontFamily}; + } + + .venn-intersection text { + font-size: 48px; + fill: ${t.vennSetTextColor}; + font-family: ${t.fontFamily}; + } + + .venn-text-node { + font-family: ${t.fontFamily}; + color: ${t.vennSetTextColor}; + } +`,"getStyles"),Ve=Be;function Ut(t){const n=new Map;for(const s of t){const e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}w(Ut,"buildStyleByKey");var Ue=w((t,n,s,e)=>{const i=e.db,o=i.getConfig?.(),{themeVariables:r,look:l,handDrawnSeed:f}=wt(),u=l==="handDrawn",a=[r.venn1,r.venn2,r.venn3,r.venn4,r.venn5,r.venn6,r.venn7,r.venn8].filter(Boolean),y=i.getDiagramTitle?.(),h=i.getSubsetData(),b=i.getTextData(),p=Ut(i.getStyleData()),M=Gt(h),E=o?.width??800,_=o?.height??450,g=E/1600,m=y?48*g:0,v=r.primaryTextColor??r.textColor,c=Qt(n);c.attr("viewBox",`0 0 ${E} ${_}`),y&&c.append("text").text(y).attr("class","venn-title").attr("font-size",`${32*g}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*g).style("fill",r.vennTitleTextColor||r.titleColor);const x=ot(document.createElement("div")),d=ve().width(E).height(_-m);x.datum(M).call(d);const D=u?$t.svg(x.select("svg").node()):void 0,I=Se(M,{width:E,height:_-m,padding:o?.padding??15}),C=new Map;for(const R of I){const T=Q([...R.data.sets].sort());C.set(T,R)}b.length>0&&qt(o,C,x,b,g,p);const q=te(r.background||"#f4f4f4");x.selectAll(".venn-circle").each(function(R,T){const A=ot(this),P=Q([...R.sets].sort()),B=p.get(P),L=B?.fill||a[T%a.length]||r.primaryColor;A.classed(`venn-set-${T%8}`,!0);const K=B?.["fill-opacity"]??.1,z=B?.stroke||L,N=B?.["stroke-width"]||`${5*g}`;if(u&&D){const X=C.get(P);if(X&&X.circles.length>0){const k=X.circles[0],F=D.circle(k.x,k.y,k.radius*2,{roughness:.7,seed:f,fill:kt(L,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+T*60,stroke:z,strokeWidth:parseFloat(String(N))});A.select("path").remove(),A.node()?.insertBefore(F,A.select("text").node())}}else A.select("path").style("fill",L).style("fill-opacity",K).style("stroke",z).style("stroke-width",N).style("stroke-opacity",.95);const j=B?.color||(q?ee(L,30):ne(L,30));A.select("text").style("font-size",`${48*g}px`).style("fill",j)}),u&&D?x.selectAll(".venn-intersection").each(function(R){const T=ot(this),G=Q([...R.sets].sort()),P=p.get(G),B=P?.fill;if(B){const L=T.select("path"),K=L.attr("d");if(K){const z=D.path(K,{roughness:.7,seed:f,fill:kt(B,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),N=L.node();N?.parentNode?.insertBefore(z,N),L.remove()}}else T.select("path").style("fill-opacity",0);T.select("text").style("font-size",`${48*g}px`).style("fill",P?.color??r.vennSetTextColor??v)}):(x.selectAll(".venn-intersection text").style("font-size",`${48*g}px`).style("fill",R=>{const A=Q([...R.sets].sort());return p.get(A)?.color??r.vennSetTextColor??v}),x.selectAll(".venn-intersection path").style("fill-opacity",R=>{const A=Q([...R.sets].sort());return p.get(A)?.fill?1:0}).style("fill",R=>{const A=Q([...R.sets].sort());return p.get(A)?.fill??"transparent"}));const V=c.append("g").attr("transform",`translate(0, ${m})`),O=x.select("svg").node();if(O&&"childNodes"in O)for(const R of[...O.childNodes])V.node()?.appendChild(R);se(c,_,E,o?.useMaxWidth??!0)},"draw");function Q(t){return t.join("|")}w(Q,"stableSetsKey");function qt(t,n,s,e,i,o){const r=t?.useDebugLayout??!1,f=s.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const a of e){const y=Q(a.sets),h=u.get(y);h?h.push(a):u.set(y,[a])}for(const[a,y]of u.entries()){const h=n.get(a);if(!h?.text)continue;const b=h.text.x,p=h.text.y,M=Math.min(...h.circles.map(O=>O.radius)),E=Math.min(...h.circles.map(O=>O.radius-Math.hypot(b-O.x,p-O.y)));let _=Number.isFinite(E)?Math.max(0,E):0;_===0&&Number.isFinite(M)&&(_=M*.6);const S=f.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);r&&S.append("circle").attr("class","venn-text-debug-circle").attr("cx",b).attr("cy",p).attr("r",_).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const g=Math.max(80*i,_*2*.95),m=Math.max(60*i,_*2*.95),x=(h.data.label&&h.data.label.length>0?Math.min(32*i,_*.25):0)+(y.length<=2?30*i:0),d=b-g/2,D=p-m/2+x,I=Math.max(1,Math.ceil(Math.sqrt(y.length))),C=Math.max(1,Math.ceil(y.length/I)),q=g/I,V=m/C;for(const[O,R]of y.entries()){const T=O%I,A=Math.floor(O/I),G=d+q*(T+.5),P=D+V*(A+.5);r&&S.append("rect").attr("class","venn-text-debug-cell").attr("x",d+q*T).attr("y",D+V*A).attr("width",q).attr("height",V).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const B=q*.9,L=V*.9,K=S.append("foreignObject").attr("class","venn-text-node-fo").attr("width",B).attr("height",L).attr("x",G-B/2).attr("y",P-L/2).attr("overflow","visible"),z=o.get(R.id)?.color,N=K.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(R.label??R.id);z&&N.style("color",z)}}}w(qt,"renderTextNodes");function Gt(t){const n=new Set(t.map(i=>[...i.sets].sort().join("|"))),s=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),e=[];for(const i of t){if(i.sets.length<3)continue;const o=[...i.sets].sort();for(let r=0;r0?[...t,...e]:t}w(Gt,"ensurePairwiseSubsets");var qe={draw:Ue},He={parser:we,db:Pe,renderer:qe,styles:Ve};export{He as diagram}; diff --git a/internal/webapp/static/assets/wardleyDiagram-T6FBY63Y-B_l7B-CB.js b/internal/webapp/static/assets/wardleyDiagram-T6FBY63Y-B_l7B-CB.js new file mode 100644 index 0000000..28f9476 --- /dev/null +++ b/internal/webapp/static/assets/wardleyDiagram-T6FBY63Y-B_l7B-CB.js @@ -0,0 +1,78 @@ +import{p as Mt}from"./chunk-JWPE2WC7-Czg53Rx5.js";import{s as Nt,g as zt,o as Lt,n as Tt,a as At,b as Xt,_ as u,E as Et,y as Yt,A as J,l as Q,D as It,e as Bt,p as Ft,c as V}from"./mermaid.core-B7WVQkyL.js";import{p as Rt}from"./cynefin-VYW2F7L2-CdOzebfq.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),K=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=K(e.fromPort)??K(e.toPort);const{flow:d,label:w}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:Xt,getAccTitle:At,setDiagramTitle:Tt,getDiagramTitle:Lt,getAccDescription:zt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map +`+o);const a=jt(),d=Ht(),w=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),R=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=It(r);Y.selectAll("*").remove(),Bt(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const I=S-a.padding*2,B=b-a.padding*2;R&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(R);const z=u(t=>a.padding+t/100*I,"projectX"),L=u(t=>b-a.padding-t/100*B,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const wt=g.axes.xLabel??"Evolution",mt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(wt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(mt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-B*n).attr("y2",b-a.padding-B*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(n.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const U=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||Z.get(t.target)?.has(t.source)));_.selectAll("line").data(U).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),_.selectAll("text").data(U.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,m=f/x,P=-l/x,N=i+m*y,W=p+P*y;let X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${W})`}).text(t=>t.label);const kt=v.append("g").attr("class","wardley-trends"),bt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=z(t.targetX),i=L(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,m=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);kt.selectAll("line").data(bt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(n.length>1)for(let i=0;i{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),n=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(x.forEach((m,P)=>{const N=f.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(j=>{const D=j.node(),Ct=D.getComputedTextLength();m=Math.max(m,Ct);const St=D.getBBox();P=Math.max(P,St.height)});const N=m+i*2+105,W=x.length*p+i*2+P/2,X=a.padding,$t=S-a.padding-N,vt=a.padding,Pt=b-a.padding-W;s=Math.max(X,Math.min(s,$t)),n=Math.max(vt,Math.min(n,Pt)),y.forEach((j,D)=>{j.attr("x",s+i).attr("y",n+i+(D+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",N).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const n=z(s.x),i=L(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=` + M ${n} ${i-l/2} + L ${n+p-f} ${i-l/2} + L ${n+p-f} ${i-l/2-8} + L ${n+p} ${i} + L ${n+p-f} ${i+l/2+8} + L ${n+p-f} ${i+l/2} + L ${n} ${i+l/2} + Z + `;t.append("path").attr("d",x).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",n+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}if(g.deaccelerators.length>0){const t=v.append("g").attr("class","wardley-deaccelerators");g.deaccelerators.forEach(s=>{const n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=` + M ${n+p} ${i-l/2} + L ${n+f} ${i-l/2} + L ${n+f} ${i-l/2-8} + L ${n} ${i} + L ${n+f} ${i+l/2+8} + L ${n+f} ${i+l/2} + L ${n+p} ${i+l/2} + Z + `;t.append("path").attr("d",x).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",n+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}},"draw"),_t={draw:Vt},Zt=u(({wardley:o}={})=>{const r=Et(),e=Yt(),h=J(r,e.themeVariables),a=J(h.wardley,o);return` + .wardley-background { + fill: ${a.backgroundColor}; + } + .wardley-axes line, .wardley-axes path { + stroke: ${a.axisColor}; + } + .wardley-axis-label { + fill: ${a.axisTextColor}; + } + .wardley-stage-label { + fill: ${a.axisTextColor}; + } + .wardley-grid line { + stroke: ${a.gridColor}; + } + .wardley-node circle { + fill: ${a.componentFill}; + stroke: ${a.componentStroke}; + } + .wardley-node-label { + fill: ${a.componentLabelColor}; + } + .wardley-link { + stroke: ${a.linkStroke}; + } + .wardley-link--dashed { + stroke-dasharray: 4 4; + } + .wardley-link-label { + fill: ${a.axisTextColor}; + } + .wardley-trend line { + stroke: ${a.evolutionStroke}; + } + .wardley-annotation-line { + stroke: ${a.annotationStroke}; + } + .wardley-annotation circle { + fill: ${a.annotationFill}; + stroke: ${a.annotationStroke}; + } + .wardley-annotation text { + fill: ${a.annotationTextColor}; + } + .wardley-annotations-box rect { + fill: ${a.annotationFill}; + stroke: ${a.annotationStroke}; + } + .wardley-annotations-box text { + fill: ${a.annotationTextColor}; + } + .wardley-pipeline-box { + stroke: ${a.componentStroke}; + } + .wardley-notes text { + fill: ${a.axisTextColor}; + } + `},"styles"),ae={parser:tt,db:Gt,renderer:_t,styles:Zt};export{ae as diagram}; diff --git a/internal/webapp/static/assets/xychartDiagram-ELKLHX3M-Bj9wLhGR.js b/internal/webapp/static/assets/xychartDiagram-ELKLHX3M-Bj9wLhGR.js new file mode 100644 index 0000000..2549de8 --- /dev/null +++ b/internal/webapp/static/assets/xychartDiagram-ELKLHX3M-Bj9wLhGR.js @@ -0,0 +1,7 @@ +import{s as xi,g as di,o as Yt,n as fi,a as pi,b as mi,_ as n,l as Nt,D as yi,e as bi,p as Ai,y as kt,i as wi,A as Ht,B as Ci,E as Si,az as Ri,P as Ot}from"./mermaid.core-B7WVQkyL.js";import{i as _i}from"./init-Gi6I4Gst.js";import{o as ki}from"./ordinal-Cboi1Yqb.js";import{l as Wt}from"./linear-DIpgEtso.js";import"./mermaid-CP2pUOT9.js";import"./_commonjsHelpers-CqkleIqs.js";import"./defaultLocale-DX6XiGOO.js";function Ti(e,t,i){e=+e,t=+t,i=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+i;for(var s=-1,a=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(a);++s"u"&&(v.yylloc={});var yt=v.yylloc;r.push(yt);var ui=v.options&&v.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gi(z){g.length=g.length-2*z,C.length=C.length-z,r.length=r.length-z}n(gi,"popStack");function Bt(){var z;return z=x.pop()||v.lex()||zt,typeof z!="number"&&(z instanceof Array&&(x=z,z=x.pop()),z=u.symbols_[z]||z),z}n(Bt,"lex");for(var M,U,O,bt,G={},xt,N,Vt,dt;;){if(U=g[g.length-1],this.defaultActions[U]?O=this.defaultActions[U]:((M===null||typeof M>"u")&&(M=Bt()),O=rt[U]&&rt[U][M]),typeof O>"u"||!O.length||!O[0]){var At="";dt=[];for(xt in rt[U])this.terminals_[xt]&&xt>li&&dt.push("'"+this.terminals_[xt]+"'");v.showPosition?At="Parse error on line "+(gt+1)+`: +`+v.showPosition()+` +Expecting `+dt.join(", ")+", got '"+(this.terminals_[M]||M)+"'":At="Parse error on line "+(gt+1)+": Unexpected "+(M==zt?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(At,{text:v.match,token:this.terminals_[M]||M,line:v.yylineno,loc:yt,expected:dt})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+M);switch(O[0]){case 1:g.push(M),C.push(v.yytext),r.push(v.yylloc),g.push(O[1]),M=null,Mt=v.yyleng,f=v.yytext,gt=v.yylineno,yt=v.yylloc;break;case 2:if(N=this.productions_[O[1]][1],G.$=C[C.length-N],G._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},ui&&(G._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),bt=this.performAction.apply(G,[f,Mt,gt,$.yy,O[1],C,r].concat(ci)),typeof bt<"u")return bt;N&&(g=g.slice(0,-1*N*2),C=C.slice(0,-1*N),r=r.slice(0,-1*N)),g.push(this.productions_[O[1]][0]),C.push(G.$),r.push(G._$),Vt=rt[g[g.length-2]][g[g.length-1]],g.push(Vt);break;case 3:return!0}}return!0},"parse")},ot=(function(){var F={EOF:1,parseError:n(function(u,g){if(this.yy.parser)this.yy.parser.parseError(u,g);else throw new Error(u)},"parseError"),setInput:n(function(h,u){return this.yy=u||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:n(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:n(function(h){var u=h.length,g=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(h){this.unput(this.match.slice(h))},"less"),pastInput:n(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var h=this.pastInput(),u=new Array(h.length+1).join("-");return h+this.upcomingInput()+` +`+u+"^"},"showPosition"),test_match:n(function(h,u){var g,x,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),x=h[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(h[0].length),this.matched+=h[0],g=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var r in C)this[r]=C[r];return!1}return!1},"test_match"),next:n(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var h,u,g,x;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),r=0;ru[0].length)){if(u=g,x=r,this.options.backtrack_lexer){if(h=this.test_match(g,C[r]),h!==!1)return h;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(h=this.test_match(u,C[x]),h!==!1?h:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:n(function(){var u=this.next();return u||this.lex()},"lex"),begin:n(function(u){this.conditionStack.push(u)},"begin"),popState:n(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:n(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:n(function(u){this.begin(u)},"pushState"),stateStackSize:n(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n(function(u,g,x,C){switch(x){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return F})();R.lexer=ot;function q(){this.yy={}}return n(q,"Parser"),q.prototype=R,R.Parser=q,new q})();Ct.parser=Ct;var Di=Ct;function St(e){return e.type==="bar"}n(St,"isBarPlot");function ft(e){return e.type==="band"}n(ft,"isBandAxisData");function j(e){return e.type==="linear"}n(j,"isLinearAxisData");var Q,$t=(Q=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((o,l)=>Math.max(l.length,o),0)*i,height:i};const s={width:0,height:0},a=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const o of t){const l=Ri(a,1,o),p=l?l.width:o.length*i,d=l?l.height:i;s.width=Math.max(s.width,p),s.height=Math.max(s.height,d)}return a.remove(),s}},n(Q,"TextDimensionCalculatorWithFont"),Q),Ft=.7,Xt=.2,K,Ut=(K=class{constructor(t,i,s,a){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Ft*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Ft*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),a=Xt*t.width;this.outerPadding=Math.min(s.width/2,a);let o=s.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(o=Math.max(o,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height))),o+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,o<=i&&(i-=o,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,a<=i&&(i-=a,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),a=Xt*t.height;this.outerPadding=Math.min(s.height/2,a);const o=s.width+this.axisConfig.labelPadding*2;o<=i&&(i-=o,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,a<=i&&(i-=a,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateOffsetByRotation(t){const i=this.normalizedLabelRotationInRad;return i===0?0:Math.sin(i)*this.getLabelDimension()[t]/2}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},n(K,"BaseAxis"),K),Z,vi=(Z=class extends Ut{constructor(t,i,s,a,o){super(t,a,o,i),this.categories=s,this.scale=wt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=wt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),Nt.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},n(Z,"BandAxis"),Z),J,Li=(J=class extends Ut{constructor(t,i,s,a,o){super(t,a,o,i),this.domain=s,this.scale=Wt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Wt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},n(J,"LinearAxis"),J);function Rt(e,t,i,s){const a=new $t(s);return ft(e)?new vi(t,i,e.categories,e.title,a):new Li(t,i,[e.min,e.max],e.title,a)}n(Rt,"getAxis");var tt,Pi=(tt=class{constructor(t,i,s,a){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,t.width),a=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=a&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=a,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}},n(tt,"ChartTitle"),tt);function qt(e,t,i,s){const a=new $t(s);return new Pi(a,e,t,i)}n(qt,"getChartTitleComponent");var it,Ei=(it=class{constructor(t,i,s,a,o){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=a,this.plotIndex=o}getDrawableElement(){const t=this.plotData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]);let i;if(this.orientation==="horizontal"?i=Ot().y(a=>a[0]).x(a=>a[1])(t):i=Ot().x(a=>a[0]).y(a=>a[1])(t),!i)return[];const s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const l=[];for(const[p,[d,k]]of t.entries()){const T=this.plotData.pointLabels[p];T&&(this.orientation==="horizontal"?l.push({x:k+10,y:d,text:T,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):l.push({x:d,y:k-10,text:T,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}l.length>0&&s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:l})}return s}},n(it,"LinePlot"),it),et,Ii=(et=class{constructor(t,i,s,a,o,l){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=a,this.orientation=o,this.plotIndex=l}getDrawableElement(){const t=this.barData.data.map(o=>[this.xAxis.getScaleValue(o[0]),this.yAxis.getScaleValue(o[1])]),s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),a=s/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(o=>({x:this.boundingRect.x,y:o[0]-a,height:s,width:o[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(o=>({x:o[0]-a,y:o[1],width:s,height:this.boundingRect.y+this.boundingRect.height-o[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},n(et,"BarPlot"),et),st,Mi=(st=class{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{const a=new Ei(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...a.getDrawableElement())}break;case"bar":{const a=new Ii(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...a.getDrawableElement())}break}return t}},n(st,"BasePlot"),st);function Gt(e,t,i){return new Mi(e,t,i)}n(Gt,"getPlotComponent");var at,zi=(at=class{constructor(t,i,s,a){this.chartConfig=t,this.chartData=i,this.componentStore={title:qt(t,i,s,a),plot:Gt(t,i,s),xAxis:Rt(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},a),yAxis:Rt(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},a)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,a=0,o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),l=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),p=this.componentStore.plot.calculateSpace({width:o,height:l});t-=p.width,i-=p.height,p=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),a=p.height,i-=p.height,this.componentStore.xAxis.setAxisPosition("bottom"),p=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=p.height,this.componentStore.yAxis.setAxisPosition("left"),p=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=p.width,t-=p.width,t>0&&(o+=t,t=0),i>0&&(l+=i,i=0),this.componentStore.plot.calculateSpace({width:o,height:l}),this.componentStore.plot.setBoundingBoxXY({x:s,y:a}),this.componentStore.xAxis.setRange([s,s+o]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:a+l}),this.componentStore.yAxis.setRange([a,a+l]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(d=>St(d))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,a=0,o=0,l=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),p=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),d=this.componentStore.plot.calculateSpace({width:l,height:p});t-=d.width,i-=d.height,d=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=d.height,i-=d.height,this.componentStore.xAxis.setAxisPosition("left"),d=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=d.width,a=d.width,this.componentStore.yAxis.setAxisPosition("top"),d=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=d.height,o=s+d.height,t>0&&(l+=t,t=0),i>0&&(p+=i,i=0),this.componentStore.plot.calculateSpace({width:l,height:p}),this.componentStore.plot.setBoundingBoxXY({x:a,y:o}),this.componentStore.yAxis.setRange([a,a+l]),this.componentStore.yAxis.setBoundingBoxXY({x:a,y:s}),this.componentStore.xAxis.setRange([o,o+p]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:o}),this.chartData.plots.some(k=>St(k))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},n(at,"Orchestrator"),at),nt,Bi=(nt=class{static build(t,i,s,a){return new zi(t,i,s,a).getDrawableElement()}},n(nt,"XYChartBuilder"),nt),ht=0,jt,lt=vt(),ct=Dt(),y=Lt(),_t=ct.plotColorPalette.split(",").map(e=>e.trim()),pt=!1,Tt=!1;function Dt(){const e=Si(),t=kt();return Ht(e.xyChart,t.themeVariables.xyChart)}n(Dt,"getChartDefaultThemeConfig");function vt(){const e=kt();return Ht(Ci.xyChart,e.xyChart)}n(vt,"getChartDefaultConfig");function Lt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}n(Lt,"getChartDefaultData");function ut(e){const t=kt();return wi(e.trim(),t)}n(ut,"textSanitizer");function Qt(e){jt=e}n(Qt,"setTmpSVGG");function Kt(e){e==="horizontal"?lt.chartOrientation="horizontal":lt.chartOrientation="vertical"}n(Kt,"setOrientation");function Zt(e){y.xAxis.title=ut(e.text)}n(Zt,"setXAxisTitle");function Pt(e,t){y.xAxis={type:"linear",title:y.xAxis.title,min:e,max:t},pt=!0}n(Pt,"setXAxisRangeData");function Jt(e){y.xAxis={type:"band",title:y.xAxis.title,categories:e.map(t=>ut(t.text))},pt=!0}n(Jt,"setXAxisBand");function ti(e){y.yAxis.title=ut(e.text)}n(ti,"setYAxisTitle");function ii(e,t){y.yAxis={type:"linear",title:y.yAxis.title,min:e,max:t},Tt=!0}n(ii,"setYAxisRangeData");function ei(e){const t=Math.min(...e),i=Math.max(...e),s=j(y.yAxis)?y.yAxis.min:1/0,a=j(y.yAxis)?y.yAxis.max:-1/0;y.yAxis={type:"linear",title:y.yAxis.title,min:Math.min(s,t),max:Math.max(a,i)}}n(ei,"setYAxisRangeFromPlotData");function Et(e){let t=[];if(e.length===0)return t;if(!pt){const i=j(y.xAxis)?y.xAxis.min:1/0,s=j(y.xAxis)?y.xAxis.max:-1/0;Pt(Math.min(i,1),Math.max(s,e.length))}if(ft(y.xAxis)&&e.length>y.xAxis.categories.length&&(e=e.slice(0,y.xAxis.categories.length)),Tt||ei(e),ft(y.xAxis)&&(t=y.xAxis.categories.map((i,s)=>[i,e[s]])),j(y.xAxis)){const i=y.xAxis.min,s=y.xAxis.max;if(e.length===1)t=[[`${i}`,e[0]]];else{const a=(s-i)/(e.length-1);t=e.map((o,l)=>[`${i+l*a}`,o])}}return t}n(Et,"transformDataWithoutCategory");function It(e){return _t[e===0?0:e%_t.length]}n(It,"getPlotColorFromPalette");function si(e,t){const i=t.map(l=>l.value),s=t.map(l=>l.label?ut(l.label):""),a=Et(i),o=s.some(l=>l!=="");y.plots.push({type:"line",strokeFill:It(ht),strokeWidth:2,data:a,...o?{pointLabels:s}:{}}),ht++}n(si,"setLineData");function ai(e,t){const i=t.map(a=>a.value),s=Et(i);y.plots.push({type:"bar",fill:It(ht),data:s}),ht++}n(ai,"setBarData");function ni(){if(y.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return y.title=Yt(),Bi.build(lt,y,ct,jt)}n(ni,"getDrawableElem");function oi(){return ct}n(oi,"getChartThemeConfig");function ri(){return lt}n(ri,"getChartConfig");function hi(){return y}n(hi,"getXYChartData");var Vi=n(function(){Ai(),ht=0,lt=vt(),y=Lt(),ct=Dt(),_t=ct.plotColorPalette.split(",").map(e=>e.trim()),pt=!1,Tt=!1},"clear"),Oi={getDrawableElem:ni,clear:Vi,setAccTitle:mi,getAccTitle:pi,setDiagramTitle:fi,getDiagramTitle:Yt,getAccDescription:di,setAccDescription:xi,setOrientation:Kt,setXAxisTitle:Zt,setXAxisRangeData:Pt,setXAxisBand:Jt,setYAxisTitle:ti,setYAxisRangeData:ii,setLineData:si,setBarData:ai,setTmpSVGG:Qt,getChartThemeConfig:oi,getChartConfig:ri,getXYChartData:hi},Wi=n((e,t,i,s)=>{const a=s.db,o=a.getChartThemeConfig(),l=a.getChartConfig(),p=a.getXYChartData().plots[0].data.map(m=>m[1]);function d(m){return m==="top"?"text-before-edge":"middle"}n(d,"getDominantBaseLine");function k(m){return m==="left"?"start":m==="right"?"end":"middle"}n(k,"getTextAnchor");function T(m){return`translate(${m.x}, ${m.y}) rotate(${m.rotation||0})`}n(T,"getTextTransformation"),Nt.debug(`Rendering xychart chart +`+e);const _=yi(t),b=_.append("g").attr("class","main"),E=b.append("rect").attr("width",l.width).attr("height",l.height).attr("class","background");bi(_,l.height,l.width,!0),_.attr("viewBox",`0 0 ${l.width} ${l.height}`),E.attr("fill",o.backgroundColor),a.setTmpSVGG(_.append("g").attr("class","mermaid-tmp-group"));const L=a.getDrawableElem(),P={};function I(m){let D=b,c="";for(const[B]of m.entries()){let W=b;B>0&&P[c]&&(W=P[c]),c+=m[B],D=P[c],D||(D=P[c]=W.append("g").attr("class",m[B]))}return D}n(I,"getGroup");for(const m of L){if(m.data.length===0)continue;const D=I(m.groupTexts);switch(m.type){case"rect":if(D.selectAll("rect").data(m.data).enter().append("rect").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).attr("fill",c=>c.fill).attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth),l.showDataLabel){const c=l.showDataLabelOutsideBar;if(l.chartOrientation==="horizontal"){let B=function(w,V){const{data:R,label:ot}=w;return V*ot.length*W<=R.width-X};n(B,"fitsHorizontally");const W=.7,X=10,Y=m.data.map((w,V)=>({data:w,label:p[V].toString()})).filter(w=>w.data.width>0&&w.data.height>0),S=Y.map(w=>{const{data:V}=w;let R=V.height*.7;for(;!B(w,R)&&R>0;)R-=1;return R}),H=Math.floor(Math.min(...S)),A=n(w=>c?w.data.x+w.data.width+X:w.data.x+w.data.width-X,"determineLabelXPosition");D.selectAll("text").data(Y).enter().append("text").attr("x",A).attr("y",w=>w.data.y+w.data.height/2).attr("text-anchor",c?"start":"end").attr("dominant-baseline","middle").attr("fill",o.dataLabelColor).attr("font-size",`${H}px`).text(w=>w.label)}else{let B=function(A,w,V){const{data:R,label:ot}=A,F=w*ot.length*.7,h=R.x+R.width/2,u=h-F/2,g=h+F/2,x=u>=R.x&&g<=R.x+R.width,C=R.y+V+w<=R.y+R.height;return x&&C};n(B,"fitsInBar");const W=10,X=m.data.map((A,w)=>({data:A,label:p[w].toString()})).filter(A=>A.data.width>0&&A.data.height>0),Y=X.map(A=>{const{data:w,label:V}=A;let R=w.width/(V.length*.7);for(;!B(A,R,W)&&R>0;)R-=1;return R}),S=Math.floor(Math.min(...Y)),H=n(A=>c?A.data.y-W:A.data.y+W,"determineLabelYPosition");D.selectAll("text").data(X).enter().append("text").attr("x",A=>A.data.x+A.data.width/2).attr("y",H).attr("text-anchor","middle").attr("dominant-baseline",c?"auto":"hanging").attr("fill",o.dataLabelColor).attr("font-size",`${S}px`).text(A=>A.label)}}break;case"text":D.selectAll("text").data(m.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",c=>c.fill).attr("font-size",c=>c.fontSize).attr("dominant-baseline",c=>d(c.verticalPos)).attr("text-anchor",c=>k(c.horizontalPos)).attr("transform",c=>T(c)).text(c=>c.text);break;case"path":D.selectAll("path").data(m.data).enter().append("path").attr("d",c=>c.path).attr("fill",c=>c.fill?c.fill:"none").attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth);break}}},"draw"),Fi={draw:Wi},Gi={parser:Di,db:Oi,renderer:Fi};export{Gi as diagram}; diff --git a/internal/webapp/static/index.html b/internal/webapp/static/index.html index 06e5bae..5cbc3e2 100644 --- a/internal/webapp/static/index.html +++ b/internal/webapp/static/index.html @@ -5,8 +5,10 @@ BearDrive - - + + + +
    diff --git a/internal/webapp/static/share-mermaid.js b/internal/webapp/static/share-mermaid.js new file mode 100644 index 0000000..69873a2 --- /dev/null +++ b/internal/webapp/static/share-mermaid.js @@ -0,0 +1 @@ +import{r,D as a,L as d}from"./assets/mermaid-CP2pUOT9.js";const n=matchMedia("(prefers-color-scheme: dark)").matches;r(document.body.innerHTML,n?a:d).then(e=>{document.body.innerHTML=e}); diff --git a/web/docs/src/content/docs/reference/hub-config.md b/web/docs/src/content/docs/reference/hub-config.md index f811e18..5b198e9 100644 --- a/web/docs/src/content/docs/reference/hub-config.md +++ b/web/docs/src/content/docs/reference/hub-config.md @@ -4,8 +4,8 @@ description: Every bdrive serve flag and config-file key. --- `bdrive serve` serves a website — browse folders and files, read markdown rendered -Obsidian-style (including `[[wikilinks]]`, task lists, and tables), download any -file. Pointed at a storage root, it becomes a multi-project sync hub. +Obsidian-style (including `[[wikilinks]]`, task lists, tables, and ```` ```mermaid ```` +diagrams), download any file. Pointed at a storage root, it becomes a multi-project sync hub. It is read-only unless started with `--upload`.