From 4f04b78c71ff5313f90483673098a046dc06bee3 Mon Sep 17 00:00:00 2001 From: "Snow Lee (Sungwon)" Date: Wed, 19 Aug 2026 12:55:29 -0700 Subject: [PATCH] feat(webapp): frontmatter moves to a collapsible side panel (BEA-154) (#187) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A doc's YAML frontmatter rendered as a table pinned to the top of the reading column, so on anything with more than two or three keys the document itself started below the fold. It is a panel beside the prose now — a sticky rail on a wide window, a closed disclosure above the body on anything narrower — and the reading column starts with the document. The table was built on the server and handed to the client inside one HTML string, so this is not a CSS change: markdown.go splits the parse (frontmatterPairs) from the markup, /api/render gains an ordered `frontmatter` field, and the viewer switches to RenderMarkdownPairs. RenderMarkdown keeps its exact output — it is the public share page, and every /s/ link ever minted serves it. shares_test now pins that, because nothing else would have failed if a later cleanup moved shares.go onto the pairs path. Values cross the wire as literal text plus a `code` flag rather than pre-escaped HTML, so the panel is ordinary React text nodes and never touches dangerouslySetInnerHTML: "a value containing markup renders as text" holds by construction. The rail's breakpoint is 1400px, not the 1180px the plan named — 768 of prose + 28 + 240 of rail needs 1036px of column, and at 1280 the reading measure lost 110px, which is the squeeze the panel exists to avoid. Co-authored-by: Claude Opus 5 (1M context) --- architecture/webapp-server.md | 15 +++ internal/webapp/dir_test.go | 31 +++++- internal/webapp/frontend/e2e/browse.spec.ts | 92 ++++++++++++++++++ internal/webapp/frontend/src/api/types.ts | 12 +++ .../frontend/src/components/FileView.tsx | 43 +++++++- internal/webapp/frontend/src/style.css | 37 +++++-- internal/webapp/frontend/src/util.ts | 26 +++++ internal/webapp/history_test.go | 18 +++- internal/webapp/markdown.go | 97 +++++++++++++++---- internal/webapp/markdown_test.go | 78 ++++++++++++++- internal/webapp/sec_defer_test.go | 37 +++++++ internal/webapp/server.go | 13 ++- internal/webapp/shares_test.go | 25 +++++ .../{index-Gbsbki_z.js => index-C9I9NHlF.js} | 30 +++--- ...{index-DISTZ6FW.css => index-L-I4D1mx.css} | 2 +- internal/webapp/static/index.html | 4 +- 16 files changed, 498 insertions(+), 62 deletions(-) rename internal/webapp/static/assets/{index-Gbsbki_z.js => index-C9I9NHlF.js} (74%) rename internal/webapp/static/assets/{index-DISTZ6FW.css => index-L-I4D1mx.css} (94%) diff --git a/architecture/webapp-server.md b/architecture/webapp-server.md index 005fe8e..226c2cb 100644 --- a/architecture/webapp-server.md +++ b/architecture/webapp-server.md @@ -316,6 +316,18 @@ classDiagram +Token +Project +Path +Creator +Expires } + class markdownRender { + <<markdown.go>> + frontmatterPairs(src) pairs + body + RenderMarkdown → table + body HTML + RenderMarkdownPairs → pairs + body HTML + yamlValue(node) text + code flag + } + class FrontmatterPair { + +Key +Value +Code + } + note for markdownRender "One parse, two surfaces. The share page is the reason the split exists: RenderMarkdown still bakes the key/value TABLE into its HTML, because every /s/ link ever minted serves that output, while the viewer takes RenderMarkdownPairs and gets the frontmatter as DATA so it can hang it beside the prose instead of on top of it (BEA-154). Values cross the wire as literal text plus a code flag, never pre-escaped markup — the panel is a React text node, so escaping is the client's by construction; the table escapes on its way out. shares_test pins the table, because nothing else would fail if someone later tidied shares.go onto the pairs path" + class mermaidTag { <<shares.go, the .md branch>> body contains language-mermaid? @@ -489,6 +501,9 @@ classDiagram projectPerm ..> Directory : org role ShareDB ..> Share ShareDB ..> mermaidTag : markdown shares only + ShareDB ..> markdownRender : RenderMarkdown (table stays) + Server ..> markdownRender : RenderMarkdownPairs (viewer) + markdownRender ..> FrontmatterPair 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 3174b4c..7254afb 100644 --- a/internal/webapp/dir_test.go +++ b/internal/webapp/dir_test.go @@ -28,10 +28,11 @@ func dirServer(t *testing.T, files map[string]string) http.Handler { func TestDirSourceServesFolder(t *testing.T) { h := dirServer(t, map[string]string{ - "README.md": "# Local", - "notes/plan.md": "content", - ".bdrive": `{"volume":"x"}`, // settings file must be hidden - ".git/config": "noise", // .git must be skipped + "README.md": "# Local", + "notes/plan.md": "content", + "notes/props.md": "---\ntitle: Plan\ntags: [a, b]\n---\n\n# Heading\n", + ".bdrive": `{"volume":"x"}`, // settings file must be hidden + ".git/config": "noise", // .git must be skipped }) var root Node @@ -65,6 +66,28 @@ func TestDirSourceServesFolder(t *testing.T) { t.Errorf("plain-folder render carries identity: %s", rec.Body) } + // Frontmatter travels as ordered data, not as a table inside html — + // the viewer puts it in a side panel, so the body starts with the body. + rec = get(t, h, "/api/render?path=notes/props.md") + var doc struct { + HTML string `json:"html"` + Frontmatter []FrontmatterPair `json:"frontmatter"` + } + if err := json.Unmarshal(rec.Body.Bytes(), &doc); err != nil { + t.Fatal(err) + } + if len(doc.Frontmatter) != 2 || doc.Frontmatter[0].Key != "title" || + doc.Frontmatter[1].Value != "a, b" { + t.Errorf("frontmatter = %+v", doc.Frontmatter) + } + if strings.Contains(doc.HTML, `class="frontmatter"`) { + t.Errorf("render still bakes the table into html: %s", doc.HTML) + } + // A doc without any: the field is absent, so the viewer shows no panel. + if rec := get(t, h, "/api/render?path=README.md"); strings.Contains(rec.Body.String(), `"frontmatter"`) { + t.Errorf("render carries an empty frontmatter field: %s", rec.Body) + } + if rec := get(t, h, "/api/file?path=.git/config"); rec.Code != 404 { t.Fatalf(".git content must be hidden, got %d", rec.Code) } diff --git a/internal/webapp/frontend/e2e/browse.spec.ts b/internal/webapp/frontend/e2e/browse.spec.ts index 44a370c..0266480 100644 --- a/internal/webapp/frontend/e2e/browse.spec.ts +++ b/internal/webapp/frontend/e2e/browse.spec.ts @@ -1203,3 +1203,95 @@ test("read counts disclose that your own views count", async ({ page }) => { "Includes your own views. Repeat opens by the same reader inside 10 minutes count once.", ); }); + +/* BEA-154: a doc's YAML frontmatter used to be a table pinned to the top of + the reading column, pushing the document below the fold. It is a panel + beside the prose now — a rail on a wide window, a closed disclosure on a + phone — and the reading column starts with the document. */ +test("frontmatter is a side panel, not a slab on top of the document", async ({ page }) => { + // Wide enough for the rail: the breakpoint is arithmetic (style.css), and + // the default 1280 viewport is deliberately below it. + await page.setViewportSize({ width: 1440, height: 900 }); + await login(page); + const pid = await wikiId(page); + // Seeded at runtime so no other spec's file counts move. + const put = async (path: string, body: string) => { + const r = await page.request.put( + `/api/p/${pid}/upload/content?path=${encodeURIComponent(path)}`, + { data: body }, + ); + expect(r.ok(), `seeding ${path}: ${r.status()}`).toBeTruthy(); + }; + await put( + "meta/props.md", + "---\ntitle: Q3 findings\nstatus: draft\ntags: [churn, revenue]\nmeta:\n reviewed: true\n---\n\n# Q3 findings\n\nBody text.\n", + ); + + await page.goto(`/${pid}/meta/props.md`); + const panel = page.locator("#content .fmpanel"); + await expect(panel).toBeVisible(); + // The document leads: the h1 is the first thing in the prose column, and + // no frontmatter table survives inside the rendered markdown. + await expect(page.locator("#content h1")).toHaveText("Q3 findings"); + await expect(page.locator("#content table.frontmatter")).toHaveCount(0); + expect( + await page.evaluate(() => { + const h1 = document.querySelector("#content h1") as HTMLElement; + return h1.getBoundingClientRect().top; + }), + ).toBeLessThan( + await panel.evaluate((el) => el.getBoundingClientRect().bottom), + ); + // Same keys, author order, nested value still compact YAML in . + await expect(panel.locator("dt")).toHaveText(["title", "status", "tags", "meta"]); + await expect(panel.locator("dd").nth(2)).toHaveText("churn, revenue"); + await expect(panel.locator("dd code")).toHaveText("reviewed: true"); + // A rail, not a squeezed column: the prose keeps its 768px measure and the + // panel sits to its right. + const geom = await page.evaluate(() => { + const prose = document.querySelector("#content .markdown > div:not(.fmpanel)") as HTMLElement; + const p = document.querySelector(".fmpanel") as HTMLElement; + return { prose: prose.getBoundingClientRect(), panel: p.getBoundingClientRect() }; + }); + expect(Math.round(geom.prose.width), "prose measure unchanged").toBe(768); + expect(geom.panel.left, "panel is to the right of the prose").toBeGreaterThanOrEqual( + geom.prose.right, + ); + + // Collapsing is remembered — across a different file, and across a reload. + await panel.locator("summary").click(); + await expect(panel).not.toHaveAttribute("open", /.*/); + await page.goto(`/${pid}/index.md`); + await expect(page.locator("#content .fmpanel")).toHaveCount(0); // no frontmatter, no panel + await page.goto(`/${pid}/meta/props.md`); + await expect(page.locator("#content .fmpanel")).not.toHaveAttribute("open", /.*/); + await page.reload(); + await expect(page.locator("#content .fmpanel")).not.toHaveAttribute("open", /.*/); +}); + +test("frontmatter panel on a phone: closed disclosure above the body", async ({ browser }) => { + const ctx = await browser.newContext({ viewport: { width: 390, height: 844 } }); + const page = await ctx.newPage(); + await login(page); + const pid = await wikiId(page); + await page.request.put(`/api/p/${pid}/upload/content?path=meta/phone.md`, { + data: "---\ntitle: Q3\nowner: snow\n---\n\n# Q3\n\nBody.\n", + }); + await page.goto(`/${pid}/meta/phone.md`); + const panel = page.locator("#content .fmpanel"); + await expect(panel).toBeVisible(); + // No stored choice yet: a phone has no room for a rail, so it opens closed + // and sits above the body rather than beside it. + await expect(panel).not.toHaveAttribute("open", /.*/); + const m = await page.evaluate(() => { + const p = document.querySelector(".fmpanel") as HTMLElement; + const h1 = document.querySelector("#content h1") as HTMLElement; + return { + above: p.getBoundingClientRect().bottom <= h1.getBoundingClientRect().top, + overflow: document.documentElement.scrollWidth > document.documentElement.clientWidth, + }; + }); + expect(m.above, "390px: panel sits above the body").toBe(true); + expect(m.overflow, "390px: horizontal page scroll").toBe(false); + await ctx.close(); +}); diff --git a/internal/webapp/frontend/src/api/types.ts b/internal/webapp/frontend/src/api/types.ts index db0933b..5d11497 100644 --- a/internal/webapp/frontend/src/api/types.ts +++ b/internal/webapp/frontend/src/api/types.ts @@ -146,10 +146,22 @@ export interface Node { children?: Node[]; } +// One key/value row of a document's YAML frontmatter, in author order. +// `value` is plain text, never markup — the panel renders it as a text node, +// so escaping is React's job and not a rule anyone has to remember. `code` +// marks the nested values that read as compact YAML. +export interface FrontmatterPair { + key: string; + value: string; + code?: boolean; +} + // GET .../render (handleRender, server.go) export interface RenderDoc { path: string; html: string; + // Absent when the document has none: no field, no panel. + frontmatter?: FrontmatterPair[]; size: number; time?: string; user?: string; diff --git a/internal/webapp/frontend/src/components/FileView.tsx b/internal/webapp/frontend/src/components/FileView.tsx index b608411..2436fd8 100644 --- a/internal/webapp/frontend/src/components/FileView.tsx +++ b/internal/webapp/frontend/src/components/FileView.tsx @@ -1,7 +1,7 @@ import { useEffect, useMemo, useState, type ReactNode } from "react"; import { useQuery } from "@tanstack/react-query"; import { getJSON } from "../api/http"; -import type { HeatMap, Node, RenderDoc } from "../api/types"; +import type { FrontmatterPair, HeatMap, Node, RenderDoc } from "../api/types"; import { heatTotal, heatText } from "../hooks/useBrowse"; import { HEAT_DISCLOSURE, staleNote } from "../lib/heat"; import { useTextAt } from "../hooks/useBlob"; @@ -12,8 +12,10 @@ import { MD_EXT, PDF_EXT, TEXT_EXT, + fmPanelOpen, humanSize, joinPath, + rememberFmPanel, resolveWiki, whoChanged, } from "../util"; @@ -234,11 +236,15 @@ function MarkdownView(props: Parameters[0]) { if (error) return ; if (!doc) return null; + // The panel is a SIBLING of the prose, not a wrapper around it: that is + // what lets plain CSS hang it in the right margin (style.css, .page.read) + // without a third column in AppShell or new props through Browser. // Server-rendered, server-sanitized markdown — same trust model as the // classic app assigning innerHTML. return ( <> + {doc.frontmatter?.length ? : null}
handleLinkClick(e, path, onOpenFile)} @@ -247,6 +253,41 @@ function MarkdownView(props: Parameters[0]) { ); } +/* A document's YAML frontmatter, beside the prose instead of on top of it. + Native
, so the disclosure, its keyboard handling and its a11y + semantics come from the element rather than from us — and values are + ordinary React text children, which is what makes "a value containing + markup renders as text" true by construction rather than by a rule. */ +function FrontmatterPanel({ pairs }: { pairs: FrontmatterPair[] }) { + const [open, setOpen] = useState(fmPanelOpen); + return ( +
+ {/* The click, not the element's own `toggle` event: `toggle` is + dispatched asynchronously, so collapsing the panel and immediately + opening another file lost the preference — the navigation started + before the handler ran. A summary click is also what Enter and + Space produce, so the keyboard path is the same one. */} + { + e.preventDefault(); + setOpen(!open); + rememberFmPanel(!open); // every file and every reload, until changed + }} + > + Properties + +
+ {pairs.map((p) => ( +
+
{p.key}
+
{p.code ? {p.value} : p.value}
+
+ ))} +
+
+ ); +} + /* The share gate could already name the rule and the line well enough to refuse to publish this file, while the file view rendered the same key as ordinary prose (BEA-147). Advisory only, in VersionBanner's shape: a strip diff --git a/internal/webapp/frontend/src/style.css b/internal/webapp/frontend/src/style.css index b40acce..0eed818 100644 --- a/internal/webapp/frontend/src/style.css +++ b/internal/webapp/frontend/src/style.css @@ -1145,12 +1145,37 @@ a.ai-main:hover { color: var(--accent); } the caret marker only lines up in a monospace, non-wrapping box. The height cap keeps a pathological message from pushing the document off the page. */ .markdown .mermaid-err-detail { margin: 0 0 1.3em; font: 11.5px/1.5 var(--mono); color: var(--text-faint); white-space: pre; overflow: auto; max-height: 12em; } -/* 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); } -.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; } +/* Frontmatter panel — the doc's YAML header beside the prose instead of on + top of it. The viewer's /api/render hands the pairs over as data; the + share page keeps the old table and inlines its own CSS (shares.go), which + is why no `table.frontmatter` rule lives here any more. */ +.fmpanel { margin: 0 0 1.8em; font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; } +.fmpanel > summary { list-style: none; cursor: pointer; padding: 7px 12px; color: var(--text-faint); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; user-select: none; display: flex; align-items: center; gap: 6px; } +.fmpanel > summary::-webkit-details-marker { display: none; } +/* The caret is the only open/closed signal, so it is drawn rather than + inherited: the default marker is hidden above to keep the row on one line. */ +.fmpanel > summary::before { content: ""; width: 0; height: 0; border: 4px solid transparent; border-left-color: currentColor; transition: transform .12s ease; } +.fmpanel[open] > summary::before { transform: rotate(90deg) translateX(-1px); } +.fmpanel > summary:hover { color: var(--text-dim); } +.fmpanel > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; } +.fmpanel dl { margin: 0; padding: 0 12px 4px; border-top: 1px solid var(--border); } +.fmpanel dl > div { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); } +.fmpanel dl > div:last-child { border-bottom: none; } +.fmpanel dt { flex: 0 0 auto; max-width: 40%; color: var(--text-faint); font-size: 11.5px; font-weight: 600; overflow-wrap: anywhere; } +.fmpanel dd { margin: 0; min-width: 0; color: var(--text-dim); overflow-wrap: anywhere; } +.fmpanel code { white-space: pre-wrap; font: 11px/1.5 var(--mono); color: #e4d9c4; } +/* Wide enough for a rail, and the number is arithmetic rather than taste: + 768 (prose) + 28 (gap) + 240 (rail) = 1036 of column, plus 265 of sidebar, + 80 of #content padding and ~10 of scrollbar gutter = 1391. A 1280 laptop + is NOT wide enough — asking for the rail there costs the prose 110px of + measure, which is the squeeze this panel exists to avoid. Below the + breakpoint none of this applies and the
renders where it sits in + the DOM: above the body, closed. Keep FM_RAIL in util.ts in step. */ +@media (min-width: 1400px) { + .page.read:has(.fmpanel) { max-width: calc(var(--page-read) + 268px); display: grid; grid-template-columns: minmax(0, var(--page-read)) 240px; column-gap: 28px; align-items: start; } + .page.read:has(.fmpanel) > * { grid-column: 1; min-width: 0; } + .page.read:has(.fmpanel) > .fmpanel { grid-column: 2; grid-row: 1; position: sticky; top: 0; margin: 0; } +} .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); } diff --git a/internal/webapp/frontend/src/util.ts b/internal/webapp/frontend/src/util.ts index 84ff827..14a020a 100644 --- a/internal/webapp/frontend/src/util.ts +++ b/internal/webapp/frontend/src/util.ts @@ -83,6 +83,32 @@ export function rememberProject(id: string) { } } +/* Whether the frontmatter panel is expanded, remembered for this browser + the same way and with the same caveats as lastProject above. Unset (the + first visit) is not "closed": the rail only exists on a wide window, so + the default follows the width — expanded on desktop, a closed disclosure + on a phone. */ +const FM_PANEL = "bdrive.fmPanel"; +export const FM_RAIL = "(min-width: 1400px)"; // must match style.css + +export function fmPanelOpen(): boolean { + try { + const v = localStorage.getItem(FM_PANEL); + if (v !== null) return v === "1"; + } catch { + /* fall through to the width default */ + } + return window.matchMedia(FM_RAIL).matches; +} + +export function rememberFmPanel(open: boolean) { + try { + localStorage.setItem(FM_PANEL, open ? "1" : "0"); + } catch { + /* preference only */ + } +} + /* Who made a change, as history renders it everywhere: the account, with the display name in front when the server knows one, falling back to the git/OS identity of an offline device. */ diff --git a/internal/webapp/history_test.go b/internal/webapp/history_test.go index 9720321..80a4da6 100644 --- a/internal/webapp/history_test.go +++ b/internal/webapp/history_test.go @@ -193,8 +193,8 @@ func TestHistoryAPI(t *testing.T) { func TestRenderVersion(t *testing.T) { srv, p, root := newHub(t, false, nil) f := newFakeRemoteAt(t, filepath.Join(root, p.ID)) - f.putAs("dev1", "alice@x.io", "Alice", "guide.md", "# Guide\n\nFirst version.\n") - f.putAs("dev1", "alice@x.io", "Alice", "guide.md", "# Guide\n\nSecond version, longer.\n") + f.putAs("dev1", "alice@x.io", "Alice", "guide.md", "---\nstatus: draft\n---\n\n# Guide\n\nFirst version.\n") + f.putAs("dev1", "alice@x.io", "Alice", "guide.md", "---\nstatus: final\n---\n\n# Guide\n\nSecond version, longer.\n") var err error if srv.Reads, err = OpenReadLedger(filepath.Join(t.TempDir(), "reads.json"), 0); err != nil { t.Fatal(err) @@ -216,12 +216,20 @@ func TestRenderVersion(t *testing.T) { t.Fatalf("render version: %d %s", rec.Code, rec.Body) } var doc struct { - Path string `json:"path"` - HTML string `json:"html"` + Path string `json:"path"` + HTML string `json:"html"` + Frontmatter []FrontmatterPair `json:"frontmatter"` } if err := json.Unmarshal(rec.Body.Bytes(), &doc); err != nil { t.Fatal(err) } + // That version's frontmatter, not today's — the panel follows the bytes. + if len(doc.Frontmatter) != 1 || doc.Frontmatter[0] != (FrontmatterPair{Key: "status", Value: "draft"}) { + t.Fatalf("version frontmatter = %+v", doc.Frontmatter) + } + if strings.Contains(doc.HTML, `class="frontmatter"`) { + t.Fatalf("version render bakes the table into html: %q", doc.HTML) + } if !strings.Contains(doc.HTML, "First version") || strings.Contains(doc.HTML, "Second version") { t.Fatalf("rendered the wrong version: %q", doc.HTML) } @@ -233,7 +241,7 @@ func TestRenderVersion(t *testing.T) { } // current content still renders from the snapshot rec = do(t, h, "GET", base+"render?path=guide.md", nil) - if !strings.Contains(rec.Body.String(), "Second version") { + if !strings.Contains(rec.Body.String(), "Second version") || !strings.Contains(rec.Body.String(), `"final"`) { t.Fatalf("current render = %s", rec.Body) } diff --git a/internal/webapp/markdown.go b/internal/webapp/markdown.go index 432b5a2..7ce94b0 100644 --- a/internal/webapp/markdown.go +++ b/internal/webapp/markdown.go @@ -39,60 +39,115 @@ func expandWikilinks(src []byte) []byte { // the source is escaped by goldmark's safe default. A leading YAML // frontmatter block renders as a small key/value table instead of the // broken thematic-break soup goldmark would make of it. +// +// This is the PUBLIC SHARE PAGE's renderer (shares.go) and its output is +// what every link ever minted serves — the table stays. The viewer uses +// RenderMarkdownPairs instead, which hands the frontmatter to the client as +// data so it can live in a side panel. func RenderMarkdown(src []byte) (string, error) { table, body := frontmatterTable(src) + out, err := renderBody(body) + if err != nil { + return "", err + } + return table + out, nil +} + +// RenderMarkdownPairs is RenderMarkdown for the viewer: the frontmatter +// comes back as ordered key/value data and the HTML is body-only. Values +// are raw text (never markup) — the client escapes them by rendering them +// as text nodes. +func RenderMarkdownPairs(src []byte) ([]FrontmatterPair, string, error) { + pairs, body := frontmatterPairs(src) + out, err := renderBody(body) + if err != nil { + return nil, "", err + } + return pairs, out, nil +} + +func renderBody(body []byte) (string, error) { var buf bytes.Buffer if err := md.Convert(expandWikilinks(body), &buf); err != nil { return "", err } - return table + buf.String(), nil + return buf.String(), nil } // fmCloseRe matches a frontmatter closing fence on its own line. var fmCloseRe = regexp.MustCompile(`(?m)^(---|\.\.\.)\s*$`) -// frontmatterTable splits a leading YAML frontmatter block off src and -// renders it as an HTML table (keys in author order, values escaped). -// Anything that isn't a well-formed YAML mapping falls through untouched — -// a stray --- line must keep rendering exactly as it always did. -func frontmatterTable(src []byte) (string, []byte) { +// FrontmatterPair is one key/value row of a document's YAML frontmatter, +// in author order. Value is plain text, never markup; Code marks the values +// the table renders inside (anything nested). +type FrontmatterPair struct { + Key string `json:"key"` + Value string `json:"value"` + Code bool `json:"code,omitempty"` +} + +// frontmatterPairs splits a leading YAML frontmatter block off src and +// returns its keys and values in author order. Anything that isn't a +// well-formed YAML mapping falls through untouched — a stray --- line must +// keep rendering exactly as it always did — and empty frontmatter is +// dropped from the body with nothing to show for it. +func frontmatterPairs(src []byte) ([]FrontmatterPair, []byte) { rest, ok := bytes.CutPrefix(src, []byte("---\n")) if !ok { if rest, ok = bytes.CutPrefix(src, []byte("---\r\n")); !ok { - return "", src + return nil, src } } loc := fmCloseRe.FindIndex(rest) if loc == nil { - return "", src + return nil, src } fm, body := rest[:loc[0]], rest[loc[1]:] var doc yaml.Node if yaml.Unmarshal(fm, &doc) != nil || len(doc.Content) != 1 || doc.Content[0].Kind != yaml.MappingNode { - return "", src + return nil, src } m := doc.Content[0] if len(m.Content) == 0 { - return "", body // empty frontmatter: hide it, nothing to tabulate + return nil, body // empty frontmatter: hide it, nothing to tabulate + } + pairs := make([]FrontmatterPair, 0, len(m.Content)/2) + for i := 0; i+1 < len(m.Content); i += 2 { + value, code := yamlValue(m.Content[i+1]) + pairs = append(pairs, FrontmatterPair{Key: m.Content[i].Value, Value: value, Code: code}) + } + return pairs, body +} + +// frontmatterTable is frontmatterPairs rendered as the HTML table the share +// page has always served (keys in author order, everything escaped). +func frontmatterTable(src []byte) (string, []byte) { + pairs, body := frontmatterPairs(src) + if len(pairs) == 0 { + return "", body } var b strings.Builder b.WriteString(``) - for i := 0; i+1 < len(m.Content); i += 2 { - key, val := m.Content[i], m.Content[i+1] + for _, p := range pairs { + val := html.EscapeString(p.Value) + if p.Code { + val = "" + val + "" + } fmt.Fprintf(&b, ``, - html.EscapeString(key.Value), yamlValueHTML(val)) + html.EscapeString(p.Key), val) } b.WriteString(`
%s%s
`) return b.String(), body } -// yamlValueHTML renders one frontmatter value: scalars as text, flat lists -// comma-joined, anything nested as compact YAML in a block. Always -// escaped — frontmatter is user input, never markup. -func yamlValueHTML(n *yaml.Node) string { +// yamlValue renders one frontmatter value: scalars as text, flat lists +// comma-joined, anything nested as compact YAML — with code true for that +// last case, where the table reaches for . Always the raw string: +// escaping belongs to whoever emits it. +func yamlValue(n *yaml.Node) (string, bool) { switch n.Kind { case yaml.ScalarNode: - return html.EscapeString(n.Value) + return n.Value, false case yaml.SequenceNode: flat := true parts := make([]string, 0, len(n.Content)) @@ -104,12 +159,12 @@ func yamlValueHTML(n *yaml.Node) string { parts = append(parts, c.Value) } if flat { - return html.EscapeString(strings.Join(parts, ", ")) + return strings.Join(parts, ", "), false } } raw, err := yaml.Marshal(n) if err != nil { - return "" + return "", false } - return "" + html.EscapeString(strings.TrimSpace(string(raw))) + "" + return strings.TrimSpace(string(raw)), true } diff --git a/internal/webapp/markdown_test.go b/internal/webapp/markdown_test.go index 5598c62..6d7000f 100644 --- a/internal/webapp/markdown_test.go +++ b/internal/webapp/markdown_test.go @@ -65,11 +65,11 @@ func TestRenderMarkdownFrontmatterFallthrough(t *testing.T) { wantTable bool want string }{ - "no frontmatter": {"# Hi\n\ntext", false, "body

"}, } for name, c := range cases { @@ -85,3 +85,71 @@ func TestRenderMarkdownFrontmatterFallthrough(t *testing.T) { } } } + +// The viewer's split: frontmatter comes back as ordered data and the HTML +// is body-only, with the same value rules the table has always applied. +func TestFrontmatterPairs(t *testing.T) { + src := `--- +title: Q3 findings +tags: [churn, revenue] +owner: snow@runbear.io +meta: + reviewed: true +--- + +# Body + +Hello.` + pairs, out, err := RenderMarkdownPairs([]byte(src)) + if err != nil { + t.Fatal(err) + } + want := []FrontmatterPair{ + {Key: "title", Value: "Q3 findings"}, + {Key: "tags", Value: "churn, revenue"}, // flat lists comma-join + {Key: "owner", Value: "snow@runbear.io"}, + {Key: "meta", Value: "reviewed: true", Code: true}, // nested: compact YAML + } + if len(pairs) != len(want) { + t.Fatalf("pairs = %+v, want %d", pairs, len(want)) + } + for i, w := range want { + if pairs[i] != w { // index-wise: author order is the contract + t.Errorf("pair %d = %+v, want %+v", i, pairs[i], w) + } + } + if strings.Contains(out, `class="frontmatter"`) { + t.Errorf("table leaked into the viewer's html:\n%s", out) + } + if !strings.HasPrefix(strings.TrimSpace(out), `

Body

`) { + t.Errorf("body does not start with its heading:\n%s", out) + } +} + +// Same tri-state as the table: anything that isn't a clean YAML mapping +// falls through with the source untouched, and empty frontmatter is hidden. +func TestFrontmatterPairsFallthrough(t *testing.T) { + cases := map[string]struct { + src string + want string + }{ + "no frontmatter": {"# Hi\n\ntext", "body

"}, + } + for name, c := range cases { + pairs, out, err := RenderMarkdownPairs([]byte(c.src)) + if err != nil { + t.Fatalf("%s: %v", name, err) + } + if len(pairs) != 0 { + t.Errorf("%s: pairs = %+v, want none", name, pairs) + } + if c.want != "" && !strings.Contains(out, c.want) { + t.Errorf("%s: missing %q in:\n%s", name, c.want, out) + } + } +} diff --git a/internal/webapp/sec_defer_test.go b/internal/webapp/sec_defer_test.go index 15ace03..f581110 100644 --- a/internal/webapp/sec_defer_test.go +++ b/internal/webapp/sec_defer_test.go @@ -1048,6 +1048,43 @@ func TestSec_Render_MarkdownCannotShipActiveContent(t *testing.T) { t.Errorf("RenderMarkdown emitted active content (%s) for input %q:\n%s", why, p.src, out) } + // The viewer's entry point is a second door onto the same room: + // it must not be a way around the escaping above. The frontmatter + // half is the deliberate difference — those values leave as + // LITERAL text (asserted below) and the client renders them as + // text nodes — so only the HTML is judged here. + _, out, err = RenderMarkdownPairs([]byte(p.src)) + if err != nil { + return + } + for _, why := range secdefActiveContent(out) { + t.Errorf("RenderMarkdownPairs emitted active content (%s) for input %q:\n%s", + why, p.src, out) + } + }) + } + + // The new field carries the raw scalar: escaping moved to the client, + // which puts it in a React text node. A value that arrived pre-escaped + // here would show up as <img …> on screen instead. + for _, c := range []struct{ name, src, key, want string }{ + {"value", "---\ntitle: \n---\nbody\n", + "title", ""}, + {"key", "---\n\"\": v\n---\nbody\n", + "", "v"}, + {"nested", "---\na:\n b: \"
\"\n---\nbody\n", + "a", "b: \"
\""}, + } { + t.Run("pairs "+c.name, func(t *testing.T) { + pairs, _, err := RenderMarkdownPairs([]byte(c.src)) + if err != nil || len(pairs) != 1 { + t.Fatalf("pairs = %+v, err = %v", pairs, err) + } + if pairs[0].Key != c.key || pairs[0].Value != c.want { + t.Errorf("pair = %+v, want key %q value %q — the frontmatter field is "+ + "contracted to be literal text; pre-escaping it here would double-escape "+ + "on the client", pairs[0], c.key, c.want) + } }) } } diff --git a/internal/webapp/server.go b/internal/webapp/server.go index b318354..6805c80 100644 --- a/internal/webapp/server.go +++ b/internal/webapp/server.go @@ -1413,7 +1413,7 @@ func (s *Server) handleRender(v *volume, w http.ResponseWriter, r *http.Request) http.Error(w, err.Error(), http.StatusBadGateway) return } - html, err := RenderMarkdown(src) + pairs, html, err := RenderMarkdownPairs(src) if err != nil { http.Error(w, fmt.Sprintf("render: %v", err), http.StatusInternalServerError) return @@ -1422,6 +1422,12 @@ func (s *Server) handleRender(v *volume, w http.ResponseWriter, r *http.Request) "path": p, "html": html, "size": fi.Size, "time": fi.Time, "author": fi.Author, "device": fi.Device, } + // Frontmatter travels as data, not as a table baked into html — the + // viewer lays it out in a side panel. Omitted when the document has + // none, so the client shows no panel rather than an empty one. + if len(pairs) > 0 { + doc["frontmatter"] = pairs + } // Omitted rather than sent empty, so a journal from before accounts // existed still renders its Author instead of a blank attribution. if fi.User != "" { @@ -1482,7 +1488,7 @@ func (s *Server) renderVersion(v *volume, w http.ResponseWriter, r *http.Request http.Error(w, err.Error(), http.StatusBadGateway) return } - html, err := RenderMarkdown(src) + pairs, html, err := RenderMarkdownPairs(src) if err != nil { http.Error(w, fmt.Sprintf("render: %v", err), http.StatusInternalServerError) return @@ -1490,6 +1496,9 @@ func (s *Server) renderVersion(v *volume, w http.ResponseWriter, r *http.Request doc := map[string]any{ "path": r.URL.Query().Get("path"), "html": html, "size": len(src), } + if len(pairs) > 0 { + doc["frontmatter"] = pairs + } // The history view goes through this same endpoint, so scanning here too // is what stops the badge vanishing the moment you click into history on // the very file it was warning about. diff --git a/internal/webapp/shares_test.go b/internal/webapp/shares_test.go index 4d216d8..e8e11b1 100644 --- a/internal/webapp/shares_test.go +++ b/internal/webapp/shares_test.go @@ -439,6 +439,31 @@ func TestShareLastUpdatedStamp(t *testing.T) { } } +// The share page keeps the frontmatter TABLE at the top of the document. +// The viewer moved its frontmatter into a side panel (BEA-154) by calling +// RenderMarkdownPairs; shares.go stayed on RenderMarkdown deliberately, and +// nothing else would fail if someone later "tidied" it onto the pairs path — +// which would silently change every public link ever minted. +func TestShareKeepsFrontmatterTable(t *testing.T) { + srv, p, _, f, h := shareHub(t) + f.put("dev1", "wiki/props.md", "---\ntitle: Q3\nowner: snow\n---\n\n# Q3\n") + token, _ := authedShare(t, srv, h, p.ID, "wiki/props.md") + body := do(t, h, "GET", "/s/"+token, nil).Body.String() + for _, want := range []string{ + ``, + ``, + ``, + } { + if !strings.Contains(body, want) { + t.Errorf("share page lost %q:\n%s", want, body) + } + } + // ...and above the document, where it has always been. + if strings.Index(body, `class="frontmatter"`) > strings.Index(body, "i[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.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 Th={exports:{}},qo={};var fb;function Rj(){if(fb)return qo;fb=1;var e=Symbol.for("react.transitional.element"),t=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 qo.Fragment=t,qo.jsx=r,qo.jsxs=r,qo}var hb;function jj(){return hb||(hb=1,Th.exports=Rj()),Th.exports}var f=jj(),Oh={exports:{}},Ve={};var mb;function Tj(){if(mb)return Ve;mb=1;var e=Symbol.for("react.transitional.element"),t=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"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),b=Symbol.iterator;function x(D){return D===null||typeof D!="object"?null:(D=b&&D[b]||D["@@iterator"],typeof D=="function"?D:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,E={};function R(D,N,H){this.props=D,this.context=N,this.refs=E,this.updater=H||w}R.prototype.isReactComponent={},R.prototype.setState=function(D,N){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,N,"setState")},R.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function T(){}T.prototype=R.prototype;function O(D,N,H){this.props=D,this.context=N,this.refs=E,this.updater=H||w}var M=O.prototype=new T;M.constructor=O,_(M,R.prototype),M.isPureReactComponent=!0;var k=Array.isArray;function B(){}var V={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function pe(D,N,H){var X=H.ref;return{$$typeof:e,type:D,key:N,ref:X!==void 0?X:null,props:H}}function ne(D,N){return pe(D.type,N,D.props)}function ce(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function me(D){var N={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(H){return N[H]})}var fe=/\/+/g;function Z(D,N){return typeof D=="object"&&D!==null&&D.key!=null?me(""+D.key):N.toString(36)}function Se(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(B,B):(D.status="pending",D.then(function(N){D.status==="pending"&&(D.status="fulfilled",D.value=N)},function(N){D.status==="pending"&&(D.status="rejected",D.reason=N)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function L(D,N,H,X,Y){var he=typeof D;(he==="undefined"||he==="boolean")&&(D=null);var re=!1;if(D===null)re=!0;else switch(he){case"bigint":case"string":case"number":re=!0;break;case"object":switch(D.$$typeof){case e:case t:re=!0;break;case y:return re=D._init,L(re(D._payload),N,H,X,Y)}}if(re)return Y=Y(D),re=X===""?"."+Z(D,0):X,k(Y)?(H="",re!=null&&(H=re.replace(fe,"$&/")+"/"),L(Y,N,H,"",function(Me){return Me})):Y!=null&&(ce(Y)&&(Y=ne(Y,H+(Y.key==null||D&&D.key===Y.key?"":(""+Y.key).replace(fe,"$&/")+"/")+re)),N.push(Y)),1;re=0;var be=X===""?".":X+":";if(k(D))for(var xe=0;xe>>1,te=L[J];if(0>>1;Jo(H,ie))Xo(Y,H)?(L[J]=Y,L[X]=ie,J=X):(L[J]=H,L[N]=ie,J=N);else if(Xo(Y,ie))L[J]=Y,L[X]=ie,J=X;else break e}}return K}function o(L,K){var ie=L.sortIndex-K.sortIndex;return ie!==0?ie:L.id-K.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 m=[],p=[],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 K=r(p);K!==null;){if(K.callback===null)i(p);else if(K.startTime<=L)i(p),K.sortIndex=K.expirationTime,t(m,K);else break;K=r(p)}}function k(L){if(_=!1,M(L),!w)if(r(m)!==null)w=!0,B||(B=!0,me());else{var K=r(p);K!==null&&Se(k,K.startTime-L)}}var B=!1,V=-1,P=5,pe=-1;function ne(){return E?!0:!(e.unstable_now()-peL&&ne());){var J=v.callback;if(typeof J=="function"){v.callback=null,b=v.priorityLevel;var te=J(v.expirationTime<=L);if(L=e.unstable_now(),typeof te=="function"){v.callback=te,M(L),K=!0;break t}v===r(m)&&i(m),M(L)}else i(m);v=r(m)}if(v!==null)K=!0;else{var D=r(p);D!==null&&Se(k,D.startTime-L),K=!1}}break e}finally{v=null,b=ie,x=!1}K=void 0}}finally{K?me():B=!1}}}var me;if(typeof O=="function")me=function(){O(ce)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,Z=fe.port2;fe.port1.onmessage=ce,me=function(){Z.postMessage(null)}}else me=function(){R(ce,0)};function Se(L,K){V=R(function(){L(e.unstable_now())},K)}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||125J?(L.sortIndex=ie,t(p,L),r(m)===null&&L===r(p)&&(_?(T(V),V=-1):_=!0,Se(k,ie-J))):(L.sortIndex=te,t(m,L),w||x||(w=!0,B||(B=!0,me()))),L},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(L){var K=b;return function(){var ie=b;b=K;try{return L.apply(this,arguments)}finally{b=ie}}}})(Nh)),Nh}var vb;function Aj(){return vb||(vb=1,Mh.exports=Oj()),Mh.exports}var Dh={exports:{}},un={};var yb;function Mj(){if(yb)return un;yb=1;var e=sp();function t(m){var p="https://react.dev/errors/"+m;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Dh.exports=Mj(),Dh.exports}var xb;function Nj(){if(xb)return Go;xb=1;var e=Aj(),t=sp(),r=Sw();function i(n){var a="https://react.dev/errors/"+n;if(1te||(n.current=J[te],J[te]=null,te--)}function H(n,a){te++,J[te]=n.current,n.current=a}var X=D(null),Y=D(null),he=D(null),re=D(null);function be(n,a){switch(H(he,a),H(Y,n),H(X,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?z0(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=z0(a),n=L0(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}N(X),H(X,n)}function xe(){N(X),N(Y),N(he)}function Me(n){n.memoizedState!==null&&H(re,n);var a=X.current,s=L0(a,n.type);a!==s&&(H(Y,n),H(X,s))}function Fe(n){Y.current===n&&(N(X),N(Y)),re.current===n&&(N(re),Vo._currentValue=ie)}var He,ct;function Je(n){if(He===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);He=a&&a[1]||"",ct=-1i[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.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 Th={exports:{}},qo={};var fb;function jj(){if(fb)return qo;fb=1;var e=Symbol.for("react.transitional.element"),t=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 qo.Fragment=t,qo.jsx=r,qo.jsxs=r,qo}var hb;function Tj(){return hb||(hb=1,Th.exports=jj()),Th.exports}var f=Tj(),Oh={exports:{}},Ve={};var mb;function Oj(){if(mb)return Ve;mb=1;var e=Symbol.for("react.transitional.element"),t=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"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),b=Symbol.iterator;function x(D){return D===null||typeof D!="object"?null:(D=b&&D[b]||D["@@iterator"],typeof D=="function"?D:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,E={};function R(D,N,H){this.props=D,this.context=N,this.refs=E,this.updater=H||w}R.prototype.isReactComponent={},R.prototype.setState=function(D,N){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,N,"setState")},R.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function T(){}T.prototype=R.prototype;function O(D,N,H){this.props=D,this.context=N,this.refs=E,this.updater=H||w}var M=O.prototype=new T;M.constructor=O,_(M,R.prototype),M.isPureReactComponent=!0;var k=Array.isArray;function B(){}var V={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function pe(D,N,H){var X=H.ref;return{$$typeof:e,type:D,key:N,ref:X!==void 0?X:null,props:H}}function ne(D,N){return pe(D.type,N,D.props)}function ce(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function me(D){var N={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(H){return N[H]})}var fe=/\/+/g;function Z(D,N){return typeof D=="object"&&D!==null&&D.key!=null?me(""+D.key):N.toString(36)}function Se(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(B,B):(D.status="pending",D.then(function(N){D.status==="pending"&&(D.status="fulfilled",D.value=N)},function(N){D.status==="pending"&&(D.status="rejected",D.reason=N)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function L(D,N,H,X,Y){var he=typeof D;(he==="undefined"||he==="boolean")&&(D=null);var re=!1;if(D===null)re=!0;else switch(he){case"bigint":case"string":case"number":re=!0;break;case"object":switch(D.$$typeof){case e:case t:re=!0;break;case y:return re=D._init,L(re(D._payload),N,H,X,Y)}}if(re)return Y=Y(D),re=X===""?"."+Z(D,0):X,k(Y)?(H="",re!=null&&(H=re.replace(fe,"$&/")+"/"),L(Y,N,H,"",function(Me){return Me})):Y!=null&&(ce(Y)&&(Y=ne(Y,H+(Y.key==null||D&&D.key===Y.key?"":(""+Y.key).replace(fe,"$&/")+"/")+re)),N.push(Y)),1;re=0;var be=X===""?".":X+":";if(k(D))for(var xe=0;xe>>1,te=L[J];if(0>>1;Jo(H,ie))Xo(Y,H)?(L[J]=Y,L[X]=ie,J=X):(L[J]=H,L[N]=ie,J=N);else if(Xo(Y,ie))L[J]=Y,L[X]=ie,J=X;else break e}}return K}function o(L,K){var ie=L.sortIndex-K.sortIndex;return ie!==0?ie:L.id-K.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 m=[],p=[],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 K=r(p);K!==null;){if(K.callback===null)i(p);else if(K.startTime<=L)i(p),K.sortIndex=K.expirationTime,t(m,K);else break;K=r(p)}}function k(L){if(_=!1,M(L),!w)if(r(m)!==null)w=!0,B||(B=!0,me());else{var K=r(p);K!==null&&Se(k,K.startTime-L)}}var B=!1,V=-1,P=5,pe=-1;function ne(){return E?!0:!(e.unstable_now()-peL&&ne());){var J=v.callback;if(typeof J=="function"){v.callback=null,b=v.priorityLevel;var te=J(v.expirationTime<=L);if(L=e.unstable_now(),typeof te=="function"){v.callback=te,M(L),K=!0;break t}v===r(m)&&i(m),M(L)}else i(m);v=r(m)}if(v!==null)K=!0;else{var D=r(p);D!==null&&Se(k,D.startTime-L),K=!1}}break e}finally{v=null,b=ie,x=!1}K=void 0}}finally{K?me():B=!1}}}var me;if(typeof O=="function")me=function(){O(ce)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,Z=fe.port2;fe.port1.onmessage=ce,me=function(){Z.postMessage(null)}}else me=function(){R(ce,0)};function Se(L,K){V=R(function(){L(e.unstable_now())},K)}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||125J?(L.sortIndex=ie,t(p,L),r(m)===null&&L===r(p)&&(_?(T(V),V=-1):_=!0,Se(k,ie-J))):(L.sortIndex=te,t(m,L),w||x||(w=!0,B||(B=!0,me()))),L},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(L){var K=b;return function(){var ie=b;b=K;try{return L.apply(this,arguments)}finally{b=ie}}}})(Nh)),Nh}var vb;function Mj(){return vb||(vb=1,Mh.exports=Aj()),Mh.exports}var Dh={exports:{}},un={};var yb;function Nj(){if(yb)return un;yb=1;var e=sp();function t(m){var p="https://react.dev/errors/"+m;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Dh.exports=Nj(),Dh.exports}var xb;function Dj(){if(xb)return Go;xb=1;var e=Mj(),t=sp(),r=Sw();function i(n){var a="https://react.dev/errors/"+n;if(1te||(n.current=J[te],J[te]=null,te--)}function H(n,a){te++,J[te]=n.current,n.current=a}var X=D(null),Y=D(null),he=D(null),re=D(null);function be(n,a){switch(H(he,a),H(Y,n),H(X,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?z0(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=z0(a),n=L0(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}N(X),H(X,n)}function xe(){N(X),N(Y),N(he)}function Me(n){n.memoizedState!==null&&H(re,n);var a=X.current,s=L0(a,n.type);a!==s&&(H(Y,n),H(X,s))}function Fe(n){Y.current===n&&(N(X),N(Y)),re.current===n&&(N(re),Vo._currentValue=ie)}var He,ct;function Je(n){if(He===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);He=a&&a[1]||"",ct=-1)":-1h||z[c]!==G[h]){var ae=` `+z[c].replace(" at new "," at ");return n.displayName&&ae.includes("")&&(ae=ae.replace("",n.displayName)),ae}while(1<=c&&0<=h);break}}}finally{hn=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?Je(s):""}function Xt(n,a){switch(n.tag){case 26:case 27:case 5:return Je(n.type);case 16:return Je("Lazy");case 13:return n.child!==a&&a!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return mn(n.type,!1);case 11:return mn(n.type.render,!1);case 1:return mn(n.type,!0);case 31:return Je("Activity");default:return""}}function yr(n){try{var a="",s=null;do a+=Xt(n,s),s=n,n=n.return;while(n);return a}catch(c){return` Error generating stack: `+c.message+` -`+c.stack}}var At=Object.prototype.hasOwnProperty,rr=e.unstable_scheduleCallback,br=e.unstable_cancelCallback,Rt=e.unstable_shouldYield,Vn=e.unstable_requestPaint,zt=e.unstable_now,Dr=e.unstable_getCurrentPriorityLevel,ar=e.unstable_ImmediatePriority,oa=e.unstable_UserBlockingPriority,ir=e.unstable_NormalPriority,la=e.unstable_LowPriority,Jt=e.unstable_IdlePriority,A=e.log,I=e.unstable_setDisableYieldValue,F=null,de=null;function oe(n){if(typeof A=="function"&&I(n),de&&typeof de.setStrictMode=="function")try{de.setStrictMode(F,n)}catch{}}var ye=Math.clz32?Math.clz32:le,we=Math.log,ee=Math.LN2;function le(n){return n>>>=0,n===0?32:31-(we(n)/ee|0)|0}var Re=256,ze=262144,it=4194304;function _t(n){var a=n&42;if(a!==0)return a;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Ae(n,a,s){var c=n.pendingLanes;if(c===0)return 0;var h=0,g=n.suspendedLanes,C=n.pingedLanes;n=n.warmLanes;var j=c&134217727;return j!==0?(c=j&~g,c!==0?h=_t(c):(C&=j,C!==0?h=_t(C):s||(s=j&~n,s!==0&&(h=_t(s))))):(j=c&~g,j!==0?h=_t(j):C!==0?h=_t(C):s||(s=c&~n,s!==0&&(h=_t(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 ut(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function st(n,a){switch(n){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 Gt(){var n=it;return it<<=1,(it&62914560)===0&&(it=4194304),n}function sr(n){for(var a=[],s=0;31>s;s++)a.push(n);return a}function Ct(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function yn(n,a,s,c,h,g){var C=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var j=n.entanglements,z=n.expirationTimes,G=n.hiddenUpdates;for(s=C&~s;0"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var vE=/[\n"\\]/g;function Hn(n){return n.replace(vE,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function wd(n,a,s,c,h,g,C,j){n.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?n.type=C:n.removeAttribute("type"),a!=null?C==="number"?(a===0&&n.value===""||n.value!=a)&&(n.value=""+Un(a)):n.value!==""+Un(a)&&(n.value=""+Un(a)):C!=="submit"&&C!=="reset"||n.removeAttribute("value"),a!=null?Sd(n,C,Un(a)):s!=null?Sd(n,C,Un(s)):c!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.name=""+Un(j):n.removeAttribute("name")}function Og(n,a,s,c,h,g,C,j){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),a!=null||s!=null){if(!(g!=="submit"&&g!=="reset"||a!=null)){xd(n);return}s=s!=null?""+Un(s):"",a=a!=null?""+Un(a):s,j||a===n.value||(n.value=a),n.defaultValue=a}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=j?n.checked:!!c,n.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(n.name=C),xd(n)}function Sd(n,a,s){a==="number"&&Nl(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function Zi(n,a,s,c){if(n=n.options,a){a={};for(var h=0;h"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jd=!1;if(Lr)try{var ao={};Object.defineProperty(ao,"passive",{get:function(){jd=!0}}),window.addEventListener("test",ao,ao),window.removeEventListener("test",ao,ao)}catch{jd=!1}var ua=null,Td=null,kl=null;function Lg(){if(kl)return kl;var n,a=Td,s=a.length,c,h="value"in ua?ua.value:ua.textContent,g=h.length;for(n=0;n=oo),Ug=" ",Hg=!1;function Bg(n,a){switch(n){case"keyup":return qE.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Xi=!1;function ZE(n,a){switch(n){case"compositionend":return qg(a);case"keypress":return a.which!==32?null:(Hg=!0,Ug);case"textInput":return n=a.data,n===Ug&&Hg?null:n;default:return null}}function KE(n,a){if(Xi)return n==="compositionend"||!Dd&&Bg(n,a)?(n=Lg(),kl=Td=ua=null,Xi=!1,n):null;switch(n){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-n};n=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Wg(s)}}function tv(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?tv(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function nv(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=Nl(n.document);a instanceof n.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)n=a.contentWindow;else break;a=Nl(n.document)}return a}function Ld(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a&&(a==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||a==="textarea"||n.contentEditable==="true")}var nR=Lr&&"documentMode"in document&&11>=document.documentMode,Ji=null,$d=null,fo=null,Id=!1;function rv(n,a,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Id||Ji==null||Ji!==Nl(c)||(c=Ji,"selectionStart"in c&&Ld(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}),fo&&uo(fo,c)||(fo=c,c=jc($d,"onSelect"),0>=C,h-=C,xr=1<<32-ye(a)+h|s<Be?(Qe=Oe,Oe=null):Qe=Oe.sibling;var tt=Q(U,Oe,q[Be],se);if(tt===null){Oe===null&&(Oe=Qe);break}n&&Oe&&tt.alternate===null&&a(U,Oe),$=g(tt,$,Be),et===null?Ne=tt:et.sibling=tt,et=tt,Oe=Qe}if(Be===q.length)return s(U,Oe),Xe&&Ir(U,Be),Ne;if(Oe===null){for(;BeBe?(Qe=Oe,Oe=null):Qe=Oe.sibling;var Na=Q(U,Oe,tt.value,se);if(Na===null){Oe===null&&(Oe=Qe);break}n&&Oe&&Na.alternate===null&&a(U,Oe),$=g(Na,$,Be),et===null?Ne=Na:et.sibling=Na,et=Na,Oe=Qe}if(tt.done)return s(U,Oe),Xe&&Ir(U,Be),Ne;if(Oe===null){for(;!tt.done;Be++,tt=q.next())tt=ue(U,tt.value,se),tt!==null&&($=g(tt,$,Be),et===null?Ne=tt:et.sibling=tt,et=tt);return Xe&&Ir(U,Be),Ne}for(Oe=c(Oe);!tt.done;Be++,tt=q.next())tt=W(Oe,U,Be,tt.value,se),tt!==null&&(n&&tt.alternate!==null&&Oe.delete(tt.key===null?Be:tt.key),$=g(tt,$,Be),et===null?Ne=tt:et.sibling=tt,et=tt);return n&&Oe.forEach(function(Sj){return a(U,Sj)}),Xe&&Ir(U,Be),Ne}function ht(U,$,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 Ne=q.key;$!==null;){if($.key===Ne){if(Ne=q.type,Ne===_){if($.tag===7){s(U,$.sibling),se=h($,q.props.children),se.return=U,U=se;break e}}else if($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===P&&fi(Ne)===$.type){s(U,$.sibling),se=h($,q.props),yo(se,q),se.return=U,U=se;break e}s(U,$);break}else a(U,$);$=$.sibling}q.type===_?(se=oi(q.props.children,U.mode,se,q.key),se.return=U,U=se):(se=Bl(q.type,q.key,q.props,null,U.mode,se),yo(se,q),se.return=U,U=se)}return C(U);case w:e:{for(Ne=q.key;$!==null;){if($.key===Ne)if($.tag===4&&$.stateNode.containerInfo===q.containerInfo&&$.stateNode.implementation===q.implementation){s(U,$.sibling),se=h($,q.children||[]),se.return=U,U=se;break e}else{s(U,$);break}else a(U,$);$=$.sibling}se=qd(q,U.mode,se),se.return=U,U=se}return C(U);case P:return q=fi(q),ht(U,$,q,se)}if(Se(q))return je(U,$,q,se);if(me(q)){if(Ne=me(q),typeof Ne!="function")throw Error(i(150));return q=Ne.call(q),ke(U,$,q,se)}if(typeof q.then=="function")return ht(U,$,Xl(q),se);if(q.$$typeof===O)return ht(U,$,Zl(U,q),se);Jl(U,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,$!==null&&$.tag===6?(s(U,$.sibling),se=h($,q),se.return=U,U=se):(s(U,$),se=Bd(q,U.mode,se),se.return=U,U=se),C(U)):s(U,$)}return function(U,$,q,se){try{vo=0;var Ne=ht(U,$,q,se);return cs=null,Ne}catch(Oe){if(Oe===ls||Oe===Yl)throw Oe;var et=Dn(29,Oe,null,U.mode);return et.lanes=se,et.return=U,et}}}var mi=Rv(!0),jv=Rv(!1),pa=!1;function rf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function af(n,a){n=n.updateQueue,a.updateQueue===n&&(a.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ga(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function va(n,a,s){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(rt&2)!==0){var h=c.pending;return h===null?a.next=a:(a.next=h.next,h.next=a),c.pending=a,a=Hl(n),uv(n,null,s),a}return Ul(n,c,a,s),Hl(n)}function bo(n,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var c=a.lanes;c&=n.pendingLanes,s|=c,a.lanes=s,bn(n,s)}}function sf(n,a){var s=n.updateQueue,c=n.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},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=a:n.next=a,s.lastBaseUpdate=a}var of=!1;function xo(){if(of){var n=os;if(n!==null)throw n}}function wo(n,a,s,c){of=!1;var h=n.updateQueue;pa=!1;var g=h.firstBaseUpdate,C=h.lastBaseUpdate,j=h.shared.pending;if(j!==null){h.shared.pending=null;var z=j,G=z.next;z.next=null,C===null?g=G:C.next=G,C=z;var ae=n.alternate;ae!==null&&(ae=ae.updateQueue,j=ae.lastBaseUpdate,j!==C&&(j===null?ae.firstBaseUpdate=G:j.next=G,ae.lastBaseUpdate=z))}if(g!==null){var ue=h.baseState;C=0,ae=G=z=null,j=g;do{var Q=j.lane&-536870913,W=Q!==j.lane;if(W?(Ye&Q)===Q:(c&Q)===Q){Q!==0&&Q===ss&&(of=!0),ae!==null&&(ae=ae.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var je=n,ke=j;Q=a;var ht=s;switch(ke.tag){case 1:if(je=ke.payload,typeof je=="function"){ue=je.call(ht,ue,Q);break e}ue=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=ke.payload,Q=typeof je=="function"?je.call(ht,ue,Q):je,Q==null)break e;ue=v({},ue,Q);break e;case 2:pa=!0}}Q=j.callback,Q!==null&&(n.flags|=64,W&&(n.flags|=8192),W=h.callbacks,W===null?h.callbacks=[Q]:W.push(Q))}else W={lane:Q,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ae===null?(G=ae=W,z=ue):ae=ae.next=W,C|=Q;if(j=j.next,j===null){if(j=h.shared.pending,j===null)break;W=j,j=W.next,W.next=null,h.lastBaseUpdate=W,h.shared.pending=null}}while(!0);ae===null&&(z=ue),h.baseState=z,h.firstBaseUpdate=G,h.lastBaseUpdate=ae,g===null&&(h.shared.lanes=0),Sa|=C,n.lanes=C,n.memoizedState=ue}}function Tv(n,a){if(typeof n!="function")throw Error(i(191,n));n.call(a)}function Ov(n,a){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;ng?g:8;var C=L.T,j={};L.T=j,Rf(n,!1,a,s);try{var z=h(),G=L.S;if(G!==null&&G(j,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ae=dR(z,c);Co(n,a,ae,In(n))}else Co(n,a,c,In(n))}catch(ue){Co(n,a,{then:function(){},status:"rejected",reason:ue},In())}finally{K.p=g,C!==null&&j.types!==null&&(C.types=j.types),L.T=C}}function vR(){}function Cf(n,a,s,c){if(n.tag!==5)throw Error(i(476));var h=oy(n).queue;sy(n,h,a,ie,s===null?vR:function(){return ly(n),s(c)})}function oy(n){var a=n.memoizedState;if(a!==null)return a;a={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ur,lastRenderedState:ie},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ur,lastRenderedState:s},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function ly(n){var a=oy(n);a.next===null&&(a=n.alternate.memoizedState),Co(n,a.next.queue,{},In())}function Ef(){return tn(Vo)}function cy(){return Nt().memoizedState}function uy(){return Nt().memoizedState}function yR(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var s=In();n=ga(s);var c=va(a,n,s);c!==null&&(jn(c,a,s),bo(c,a,s)),a={cache:Wd()},n.payload=a;return}a=a.return}}function bR(n,a,s){var c=In();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},lc(n)?fy(a,s):(s=Ud(n,a,s,c),s!==null&&(jn(s,n,c),hy(s,a,c)))}function dy(n,a,s){var c=In();Co(n,a,s,c)}function Co(n,a,s,c){var h={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(lc(n))fy(a,h);else{var g=n.alternate;if(n.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,Nn(j,C))return Ul(n,a,h,0),gt===null&&Vl(),!1}catch{}if(s=Ud(n,a,h,c),s!==null)return jn(s,n,c),hy(s,a,c),!0}return!1}function Rf(n,a,s,c){if(c={lane:2,revertLane:ah(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},lc(n)){if(a)throw Error(i(479))}else a=Ud(n,s,c,2),a!==null&&jn(a,n,2)}function lc(n){var a=n.alternate;return n===Ue||a!==null&&a===Ue}function fy(n,a){ds=tc=!0;var s=n.pending;s===null?a.next=a:(a.next=s.next,s.next=a),n.pending=a}function hy(n,a,s){if((s&4194048)!==0){var c=a.lanes;c&=n.pendingLanes,s|=c,a.lanes=s,bn(n,s)}}var Eo={readContext:tn,use:ac,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};Eo.useEffectEvent=jt;var my={readContext:tn,use:ac,useCallback:function(n,a){return pn().memoizedState=[n,a===void 0?null:a],n},useContext:tn,useEffect:Xv,useImperativeHandle:function(n,a,s){s=s!=null?s.concat([n]):null,sc(4194308,4,ty.bind(null,a,n),s)},useLayoutEffect:function(n,a){return sc(4194308,4,n,a)},useInsertionEffect:function(n,a){sc(4,2,n,a)},useMemo:function(n,a){var s=pn();a=a===void 0?null:a;var c=n();if(pi){oe(!0);try{n()}finally{oe(!1)}}return s.memoizedState=[c,a],c},useReducer:function(n,a,s){var c=pn();if(s!==void 0){var h=s(a);if(pi){oe(!0);try{s(a)}finally{oe(!1)}}}else h=a;return c.memoizedState=c.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},c.queue=n,n=n.dispatch=bR.bind(null,Ue,n),[c.memoizedState,n]},useRef:function(n){var a=pn();return n={current:n},a.memoizedState=n},useState:function(n){n=bf(n);var a=n.queue,s=dy.bind(null,Ue,a);return a.dispatch=s,[n.memoizedState,s]},useDebugValue:Sf,useDeferredValue:function(n,a){var s=pn();return _f(s,n,a)},useTransition:function(){var n=bf(!1);return n=sy.bind(null,Ue,n.queue,!0,!1),pn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,s){var c=Ue,h=pn();if(Xe){if(s===void 0)throw Error(i(407));s=s()}else{if(s=a(),gt===null)throw Error(i(349));(Ye&127)!==0||zv(c,a,s)}h.memoizedState=s;var g={value:s,getSnapshot:a};return h.queue=g,Xv($v.bind(null,c,g,n),[n]),c.flags|=2048,hs(9,{destroy:void 0},Lv.bind(null,c,g,s,a),null),s},useId:function(){var n=pn(),a=gt.identifierPrefix;if(Xe){var s=wr,c=xr;s=(c&~(1<<32-ye(c)-1)).toString(32)+s,a="_"+a+"R_"+s,s=nc++,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[Wt]=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(rn(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&&Br(a)}}return yt(a),Ff(a,a.type,n===null?null:n.memoizedProps,a.pendingProps,s),null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==c&&Br(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(i(166));if(n=he.current,as(a)){if(n=a.stateNode,s=a.memoizedProps,c=null,h=en,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}n[Wt]=a,n=!!(n.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||D0(n.nodeValue,s)),n||ha(a,!0)}else n=Tc(n).createTextNode(c),n[Wt]=a,a.stateNode=n}return yt(a),null;case 31:if(s=a.memoizedState,n===null||n.memoizedState!==null){if(c=as(a),s!==null){if(n===null){if(!c)throw Error(i(318));if(n=a.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[Wt]=a}else li(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;yt(a),n=!1}else s=Yd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=s),n=!0;if(!n)return a.flags&256?(zn(a),a):(zn(a),null);if((a.flags&128)!==0)throw Error(i(558))}return yt(a),null;case 13:if(c=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=as(a),c!==null&&c.dehydrated!==null){if(n===null){if(!h)throw Error(i(318));if(h=a.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(i(317));h[Wt]=a}else li(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;yt(a),h=!1}else h=Yd(),n!==null&&n.memoizedState!==null&&(n.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,n=n!==null&&n.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!==n&&s&&(a.child.flags|=8192),hc(a,a.updateQueue),yt(a),null);case 4:return xe(),n===null&&lh(a.stateNode.containerInfo),yt(a),null;case 10:return Fr(a.type),yt(a),null;case 19:if(N(Mt),c=a.memoizedState,c===null)return yt(a),null;if(h=(a.flags&128)!==0,g=c.rendering,g===null)if(h)jo(c,!1);else{if(Tt!==0||n!==null&&(n.flags&128)!==0)for(n=a.child;n!==null;){if(g=ec(n),g!==null){for(a.flags|=128,jo(c,!1),n=g.updateQueue,a.updateQueue=n,hc(a,n),a.subtreeFlags=0,n=s,s=a.child;s!==null;)dv(s,n),s=s.sibling;return H(Mt,Mt.current&1|2),Xe&&Ir(a,c.treeForkCount),a.child}n=n.sibling}c.tail!==null&&zt()>yc&&(a.flags|=128,h=!0,jo(c,!1),a.lanes=4194304)}else{if(!h)if(n=ec(g),n!==null){if(a.flags|=128,h=!0,n=n.updateQueue,a.updateQueue=n,hc(a,n),jo(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!Xe)return yt(a),null}else 2*zt()-c.renderingStartTime>yc&&s!==536870912&&(a.flags|=128,h=!0,jo(c,!1),a.lanes=4194304);c.isBackwards?(g.sibling=a.child,a.child=g):(n=c.last,n!==null?n.sibling=g:a.child=g,c.last=g)}return c.tail!==null?(n=c.tail,c.rendering=n,c.tail=n.sibling,c.renderingStartTime=zt(),n.sibling=null,s=Mt.current,H(Mt,h?s&1|2:s&1),Xe&&Ir(a,c.treeForkCount),n):(yt(a),null);case 22:case 23:return zn(a),cf(),c=a.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(s&536870912)!==0&&(a.flags&128)===0&&(yt(a),a.subtreeFlags&6&&(a.flags|=8192)):yt(a),s=a.updateQueue,s!==null&&hc(a,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048),n!==null&&N(di),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Fr(Lt),yt(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function CR(n,a){switch(Zd(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return Fr(Lt),xe(),n=a.flags,(n&65536)!==0&&(n&128)===0?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return Fe(a),null;case 31:if(a.memoizedState!==null){if(zn(a),a.alternate===null)throw Error(i(340));li()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 13:if(zn(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(i(340));li()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return N(Mt),null;case 4:return xe(),null;case 10:return Fr(a.type),null;case 22:case 23:return zn(a),cf(),n!==null&&N(di),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return Fr(Lt),null;case 25:return null;default:return null}}function Iy(n,a){switch(Zd(a),a.tag){case 3:Fr(Lt),xe();break;case 26:case 27:case 5:Fe(a);break;case 4:xe();break;case 31:a.memoizedState!==null&&zn(a);break;case 13:zn(a);break;case 19:N(Mt);break;case 10:Fr(a.type);break;case 22:case 23:zn(a),cf(),n!==null&&N(di);break;case 24:Fr(Lt)}}function To(n,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&n)===n){c=void 0;var g=s.create,C=s.inst;c=g(),C.destroy=c}s=s.next}while(s!==h)}}catch(j){lt(a,a.return,j)}}function xa(n,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&n)===n){var C=c.inst,j=C.destroy;if(j!==void 0){C.destroy=void 0,h=a;var z=s,G=j;try{G()}catch(ae){lt(h,z,ae)}}}c=c.next}while(c!==g)}}catch(ae){lt(a,a.return,ae)}}function Py(n){var a=n.updateQueue;if(a!==null){var s=n.stateNode;try{Ov(a,s)}catch(c){lt(n,n.return,c)}}}function Fy(n,a,s){s.props=gi(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(c){lt(n,a,c)}}function Oo(n,a){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof s=="function"?n.refCleanup=s(c):s.current=c}}catch(h){lt(n,a,h)}}function Sr(n,a){var s=n.ref,c=n.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(h){lt(n,a,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(h){lt(n,a,h)}else s.current=null}function Vy(n){var a=n.type,s=n.memoizedProps,c=n.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){lt(n,n.return,h)}}function Vf(n,a,s){try{var c=n.stateNode;GR(c,n.type,s,a),c[wn]=a}catch(h){lt(n,n.return,h)}}function Uy(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&ja(n.type)||n.tag===4}function Uf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Uy(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&ja(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Hf(n,a,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(n),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=zr));else if(c!==4&&(c===27&&ja(n.type)&&(s=n.stateNode,a=null),n=n.child,n!==null))for(Hf(n,a,s),n=n.sibling;n!==null;)Hf(n,a,s),n=n.sibling}function mc(n,a,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,a?s.insertBefore(n,a):s.appendChild(n);else if(c!==4&&(c===27&&ja(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(mc(n,a,s),n=n.sibling;n!==null;)mc(n,a,s),n=n.sibling}function Hy(n){var a=n.stateNode,s=n.memoizedProps;try{for(var c=n.type,h=a.attributes;h.length;)a.removeAttributeNode(h[0]);rn(a,c,s),a[Wt]=n,a[wn]=s}catch(g){lt(n,n.return,g)}}var qr=!1,Pt=!1,Bf=!1,By=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function ER(n,a){if(n=n.containerInfo,dh=zc,n=nv(n),Ld(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.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,z=-1,G=0,ae=0,ue=n,Q=null;t:for(;;){for(var W;ue!==s||h!==0&&ue.nodeType!==3||(j=C+h),ue!==g||c!==0&&ue.nodeType!==3||(z=C+c),ue.nodeType===3&&(C+=ue.nodeValue.length),(W=ue.firstChild)!==null;)Q=ue,ue=W;for(;;){if(ue===n)break t;if(Q===s&&++G===h&&(j=C),Q===g&&++ae===c&&(z=C),(W=ue.nextSibling)!==null)break;ue=Q,Q=ue.parentNode}ue=W}s=j===-1||z===-1?null:{start:j,end:z}}else s=null}s=s||{start:0,end:0}}else s=null;for(fh={focusedElem:n,selectionRange:s},zc=!1,Kt=a;Kt!==null;)if(a=Kt,n=a.child,(a.subtreeFlags&1028)!==0&&n!==null)n.return=a,Kt=n;else for(;Kt!==null;){switch(a=Kt,g=a.alternate,n=a.flags,a.tag){case 0:if((n&4)!==0&&(n=a.updateQueue,n=n!==null?n.events:null,n!==null))for(s=0;s title"))),rn(g,c,s),g[Wt]=n,Zt(g),c=g;break e;case"link":var C=Q0("link","href",h).get(c+(s.href||""));if(C){for(var j=0;jht&&(C=ht,ht=ke,ke=C);var U=ev(j,ke),$=ev(j,ht);if(U&&$&&(W.rangeCount!==1||W.anchorNode!==U.node||W.anchorOffset!==U.offset||W.focusNode!==$.node||W.focusOffset!==$.offset)){var q=ue.createRange();q.setStart(U.node,U.offset),W.removeAllRanges(),ke>ht?(W.addRange(q),W.extend($.node,$.offset)):(q.setEnd($.node,$.offset),W.addRange(q))}}}}for(ue=[],W=j;W=W.parentNode;)W.nodeType===1&&ue.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;js?32:s,L.T=null,s=Xf,Xf=null;var g=Ca,C=Qr;if(Ht=0,ys=Ca=null,Qr=0,(rt&6)!==0)throw Error(i(331));var j=rt;if(rt|=4,t0(g.current),Jy(g,g.current,C,s),rt=j,zo(0,!1),de&&typeof de.onPostCommitFiberRoot=="function")try{de.onPostCommitFiberRoot(F,g)}catch{}return!0}finally{K.p=h,L.T=c,b0(n,a)}}function w0(n,a,s){a=qn(s,a),a=Af(n.stateNode,a,2),n=va(n,a,2),n!==null&&(Ct(n,2),_r(n))}function lt(n,a,s){if(n.tag===3)w0(n,n,s);else for(;a!==null;){if(a.tag===3){w0(a,n,s);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(_a===null||!_a.has(c))){n=qn(s,n),s=Sy(2),c=va(a,s,2),c!==null&&(_y(s,c,a,n),Ct(c,2),_r(c));break}}a=a.return}}function th(n,a,s){var c=n.pingCache;if(c===null){c=n.pingCache=new TR;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)||(Zf=!0,h.add(s),n=DR.bind(null,n,a,s),a.then(n,n))}function DR(n,a,s){var c=n.pingCache;c!==null&&c.delete(a),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,gt===n&&(Ye&s)===s&&(Tt===4||Tt===3&&(Ye&62914560)===Ye&&300>zt()-vc?(rt&2)===0&&bs(n,0):Kf|=s,vs===Ye&&(vs=0)),_r(n)}function S0(n,a){a===0&&(a=Gt()),n=si(n,a),n!==null&&(Ct(n,a),_r(n))}function kR(n){var a=n.memoizedState,s=0;a!==null&&(s=a.retryLane),S0(n,s)}function zR(n,a){var s=0;switch(n.tag){case 31:case 13:var c=n.stateNode,h=n.memoizedState;h!==null&&(s=h.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(a),S0(n,s)}function LR(n,a){return rr(n,a)}var Cc=null,ws=null,nh=!1,Ec=!1,rh=!1,Ra=0;function _r(n){n!==ws&&n.next===null&&(ws===null?Cc=ws=n:ws=ws.next=n),Ec=!0,nh||(nh=!0,IR())}function zo(n,a){if(!rh&&Ec){rh=!0;do for(var s=!1,c=Cc;c!==null;){if(n!==0){var h=c.pendingLanes;if(h===0)var g=0;else{var C=c.suspendedLanes,j=c.pingedLanes;g=(1<<31-ye(42|n)+1)-1,g&=h&~(C&~j),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(s=!0,R0(c,g))}else g=Ye,g=Ae(c,c===gt?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||ut(c,g)||(s=!0,R0(c,g));c=c.next}while(s);rh=!1}}function $R(){_0()}function _0(){Ec=nh=!1;var n=0;Ra!==0&&KR()&&(n=Ra);for(var a=zt(),s=null,c=Cc;c!==null;){var h=c.next,g=C0(c,a);g===0?(c.next=null,s===null?Cc=h:s.next=h,h===null&&(ws=s)):(s=c,(n!==0||(g&3)!==0)&&(Ec=!0)),c=h}Ht!==0&&Ht!==5||zo(n),Ra!==0&&(Ra=0)}function C0(n,a){for(var s=n.suspendedLanes,c=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0j)break;var ae=z.transferSize,ue=z.initiatorType;ae&&k0(ue)&&(z=z.responseEnd,C+=ae*(z"u"?null:document;function G0(n,a,s){var c=Ss;if(c&&typeof a=="string"&&a){var h=Hn(a);h='link[rel="'+n+'"][href="'+h+'"]',typeof s=="string"&&(h+='[crossorigin="'+s+'"]'),q0.has(h)||(q0.add(h),n={rel:n,crossOrigin:s,href:a},c.querySelector(h)===null&&(a=c.createElement("link"),rn(a,"link",n),Zt(a),c.head.appendChild(a)))}}function rj(n){Xr.D(n),G0("dns-prefetch",n,null)}function aj(n,a){Xr.C(n,a),G0("preconnect",n,a)}function ij(n,a,s){Xr.L(n,a,s);var c=Ss;if(c&&n&&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(n)+'"]';var g=h;switch(a){case"style":g=_s(n);break;case"script":g=Cs(n)}Xn.has(g)||(n=v({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:n,as:a},s),Xn.set(g,n),c.querySelector(h)!==null||a==="style"&&c.querySelector(Po(g))||a==="script"&&c.querySelector(Fo(g))||(a=c.createElement("link"),rn(a,"link",n),Zt(a),c.head.appendChild(a)))}}function sj(n,a){Xr.m(n,a);var s=Ss;if(s&&n){var c=a&&typeof a.as=="string"?a.as:"script",h='link[rel="modulepreload"][as="'+Hn(c)+'"][href="'+Hn(n)+'"]',g=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Cs(n)}if(!Xn.has(g)&&(n=v({rel:"modulepreload",href:n},a),Xn.set(g,n),s.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Fo(g)))return}c=s.createElement("link"),rn(c,"link",n),Zt(c),s.head.appendChild(c)}}}function oj(n,a,s){Xr.S(n,a,s);var c=Ss;if(c&&n){var h=qi(c).hoistableStyles,g=_s(n);a=a||"default";var C=h.get(g);if(!C){var j={loading:0,preload:null};if(C=c.querySelector(Po(g)))j.loading=5;else{n=v({rel:"stylesheet",href:n,"data-precedence":a},s),(s=Xn.get(g))&&bh(n,s);var z=C=c.createElement("link");Zt(z),rn(z,"link",n),z._p=new Promise(function(G,ae){z.onload=G,z.onerror=ae}),z.addEventListener("load",function(){j.loading|=1}),z.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Ac(C,a,c)}C={type:"stylesheet",instance:C,count:1,state:j},h.set(g,C)}}}function lj(n,a){Xr.X(n,a);var s=Ss;if(s&&n){var c=qi(s).hoistableScripts,h=Cs(n),g=c.get(h);g||(g=s.querySelector(Fo(h)),g||(n=v({src:n,async:!0},a),(a=Xn.get(h))&&xh(n,a),g=s.createElement("script"),Zt(g),rn(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function cj(n,a){Xr.M(n,a);var s=Ss;if(s&&n){var c=qi(s).hoistableScripts,h=Cs(n),g=c.get(h);g||(g=s.querySelector(Fo(h)),g||(n=v({src:n,async:!0,type:"module"},a),(a=Xn.get(h))&&xh(n,a),g=s.createElement("script"),Zt(g),rn(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function Z0(n,a,s,c){var h=(h=he.current)?Oc(h):null;if(!h)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=_s(s.href),s=qi(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"){n=_s(s.href);var g=qi(h).hoistableStyles,C=g.get(n);if(C||(h=h.ownerDocument||h,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,C),(g=h.querySelector(Po(n)))&&!g._p&&(C.instance=g,C.state.loading=5),Xn.has(n)||(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(n,s),g||uj(h,n,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=Cs(s),s=qi(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,n))}}function _s(n){return'href="'+Hn(n)+'"'}function Po(n){return'link[rel="stylesheet"]['+n+"]"}function K0(n){return v({},n,{"data-precedence":n.precedence,precedence:null})}function uj(n,a,s,c){n.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=n.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),rn(a,"link",s),Zt(a),n.head.appendChild(a))}function Cs(n){return'[src="'+Hn(n)+'"]'}function Fo(n){return"script[async]"+n}function Y0(n,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var c=n.querySelector('style[data-href~="'+Hn(s.href)+'"]');if(c)return a.instance=c,Zt(c),c;var h=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),Zt(c),rn(c,"style",h),Ac(c,s.precedence,n),a.instance=c;case"stylesheet":h=_s(s.href);var g=n.querySelector(Po(h));if(g)return a.state.loading|=4,a.instance=g,Zt(g),g;c=K0(s),(h=Xn.get(h))&&bh(c,h),g=(n.ownerDocument||n).createElement("link"),Zt(g);var C=g;return C._p=new Promise(function(j,z){C.onload=j,C.onerror=z}),rn(g,"link",c),a.state.loading|=4,Ac(g,s.precedence,n),a.instance=g;case"script":return g=Cs(s.src),(h=n.querySelector(Fo(g)))?(a.instance=h,Zt(h),h):(c=s,(h=Xn.get(g))&&(c=v({},s),xh(c,h)),n=n.ownerDocument||n,h=n.createElement("script"),Zt(h),rn(h,"link",c),n.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,Ac(c,s.precedence,n));return a.instance}function Ac(n,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 dj(n,a,s){if(s===1||a.itemProp!=null)return!1;switch(n){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"?(n=a.disabled,typeof a.precedence=="string"&&n==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 J0(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function fj(n,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=_s(c.href),g=a.querySelector(Po(h));if(g){a=g._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(n.count++,n=Nc.bind(n),a.then(n,n)),s.state.loading|=4,s.instance=g,Zt(g);return}g=a.ownerDocument||a,c=K0(c),(h=Xn.get(h))&&bh(c,h),g=g.createElement("link"),Zt(g);var C=g;C._p=new Promise(function(j,z){C.onload=j,C.onerror=z}),rn(g,"link",c),s.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(n.count++,s=Nc.bind(n),a.addEventListener("load",s),a.addEventListener("error",s))}}var wh=0;function hj(n,a){return n.stylesheets&&n.count===0&&kc(n,n.stylesheets),0wh?50:800)+a);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(h)}}:null}function Nc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)kc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Dc=null;function kc(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Dc=new Map,a.forEach(mj,n),Dc=null,Nc.call(n))}function mj(n,a){if(!(a.state.loading&4)){var s=Dc.get(n);if(s)var c=s.get(null);else{s=new Map,Dc.set(n,s);for(var h=n.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(t){console.error(t)}}return e(),Ah.exports=Nj(),Ah.exports}var kj=Dj(),yl=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(){}},zj=class extends yl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}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(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},op=new zj,Lj={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},$j=class{#e=Lj;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Si=new $j;function Ij(e){setTimeout(e,0)}var Pj=typeof window>"u"||"Deno"in globalThis;function On(){}function Fj(e,t){return typeof e=="function"?e(t):e}function mm(e){return typeof e=="number"&&e>=0&&e!==1/0}function _w(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ia(e,t){return typeof e=="function"?e(t):e}function Pn(e,t){return typeof e=="function"?e(t):e}function Sb(e,t){const{type:r="all",exact:i,fetchStatus:o,predicate:l,queryKey:u,stale:d}=e;if(u){if(i){if(t.queryHash!==lp(u,t.options))return!1}else if(!ll(t.queryKey,u))return!1}if(r!=="all"){const m=t.isActive();if(r==="active"&&!m||r==="inactive"&&m)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||o&&o!==t.state.fetchStatus||l&&!l(t))}function _b(e,t){const{exact:r,status:i,predicate:o,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(r){if(ol(t.options.mutationKey)!==ol(l))return!1}else if(!ll(t.options.mutationKey,l))return!1}return!(i&&t.state.status!==i||o&&!o(t))}function lp(e,t){return(t?.queryKeyHashFn||ol)(e)}function ol(e){return JSON.stringify(e,(t,r)=>gm(r)?Object.keys(r).sort().reduce((i,o)=>(i[o]=r[o],i),{}):r)}function ll(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ll(e[r],t[r])):!1}var Vj=Object.prototype.hasOwnProperty;function Cw(e,t,r=0){if(e===t)return e;if(r>500)return t;const i=Cb(e)&&Cb(t);if(!i&&!(gm(e)&&gm(t)))return t;const l=(i?e:Object.keys(e)).length,u=i?t:Object.keys(t),d=u.length,m=i?new Array(d):{};let p=0;for(let y=0;y{Si.setTimeout(t,e)})}function vm(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Cw(e,t):t}function Hj(e,t,r=0){const i=[...e,t];return r&&i.length>r?i.slice(1):i}function Bj(e,t,r=0){const i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var cp=Symbol();function Ew(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===cp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Rw(e,t){return typeof e=="function"?e(...t):!!e}function qj(e,t,r){let i=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),i||(i=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var cl=(()=>{let e=()=>Pj;return{isServer(){return e()},setIsServer(t){e=t}}})();function ym(){let e,t;const r=new Promise((o,l)=>{e=o,t=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}),t(o)},r}var Gj=Ij;function Zj(){let e=[],t=0,r=d=>{d()},i=d=>{d()},o=Gj;const l=d=>{t?e.push(d):o(()=>{r(d)})},u=()=>{const d=e;e=[],d.length&&o(()=>{i(()=>{d.forEach(m=>{r(m)})})})};return{batch:d=>{let m;t++;try{m=d()}finally{t--,t||u()}return m},batchCalls:d=>(...m)=>{l(()=>{d(...m)})},schedule:l,setNotifyFunction:d=>{r=d},setBatchNotifyFunction:d=>{i=d},setScheduler:d=>{o=d}}}var on=Zj(),Kj=class extends yl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),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}},mu=new Kj;function Yj(e){return Math.min(1e3*2**e,3e4)}function jw(e){return(e??"online")==="online"?mu.isOnline():!0}var bm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Tw(e){let t=!1,r=0,i;const o=ym(),l=()=>o.status!=="pending",u=_=>{if(!l()){const E=new bm(_);b(E),e.onCancel?.(E)}},d=()=>{t=!0},m=()=>{t=!1},p=()=>op.isFocused()&&(e.networkMode==="always"||mu.isOnline())&&e.canRun(),y=()=>jw(e.networkMode)&&e.canRun(),v=_=>{l()||(i?.(),o.resolve(_))},b=_=>{l()||(i?.(),o.reject(_))},x=()=>new Promise(_=>{i=E=>{(l()||p())&&_(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??(cl.isServer()?0:3),O=e.retryDelay??Yj,M=typeof O=="function"?O(r,R):O,k=T===!0||typeof T=="number"&&rp()?void 0:x()).then(()=>{t?b(R):w()})})};return{promise:o,status:()=>o.status,cancel:u,continue:()=>(i?.(),o),cancelRetry:d,continueRetry:m,canStart:y,start:()=>(y()?w():x().then(w),o)}}var Ow=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mm(this.gcTime)&&(this.#e=Si.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(cl.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Si.clearTimeout(this.#e),this.#e=void 0)}};function Qj(e){return{onFetch:(t,r)=>{const i=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let d={pages:[],pageParams:[]},m=0;const p=async()=>{let y=!1;const v=w=>{qj(w,()=>t.signal,()=>y=!0)},b=Ew(t.options,t.fetchOptions),x=async(w,_,E)=>{if(y)return Promise.reject(t.signal.reason);if(_==null&&w.pages.length)return Promise.resolve(w);const T=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:_,direction:E?"backward":"forward",meta:t.options.meta};return v(B),B})(),O=await b(T),{maxPages:M}=t.options,k=E?Bj:Hj;return{pages:k(w.pages,O,M),pageParams:k(w.pageParams,_,M)}};if(o&&l.length){const w=o==="backward",_=w?Aw:xm,E={pages:l,pageParams:u},R=_(i,E);d=await x(E,R,w)}else{const w=e??l.length;do{const _=m===0?u[0]??i.initialPageParam:xm(i,d);if(m>0&&_==null)break;d=await x(d,_),m++}while(mt.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=p}}}function xm(e,{pages:t,pageParams:r}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,r[i],r):void 0}function Aw(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function Xj(e,t){return t?xm(e,t)!=null:!1}function Jj(e,t){return!t||!e.getPreviousPageParam?!1:Aw(e,t)!=null}var Wj=class extends Ow{#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=jb(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 t=jb(this.options);t.data!==void 0&&(this.setState(Rb(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=vm(this.state.data,e,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#a?.promise;return this.#a?.cancel(e),t?t.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=>Pn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===cp||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ia(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:!_w(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(t=>t.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(t=>t!==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,t){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&t?.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 m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const r=new AbortController,i=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#s=!0,r.signal)})},o=()=>{const m=Ew(this.options,t),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(m,y,this):m(y)},u=(()=>{const m={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:o};return i(m),m})();(this.#e==="infinite"?Qj(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=Tw({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:m=>{m instanceof bm&&m.revert&&this.setState({...this.#n,fetchStatus:"idle"}),r.abort()},onFail:(m,p)=>{this.#l({type:"failed",failureCount:m,error:p})},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 m=await this.#a.start();if(m===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(m),this.#r.config.onSuccess?.(m,this),this.#r.config.onSettled?.(m,this.state.error,this),m}catch(m){if(m instanceof bm){if(m.silent)return this.#a.promise;if(m.revert){if(this.state.data===void 0)throw m;return this.state.data}}throw this.#l({type:"error",error:m}),this.#r.config.onError?.(m,this),this.#r.config.onSettled?.(this.state.data,m,this),m}finally{this.scheduleGc()}}#l(e){const t=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,...Mw(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...Rb(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=t(this.state),on.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Mw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Rb(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jb(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,i=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,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 Nw=class extends yl{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=ym(),this.bindMethods(),this.setOptions(t)}#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),Tb(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wm(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wm(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=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 Pn(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),t._defaulted&&!pm(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&Ob(this.#t,r,this.options,t)&&this.#h(),this.updateResult(),i&&(this.#t!==r||Pn(this.options.enabled,this.#t)!==Pn(t.enabled,this.#t)||Ia(this.options.staleTime,this.#t)!==Ia(t.staleTime,this.#t))&&this.#g();const o=this.#v();i&&(this.#t!==r||Pn(this.options.enabled,this.#t)!==Pn(t.enabled,this.#t)||o!==this.#c)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return t2(this,r)&&(this.#r=r,this.#a=this.options,this.#i=this.#t.state),r}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),t?.(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 t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(On)),t}#g(){this.#x();const e=Ia(this.options.staleTime,this.#t);if(cl.isServer()||this.#r.isStale||!mm(e))return;const r=_w(this.#r.dataUpdatedAt,e)+1;this.#d=Si.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,!(cl.isServer()||Pn(this.options.enabled,this.#t)===!1||!mm(this.#c)||this.#c===0)&&(this.#f=Si.setInterval(()=>{(this.options.refetchIntervalInBackground||op.isFocused())&&this.#h()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#d!==void 0&&(Si.clearTimeout(this.#d),this.#d=void 0)}#w(){this.#f!==void 0&&(Si.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const r=this.#t,i=this.options,o=this.#r,l=this.#i,u=this.#a,m=e!==r?e.state:this.#n,{state:p}=e;let y={...p},v=!1,b;if(t._optimisticResults){const P=this.hasListeners(),pe=!P&&Tb(e,t),ne=P&&Ob(e,r,t,i);(pe||ne)&&(y={...y,...Mw(p.data,e.options)}),t._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:x,errorUpdatedAt:w,status:_}=y;b=y.data;let E=!1;if(t.placeholderData!==void 0&&b===void 0&&_==="pending"){let P;o?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(P=o.data,E=!0):P=typeof t.placeholderData=="function"?t.placeholderData(this.#m?.state.data,this.#m):t.placeholderData,P!==void 0&&(_="success",b=vm(o?.data,P,t),v=!0)}if(t.select&&b!==void 0&&!E)if(o&&b===l?.data&&t.select===this.#u)b=this.#l;else try{this.#u=t.select,b=t.select(b),b=vm(o?.data,b,t),this.#l=b,this.#s=null}catch(P){this.#s=P}this.#s&&(x=this.#s,b=this.#l,w=Date.now(),_="error");const R=y.fetchStatus==="fetching",T=_==="pending",O=_==="error",M=T&&R,k=b!==void 0,V={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>m.dataUpdateCount||y.errorUpdateCount>m.errorUpdateCount,isFetching:R,isRefetching:R&&!T,isLoadingError:O&&!k,isPaused:y.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:O&&k,isStale:up(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Pn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const P=V.data!==void 0,pe=V.status==="error"&&!P,ne=fe=>{pe?fe.reject(V.error):P&&fe.resolve(V.data)},ce=()=>{const fe=this.#o=V.promise=ym();ne(fe)},me=this.#o;switch(me.status){case"pending":e.queryHash===r.queryHash&&ne(me);break;case"fulfilled":(pe||V.data!==me.value)&&ce();break;case"rejected":(!pe||V.error!==me.reason)&&ce();break}}return V}updateResult(){const e=this.#r,t=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),pm(t,e))return;this.#r=t;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 t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){on.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function e2(e,t){return Pn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Pn(t.retryOnMount,e)===!1)}function Tb(e,t){return e2(e,t)||e.state.data!==void 0&&wm(e,t,t.refetchOnMount)}function wm(e,t,r){if(Pn(t.enabled,e)!==!1&&Ia(t.staleTime,e)!=="static"){const i=typeof r=="function"?r(e):r;return i==="always"||i!==!1&&up(e,t)}return!1}function Ob(e,t,r,i){return(e!==t||Pn(i.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&up(e,r)}function up(e,t){return Pn(t.enabled,e)!==!1&&e.isStaleByTime(Ia(t.staleTime,e))}function t2(e,t){return!pm(e.getCurrentResult(),t)}var n2=class extends Nw{constructor(e,t){super(e,t)}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,t){const{state:r}=e,i=super.createResult(e,t),{isFetching:o,isRefetching:l,isError:u,isRefetchError:d}=i,m=r.fetchMeta?.fetchMore?.direction,p=u&&m==="forward",y=o&&m==="forward",v=u&&m==="backward",b=o&&m==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Xj(t,r.data),hasPreviousPage:Jj(t,r.data),isFetchNextPageError:p,isFetchingNextPage:y,isFetchPreviousPageError:v,isFetchingPreviousPage:b,isRefetchError:d&&!p&&!v,isRefetching:l&&!y&&!b}}},r2=class extends Ow{#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||a2(),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(t=>t!==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 t=()=>{this.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Tw({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:t,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)t();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 t=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=t(this.state),on.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function a2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var i2=class extends yl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,r){const i=new r2({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:r});return this.add(i),i}add(e){this.#e.add(e);const t=Uc(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Uc(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Uc(e);if(typeof t=="string"){const i=this.#t.get(t)?.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){const t=Uc(e);return typeof t=="string"?this.#t.get(t)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){on.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 t={exact:!0,...e};return this.getAll().find(r=>_b(t,r))}findAll(e={}){return this.getAll().filter(t=>_b(e,t))}notify(e){on.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return on.batch(()=>Promise.all(e.map(t=>t.continue().catch(On))))}};function Uc(e){return e.options.scope?.id}var s2=class extends yl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const i=t.queryKey,o=t.queryHash??lp(i,t);let l=this.get(o);return l||(l=new Wj({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),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 t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){on.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>Sb(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>Sb(e,r)):t}notify(e){on.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){on.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){on.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},o2=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new s2,this.#t=e.mutationCache||new i2,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=op.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=mu.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 t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ia(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const i=r.data;return[t,i]})}setQueryData(e,t,r){const i=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(i.queryHash)?.state.data,u=Fj(t,l);if(u!==void 0)return this.#e.build(this,i).setData(u,{...r,manual:!0})}setQueriesData(e,t,r){return on.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;on.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return on.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},i=on.batch(()=>this.#e.findAll(e).map(o=>o.cancel(r)));return Promise.all(i).then(On).catch(On)}invalidateQueries(e,t={}){return on.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},i=on.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 t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(Ia(t.staleTime,r))?r.fetch(t):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 mu.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,t){this.#r.set(ol(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],r={};return t.forEach(i=>{ll(e,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(e,t){this.#i.set(ol(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#i.values()],r={};return t.forEach(i=>{ll(e,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=lp(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===cp&&(t.enabled=!1),t}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()}},Dw=S.createContext(void 0),ki=e=>{const t=S.useContext(Dw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},l2=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(Dw.Provider,{value:e,children:t})),kw=S.createContext(!1),c2=()=>S.useContext(kw);kw.Provider;function u2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var d2=S.createContext(u2()),f2=()=>S.useContext(d2),h2=(e,t,r)=>{const i=r?.state.error&&typeof e.throwOnError=="function"?Rw(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},m2=e=>{S.useEffect(()=>{e.clearReset()},[e])},p2=({result:e,errorResetBoundary:t,throwOnError:r,query:i,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(o&&e.data===void 0||Rw(r,[e.error,i])),g2=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))}},v2=(e,t)=>e.isLoading&&e.isFetching&&!t,y2=(e,t)=>e?.suspense&&t.isPending,Ab=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function zw(e,t,r){const i=c2(),o=f2(),l=ki(),u=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const d=l.getQueryCache().get(u.queryHash),m=e.subscribed!==!1;u._optimisticResults=i?"isRestoring":m?"optimistic":void 0,g2(u),h2(u,o,d),m2(o);const p=!l.getQueryCache().get(u.queryHash),[y]=S.useState(()=>new t(l,u)),v=y.getOptimisticResult(u),b=!i&&m;if(S.useSyncExternalStore(S.useCallback(x=>{const w=b?y.subscribe(on.batchCalls(x)):On;return y.updateResult(),w},[y,b]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),S.useEffect(()=>{y.setOptions(u)},[u,y]),y2(u,v))throw Ab(u,y,o);if(p2({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&&!cl.isServer()&&v2(v,i)&&(p?Ab(u,y,o):d?.promise)?.catch(On).finally(()=>{y.updateResult()}),u.notifyOnChangeProps?v:y.trackResult(v)}function Ft(e,t){return zw(e,Nw)}function b2(e,t){return zw(e,n2)}let Mb=!1;function x2(e){const t=e.analytics;if(!t?.key||Mb)return;Mb=!0;const r=document.createElement("script");r.src=t.host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",r.async=!0,r.onload=()=>{const i=window.posthog;i&&(i.init(t.key,{api_host:t.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 Lw(e,t){window.posthog?.capture(e,t)}const w2=[[/^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 $w(e,t){const r=e+" "+t.split("?")[0],i=w2.find(([o])=>o.test(r));i&&Lw(i[1])}function dp(){throw location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),new Error("signing in…")}function S2(e,t){const r=t.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 Nu(e){throw new Error(S2(e.status,await e.text()))}async function qt(e){const t=await fetch(e,{headers:{Accept:"application/json"}});return t.status===401&&dp(),t.ok||await Nu(t),t.json()}async function _2(e){const t=await fetch(e);return t.status===401&&dp(),t.ok||await Nu(t),t}async function Wn(e,t,r){const i={method:e};r!==void 0&&(i.headers={"Content-Type":"application/json"},i.body=JSON.stringify(r));const o=await fetch(t,i);return o.ok||await Nu(o),$w(e,t),o.status===204?{}:o.json()}async function ea(e,t){const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return r.status===401&&dp(),r.ok||await Nu(r),$w("POST",e),r.json()}function C2(){return Ft({queryKey:["config"],queryFn:async()=>{const e=await qt("/api/config");return e.auth.enabled&&!e.me&&(location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),await new Promise(()=>{})),x2(e),e},staleTime:1/0})}var zi=Sw();const E2=ww(zi);function Nb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Gs(...e){return t=>{let r=!1;const i=e.map(o=>{const l=Nb(o,t);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 m=[];Db(o)&&typeof Hc=="function"&&(o=Hc(o._payload)),S.Children.forEach(o,b=>{if(M2(b)){d=!0;const x=b;let w="child"in x.props?x.props.child:x.props.children;Db(w)&&typeof Hc=="function"&&(w=Hc(w._payload)),u=T2(x,w),m.push(u?.props?.children)}else m.push(b)}),u?u=S.cloneElement(u,void 0,m):!d&&S.Children.count(o)===1&&S.isValidElement(o)&&(u=o);const p=u?A2(u):void 0,y=at(i,p);if(!u){if(o||o===0)throw new Error(d?z2(e):k2(e));return o}const v=O2(l,u.props??{});return u.type!==S.Fragment&&(v.ref=i?y:p),S.cloneElement(u,v)});return t.displayName=`${e}.Slot`,t}var R2=Ei("Slot"),Iw=Symbol.for("radix.slottable");function j2(e){const t=r=>"child"in r?r.children(r.child):r.children;return t.displayName=`${e}.Slottable`,t.__radixId=Iw,t}var T2=(e,t)=>{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(t)?t:null};function O2(e,t){const r={...t};for(const i in t){const o=e[i],l=t[i];/^on[A-Z]/.test(i)?o&&l?r[i]=(...d)=>{const m=l(...d);return o(...d),m}:o&&(r[i]=o):i==="style"?r[i]={...o,...l}:i==="className"&&(r[i]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}function A2(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function M2(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Iw}var N2=Symbol.for("react.lazy");function Db(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===N2&&"_payload"in e&&D2(e._payload)}function D2(e){return typeof e=="object"&&e!==null&&"then"in e}var k2=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,z2=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Hc=Mu[" use ".trim().toString()],L2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=L2.reduce((e,t)=>{const r=Ei(`Primitive.${t}`),i=S.forwardRef((o,l)=>{const{asChild:u,...d}=o,m=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(m,{...d,ref:l})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function Pw(e,t){e&&zi.flushSync(()=>e.dispatchEvent(t))}var Fw=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"}),$2="VisuallyHidden",Vw=S.forwardRef((e,t)=>f.jsx(Pe.span,{...e,ref:t,style:{...Fw,...e.style}}));Vw.displayName=$2;var I2=Vw;function Ka(e,t=[]){let r=[];function i(l,u){const d=S.createContext(u);d.displayName=l+"Context";const m=r.length;r=[...r,u];const p=v=>{const{scope:b,children:x,...w}=v,_=b?.[e]?.[m]||d,E=S.useMemo(()=>w,Object.values(w));return f.jsx(_.Provider,{value:E,children:x})};p.displayName=l+"Provider";function y(v,b,x={}){const{optional:w=!1}=x,_=b?.[e]?.[m]||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[p,y]}const o=()=>{const l=r.map(u=>S.createContext(u));return function(d){const m=d?.[e]||l;return S.useMemo(()=>({[`__scope${e}`]:{...d,[e]:m}}),[d,m])}};return o.scopeName=e,[i,P2(o,...t)]}function P2(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const i=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const u=i.reduce((d,{useScope:m,scopeName:p})=>{const v=m(l)[`__scope${p}`];return{...d,...v}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}function fp(e){const t=e+"CollectionProvider",[r,i]=Ka(t),[o,l]=r(t,{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=t;const d=e+"CollectionSlot",m=Ei(d),p=S.forwardRef((_,E)=>{const{scope:R,children:T}=_,O=l(d,R),M=at(E,O.collectionRef);return f.jsx(m,{ref:M,children:T})});p.displayName=d;const y=e+"CollectionItemSlot",v="data-radix-collection-item",b=Ei(y),x=S.forwardRef((_,E)=>{const{scope:R,children:T,...O}=_,M=S.useRef(null),k=at(E,M),B=l(y,R);return S.useEffect(()=>(B.itemMap.set(M,{ref:M,...O}),()=>{B.itemMap.delete(M)})),f.jsx(b,{[v]:"",ref:k,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((B,V)=>O.indexOf(B.ref.current)-O.indexOf(V.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:u,Slot:p,ItemSlot:x},w,i]}function Te(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o||!o.defaultPrevented)return t?.(o)}}var Qt=globalThis?.document?S.useLayoutEffect:()=>{},F2=Mu[" useInsertionEffect ".trim().toString()]||Qt;function Zs({prop:e,defaultProp:t,onChange:r=()=>{},caller:i}){const[o,l,u]=V2({defaultProp:t,onChange:r}),d=e!==void 0,m=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 p=S.useCallback(y=>{if(d){const v=U2(y)?y(e):y;v!==e&&u.current?.(v)}else l(y)},[d,e,l,u]);return[m,p]}function V2({defaultProp:e,onChange:t}){const[r,i]=S.useState(e),o=S.useRef(r),l=S.useRef(t);return F2(()=>{l.current=t},[t]),S.useEffect(()=>{o.current!==r&&(l.current?.(r),o.current=r)},[r,o]),[r,i,l]}function U2(e){return typeof e=="function"}function H2(e,t){return S.useReducer((r,i)=>t[r][i]??r,e)}var gr=e=>{const{present:t,children:r}=e,i=B2(t),o=typeof r=="function"?r({present:i.isPresent}):S.Children.only(r),l=q2(i.ref,G2(o));return typeof r=="function"||i.isPresent?S.cloneElement(o,{ref:l}):null};gr.displayName="Presence";function B2(e){const[t,r]=S.useState(),i=S.useRef(null),o=S.useRef(e),l=S.useRef("none"),u=S.useRef(void 0),d=e?"mounted":"unmounted",[m,p]=H2(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{m==="mounted"?(l.current=u.current??Zo(i.current),u.current=void 0):l.current="none"},[m]),Qt(()=>{const y=i.current,v=o.current;if(v!==e){const x=l.current,w=Zo(y);e?(u.current=w,p("MOUNT")):w==="none"||y?.display==="none"?p("UNMOUNT"):p(v&&x!==w?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,p]),Qt(()=>{if(t){let y;const v=t.ownerDocument.defaultView??window,b=w=>{const E=Zo(i.current).includes(CSS.escape(w.animationName));if(w.target===t&&E&&(p("ANIMATION_END"),!o.current)){const R=t.style.animationFillMode;t.style.animationFillMode="forwards",y=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=R)})}},x=w=>{w.target===t&&(l.current=Zo(i.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",b),t.addEventListener("animationend",b),()=>{v.clearTimeout(y),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",b),t.removeEventListener("animationend",b)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:S.useCallback(y=>{if(y){const v=getComputedStyle(y);i.current=v,u.current=Zo(v)}else i.current=null;r(y)},[])}}function kb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function q2(...e){const t=S.useRef(e);return t.current=e,S.useCallback(r=>{const i=t.current;let o=!1;const l=i.map(u=>{const d=kb(u,r);return!o&&typeof d=="function"&&(o=!0),d});if(o)return()=>{for(let u=0;u{}),K2=0;function fn(e){const[t,r]=S.useState(Z2());return Qt(()=>{r(i=>i??String(K2++))},[e]),t?`radix-${t}`:""}var Y2=S.createContext(void 0);function hp(e){const t=S.useContext(Y2);return e||t||"ltr"}function tr(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>((...r)=>t.current?.(...r)),[])}var Q2="DismissableLayer",Sm="dismissableLayer.update",X2="dismissableLayer.pointerDownOutside",J2="dismissableLayer.focusOutside",zb,mp=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),bl=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,onDismiss:m,...p}=e,y=S.useContext(mp),[v,b]=S.useState(null),x=v?.ownerDocument??globalThis?.document,[,w]=S.useState({}),_=at(t,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,k=O>=T,B=S.useRef(!1),V=rT(ce=>{l?.(ce),d?.(ce),ce.defaultPrevented||m?.()},{ownerDocument:x,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:B,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:S.useCallback(ce=>{if(!(ce instanceof Node))return!1;const me=[...y.branches].some(fe=>fe.contains(ce));return k&&!me},[y.branches,k])}),P=aT(ce=>{if(i&&B.current)return;const me=ce.target;[...y.branches].some(Z=>Z.contains(me))||(u?.(ce),d?.(ce),ce.defaultPrevented||m?.())},x),pe=v?O===E.length-1:!1,ne=tr(ce=>{ce.key==="Escape"&&(o?.(ce),!ce.defaultPrevented&&m&&(ce.preventDefault(),m()))});return S.useEffect(()=>{if(pe)return x.addEventListener("keydown",ne,{capture:!0}),()=>x.removeEventListener("keydown",ne,{capture:!0})},[x,pe,ne]),S.useEffect(()=>{if(v)return r&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(zb=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(v)),y.layers.add(v),Lb(),()=>{r&&(y.layersWithOutsidePointerEventsDisabled.delete(v),y.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=zb))}},[v,x,r,y]),S.useEffect(()=>()=>{v&&(y.layers.delete(v),y.layersWithOutsidePointerEventsDisabled.delete(v),Lb())},[v,y]),S.useEffect(()=>{const ce=()=>w({});return document.addEventListener(Sm,ce),()=>document.removeEventListener(Sm,ce)},[]),f.jsx(Pe.div,{...p,ref:_,style:{pointerEvents:M?k?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,V.onPointerDownCapture)})});bl.displayName=Q2;var W2="DismissableLayerBranch",eT=S.forwardRef((e,t)=>{const r=S.useContext(mp),i=S.useRef(null),o=at(t,i);return S.useEffect(()=>{const l=i.current;if(l)return r.branches.add(l),()=>{r.branches.delete(l)}},[r.branches]),f.jsx(Pe.div,{...e,ref:o})});eT.displayName=W2;function tT(){const e=S.useContext(mp),[t,r]=S.useState(null);return S.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}var nT=()=>!0;function rT(e,t){const{ownerDocument:r=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:l,shouldHandlePointerDownOutside:u=nT}=t,d=tr(e),m=S.useRef(!1),p=S.useRef(!1),y=S.useRef(new Map),v=S.useRef(()=>{});return S.useEffect(()=>{function b(){p.current=!1,o.current=!1,y.current.clear()}function x(){return Array.from(y.current.values()).some(Boolean)}function w(O){if(!p.current)return;const M=O.target;M instanceof Node&&[...l].some(B=>B.contains(M))||y.current.set(O.type,!0),O.type==="click"&&window.setTimeout(()=>{p.current&&v.current()},0)}function _(O){p.current&&y.current.set(O.type,!1)}const E=O=>{if(O.target&&!m.current){let M=function(){r.removeEventListener("click",v.current);const B=x();b(),B||Uw(X2,d,k,{discrete:!0})};if(!u(O.target)){r.removeEventListener("click",v.current),b(),m.current=!1;return}const k={originalEvent:O};p.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();m.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:()=>m.current=!0}}function aT(e,t=globalThis?.document){const r=tr(e),i=S.useRef(!1);return S.useEffect(()=>{const o=l=>{l.target&&!i.current&&Uw(J2,r,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Lb(){const e=new CustomEvent(Sm);document.dispatchEvent(e)}function Uw(e,t,r,{discrete:i}){const o=r.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),i?Pw(o,l):o.dispatchEvent(l)}var kh="focusScope.autoFocusOnMount",zh="focusScope.autoFocusOnUnmount",$b={bubbles:!1,cancelable:!0},iT="FocusScope",Du=S.forwardRef((e,t)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=e,[d,m]=S.useState(null),p=tr(o),y=tr(l),v=S.useRef(null),b=at(t,m),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:ka(v.current,{select:!0})},E=function(O){if(x.paused||!d)return;const M=O.relatedTarget;M!==null&&(d.contains(M)||ka(v.current,{select:!0}))},R=function(O){if(document.activeElement===document.body)for(const k of O)k.removedNodes.length>0&&ka(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){Pb.add(x);const _=document.activeElement;if(!d.contains(_)){const R=new CustomEvent(kh,$b);d.addEventListener(kh,p),d.dispatchEvent(R),R.defaultPrevented||(sT(dT(Hw(d)),{select:!0}),document.activeElement===_&&ka(d))}return()=>{d.removeEventListener(kh,p),setTimeout(()=>{const R=new CustomEvent(zh,$b);d.addEventListener(zh,y),d.dispatchEvent(R),R.defaultPrevented||ka(_??document.body,{select:!0}),d.removeEventListener(zh,y),Pb.remove(x)},0)}}},[d,p,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]=oT(T);O&&M?!_.shiftKey&&R===M?(_.preventDefault(),r&&ka(O,{select:!0})):_.shiftKey&&R===O&&(_.preventDefault(),r&&ka(M,{select:!0})):R===T&&_.preventDefault()}},[r,i,x.paused]);return f.jsx(Pe.div,{tabIndex:-1,...u,ref:b,onKeyDown:w})});Du.displayName=iT;function sT(e,{select:t=!1}={}){const r=document.activeElement;for(const i of e)if(ka(i,{select:t}),document.activeElement!==r)return}function oT(e){const t=Hw(e),r=Ib(t,e),i=Ib(t.reverse(),e);return[r,i]}function Hw(e){const t=[],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();)t.push(r.currentNode);return t}function Ib(e,t){const r=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(r?!i.checkVisibility({checkVisibilityCSS:!0}):lT(i,{upTo:t})))return i}function lT(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function cT(e){return e instanceof HTMLInputElement&&"select"in e}function ka(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&cT(e)&&t&&e.select()}}var Pb=uT();function uT(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Fb(e,t),e.unshift(t)},remove(t){e=Fb(e,t),e[0]?.resume()}}}function Fb(e,t){const r=[...e],i=r.indexOf(t);return i!==-1&&r.splice(i,1),r}function dT(e){return e.filter(t=>t.tagName!=="A")}var fT="Portal",xl=S.forwardRef((e,t)=>{const{container:r,...i}=e,[o,l]=S.useState(!1);Qt(()=>l(!0),[]);const u=r||o&&globalThis?.document?.body;return u?zi.createPortal(f.jsx(Pe.div,{...i,ref:t}),u):null});xl.displayName=fT;var Bc=0,Rs=null;function pp(){S.useEffect(()=>{Rs||(Rs={start:Vb(),end:Vb()});const{start:e,end:t}=Rs;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Bc++,()=>{Bc===1&&(Rs?.start.remove(),Rs?.end.remove(),Rs=null),Bc=Math.max(0,Bc-1)}},[])}function Vb(){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 Tr=function(){return Tr=Object.assign||function(t){for(var r,i=1,o=arguments.length;i"u")return OT;var t=AT(e),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-r+t[2]-t[0])}},NT=Zw(),Ps="data-scroll-locked",DT=function(e,t,r,i){var o=e.left,l=e.top,u=e.right,d=e.gap;return r===void 0&&(r="margin"),` - .`.concat(mT,` { +`+c.stack}}var At=Object.prototype.hasOwnProperty,rr=e.unstable_scheduleCallback,br=e.unstable_cancelCallback,Rt=e.unstable_shouldYield,Vn=e.unstable_requestPaint,zt=e.unstable_now,Dr=e.unstable_getCurrentPriorityLevel,ar=e.unstable_ImmediatePriority,oa=e.unstable_UserBlockingPriority,ir=e.unstable_NormalPriority,la=e.unstable_LowPriority,Jt=e.unstable_IdlePriority,A=e.log,I=e.unstable_setDisableYieldValue,F=null,de=null;function oe(n){if(typeof A=="function"&&I(n),de&&typeof de.setStrictMode=="function")try{de.setStrictMode(F,n)}catch{}}var ye=Math.clz32?Math.clz32:le,we=Math.log,ee=Math.LN2;function le(n){return n>>>=0,n===0?32:31-(we(n)/ee|0)|0}var Re=256,ze=262144,it=4194304;function _t(n){var a=n&42;if(a!==0)return a;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Ae(n,a,s){var c=n.pendingLanes;if(c===0)return 0;var h=0,g=n.suspendedLanes,C=n.pingedLanes;n=n.warmLanes;var j=c&134217727;return j!==0?(c=j&~g,c!==0?h=_t(c):(C&=j,C!==0?h=_t(C):s||(s=j&~n,s!==0&&(h=_t(s))))):(j=c&~g,j!==0?h=_t(j):C!==0?h=_t(C):s||(s=c&~n,s!==0&&(h=_t(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 ut(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function st(n,a){switch(n){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 Gt(){var n=it;return it<<=1,(it&62914560)===0&&(it=4194304),n}function sr(n){for(var a=[],s=0;31>s;s++)a.push(n);return a}function Ct(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function yn(n,a,s,c,h,g){var C=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var j=n.entanglements,z=n.expirationTimes,G=n.hiddenUpdates;for(s=C&~s;0"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var yE=/[\n"\\]/g;function Hn(n){return n.replace(yE,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function wd(n,a,s,c,h,g,C,j){n.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?n.type=C:n.removeAttribute("type"),a!=null?C==="number"?(a===0&&n.value===""||n.value!=a)&&(n.value=""+Un(a)):n.value!==""+Un(a)&&(n.value=""+Un(a)):C!=="submit"&&C!=="reset"||n.removeAttribute("value"),a!=null?Sd(n,C,Un(a)):s!=null?Sd(n,C,Un(s)):c!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.name=""+Un(j):n.removeAttribute("name")}function Og(n,a,s,c,h,g,C,j){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),a!=null||s!=null){if(!(g!=="submit"&&g!=="reset"||a!=null)){xd(n);return}s=s!=null?""+Un(s):"",a=a!=null?""+Un(a):s,j||a===n.value||(n.value=a),n.defaultValue=a}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=j?n.checked:!!c,n.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(n.name=C),xd(n)}function Sd(n,a,s){a==="number"&&Nl(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function Zi(n,a,s,c){if(n=n.options,a){a={};for(var h=0;h"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jd=!1;if(Lr)try{var ao={};Object.defineProperty(ao,"passive",{get:function(){jd=!0}}),window.addEventListener("test",ao,ao),window.removeEventListener("test",ao,ao)}catch{jd=!1}var ua=null,Td=null,kl=null;function Lg(){if(kl)return kl;var n,a=Td,s=a.length,c,h="value"in ua?ua.value:ua.textContent,g=h.length;for(n=0;n=oo),Ug=" ",Hg=!1;function Bg(n,a){switch(n){case"keyup":return GE.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Xi=!1;function KE(n,a){switch(n){case"compositionend":return qg(a);case"keypress":return a.which!==32?null:(Hg=!0,Ug);case"textInput":return n=a.data,n===Ug&&Hg?null:n;default:return null}}function YE(n,a){if(Xi)return n==="compositionend"||!Dd&&Bg(n,a)?(n=Lg(),kl=Td=ua=null,Xi=!1,n):null;switch(n){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-n};n=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Wg(s)}}function tv(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?tv(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function nv(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=Nl(n.document);a instanceof n.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)n=a.contentWindow;else break;a=Nl(n.document)}return a}function Ld(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a&&(a==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||a==="textarea"||n.contentEditable==="true")}var rR=Lr&&"documentMode"in document&&11>=document.documentMode,Ji=null,$d=null,fo=null,Id=!1;function rv(n,a,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Id||Ji==null||Ji!==Nl(c)||(c=Ji,"selectionStart"in c&&Ld(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}),fo&&uo(fo,c)||(fo=c,c=jc($d,"onSelect"),0>=C,h-=C,xr=1<<32-ye(a)+h|s<Be?(Qe=Oe,Oe=null):Qe=Oe.sibling;var tt=Q(U,Oe,q[Be],se);if(tt===null){Oe===null&&(Oe=Qe);break}n&&Oe&&tt.alternate===null&&a(U,Oe),$=g(tt,$,Be),et===null?Ne=tt:et.sibling=tt,et=tt,Oe=Qe}if(Be===q.length)return s(U,Oe),Xe&&Ir(U,Be),Ne;if(Oe===null){for(;BeBe?(Qe=Oe,Oe=null):Qe=Oe.sibling;var Na=Q(U,Oe,tt.value,se);if(Na===null){Oe===null&&(Oe=Qe);break}n&&Oe&&Na.alternate===null&&a(U,Oe),$=g(Na,$,Be),et===null?Ne=Na:et.sibling=Na,et=Na,Oe=Qe}if(tt.done)return s(U,Oe),Xe&&Ir(U,Be),Ne;if(Oe===null){for(;!tt.done;Be++,tt=q.next())tt=ue(U,tt.value,se),tt!==null&&($=g(tt,$,Be),et===null?Ne=tt:et.sibling=tt,et=tt);return Xe&&Ir(U,Be),Ne}for(Oe=c(Oe);!tt.done;Be++,tt=q.next())tt=W(Oe,U,Be,tt.value,se),tt!==null&&(n&&tt.alternate!==null&&Oe.delete(tt.key===null?Be:tt.key),$=g(tt,$,Be),et===null?Ne=tt:et.sibling=tt,et=tt);return n&&Oe.forEach(function(_j){return a(U,_j)}),Xe&&Ir(U,Be),Ne}function ht(U,$,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 Ne=q.key;$!==null;){if($.key===Ne){if(Ne=q.type,Ne===_){if($.tag===7){s(U,$.sibling),se=h($,q.props.children),se.return=U,U=se;break e}}else if($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===P&&fi(Ne)===$.type){s(U,$.sibling),se=h($,q.props),yo(se,q),se.return=U,U=se;break e}s(U,$);break}else a(U,$);$=$.sibling}q.type===_?(se=oi(q.props.children,U.mode,se,q.key),se.return=U,U=se):(se=Bl(q.type,q.key,q.props,null,U.mode,se),yo(se,q),se.return=U,U=se)}return C(U);case w:e:{for(Ne=q.key;$!==null;){if($.key===Ne)if($.tag===4&&$.stateNode.containerInfo===q.containerInfo&&$.stateNode.implementation===q.implementation){s(U,$.sibling),se=h($,q.children||[]),se.return=U,U=se;break e}else{s(U,$);break}else a(U,$);$=$.sibling}se=qd(q,U.mode,se),se.return=U,U=se}return C(U);case P:return q=fi(q),ht(U,$,q,se)}if(Se(q))return je(U,$,q,se);if(me(q)){if(Ne=me(q),typeof Ne!="function")throw Error(i(150));return q=Ne.call(q),ke(U,$,q,se)}if(typeof q.then=="function")return ht(U,$,Xl(q),se);if(q.$$typeof===O)return ht(U,$,Zl(U,q),se);Jl(U,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,$!==null&&$.tag===6?(s(U,$.sibling),se=h($,q),se.return=U,U=se):(s(U,$),se=Bd(q,U.mode,se),se.return=U,U=se),C(U)):s(U,$)}return function(U,$,q,se){try{vo=0;var Ne=ht(U,$,q,se);return cs=null,Ne}catch(Oe){if(Oe===ls||Oe===Yl)throw Oe;var et=Dn(29,Oe,null,U.mode);return et.lanes=se,et.return=U,et}}}var mi=Rv(!0),jv=Rv(!1),pa=!1;function rf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function af(n,a){n=n.updateQueue,a.updateQueue===n&&(a.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ga(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function va(n,a,s){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(rt&2)!==0){var h=c.pending;return h===null?a.next=a:(a.next=h.next,h.next=a),c.pending=a,a=Hl(n),uv(n,null,s),a}return Ul(n,c,a,s),Hl(n)}function bo(n,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var c=a.lanes;c&=n.pendingLanes,s|=c,a.lanes=s,bn(n,s)}}function sf(n,a){var s=n.updateQueue,c=n.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},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=a:n.next=a,s.lastBaseUpdate=a}var of=!1;function xo(){if(of){var n=os;if(n!==null)throw n}}function wo(n,a,s,c){of=!1;var h=n.updateQueue;pa=!1;var g=h.firstBaseUpdate,C=h.lastBaseUpdate,j=h.shared.pending;if(j!==null){h.shared.pending=null;var z=j,G=z.next;z.next=null,C===null?g=G:C.next=G,C=z;var ae=n.alternate;ae!==null&&(ae=ae.updateQueue,j=ae.lastBaseUpdate,j!==C&&(j===null?ae.firstBaseUpdate=G:j.next=G,ae.lastBaseUpdate=z))}if(g!==null){var ue=h.baseState;C=0,ae=G=z=null,j=g;do{var Q=j.lane&-536870913,W=Q!==j.lane;if(W?(Ye&Q)===Q:(c&Q)===Q){Q!==0&&Q===ss&&(of=!0),ae!==null&&(ae=ae.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var je=n,ke=j;Q=a;var ht=s;switch(ke.tag){case 1:if(je=ke.payload,typeof je=="function"){ue=je.call(ht,ue,Q);break e}ue=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=ke.payload,Q=typeof je=="function"?je.call(ht,ue,Q):je,Q==null)break e;ue=v({},ue,Q);break e;case 2:pa=!0}}Q=j.callback,Q!==null&&(n.flags|=64,W&&(n.flags|=8192),W=h.callbacks,W===null?h.callbacks=[Q]:W.push(Q))}else W={lane:Q,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ae===null?(G=ae=W,z=ue):ae=ae.next=W,C|=Q;if(j=j.next,j===null){if(j=h.shared.pending,j===null)break;W=j,j=W.next,W.next=null,h.lastBaseUpdate=W,h.shared.pending=null}}while(!0);ae===null&&(z=ue),h.baseState=z,h.firstBaseUpdate=G,h.lastBaseUpdate=ae,g===null&&(h.shared.lanes=0),Sa|=C,n.lanes=C,n.memoizedState=ue}}function Tv(n,a){if(typeof n!="function")throw Error(i(191,n));n.call(a)}function Ov(n,a){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;ng?g:8;var C=L.T,j={};L.T=j,Rf(n,!1,a,s);try{var z=h(),G=L.S;if(G!==null&&G(j,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ae=fR(z,c);Co(n,a,ae,In(n))}else Co(n,a,c,In(n))}catch(ue){Co(n,a,{then:function(){},status:"rejected",reason:ue},In())}finally{K.p=g,C!==null&&j.types!==null&&(C.types=j.types),L.T=C}}function yR(){}function Cf(n,a,s,c){if(n.tag!==5)throw Error(i(476));var h=oy(n).queue;sy(n,h,a,ie,s===null?yR:function(){return ly(n),s(c)})}function oy(n){var a=n.memoizedState;if(a!==null)return a;a={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ur,lastRenderedState:ie},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ur,lastRenderedState:s},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function ly(n){var a=oy(n);a.next===null&&(a=n.alternate.memoizedState),Co(n,a.next.queue,{},In())}function Ef(){return tn(Vo)}function cy(){return Nt().memoizedState}function uy(){return Nt().memoizedState}function bR(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var s=In();n=ga(s);var c=va(a,n,s);c!==null&&(jn(c,a,s),bo(c,a,s)),a={cache:Wd()},n.payload=a;return}a=a.return}}function xR(n,a,s){var c=In();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},lc(n)?fy(a,s):(s=Ud(n,a,s,c),s!==null&&(jn(s,n,c),hy(s,a,c)))}function dy(n,a,s){var c=In();Co(n,a,s,c)}function Co(n,a,s,c){var h={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(lc(n))fy(a,h);else{var g=n.alternate;if(n.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,Nn(j,C))return Ul(n,a,h,0),gt===null&&Vl(),!1}catch{}if(s=Ud(n,a,h,c),s!==null)return jn(s,n,c),hy(s,a,c),!0}return!1}function Rf(n,a,s,c){if(c={lane:2,revertLane:ah(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},lc(n)){if(a)throw Error(i(479))}else a=Ud(n,s,c,2),a!==null&&jn(a,n,2)}function lc(n){var a=n.alternate;return n===Ue||a!==null&&a===Ue}function fy(n,a){ds=tc=!0;var s=n.pending;s===null?a.next=a:(a.next=s.next,s.next=a),n.pending=a}function hy(n,a,s){if((s&4194048)!==0){var c=a.lanes;c&=n.pendingLanes,s|=c,a.lanes=s,bn(n,s)}}var Eo={readContext:tn,use:ac,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};Eo.useEffectEvent=jt;var my={readContext:tn,use:ac,useCallback:function(n,a){return pn().memoizedState=[n,a===void 0?null:a],n},useContext:tn,useEffect:Xv,useImperativeHandle:function(n,a,s){s=s!=null?s.concat([n]):null,sc(4194308,4,ty.bind(null,a,n),s)},useLayoutEffect:function(n,a){return sc(4194308,4,n,a)},useInsertionEffect:function(n,a){sc(4,2,n,a)},useMemo:function(n,a){var s=pn();a=a===void 0?null:a;var c=n();if(pi){oe(!0);try{n()}finally{oe(!1)}}return s.memoizedState=[c,a],c},useReducer:function(n,a,s){var c=pn();if(s!==void 0){var h=s(a);if(pi){oe(!0);try{s(a)}finally{oe(!1)}}}else h=a;return c.memoizedState=c.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},c.queue=n,n=n.dispatch=xR.bind(null,Ue,n),[c.memoizedState,n]},useRef:function(n){var a=pn();return n={current:n},a.memoizedState=n},useState:function(n){n=bf(n);var a=n.queue,s=dy.bind(null,Ue,a);return a.dispatch=s,[n.memoizedState,s]},useDebugValue:Sf,useDeferredValue:function(n,a){var s=pn();return _f(s,n,a)},useTransition:function(){var n=bf(!1);return n=sy.bind(null,Ue,n.queue,!0,!1),pn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,s){var c=Ue,h=pn();if(Xe){if(s===void 0)throw Error(i(407));s=s()}else{if(s=a(),gt===null)throw Error(i(349));(Ye&127)!==0||zv(c,a,s)}h.memoizedState=s;var g={value:s,getSnapshot:a};return h.queue=g,Xv($v.bind(null,c,g,n),[n]),c.flags|=2048,hs(9,{destroy:void 0},Lv.bind(null,c,g,s,a),null),s},useId:function(){var n=pn(),a=gt.identifierPrefix;if(Xe){var s=wr,c=xr;s=(c&~(1<<32-ye(c)-1)).toString(32)+s,a="_"+a+"R_"+s,s=nc++,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[Wt]=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(rn(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&&Br(a)}}return yt(a),Ff(a,a.type,n===null?null:n.memoizedProps,a.pendingProps,s),null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==c&&Br(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(i(166));if(n=he.current,as(a)){if(n=a.stateNode,s=a.memoizedProps,c=null,h=en,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}n[Wt]=a,n=!!(n.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||D0(n.nodeValue,s)),n||ha(a,!0)}else n=Tc(n).createTextNode(c),n[Wt]=a,a.stateNode=n}return yt(a),null;case 31:if(s=a.memoizedState,n===null||n.memoizedState!==null){if(c=as(a),s!==null){if(n===null){if(!c)throw Error(i(318));if(n=a.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[Wt]=a}else li(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;yt(a),n=!1}else s=Yd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=s),n=!0;if(!n)return a.flags&256?(zn(a),a):(zn(a),null);if((a.flags&128)!==0)throw Error(i(558))}return yt(a),null;case 13:if(c=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=as(a),c!==null&&c.dehydrated!==null){if(n===null){if(!h)throw Error(i(318));if(h=a.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(i(317));h[Wt]=a}else li(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;yt(a),h=!1}else h=Yd(),n!==null&&n.memoizedState!==null&&(n.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,n=n!==null&&n.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!==n&&s&&(a.child.flags|=8192),hc(a,a.updateQueue),yt(a),null);case 4:return xe(),n===null&&lh(a.stateNode.containerInfo),yt(a),null;case 10:return Fr(a.type),yt(a),null;case 19:if(N(Mt),c=a.memoizedState,c===null)return yt(a),null;if(h=(a.flags&128)!==0,g=c.rendering,g===null)if(h)jo(c,!1);else{if(Tt!==0||n!==null&&(n.flags&128)!==0)for(n=a.child;n!==null;){if(g=ec(n),g!==null){for(a.flags|=128,jo(c,!1),n=g.updateQueue,a.updateQueue=n,hc(a,n),a.subtreeFlags=0,n=s,s=a.child;s!==null;)dv(s,n),s=s.sibling;return H(Mt,Mt.current&1|2),Xe&&Ir(a,c.treeForkCount),a.child}n=n.sibling}c.tail!==null&&zt()>yc&&(a.flags|=128,h=!0,jo(c,!1),a.lanes=4194304)}else{if(!h)if(n=ec(g),n!==null){if(a.flags|=128,h=!0,n=n.updateQueue,a.updateQueue=n,hc(a,n),jo(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!Xe)return yt(a),null}else 2*zt()-c.renderingStartTime>yc&&s!==536870912&&(a.flags|=128,h=!0,jo(c,!1),a.lanes=4194304);c.isBackwards?(g.sibling=a.child,a.child=g):(n=c.last,n!==null?n.sibling=g:a.child=g,c.last=g)}return c.tail!==null?(n=c.tail,c.rendering=n,c.tail=n.sibling,c.renderingStartTime=zt(),n.sibling=null,s=Mt.current,H(Mt,h?s&1|2:s&1),Xe&&Ir(a,c.treeForkCount),n):(yt(a),null);case 22:case 23:return zn(a),cf(),c=a.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(s&536870912)!==0&&(a.flags&128)===0&&(yt(a),a.subtreeFlags&6&&(a.flags|=8192)):yt(a),s=a.updateQueue,s!==null&&hc(a,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048),n!==null&&N(di),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Fr(Lt),yt(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function ER(n,a){switch(Zd(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return Fr(Lt),xe(),n=a.flags,(n&65536)!==0&&(n&128)===0?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return Fe(a),null;case 31:if(a.memoizedState!==null){if(zn(a),a.alternate===null)throw Error(i(340));li()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 13:if(zn(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(i(340));li()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return N(Mt),null;case 4:return xe(),null;case 10:return Fr(a.type),null;case 22:case 23:return zn(a),cf(),n!==null&&N(di),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return Fr(Lt),null;case 25:return null;default:return null}}function Iy(n,a){switch(Zd(a),a.tag){case 3:Fr(Lt),xe();break;case 26:case 27:case 5:Fe(a);break;case 4:xe();break;case 31:a.memoizedState!==null&&zn(a);break;case 13:zn(a);break;case 19:N(Mt);break;case 10:Fr(a.type);break;case 22:case 23:zn(a),cf(),n!==null&&N(di);break;case 24:Fr(Lt)}}function To(n,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&n)===n){c=void 0;var g=s.create,C=s.inst;c=g(),C.destroy=c}s=s.next}while(s!==h)}}catch(j){lt(a,a.return,j)}}function xa(n,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&n)===n){var C=c.inst,j=C.destroy;if(j!==void 0){C.destroy=void 0,h=a;var z=s,G=j;try{G()}catch(ae){lt(h,z,ae)}}}c=c.next}while(c!==g)}}catch(ae){lt(a,a.return,ae)}}function Py(n){var a=n.updateQueue;if(a!==null){var s=n.stateNode;try{Ov(a,s)}catch(c){lt(n,n.return,c)}}}function Fy(n,a,s){s.props=gi(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(c){lt(n,a,c)}}function Oo(n,a){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof s=="function"?n.refCleanup=s(c):s.current=c}}catch(h){lt(n,a,h)}}function Sr(n,a){var s=n.ref,c=n.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(h){lt(n,a,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(h){lt(n,a,h)}else s.current=null}function Vy(n){var a=n.type,s=n.memoizedProps,c=n.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){lt(n,n.return,h)}}function Vf(n,a,s){try{var c=n.stateNode;ZR(c,n.type,s,a),c[wn]=a}catch(h){lt(n,n.return,h)}}function Uy(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&ja(n.type)||n.tag===4}function Uf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Uy(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&ja(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Hf(n,a,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(n),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=zr));else if(c!==4&&(c===27&&ja(n.type)&&(s=n.stateNode,a=null),n=n.child,n!==null))for(Hf(n,a,s),n=n.sibling;n!==null;)Hf(n,a,s),n=n.sibling}function mc(n,a,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,a?s.insertBefore(n,a):s.appendChild(n);else if(c!==4&&(c===27&&ja(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(mc(n,a,s),n=n.sibling;n!==null;)mc(n,a,s),n=n.sibling}function Hy(n){var a=n.stateNode,s=n.memoizedProps;try{for(var c=n.type,h=a.attributes;h.length;)a.removeAttributeNode(h[0]);rn(a,c,s),a[Wt]=n,a[wn]=s}catch(g){lt(n,n.return,g)}}var qr=!1,Pt=!1,Bf=!1,By=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function RR(n,a){if(n=n.containerInfo,dh=zc,n=nv(n),Ld(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.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,z=-1,G=0,ae=0,ue=n,Q=null;t:for(;;){for(var W;ue!==s||h!==0&&ue.nodeType!==3||(j=C+h),ue!==g||c!==0&&ue.nodeType!==3||(z=C+c),ue.nodeType===3&&(C+=ue.nodeValue.length),(W=ue.firstChild)!==null;)Q=ue,ue=W;for(;;){if(ue===n)break t;if(Q===s&&++G===h&&(j=C),Q===g&&++ae===c&&(z=C),(W=ue.nextSibling)!==null)break;ue=Q,Q=ue.parentNode}ue=W}s=j===-1||z===-1?null:{start:j,end:z}}else s=null}s=s||{start:0,end:0}}else s=null;for(fh={focusedElem:n,selectionRange:s},zc=!1,Kt=a;Kt!==null;)if(a=Kt,n=a.child,(a.subtreeFlags&1028)!==0&&n!==null)n.return=a,Kt=n;else for(;Kt!==null;){switch(a=Kt,g=a.alternate,n=a.flags,a.tag){case 0:if((n&4)!==0&&(n=a.updateQueue,n=n!==null?n.events:null,n!==null))for(s=0;s title"))),rn(g,c,s),g[Wt]=n,Zt(g),c=g;break e;case"link":var C=Q0("link","href",h).get(c+(s.href||""));if(C){for(var j=0;jht&&(C=ht,ht=ke,ke=C);var U=ev(j,ke),$=ev(j,ht);if(U&&$&&(W.rangeCount!==1||W.anchorNode!==U.node||W.anchorOffset!==U.offset||W.focusNode!==$.node||W.focusOffset!==$.offset)){var q=ue.createRange();q.setStart(U.node,U.offset),W.removeAllRanges(),ke>ht?(W.addRange(q),W.extend($.node,$.offset)):(q.setEnd($.node,$.offset),W.addRange(q))}}}}for(ue=[],W=j;W=W.parentNode;)W.nodeType===1&&ue.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;js?32:s,L.T=null,s=Xf,Xf=null;var g=Ca,C=Qr;if(Ht=0,ys=Ca=null,Qr=0,(rt&6)!==0)throw Error(i(331));var j=rt;if(rt|=4,t0(g.current),Jy(g,g.current,C,s),rt=j,zo(0,!1),de&&typeof de.onPostCommitFiberRoot=="function")try{de.onPostCommitFiberRoot(F,g)}catch{}return!0}finally{K.p=h,L.T=c,b0(n,a)}}function w0(n,a,s){a=qn(s,a),a=Af(n.stateNode,a,2),n=va(n,a,2),n!==null&&(Ct(n,2),_r(n))}function lt(n,a,s){if(n.tag===3)w0(n,n,s);else for(;a!==null;){if(a.tag===3){w0(a,n,s);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(_a===null||!_a.has(c))){n=qn(s,n),s=Sy(2),c=va(a,s,2),c!==null&&(_y(s,c,a,n),Ct(c,2),_r(c));break}}a=a.return}}function th(n,a,s){var c=n.pingCache;if(c===null){c=n.pingCache=new OR;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)||(Zf=!0,h.add(s),n=kR.bind(null,n,a,s),a.then(n,n))}function kR(n,a,s){var c=n.pingCache;c!==null&&c.delete(a),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,gt===n&&(Ye&s)===s&&(Tt===4||Tt===3&&(Ye&62914560)===Ye&&300>zt()-vc?(rt&2)===0&&bs(n,0):Kf|=s,vs===Ye&&(vs=0)),_r(n)}function S0(n,a){a===0&&(a=Gt()),n=si(n,a),n!==null&&(Ct(n,a),_r(n))}function zR(n){var a=n.memoizedState,s=0;a!==null&&(s=a.retryLane),S0(n,s)}function LR(n,a){var s=0;switch(n.tag){case 31:case 13:var c=n.stateNode,h=n.memoizedState;h!==null&&(s=h.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(a),S0(n,s)}function $R(n,a){return rr(n,a)}var Cc=null,ws=null,nh=!1,Ec=!1,rh=!1,Ra=0;function _r(n){n!==ws&&n.next===null&&(ws===null?Cc=ws=n:ws=ws.next=n),Ec=!0,nh||(nh=!0,PR())}function zo(n,a){if(!rh&&Ec){rh=!0;do for(var s=!1,c=Cc;c!==null;){if(n!==0){var h=c.pendingLanes;if(h===0)var g=0;else{var C=c.suspendedLanes,j=c.pingedLanes;g=(1<<31-ye(42|n)+1)-1,g&=h&~(C&~j),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(s=!0,R0(c,g))}else g=Ye,g=Ae(c,c===gt?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||ut(c,g)||(s=!0,R0(c,g));c=c.next}while(s);rh=!1}}function IR(){_0()}function _0(){Ec=nh=!1;var n=0;Ra!==0&&YR()&&(n=Ra);for(var a=zt(),s=null,c=Cc;c!==null;){var h=c.next,g=C0(c,a);g===0?(c.next=null,s===null?Cc=h:s.next=h,h===null&&(ws=s)):(s=c,(n!==0||(g&3)!==0)&&(Ec=!0)),c=h}Ht!==0&&Ht!==5||zo(n),Ra!==0&&(Ra=0)}function C0(n,a){for(var s=n.suspendedLanes,c=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0j)break;var ae=z.transferSize,ue=z.initiatorType;ae&&k0(ue)&&(z=z.responseEnd,C+=ae*(z"u"?null:document;function G0(n,a,s){var c=Ss;if(c&&typeof a=="string"&&a){var h=Hn(a);h='link[rel="'+n+'"][href="'+h+'"]',typeof s=="string"&&(h+='[crossorigin="'+s+'"]'),q0.has(h)||(q0.add(h),n={rel:n,crossOrigin:s,href:a},c.querySelector(h)===null&&(a=c.createElement("link"),rn(a,"link",n),Zt(a),c.head.appendChild(a)))}}function aj(n){Xr.D(n),G0("dns-prefetch",n,null)}function ij(n,a){Xr.C(n,a),G0("preconnect",n,a)}function sj(n,a,s){Xr.L(n,a,s);var c=Ss;if(c&&n&&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(n)+'"]';var g=h;switch(a){case"style":g=_s(n);break;case"script":g=Cs(n)}Xn.has(g)||(n=v({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:n,as:a},s),Xn.set(g,n),c.querySelector(h)!==null||a==="style"&&c.querySelector(Po(g))||a==="script"&&c.querySelector(Fo(g))||(a=c.createElement("link"),rn(a,"link",n),Zt(a),c.head.appendChild(a)))}}function oj(n,a){Xr.m(n,a);var s=Ss;if(s&&n){var c=a&&typeof a.as=="string"?a.as:"script",h='link[rel="modulepreload"][as="'+Hn(c)+'"][href="'+Hn(n)+'"]',g=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Cs(n)}if(!Xn.has(g)&&(n=v({rel:"modulepreload",href:n},a),Xn.set(g,n),s.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Fo(g)))return}c=s.createElement("link"),rn(c,"link",n),Zt(c),s.head.appendChild(c)}}}function lj(n,a,s){Xr.S(n,a,s);var c=Ss;if(c&&n){var h=qi(c).hoistableStyles,g=_s(n);a=a||"default";var C=h.get(g);if(!C){var j={loading:0,preload:null};if(C=c.querySelector(Po(g)))j.loading=5;else{n=v({rel:"stylesheet",href:n,"data-precedence":a},s),(s=Xn.get(g))&&bh(n,s);var z=C=c.createElement("link");Zt(z),rn(z,"link",n),z._p=new Promise(function(G,ae){z.onload=G,z.onerror=ae}),z.addEventListener("load",function(){j.loading|=1}),z.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Ac(C,a,c)}C={type:"stylesheet",instance:C,count:1,state:j},h.set(g,C)}}}function cj(n,a){Xr.X(n,a);var s=Ss;if(s&&n){var c=qi(s).hoistableScripts,h=Cs(n),g=c.get(h);g||(g=s.querySelector(Fo(h)),g||(n=v({src:n,async:!0},a),(a=Xn.get(h))&&xh(n,a),g=s.createElement("script"),Zt(g),rn(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function uj(n,a){Xr.M(n,a);var s=Ss;if(s&&n){var c=qi(s).hoistableScripts,h=Cs(n),g=c.get(h);g||(g=s.querySelector(Fo(h)),g||(n=v({src:n,async:!0,type:"module"},a),(a=Xn.get(h))&&xh(n,a),g=s.createElement("script"),Zt(g),rn(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function Z0(n,a,s,c){var h=(h=he.current)?Oc(h):null;if(!h)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=_s(s.href),s=qi(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"){n=_s(s.href);var g=qi(h).hoistableStyles,C=g.get(n);if(C||(h=h.ownerDocument||h,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,C),(g=h.querySelector(Po(n)))&&!g._p&&(C.instance=g,C.state.loading=5),Xn.has(n)||(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(n,s),g||dj(h,n,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=Cs(s),s=qi(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,n))}}function _s(n){return'href="'+Hn(n)+'"'}function Po(n){return'link[rel="stylesheet"]['+n+"]"}function K0(n){return v({},n,{"data-precedence":n.precedence,precedence:null})}function dj(n,a,s,c){n.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=n.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),rn(a,"link",s),Zt(a),n.head.appendChild(a))}function Cs(n){return'[src="'+Hn(n)+'"]'}function Fo(n){return"script[async]"+n}function Y0(n,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var c=n.querySelector('style[data-href~="'+Hn(s.href)+'"]');if(c)return a.instance=c,Zt(c),c;var h=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),Zt(c),rn(c,"style",h),Ac(c,s.precedence,n),a.instance=c;case"stylesheet":h=_s(s.href);var g=n.querySelector(Po(h));if(g)return a.state.loading|=4,a.instance=g,Zt(g),g;c=K0(s),(h=Xn.get(h))&&bh(c,h),g=(n.ownerDocument||n).createElement("link"),Zt(g);var C=g;return C._p=new Promise(function(j,z){C.onload=j,C.onerror=z}),rn(g,"link",c),a.state.loading|=4,Ac(g,s.precedence,n),a.instance=g;case"script":return g=Cs(s.src),(h=n.querySelector(Fo(g)))?(a.instance=h,Zt(h),h):(c=s,(h=Xn.get(g))&&(c=v({},s),xh(c,h)),n=n.ownerDocument||n,h=n.createElement("script"),Zt(h),rn(h,"link",c),n.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,Ac(c,s.precedence,n));return a.instance}function Ac(n,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 fj(n,a,s){if(s===1||a.itemProp!=null)return!1;switch(n){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"?(n=a.disabled,typeof a.precedence=="string"&&n==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 J0(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function hj(n,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=_s(c.href),g=a.querySelector(Po(h));if(g){a=g._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(n.count++,n=Nc.bind(n),a.then(n,n)),s.state.loading|=4,s.instance=g,Zt(g);return}g=a.ownerDocument||a,c=K0(c),(h=Xn.get(h))&&bh(c,h),g=g.createElement("link"),Zt(g);var C=g;C._p=new Promise(function(j,z){C.onload=j,C.onerror=z}),rn(g,"link",c),s.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(n.count++,s=Nc.bind(n),a.addEventListener("load",s),a.addEventListener("error",s))}}var wh=0;function mj(n,a){return n.stylesheets&&n.count===0&&kc(n,n.stylesheets),0wh?50:800)+a);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(h)}}:null}function Nc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)kc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Dc=null;function kc(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Dc=new Map,a.forEach(pj,n),Dc=null,Nc.call(n))}function pj(n,a){if(!(a.state.loading&4)){var s=Dc.get(n);if(s)var c=s.get(null);else{s=new Map,Dc.set(n,s);for(var h=n.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(t){console.error(t)}}return e(),Ah.exports=Dj(),Ah.exports}var zj=kj(),yl=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(){}},Lj=class extends yl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}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(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},op=new Lj,$j={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ij=class{#e=$j;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Si=new Ij;function Pj(e){setTimeout(e,0)}var Fj=typeof window>"u"||"Deno"in globalThis;function On(){}function Vj(e,t){return typeof e=="function"?e(t):e}function mm(e){return typeof e=="number"&&e>=0&&e!==1/0}function _w(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ia(e,t){return typeof e=="function"?e(t):e}function Pn(e,t){return typeof e=="function"?e(t):e}function Sb(e,t){const{type:r="all",exact:i,fetchStatus:o,predicate:l,queryKey:u,stale:d}=e;if(u){if(i){if(t.queryHash!==lp(u,t.options))return!1}else if(!ll(t.queryKey,u))return!1}if(r!=="all"){const m=t.isActive();if(r==="active"&&!m||r==="inactive"&&m)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||o&&o!==t.state.fetchStatus||l&&!l(t))}function _b(e,t){const{exact:r,status:i,predicate:o,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(r){if(ol(t.options.mutationKey)!==ol(l))return!1}else if(!ll(t.options.mutationKey,l))return!1}return!(i&&t.state.status!==i||o&&!o(t))}function lp(e,t){return(t?.queryKeyHashFn||ol)(e)}function ol(e){return JSON.stringify(e,(t,r)=>gm(r)?Object.keys(r).sort().reduce((i,o)=>(i[o]=r[o],i),{}):r)}function ll(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ll(e[r],t[r])):!1}var Uj=Object.prototype.hasOwnProperty;function Cw(e,t,r=0){if(e===t)return e;if(r>500)return t;const i=Cb(e)&&Cb(t);if(!i&&!(gm(e)&&gm(t)))return t;const l=(i?e:Object.keys(e)).length,u=i?t:Object.keys(t),d=u.length,m=i?new Array(d):{};let p=0;for(let y=0;y{Si.setTimeout(t,e)})}function vm(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Cw(e,t):t}function Bj(e,t,r=0){const i=[...e,t];return r&&i.length>r?i.slice(1):i}function qj(e,t,r=0){const i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var cp=Symbol();function Ew(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===cp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Rw(e,t){return typeof e=="function"?e(...t):!!e}function Gj(e,t,r){let i=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),i||(i=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var cl=(()=>{let e=()=>Fj;return{isServer(){return e()},setIsServer(t){e=t}}})();function ym(){let e,t;const r=new Promise((o,l)=>{e=o,t=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}),t(o)},r}var Zj=Pj;function Kj(){let e=[],t=0,r=d=>{d()},i=d=>{d()},o=Zj;const l=d=>{t?e.push(d):o(()=>{r(d)})},u=()=>{const d=e;e=[],d.length&&o(()=>{i(()=>{d.forEach(m=>{r(m)})})})};return{batch:d=>{let m;t++;try{m=d()}finally{t--,t||u()}return m},batchCalls:d=>(...m)=>{l(()=>{d(...m)})},schedule:l,setNotifyFunction:d=>{r=d},setBatchNotifyFunction:d=>{i=d},setScheduler:d=>{o=d}}}var on=Kj(),Yj=class extends yl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),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}},mu=new Yj;function Qj(e){return Math.min(1e3*2**e,3e4)}function jw(e){return(e??"online")==="online"?mu.isOnline():!0}var bm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Tw(e){let t=!1,r=0,i;const o=ym(),l=()=>o.status!=="pending",u=_=>{if(!l()){const E=new bm(_);b(E),e.onCancel?.(E)}},d=()=>{t=!0},m=()=>{t=!1},p=()=>op.isFocused()&&(e.networkMode==="always"||mu.isOnline())&&e.canRun(),y=()=>jw(e.networkMode)&&e.canRun(),v=_=>{l()||(i?.(),o.resolve(_))},b=_=>{l()||(i?.(),o.reject(_))},x=()=>new Promise(_=>{i=E=>{(l()||p())&&_(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??(cl.isServer()?0:3),O=e.retryDelay??Qj,M=typeof O=="function"?O(r,R):O,k=T===!0||typeof T=="number"&&rp()?void 0:x()).then(()=>{t?b(R):w()})})};return{promise:o,status:()=>o.status,cancel:u,continue:()=>(i?.(),o),cancelRetry:d,continueRetry:m,canStart:y,start:()=>(y()?w():x().then(w),o)}}var Ow=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mm(this.gcTime)&&(this.#e=Si.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(cl.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Si.clearTimeout(this.#e),this.#e=void 0)}};function Xj(e){return{onFetch:(t,r)=>{const i=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let d={pages:[],pageParams:[]},m=0;const p=async()=>{let y=!1;const v=w=>{Gj(w,()=>t.signal,()=>y=!0)},b=Ew(t.options,t.fetchOptions),x=async(w,_,E)=>{if(y)return Promise.reject(t.signal.reason);if(_==null&&w.pages.length)return Promise.resolve(w);const T=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:_,direction:E?"backward":"forward",meta:t.options.meta};return v(B),B})(),O=await b(T),{maxPages:M}=t.options,k=E?qj:Bj;return{pages:k(w.pages,O,M),pageParams:k(w.pageParams,_,M)}};if(o&&l.length){const w=o==="backward",_=w?Aw:xm,E={pages:l,pageParams:u},R=_(i,E);d=await x(E,R,w)}else{const w=e??l.length;do{const _=m===0?u[0]??i.initialPageParam:xm(i,d);if(m>0&&_==null)break;d=await x(d,_),m++}while(mt.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=p}}}function xm(e,{pages:t,pageParams:r}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,r[i],r):void 0}function Aw(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function Jj(e,t){return t?xm(e,t)!=null:!1}function Wj(e,t){return!t||!e.getPreviousPageParam?!1:Aw(e,t)!=null}var e2=class extends Ow{#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=jb(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 t=jb(this.options);t.data!==void 0&&(this.setState(Rb(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=vm(this.state.data,e,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#a?.promise;return this.#a?.cancel(e),t?t.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=>Pn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===cp||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ia(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:!_w(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(t=>t.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(t=>t!==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,t){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&t?.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 m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const r=new AbortController,i=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#s=!0,r.signal)})},o=()=>{const m=Ew(this.options,t),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(m,y,this):m(y)},u=(()=>{const m={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:o};return i(m),m})();(this.#e==="infinite"?Xj(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=Tw({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:m=>{m instanceof bm&&m.revert&&this.setState({...this.#n,fetchStatus:"idle"}),r.abort()},onFail:(m,p)=>{this.#l({type:"failed",failureCount:m,error:p})},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 m=await this.#a.start();if(m===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(m),this.#r.config.onSuccess?.(m,this),this.#r.config.onSettled?.(m,this.state.error,this),m}catch(m){if(m instanceof bm){if(m.silent)return this.#a.promise;if(m.revert){if(this.state.data===void 0)throw m;return this.state.data}}throw this.#l({type:"error",error:m}),this.#r.config.onError?.(m,this),this.#r.config.onSettled?.(this.state.data,m,this),m}finally{this.scheduleGc()}}#l(e){const t=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,...Mw(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...Rb(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=t(this.state),on.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Mw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Rb(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jb(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,i=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,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 Nw=class extends yl{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=ym(),this.bindMethods(),this.setOptions(t)}#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),Tb(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wm(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wm(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=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 Pn(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),t._defaulted&&!pm(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&Ob(this.#t,r,this.options,t)&&this.#h(),this.updateResult(),i&&(this.#t!==r||Pn(this.options.enabled,this.#t)!==Pn(t.enabled,this.#t)||Ia(this.options.staleTime,this.#t)!==Ia(t.staleTime,this.#t))&&this.#g();const o=this.#v();i&&(this.#t!==r||Pn(this.options.enabled,this.#t)!==Pn(t.enabled,this.#t)||o!==this.#c)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return n2(this,r)&&(this.#r=r,this.#a=this.options,this.#i=this.#t.state),r}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),t?.(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 t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(On)),t}#g(){this.#x();const e=Ia(this.options.staleTime,this.#t);if(cl.isServer()||this.#r.isStale||!mm(e))return;const r=_w(this.#r.dataUpdatedAt,e)+1;this.#d=Si.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,!(cl.isServer()||Pn(this.options.enabled,this.#t)===!1||!mm(this.#c)||this.#c===0)&&(this.#f=Si.setInterval(()=>{(this.options.refetchIntervalInBackground||op.isFocused())&&this.#h()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#d!==void 0&&(Si.clearTimeout(this.#d),this.#d=void 0)}#w(){this.#f!==void 0&&(Si.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const r=this.#t,i=this.options,o=this.#r,l=this.#i,u=this.#a,m=e!==r?e.state:this.#n,{state:p}=e;let y={...p},v=!1,b;if(t._optimisticResults){const P=this.hasListeners(),pe=!P&&Tb(e,t),ne=P&&Ob(e,r,t,i);(pe||ne)&&(y={...y,...Mw(p.data,e.options)}),t._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:x,errorUpdatedAt:w,status:_}=y;b=y.data;let E=!1;if(t.placeholderData!==void 0&&b===void 0&&_==="pending"){let P;o?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(P=o.data,E=!0):P=typeof t.placeholderData=="function"?t.placeholderData(this.#m?.state.data,this.#m):t.placeholderData,P!==void 0&&(_="success",b=vm(o?.data,P,t),v=!0)}if(t.select&&b!==void 0&&!E)if(o&&b===l?.data&&t.select===this.#u)b=this.#l;else try{this.#u=t.select,b=t.select(b),b=vm(o?.data,b,t),this.#l=b,this.#s=null}catch(P){this.#s=P}this.#s&&(x=this.#s,b=this.#l,w=Date.now(),_="error");const R=y.fetchStatus==="fetching",T=_==="pending",O=_==="error",M=T&&R,k=b!==void 0,V={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>m.dataUpdateCount||y.errorUpdateCount>m.errorUpdateCount,isFetching:R,isRefetching:R&&!T,isLoadingError:O&&!k,isPaused:y.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:O&&k,isStale:up(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Pn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const P=V.data!==void 0,pe=V.status==="error"&&!P,ne=fe=>{pe?fe.reject(V.error):P&&fe.resolve(V.data)},ce=()=>{const fe=this.#o=V.promise=ym();ne(fe)},me=this.#o;switch(me.status){case"pending":e.queryHash===r.queryHash&&ne(me);break;case"fulfilled":(pe||V.data!==me.value)&&ce();break;case"rejected":(!pe||V.error!==me.reason)&&ce();break}}return V}updateResult(){const e=this.#r,t=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),pm(t,e))return;this.#r=t;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 t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){on.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function t2(e,t){return Pn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Pn(t.retryOnMount,e)===!1)}function Tb(e,t){return t2(e,t)||e.state.data!==void 0&&wm(e,t,t.refetchOnMount)}function wm(e,t,r){if(Pn(t.enabled,e)!==!1&&Ia(t.staleTime,e)!=="static"){const i=typeof r=="function"?r(e):r;return i==="always"||i!==!1&&up(e,t)}return!1}function Ob(e,t,r,i){return(e!==t||Pn(i.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&up(e,r)}function up(e,t){return Pn(t.enabled,e)!==!1&&e.isStaleByTime(Ia(t.staleTime,e))}function n2(e,t){return!pm(e.getCurrentResult(),t)}var r2=class extends Nw{constructor(e,t){super(e,t)}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,t){const{state:r}=e,i=super.createResult(e,t),{isFetching:o,isRefetching:l,isError:u,isRefetchError:d}=i,m=r.fetchMeta?.fetchMore?.direction,p=u&&m==="forward",y=o&&m==="forward",v=u&&m==="backward",b=o&&m==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Jj(t,r.data),hasPreviousPage:Wj(t,r.data),isFetchNextPageError:p,isFetchingNextPage:y,isFetchPreviousPageError:v,isFetchingPreviousPage:b,isRefetchError:d&&!p&&!v,isRefetching:l&&!y&&!b}}},a2=class extends Ow{#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||i2(),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(t=>t!==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 t=()=>{this.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Tw({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:t,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)t();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 t=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=t(this.state),on.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function i2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var s2=class extends yl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,r){const i=new a2({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:r});return this.add(i),i}add(e){this.#e.add(e);const t=Uc(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Uc(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Uc(e);if(typeof t=="string"){const i=this.#t.get(t)?.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){const t=Uc(e);return typeof t=="string"?this.#t.get(t)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){on.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 t={exact:!0,...e};return this.getAll().find(r=>_b(t,r))}findAll(e={}){return this.getAll().filter(t=>_b(e,t))}notify(e){on.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return on.batch(()=>Promise.all(e.map(t=>t.continue().catch(On))))}};function Uc(e){return e.options.scope?.id}var o2=class extends yl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const i=t.queryKey,o=t.queryHash??lp(i,t);let l=this.get(o);return l||(l=new e2({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),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 t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){on.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>Sb(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>Sb(e,r)):t}notify(e){on.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){on.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){on.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},l2=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new o2,this.#t=e.mutationCache||new s2,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=op.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=mu.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 t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ia(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const i=r.data;return[t,i]})}setQueryData(e,t,r){const i=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(i.queryHash)?.state.data,u=Vj(t,l);if(u!==void 0)return this.#e.build(this,i).setData(u,{...r,manual:!0})}setQueriesData(e,t,r){return on.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;on.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return on.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},i=on.batch(()=>this.#e.findAll(e).map(o=>o.cancel(r)));return Promise.all(i).then(On).catch(On)}invalidateQueries(e,t={}){return on.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},i=on.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 t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(Ia(t.staleTime,r))?r.fetch(t):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 mu.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,t){this.#r.set(ol(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],r={};return t.forEach(i=>{ll(e,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(e,t){this.#i.set(ol(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#i.values()],r={};return t.forEach(i=>{ll(e,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=lp(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===cp&&(t.enabled=!1),t}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()}},Dw=S.createContext(void 0),ki=e=>{const t=S.useContext(Dw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},c2=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(Dw.Provider,{value:e,children:t})),kw=S.createContext(!1),u2=()=>S.useContext(kw);kw.Provider;function d2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var f2=S.createContext(d2()),h2=()=>S.useContext(f2),m2=(e,t,r)=>{const i=r?.state.error&&typeof e.throwOnError=="function"?Rw(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},p2=e=>{S.useEffect(()=>{e.clearReset()},[e])},g2=({result:e,errorResetBoundary:t,throwOnError:r,query:i,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(o&&e.data===void 0||Rw(r,[e.error,i])),v2=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))}},y2=(e,t)=>e.isLoading&&e.isFetching&&!t,b2=(e,t)=>e?.suspense&&t.isPending,Ab=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function zw(e,t,r){const i=u2(),o=h2(),l=ki(),u=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const d=l.getQueryCache().get(u.queryHash),m=e.subscribed!==!1;u._optimisticResults=i?"isRestoring":m?"optimistic":void 0,v2(u),m2(u,o,d),p2(o);const p=!l.getQueryCache().get(u.queryHash),[y]=S.useState(()=>new t(l,u)),v=y.getOptimisticResult(u),b=!i&&m;if(S.useSyncExternalStore(S.useCallback(x=>{const w=b?y.subscribe(on.batchCalls(x)):On;return y.updateResult(),w},[y,b]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),S.useEffect(()=>{y.setOptions(u)},[u,y]),b2(u,v))throw Ab(u,y,o);if(g2({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&&!cl.isServer()&&y2(v,i)&&(p?Ab(u,y,o):d?.promise)?.catch(On).finally(()=>{y.updateResult()}),u.notifyOnChangeProps?v:y.trackResult(v)}function Ft(e,t){return zw(e,Nw)}function x2(e,t){return zw(e,r2)}let Mb=!1;function w2(e){const t=e.analytics;if(!t?.key||Mb)return;Mb=!0;const r=document.createElement("script");r.src=t.host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",r.async=!0,r.onload=()=>{const i=window.posthog;i&&(i.init(t.key,{api_host:t.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 Lw(e,t){window.posthog?.capture(e,t)}const S2=[[/^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 $w(e,t){const r=e+" "+t.split("?")[0],i=S2.find(([o])=>o.test(r));i&&Lw(i[1])}function dp(){throw location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),new Error("signing in…")}function _2(e,t){const r=t.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 Nu(e){throw new Error(_2(e.status,await e.text()))}async function qt(e){const t=await fetch(e,{headers:{Accept:"application/json"}});return t.status===401&&dp(),t.ok||await Nu(t),t.json()}async function C2(e){const t=await fetch(e);return t.status===401&&dp(),t.ok||await Nu(t),t}async function Wn(e,t,r){const i={method:e};r!==void 0&&(i.headers={"Content-Type":"application/json"},i.body=JSON.stringify(r));const o=await fetch(t,i);return o.ok||await Nu(o),$w(e,t),o.status===204?{}:o.json()}async function ea(e,t){const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return r.status===401&&dp(),r.ok||await Nu(r),$w("POST",e),r.json()}function E2(){return Ft({queryKey:["config"],queryFn:async()=>{const e=await qt("/api/config");return e.auth.enabled&&!e.me&&(location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),await new Promise(()=>{})),w2(e),e},staleTime:1/0})}var zi=Sw();const R2=ww(zi);function Nb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Gs(...e){return t=>{let r=!1;const i=e.map(o=>{const l=Nb(o,t);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 m=[];Db(o)&&typeof Hc=="function"&&(o=Hc(o._payload)),S.Children.forEach(o,b=>{if(N2(b)){d=!0;const x=b;let w="child"in x.props?x.props.child:x.props.children;Db(w)&&typeof Hc=="function"&&(w=Hc(w._payload)),u=O2(x,w),m.push(u?.props?.children)}else m.push(b)}),u?u=S.cloneElement(u,void 0,m):!d&&S.Children.count(o)===1&&S.isValidElement(o)&&(u=o);const p=u?M2(u):void 0,y=at(i,p);if(!u){if(o||o===0)throw new Error(d?L2(e):z2(e));return o}const v=A2(l,u.props??{});return u.type!==S.Fragment&&(v.ref=i?y:p),S.cloneElement(u,v)});return t.displayName=`${e}.Slot`,t}var j2=Ei("Slot"),Iw=Symbol.for("radix.slottable");function T2(e){const t=r=>"child"in r?r.children(r.child):r.children;return t.displayName=`${e}.Slottable`,t.__radixId=Iw,t}var O2=(e,t)=>{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(t)?t:null};function A2(e,t){const r={...t};for(const i in t){const o=e[i],l=t[i];/^on[A-Z]/.test(i)?o&&l?r[i]=(...d)=>{const m=l(...d);return o(...d),m}:o&&(r[i]=o):i==="style"?r[i]={...o,...l}:i==="className"&&(r[i]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}function M2(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function N2(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Iw}var D2=Symbol.for("react.lazy");function Db(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===D2&&"_payload"in e&&k2(e._payload)}function k2(e){return typeof e=="object"&&e!==null&&"then"in e}var z2=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,L2=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Hc=Mu[" use ".trim().toString()],$2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=$2.reduce((e,t)=>{const r=Ei(`Primitive.${t}`),i=S.forwardRef((o,l)=>{const{asChild:u,...d}=o,m=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(m,{...d,ref:l})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function Pw(e,t){e&&zi.flushSync(()=>e.dispatchEvent(t))}var Fw=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"}),I2="VisuallyHidden",Vw=S.forwardRef((e,t)=>f.jsx(Pe.span,{...e,ref:t,style:{...Fw,...e.style}}));Vw.displayName=I2;var P2=Vw;function Ka(e,t=[]){let r=[];function i(l,u){const d=S.createContext(u);d.displayName=l+"Context";const m=r.length;r=[...r,u];const p=v=>{const{scope:b,children:x,...w}=v,_=b?.[e]?.[m]||d,E=S.useMemo(()=>w,Object.values(w));return f.jsx(_.Provider,{value:E,children:x})};p.displayName=l+"Provider";function y(v,b,x={}){const{optional:w=!1}=x,_=b?.[e]?.[m]||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[p,y]}const o=()=>{const l=r.map(u=>S.createContext(u));return function(d){const m=d?.[e]||l;return S.useMemo(()=>({[`__scope${e}`]:{...d,[e]:m}}),[d,m])}};return o.scopeName=e,[i,F2(o,...t)]}function F2(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const i=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const u=i.reduce((d,{useScope:m,scopeName:p})=>{const v=m(l)[`__scope${p}`];return{...d,...v}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}function fp(e){const t=e+"CollectionProvider",[r,i]=Ka(t),[o,l]=r(t,{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=t;const d=e+"CollectionSlot",m=Ei(d),p=S.forwardRef((_,E)=>{const{scope:R,children:T}=_,O=l(d,R),M=at(E,O.collectionRef);return f.jsx(m,{ref:M,children:T})});p.displayName=d;const y=e+"CollectionItemSlot",v="data-radix-collection-item",b=Ei(y),x=S.forwardRef((_,E)=>{const{scope:R,children:T,...O}=_,M=S.useRef(null),k=at(E,M),B=l(y,R);return S.useEffect(()=>(B.itemMap.set(M,{ref:M,...O}),()=>{B.itemMap.delete(M)})),f.jsx(b,{[v]:"",ref:k,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((B,V)=>O.indexOf(B.ref.current)-O.indexOf(V.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:u,Slot:p,ItemSlot:x},w,i]}function Te(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o||!o.defaultPrevented)return t?.(o)}}var Qt=globalThis?.document?S.useLayoutEffect:()=>{},V2=Mu[" useInsertionEffect ".trim().toString()]||Qt;function Zs({prop:e,defaultProp:t,onChange:r=()=>{},caller:i}){const[o,l,u]=U2({defaultProp:t,onChange:r}),d=e!==void 0,m=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 p=S.useCallback(y=>{if(d){const v=H2(y)?y(e):y;v!==e&&u.current?.(v)}else l(y)},[d,e,l,u]);return[m,p]}function U2({defaultProp:e,onChange:t}){const[r,i]=S.useState(e),o=S.useRef(r),l=S.useRef(t);return V2(()=>{l.current=t},[t]),S.useEffect(()=>{o.current!==r&&(l.current?.(r),o.current=r)},[r,o]),[r,i,l]}function H2(e){return typeof e=="function"}function B2(e,t){return S.useReducer((r,i)=>t[r][i]??r,e)}var gr=e=>{const{present:t,children:r}=e,i=q2(t),o=typeof r=="function"?r({present:i.isPresent}):S.Children.only(r),l=G2(i.ref,Z2(o));return typeof r=="function"||i.isPresent?S.cloneElement(o,{ref:l}):null};gr.displayName="Presence";function q2(e){const[t,r]=S.useState(),i=S.useRef(null),o=S.useRef(e),l=S.useRef("none"),u=S.useRef(void 0),d=e?"mounted":"unmounted",[m,p]=B2(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{m==="mounted"?(l.current=u.current??Zo(i.current),u.current=void 0):l.current="none"},[m]),Qt(()=>{const y=i.current,v=o.current;if(v!==e){const x=l.current,w=Zo(y);e?(u.current=w,p("MOUNT")):w==="none"||y?.display==="none"?p("UNMOUNT"):p(v&&x!==w?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,p]),Qt(()=>{if(t){let y;const v=t.ownerDocument.defaultView??window,b=w=>{const E=Zo(i.current).includes(CSS.escape(w.animationName));if(w.target===t&&E&&(p("ANIMATION_END"),!o.current)){const R=t.style.animationFillMode;t.style.animationFillMode="forwards",y=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=R)})}},x=w=>{w.target===t&&(l.current=Zo(i.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",b),t.addEventListener("animationend",b),()=>{v.clearTimeout(y),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",b),t.removeEventListener("animationend",b)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:S.useCallback(y=>{if(y){const v=getComputedStyle(y);i.current=v,u.current=Zo(v)}else i.current=null;r(y)},[])}}function kb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function G2(...e){const t=S.useRef(e);return t.current=e,S.useCallback(r=>{const i=t.current;let o=!1;const l=i.map(u=>{const d=kb(u,r);return!o&&typeof d=="function"&&(o=!0),d});if(o)return()=>{for(let u=0;u{}),Y2=0;function fn(e){const[t,r]=S.useState(K2());return Qt(()=>{r(i=>i??String(Y2++))},[e]),t?`radix-${t}`:""}var Q2=S.createContext(void 0);function hp(e){const t=S.useContext(Q2);return e||t||"ltr"}function tr(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>((...r)=>t.current?.(...r)),[])}var X2="DismissableLayer",Sm="dismissableLayer.update",J2="dismissableLayer.pointerDownOutside",W2="dismissableLayer.focusOutside",zb,mp=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),bl=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,onDismiss:m,...p}=e,y=S.useContext(mp),[v,b]=S.useState(null),x=v?.ownerDocument??globalThis?.document,[,w]=S.useState({}),_=at(t,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,k=O>=T,B=S.useRef(!1),V=aT(ce=>{l?.(ce),d?.(ce),ce.defaultPrevented||m?.()},{ownerDocument:x,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:B,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:S.useCallback(ce=>{if(!(ce instanceof Node))return!1;const me=[...y.branches].some(fe=>fe.contains(ce));return k&&!me},[y.branches,k])}),P=iT(ce=>{if(i&&B.current)return;const me=ce.target;[...y.branches].some(Z=>Z.contains(me))||(u?.(ce),d?.(ce),ce.defaultPrevented||m?.())},x),pe=v?O===E.length-1:!1,ne=tr(ce=>{ce.key==="Escape"&&(o?.(ce),!ce.defaultPrevented&&m&&(ce.preventDefault(),m()))});return S.useEffect(()=>{if(pe)return x.addEventListener("keydown",ne,{capture:!0}),()=>x.removeEventListener("keydown",ne,{capture:!0})},[x,pe,ne]),S.useEffect(()=>{if(v)return r&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(zb=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(v)),y.layers.add(v),Lb(),()=>{r&&(y.layersWithOutsidePointerEventsDisabled.delete(v),y.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=zb))}},[v,x,r,y]),S.useEffect(()=>()=>{v&&(y.layers.delete(v),y.layersWithOutsidePointerEventsDisabled.delete(v),Lb())},[v,y]),S.useEffect(()=>{const ce=()=>w({});return document.addEventListener(Sm,ce),()=>document.removeEventListener(Sm,ce)},[]),f.jsx(Pe.div,{...p,ref:_,style:{pointerEvents:M?k?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,V.onPointerDownCapture)})});bl.displayName=X2;var eT="DismissableLayerBranch",tT=S.forwardRef((e,t)=>{const r=S.useContext(mp),i=S.useRef(null),o=at(t,i);return S.useEffect(()=>{const l=i.current;if(l)return r.branches.add(l),()=>{r.branches.delete(l)}},[r.branches]),f.jsx(Pe.div,{...e,ref:o})});tT.displayName=eT;function nT(){const e=S.useContext(mp),[t,r]=S.useState(null);return S.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}var rT=()=>!0;function aT(e,t){const{ownerDocument:r=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:l,shouldHandlePointerDownOutside:u=rT}=t,d=tr(e),m=S.useRef(!1),p=S.useRef(!1),y=S.useRef(new Map),v=S.useRef(()=>{});return S.useEffect(()=>{function b(){p.current=!1,o.current=!1,y.current.clear()}function x(){return Array.from(y.current.values()).some(Boolean)}function w(O){if(!p.current)return;const M=O.target;M instanceof Node&&[...l].some(B=>B.contains(M))||y.current.set(O.type,!0),O.type==="click"&&window.setTimeout(()=>{p.current&&v.current()},0)}function _(O){p.current&&y.current.set(O.type,!1)}const E=O=>{if(O.target&&!m.current){let M=function(){r.removeEventListener("click",v.current);const B=x();b(),B||Uw(J2,d,k,{discrete:!0})};if(!u(O.target)){r.removeEventListener("click",v.current),b(),m.current=!1;return}const k={originalEvent:O};p.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();m.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:()=>m.current=!0}}function iT(e,t=globalThis?.document){const r=tr(e),i=S.useRef(!1);return S.useEffect(()=>{const o=l=>{l.target&&!i.current&&Uw(W2,r,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Lb(){const e=new CustomEvent(Sm);document.dispatchEvent(e)}function Uw(e,t,r,{discrete:i}){const o=r.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),i?Pw(o,l):o.dispatchEvent(l)}var kh="focusScope.autoFocusOnMount",zh="focusScope.autoFocusOnUnmount",$b={bubbles:!1,cancelable:!0},sT="FocusScope",Du=S.forwardRef((e,t)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=e,[d,m]=S.useState(null),p=tr(o),y=tr(l),v=S.useRef(null),b=at(t,m),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:ka(v.current,{select:!0})},E=function(O){if(x.paused||!d)return;const M=O.relatedTarget;M!==null&&(d.contains(M)||ka(v.current,{select:!0}))},R=function(O){if(document.activeElement===document.body)for(const k of O)k.removedNodes.length>0&&ka(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){Pb.add(x);const _=document.activeElement;if(!d.contains(_)){const R=new CustomEvent(kh,$b);d.addEventListener(kh,p),d.dispatchEvent(R),R.defaultPrevented||(oT(fT(Hw(d)),{select:!0}),document.activeElement===_&&ka(d))}return()=>{d.removeEventListener(kh,p),setTimeout(()=>{const R=new CustomEvent(zh,$b);d.addEventListener(zh,y),d.dispatchEvent(R),R.defaultPrevented||ka(_??document.body,{select:!0}),d.removeEventListener(zh,y),Pb.remove(x)},0)}}},[d,p,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]=lT(T);O&&M?!_.shiftKey&&R===M?(_.preventDefault(),r&&ka(O,{select:!0})):_.shiftKey&&R===O&&(_.preventDefault(),r&&ka(M,{select:!0})):R===T&&_.preventDefault()}},[r,i,x.paused]);return f.jsx(Pe.div,{tabIndex:-1,...u,ref:b,onKeyDown:w})});Du.displayName=sT;function oT(e,{select:t=!1}={}){const r=document.activeElement;for(const i of e)if(ka(i,{select:t}),document.activeElement!==r)return}function lT(e){const t=Hw(e),r=Ib(t,e),i=Ib(t.reverse(),e);return[r,i]}function Hw(e){const t=[],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();)t.push(r.currentNode);return t}function Ib(e,t){const r=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(r?!i.checkVisibility({checkVisibilityCSS:!0}):cT(i,{upTo:t})))return i}function cT(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function uT(e){return e instanceof HTMLInputElement&&"select"in e}function ka(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&uT(e)&&t&&e.select()}}var Pb=dT();function dT(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Fb(e,t),e.unshift(t)},remove(t){e=Fb(e,t),e[0]?.resume()}}}function Fb(e,t){const r=[...e],i=r.indexOf(t);return i!==-1&&r.splice(i,1),r}function fT(e){return e.filter(t=>t.tagName!=="A")}var hT="Portal",xl=S.forwardRef((e,t)=>{const{container:r,...i}=e,[o,l]=S.useState(!1);Qt(()=>l(!0),[]);const u=r||o&&globalThis?.document?.body;return u?zi.createPortal(f.jsx(Pe.div,{...i,ref:t}),u):null});xl.displayName=hT;var Bc=0,Rs=null;function pp(){S.useEffect(()=>{Rs||(Rs={start:Vb(),end:Vb()});const{start:e,end:t}=Rs;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Bc++,()=>{Bc===1&&(Rs?.start.remove(),Rs?.end.remove(),Rs=null),Bc=Math.max(0,Bc-1)}},[])}function Vb(){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 Tr=function(){return Tr=Object.assign||function(t){for(var r,i=1,o=arguments.length;i"u")return AT;var t=MT(e),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-r+t[2]-t[0])}},DT=Zw(),Ps="data-scroll-locked",kT=function(e,t,r,i){var o=e.left,l=e.top,u=e.right,d=e.gap;return r===void 0&&(r="margin"),` + .`.concat(pT,` { overflow: hidden `).concat(i,`; padding-right: `).concat(d,"px ").concat(i,`; } @@ -41,17 +41,17 @@ Error generating stack: `+c.message+` } body[`).concat(Ps,`] { - `).concat(pT,": ").concat(d,`px; + `).concat(gT,": ").concat(d,`px; } -`)},Hb=function(){var e=parseInt(document.body.getAttribute(Ps)||"0",10);return isFinite(e)?e:0},kT=function(){S.useEffect(function(){return document.body.setAttribute(Ps,(Hb()+1).toString()),function(){var e=Hb()-1;e<=0?document.body.removeAttribute(Ps):document.body.setAttribute(Ps,e.toString())}},[])},zT=function(e){var t=e.noRelative,r=e.noImportant,i=e.gapMode,o=i===void 0?"margin":i;kT();var l=S.useMemo(function(){return MT(o)},[o]);return S.createElement(NT,{styles:DT(l,!t,o,r?"":"!important")})},_m=!1;if(typeof window<"u")try{var qc=Object.defineProperty({},"passive",{get:function(){return _m=!0,!0}});window.addEventListener("test",qc,qc),window.removeEventListener("test",qc,qc)}catch{_m=!1}var js=_m?{passive:!1}:!1,LT=function(e){return e.tagName==="TEXTAREA"},Kw=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!LT(e)&&r[t]==="visible")},$T=function(e){return Kw(e,"overflowY")},IT=function(e){return Kw(e,"overflowX")},Bb=function(e,t){var r=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var o=Yw(e,i);if(o){var l=Qw(e,i),u=l[1],d=l[2];if(u>d)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},PT=function(e){var t=e.scrollTop,r=e.scrollHeight,i=e.clientHeight;return[t,r,i]},FT=function(e){var t=e.scrollLeft,r=e.scrollWidth,i=e.clientWidth;return[t,r,i]},Yw=function(e,t){return e==="v"?$T(t):IT(t)},Qw=function(e,t){return e==="v"?PT(t):FT(t)},VT=function(e,t){return e==="h"&&t==="rtl"?-1:1},UT=function(e,t,r,i,o){var l=VT(e,window.getComputedStyle(t).direction),u=l*i,d=r.target,m=t.contains(d),p=!1,y=u>0,v=0,b=0;do{if(!d)break;var x=Qw(e,d),w=x[0],_=x[1],E=x[2],R=_-E-l*w;(w||R)&&Yw(e,d)&&(v+=R,b+=w);var T=d.parentNode;d=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!m&&d!==document.body||m&&(t.contains(d)||t===d));return(y&&Math.abs(v)<1||!y&&Math.abs(b)<1)&&(p=!0),p},Gc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qb=function(e){return[e.deltaX,e.deltaY]},Gb=function(e){return e&&"current"in e?e.current:e},HT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},BT=function(e){return` +`)},Hb=function(){var e=parseInt(document.body.getAttribute(Ps)||"0",10);return isFinite(e)?e:0},zT=function(){S.useEffect(function(){return document.body.setAttribute(Ps,(Hb()+1).toString()),function(){var e=Hb()-1;e<=0?document.body.removeAttribute(Ps):document.body.setAttribute(Ps,e.toString())}},[])},LT=function(e){var t=e.noRelative,r=e.noImportant,i=e.gapMode,o=i===void 0?"margin":i;zT();var l=S.useMemo(function(){return NT(o)},[o]);return S.createElement(DT,{styles:kT(l,!t,o,r?"":"!important")})},_m=!1;if(typeof window<"u")try{var qc=Object.defineProperty({},"passive",{get:function(){return _m=!0,!0}});window.addEventListener("test",qc,qc),window.removeEventListener("test",qc,qc)}catch{_m=!1}var js=_m?{passive:!1}:!1,$T=function(e){return e.tagName==="TEXTAREA"},Kw=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!$T(e)&&r[t]==="visible")},IT=function(e){return Kw(e,"overflowY")},PT=function(e){return Kw(e,"overflowX")},Bb=function(e,t){var r=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var o=Yw(e,i);if(o){var l=Qw(e,i),u=l[1],d=l[2];if(u>d)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},FT=function(e){var t=e.scrollTop,r=e.scrollHeight,i=e.clientHeight;return[t,r,i]},VT=function(e){var t=e.scrollLeft,r=e.scrollWidth,i=e.clientWidth;return[t,r,i]},Yw=function(e,t){return e==="v"?IT(t):PT(t)},Qw=function(e,t){return e==="v"?FT(t):VT(t)},UT=function(e,t){return e==="h"&&t==="rtl"?-1:1},HT=function(e,t,r,i,o){var l=UT(e,window.getComputedStyle(t).direction),u=l*i,d=r.target,m=t.contains(d),p=!1,y=u>0,v=0,b=0;do{if(!d)break;var x=Qw(e,d),w=x[0],_=x[1],E=x[2],R=_-E-l*w;(w||R)&&Yw(e,d)&&(v+=R,b+=w);var T=d.parentNode;d=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!m&&d!==document.body||m&&(t.contains(d)||t===d));return(y&&Math.abs(v)<1||!y&&Math.abs(b)<1)&&(p=!0),p},Gc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qb=function(e){return[e.deltaX,e.deltaY]},Gb=function(e){return e&&"current"in e?e.current:e},BT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qT=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},qT=0,Ts=[];function GT(e){var t=S.useRef([]),r=S.useRef([0,0]),i=S.useRef(),o=S.useState(qT++)[0],l=S.useState(Zw)[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 _=hT([e.lockRef.current],(e.shards||[]).map(Gb),!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=Gc(_),T=r.current,O="deltaX"in _?_.deltaX:T[0]-R[0],M="deltaY"in _?_.deltaY:T[1]-R[1],k,B=_.target,V=Math.abs(O)>Math.abs(M)?"h":"v";if("touches"in _&&V==="h"&&B.type==="range")return!1;var P=window.getSelection(),pe=P&&P.anchorNode,ne=pe?pe===B||pe.contains(B):!1;if(ne)return!1;var ce=Bb(V,B);if(!ce)return!0;if(ce?k=V:(k=V==="v"?"h":"v",ce=Bb(V,B)),!ce)return!1;if(!i.current&&"changedTouches"in _&&(O||M)&&(i.current=k),!k)return!0;var me=i.current||k;return UT(me,E,_,me==="h"?O:M)},[]),m=S.useCallback(function(_){var E=_;if(!(!Ts.length||Ts[Ts.length-1]!==l)){var R="deltaY"in E?qb(E):Gc(E),T=t.current.filter(function(k){return k.name===E.type&&(k.target===E.target||E.target===k.shadowParent)&&HT(k.delta,R)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var O=(u.current.shards||[]).map(Gb).filter(Boolean).filter(function(k){return k.contains(E.target)}),M=O.length>0?d(E,O[0]):!u.current.noIsolation;M&&E.cancelable&&E.preventDefault()}}},[]),p=S.useCallback(function(_,E,R,T){var O={name:_,delta:E,target:R,should:T,shadowParent:ZT(R)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(M){return M!==O})},1)},[]),y=S.useCallback(function(_){r.current=Gc(_),i.current=void 0},[]),v=S.useCallback(function(_){p(_.type,qb(_),_.target,d(_,e.lockRef.current))},[]),b=S.useCallback(function(_){p(_.type,Gc(_),_.target,d(_,e.lockRef.current))},[]);S.useEffect(function(){return Ts.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:b}),document.addEventListener("wheel",m,js),document.addEventListener("touchmove",m,js),document.addEventListener("touchstart",y,js),function(){Ts=Ts.filter(function(_){return _!==l}),document.removeEventListener("wheel",m,js),document.removeEventListener("touchmove",m,js),document.removeEventListener("touchstart",y,js)}},[]);var x=e.removeScrollBar,w=e.inert;return S.createElement(S.Fragment,null,w?S.createElement(l,{styles:BT(o)}):null,x?S.createElement(zT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ZT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const KT=ST(Gw,GT);var zu=S.forwardRef(function(e,t){return S.createElement(ku,Tr({},e,{ref:t,sideCar:KT}))});zu.classNames=ku.classNames;var YT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Os=new WeakMap,Zc=new WeakMap,Kc={},Ph=0,Xw=function(e){return e&&(e.host||Xw(e.parentNode))},QT=function(e,t){return t.map(function(r){if(e.contains(r))return r;var i=Xw(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})},XT=function(e,t,r,i){var o=QT(t,Array.isArray(e)?e:[e]);Kc[r]||(Kc[r]=new WeakMap);var l=Kc[r],u=[],d=new Set,m=new Set(o),p=function(v){!v||d.has(v)||(d.add(v),p(v.parentNode))};o.forEach(p);var y=function(v){!v||m.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",_=(Os.get(b)||0)+1,E=(l.get(b)||0)+1;Os.set(b,_),l.set(b,E),u.push(b),_===1&&w&&Zc.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(t),d.clear(),Ph++,function(){u.forEach(function(v){var b=Os.get(v)-1,x=l.get(v)-1;Os.set(v,b),l.set(v,x),b||(Zc.has(v)||v.removeAttribute(i),Zc.delete(v)),x||v.removeAttribute(r)}),Ph--,Ph||(Os=new WeakMap,Os=new WeakMap,Zc=new WeakMap,Kc={})}},gp=function(e,t,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),o=YT(e);return o?(i.push.apply(i,Array.from(o.querySelectorAll("[aria-live], script"))),XT(i,o,r,"aria-hidden")):function(){return null}},Lu="Dialog",[Jw]=Ka(Lu),[JT,vr]=Jw(Lu),vp=e=>{const{__scopeDialog:t,children:r,open:i,defaultOpen:o,onOpenChange:l,modal:u=!0}=e,d=S.useRef(null),m=S.useRef(null),[p,y]=Zs({prop:i,defaultProp:o??!1,onChange:l,caller:Lu});return f.jsx(JT,{scope:t,triggerRef:d,contentRef:m,contentId:fn(),titleId:fn(),descriptionId:fn(),open:p,onOpenChange:y,onOpenToggle:S.useCallback(()=>y(v=>!v),[y]),modal:u,children:r})};vp.displayName=Lu;var Ww="DialogTrigger",WT=S.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,o=vr(Ww,r),l=at(t,o.triggerRef);return f.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":Sp(o.open),...i,ref:l,onClick:Te(e.onClick,o.onOpenToggle)})});WT.displayName=Ww;var yp="DialogPortal",[eO,eS]=Jw(yp,{forceMount:void 0}),bp=e=>{const{__scopeDialog:t,forceMount:r,children:i,container:o}=e,l=vr(yp,t);return f.jsx(eO,{scope:t,forceMount:r,children:S.Children.map(i,u=>f.jsx(gr,{present:r||l.open,children:f.jsx(xl,{asChild:!0,container:o,children:u})}))})};bp.displayName=yp;var pu="DialogOverlay",xp=S.forwardRef((e,t)=>{const r=eS(pu,e.__scopeDialog),{forceMount:i=r.forceMount,...o}=e,l=vr(pu,e.__scopeDialog);return l.modal?f.jsx(gr,{present:i||l.open,children:f.jsx(nO,{...o,ref:t})}):null});xp.displayName=pu;var tO=Ei("DialogOverlay.RemoveScroll"),nO=S.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,o=vr(pu,r),l=tT(),u=at(t,l);return f.jsx(zu,{as:tO,allowPinchZoom:!0,shards:[o.contentRef],children:f.jsx(Pe.div,{"data-state":Sp(o.open),...i,ref:u,style:{pointerEvents:"auto",...i.style}})})}),Ks="DialogContent",wp=S.forwardRef((e,t)=>{const r=eS(Ks,e.__scopeDialog),{forceMount:i=r.forceMount,...o}=e,l=vr(Ks,e.__scopeDialog);return f.jsx(gr,{present:i||l.open,children:l.modal?f.jsx(rO,{...o,ref:t}):f.jsx(aO,{...o,ref:t})})});wp.displayName=Ks;var rO=S.forwardRef((e,t)=>{const r=vr(Ks,e.__scopeDialog),i=S.useRef(null),o=at(t,r.contentRef,i);return S.useEffect(()=>{const l=i.current;if(l)return gp(l)},[]),f.jsx(tS,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Te(e.onCloseAutoFocus,l=>{l.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0;(u.button===2||d)&&l.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault())})}),aO=S.forwardRef((e,t)=>{const r=vr(Ks,e.__scopeDialog),i=S.useRef(!1),o=S.useRef(!1);return f.jsx(tS,{...e,ref:t,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()}})}),tS=S.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:l,...u}=e,d=vr(Ks,r);return pp(),f.jsx(f.Fragment,{children:f.jsx(Du,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:l,children:f.jsx(bl,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Sp(d.open),...u,ref:t,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1)})})})}),nS="DialogTitle",rS=S.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,o=vr(nS,r);return f.jsx(Pe.h2,{id:o.titleId,...i,ref:t})});rS.displayName=nS;var aS="DialogDescription",iO=S.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,o=vr(aS,r);return f.jsx(Pe.p,{id:o.descriptionId,...i,ref:t})});iO.displayName=aS;var iS="DialogClose",sS=S.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,o=vr(iS,r);return f.jsx(Pe.button,{type:"button",...i,ref:t,onClick:Te(e.onClick,()=>o.onOpenChange(!1))})});sS.displayName=iS;function Sp(e){return e?"open":"closed"}function sO(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function oO(e){const[t,r]=S.useState(void 0);return Qt(()=>{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 m=l.borderBoxSize,p=Array.isArray(m)?m[0]:m;u=p.inlineSize,d=p.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]),t}const lO=["top","right","bottom","left"],Ha=Math.min,ra=Math.max,gu=Math.round,Yc=Math.floor,aa=e=>({x:e,y:e}),cO={left:"right",right:"left",bottom:"top",top:"bottom"};function oS(e,t,r){return ra(e,Ha(t,r))}function ia(e,t){return typeof e=="function"?e(t):e}function Ba(e){return e.split("-")[0]}function Xs(e){return e.split("-")[1]}function _p(e){return e==="x"?"y":"x"}function Cp(e){return e==="y"?"height":"width"}function Or(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ep(e){return _p(Or(e))}function uO(e,t,r){r===void 0&&(r=!1);const i=Xs(e),o=Ep(e),l=Cp(o);let u=o==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=vu(u)),[u,vu(u)]}function dO(e){const t=vu(e);return[Cm(e),t,Cm(t)]}function Cm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Zb=["left","right"],Kb=["right","left"],fO=["top","bottom"],hO=["bottom","top"];function mO(e,t,r){switch(e){case"top":case"bottom":return r?t?Kb:Zb:t?Zb:Kb;case"left":case"right":return t?fO:hO;default:return[]}}function pO(e,t,r,i){const o=Xs(e);let l=mO(Ba(e),r==="start",i);return o&&(l=l.map(u=>u+"-"+o),t&&(l=l.concat(l.map(Cm)))),l}function vu(e){const t=Ba(e);return cO[t]+e.slice(t.length)}function gO(e){var t,r,i,o;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(i=e.bottom)!=null?i:0,left:(o=e.left)!=null?o:0}}function lS(e){return typeof e!="number"?gO(e):{top:e,right:e,bottom:e,left:e}}function yu(e){const{x:t,y:r,width:i,height:o}=e;return{width:i,height:o,top:r,left:t,right:t+i,bottom:r+o,x:t,y:r}}function Yb(e,t,r){let{reference:i,floating:o}=e;const l=Or(t),u=Ep(t),d=Cp(u),m=Ba(t),p=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(m){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=Xs(t);return w&&(x[u]+=b*(w==="end"?1:-1)*(r&&p?-1:1)),x}async function vO(e,t){var r;t===void 0&&(t={});const{x:i,y:o,platform:l,rects:u,elements:d,strategy:m}=e,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:v="floating",altBoundary:b=!1,padding:x=0}=ia(t,e),w=lS(x),E=d[b?v==="floating"?"reference":"floating":v],R=yu(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:p,rootBoundary:y,strategy:m})),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},k=yu(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:T,offsetParent:O,strategy:m}):T);return{top:(R.top-k.top+w.top)/M.y,bottom:(k.bottom-R.bottom+w.bottom)/M.y,left:(R.left-k.left+w.left)/M.x,right:(k.right-R.right+w.right)/M.x}}const yO=50,bO=async(e,t,r)=>{const{placement:i="bottom",strategy:o="absolute",middleware:l=[],platform:u}=r,d=u.detectOverflow?u:{...u,detectOverflow:vO},m=await(u.isRTL==null?void 0:u.isRTL(t));let p=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:y,y:v}=Yb(p,i,m),b=i,x=0;const w={};for(let _=0;_({name:"arrow",options:e,async fn(t){const{x:r,y:i,placement:o,rects:l,platform:u,elements:d,middlewareData:m}=t,{element:p,padding:y=0}=ia(e,t)||{};if(p==null)return{};const v=lS(y),b={x:r,y:i},x=Ep(o),w=Cp(x),_=await u.getDimensions(p),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],k=b[x]-l.reference[x],B=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let V=B?B[O]:0;(!V||!await(u.isElement==null?void 0:u.isElement(B)))&&(V=d.floating[O]||l.floating[w]);const P=M/2-k/2,pe=V/2-_[w]/2-1,ne=Ha(v[R],pe),ce=Ha(v[T],pe),me=V-_[w]-ce,fe=V/2-_[w]/2+P,Z=oS(ne,fe,me),Se=!m.arrow&&Xs(o)!=null&&fe!==Z&&l.reference[w]/2-(feZ<=0)){var ce,me;const Z=(((ce=l.flip)==null?void 0:ce.index)||0)+1,Se=V[Z];if(Se&&(!(v==="alignment"?T!==Or(Se):!1)||ne.every(ie=>Or(ie.placement)===T?ie.overflows[0]>0:!0)))return{data:{index:Z,overflows:ne},reset:{placement:Se}};let L=(me=ne.filter(K=>K.overflows[0]<=0).sort((K,ie)=>K.overflows[1]-ie.overflows[1])[0])==null?void 0:me.placement;if(!L)switch(x){case"bestFit":{var fe;const K=(fe=ne.filter(ie=>{if(B){const J=Or(ie.placement);return J===T||J==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(J=>J>0).reduce((J,te)=>J+te,0)]).sort((ie,J)=>ie[1]-J[1])[0])==null?void 0:fe[0];K&&(L=K);break}case"initialPlacement":L=d;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function Qb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xb(e){return lO.some(t=>e[t]>=0)}const SO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:i}=t,{strategy:o="referenceHidden",...l}=ia(e,t);switch(o){case"referenceHidden":{const u=await i.detectOverflow(t,{...l,elementContext:"reference"}),d=Qb(u,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Xb(d)}}}case"escaped":{const u=await i.detectOverflow(t,{...l,altBoundary:!0}),d=Qb(u,r.floating);return{data:{escapedOffsets:d,escaped:Xb(d)}}}default:return{}}}}},cS=new Set(["left","top"]);async function _O(e,t){const{placement:r,platform:i,elements:o}=e,l=await(i.isRTL==null?void 0:i.isRTL(o.floating)),u=Ba(r),d=Xs(r),m=Or(r)==="y",p=cS.has(u)?-1:1,y=l&&m?-1:1,v=ia(t,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),m?{x:x*y,y:b*p}:{x:b*p,y:x*y}}const CO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,i;const{x:o,y:l,placement:u,middlewareData:d}=t,m=await _O(t,e);return u===((r=d.offset)==null?void 0:r.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:o+m.x,y:l+m.y,data:{...m,placement:u}}}}},EO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:i,placement:o,platform:l}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:m={fn:T=>{let{x:O,y:M}=T;return{x:O,y:M}}},...p}=ia(e,t),y={x:r,y:i},v=await l.detectOverflow(t,p),b=Or(o),x=_p(b);let w=y[x],_=y[b];const E=(T,O)=>oS(O+v[T==="y"?"top":"left"],O,O-v[T==="y"?"bottom":"right"]);u&&(w=E(x,w)),d&&(_=E(b,_));const R=m.fn({...t,[x]:w,[b]:_});return{...R,data:{x:R.x-r,y:R.y-i,enabled:{[x]:u,[b]:d}}}}}},RO=function(e){return e===void 0&&(e={}),{options:e,fn(t){var r,i;const{x:o,y:l,placement:u,rects:d,middlewareData:m}=t,{offset:p=0,mainAxis:y=!0,crossAxis:v=!0}=ia(e,t),b={x:o,y:l},x=Or(u),w=_p(x);let _=b[w],E=b[x];const R=ia(p,t),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 k=w==="y"?"height":"width",B=d.reference[w]-d.floating[k]+T.mainAxis,V=d.reference[w]+d.reference[k]-T.mainAxis;_V&&(_=V)}if(v){var O,M;const k=w==="y"?"width":"height",B=cS.has(Ba(u)),V=d.reference[x]-d.floating[k]+(B&&((O=m.offset)==null?void 0:O[x])||0)+(B?0:T.crossAxis),P=d.reference[x]+d.reference[k]+(B?0:((M=m.offset)==null?void 0:M[x])||0)-(B?T.crossAxis:0);EP&&(E=P)}return{[w]:_,[x]:E}}}},jO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:i,platform:o,elements:l}=t,{apply:u=()=>{},...d}=ia(e,t),m=await o.detectOverflow(t,d),p=Ba(r),y=Xs(r),v=Or(r)==="y",{width:b,height:x}=i.floating;let w,_;p==="top"||p==="bottom"?(w=p,_=y===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(_=p,w=y==="end"?"top":"bottom");const E=x-m.top-m.bottom,R=b-m.left-m.right,T=Ha(x-m[w],E),O=Ha(b-m[_],R),M=t.middlewareData.shift,k=!M;let B=T,V=O;M!=null&&M.enabled.x&&(V=R),M!=null&&M.enabled.y&&(B=E),k&&!y&&(v?V=b-2*ra(m.left,m.right):B=x-2*ra(m.top,m.bottom)),await u({...t,availableWidth:V,availableHeight:B});const P=await o.getDimensions(l.floating);return b!==P.width||x!==P.height?{reset:{rects:!0}}:{}}}};function $u(){return typeof window<"u"}function Js(e){return uS(e)?(e.nodeName||"").toLowerCase():"#document"}function Mn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sa(e){var t;return(t=(uS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function uS(e){return $u()?e instanceof Node||e instanceof Mn(e).Node:!1}function Ar(e){return $u()?e instanceof Element||e instanceof Mn(e).Element:!1}function Ya(e){return $u()?e instanceof HTMLElement||e instanceof Mn(e).HTMLElement:!1}function Jb(e){return!$u()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mn(e).ShadowRoot}function Iu(e){const{overflow:t,overflowX:r,overflowY:i,display:o}=Mr(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+r)&&o!=="inline"&&o!=="contents"}function TO(e){return/^(table|td|th)$/.test(Js(e))}function Pu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const OO=/transform|translate|scale|rotate|perspective|filter/,AO=/paint|layout|strict|content/,bi=e=>!!e&&e!=="none";let Fh;function Rp(e){const t=Ar(e)?Mr(e):e;return bi(t.transform)||bi(t.translate)||bi(t.scale)||bi(t.rotate)||bi(t.perspective)||!jp()&&(bi(t.backdropFilter)||bi(t.filter))||OO.test(t.willChange||"")||AO.test(t.contain||"")}function MO(e){let t=Ri(e);for(;Ya(t)&&!ul(t);){if(Rp(t))return t;if(Pu(t))return null;t=Ri(t)}return null}function jp(){return Fh==null&&(Fh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Fh}function ul(e){return/^(html|body|#document)$/.test(Js(e))}function Mr(e){return Mn(e).getComputedStyle(e)}function Fu(e){return Ar(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ri(e){if(Js(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Jb(e)&&e.host||sa(e);return Jb(t)?t.host:t}function dS(e){const t=Ri(e);return ul(t)?(e.ownerDocument||e).body:Ya(t)&&Iu(t)?t:dS(t)}function dl(e,t,r){var i;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=dS(e),l=o===((i=e.ownerDocument)==null?void 0:i.body),u=Mn(o);if(l){const d=Em(u);return t.concat(u,u.visualViewport||[],Iu(o)?o:[],d&&r?dl(d):[])}else return t.concat(o,dl(o,[],r))}function Em(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fS(e){const t=Mr(e);let r=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=Ya(e),l=o?e.offsetWidth:r,u=o?e.offsetHeight:i,d=gu(r)!==l||gu(i)!==u;return d&&(r=l,i=u),{width:r,height:i,$:d}}function Tp(e){return Ar(e)?e:e.contextElement}function Fs(e){const t=Tp(e);if(!Ya(t))return aa(1);const r=t.getBoundingClientRect(),{width:i,height:o,$:l}=fS(t);let u=(l?gu(r.width):r.width)/i,d=(l?gu(r.height):r.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const NO=aa(0);function hS(e){const t=Mn(e);return!jp()||!t.visualViewport?NO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function DO(e,t,r){return t===void 0&&(t=!1),!!r&&t&&r===Mn(e)}function ji(e,t,r,i){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),l=Tp(e);let u=aa(1);t&&(i?Ar(i)&&(u=Fs(i)):u=Fs(e));const d=DO(l,r,i)?hS(l):aa(0);let m=(o.left+d.x)/u.x,p=(o.top+d.y)/u.y,y=o.width/u.x,v=o.height/u.y;if(l&&i){const b=Mn(l),x=Ar(i)?Mn(i):i;let w=b,_=Em(w);for(;_&&x!==w;){const E=Fs(_),R=_.getBoundingClientRect(),T=Mr(_),O=R.left+(_.clientLeft+parseFloat(T.paddingLeft))*E.x,M=R.top+(_.clientTop+parseFloat(T.paddingTop))*E.y;m*=E.x,p*=E.y,y*=E.x,v*=E.y,m+=O,p+=M,w=Mn(_),_=Em(w)}}return yu({width:y,height:v,x:m,y:p})}function Vu(e,t){const r=Fu(e).scrollLeft;return t?t.left+r:ji(sa(e)).left+r}function mS(e,t){const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-Vu(e,r),o=r.top+t.scrollTop;return{x:i,y:o}}function kO(e){let{elements:t,rect:r,offsetParent:i,strategy:o}=e;const l=o==="fixed",u=sa(i),d=t?Pu(t.floating):!1;if(i===u||d&&l)return r;let m={scrollLeft:0,scrollTop:0},p=aa(1);const y=aa(0),v=Ya(i);if((v||!l)&&((Js(i)!=="body"||Iu(u))&&(m=Fu(i)),v)){const x=ji(i);p=Fs(i),y.x=x.x+i.clientLeft,y.y=x.y+i.clientTop}const b=u&&!v&&!l?mS(u,m):aa(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-m.scrollLeft*p.x+y.x+b.x,y:r.y*p.y-m.scrollTop*p.y+y.y+b.y}}function zO(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function LO(e){const t=Fu(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=-t.scrollLeft+Vu(e);const u=-t.scrollTop;return Mr(r).direction==="rtl"&&(l+=ra(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:u}}const $O=25;function IO(e,t,r){r===void 0&&(r="viewport");const i=r==="layoutViewport",o=Mn(e),l=sa(e),u=o.visualViewport;let d=l.clientWidth,m=l.clientHeight,p=0,y=0;if(u){const b=!jp()||t==="fixed";i?b||(p=-u.offsetLeft,y=-u.offsetTop):(d=u.width,m=u.height,b&&(p=u.offsetLeft,y=u.offsetTop))}if(Vu(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<=$O&&(d-=R)}return{width:d,height:m,x:p,y}}function PO(e,t){const r=ji(e,!0,t==="fixed"),i=r.top+e.clientTop,o=r.left+e.clientLeft,l=Fs(e),u=e.clientWidth*l.x,d=e.clientHeight*l.y,m=o*l.x,p=i*l.y;return{width:u,height:d,x:m,y:p}}function Wb(e,t,r){let i;if(t==="viewport"||t==="layoutViewport")i=IO(e,r,t);else if(t==="document")i=LO(sa(e));else if(Ar(t))i=PO(t,r);else{const o=hS(e);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return yu(i)}function FO(e,t){const r=t.get(e);if(r)return r;let i=dl(e,[],!1).filter(d=>Ar(d)&&Js(d)!=="body"),o=null;const l=Mr(e).position==="fixed";let u=l?Ri(e):e;for(;Ar(u)&&!ul(u);){const d=Mr(u),m=Rp(u),p=o?o.position:l?"fixed":"";!m&&(p==="fixed"||p==="absolute"&&d.position==="static")?i=i.filter(v=>v!==u):o=d,u=Ri(u)}return t.set(e,i),i}function VO(e){let{element:t,boundary:r,rootBoundary:i,strategy:o}=e;const u=[...r==="clippingAncestors"?Pu(t)?[]:FO(t,this._c):[].concat(r),i],d=Wb(t,u[0],o);let m=d.top,p=d.right,y=d.bottom,v=d.left;for(let b=1;b{d(!1,1e-7)},1e3)}V=!1}try{i=new IntersectionObserver(P,{...B,root:l.ownerDocument})}catch{i=new IntersectionObserver(P,B)}i.observe(e)}const m=Mn(e),p=()=>d(r);return m.addEventListener("resize",p),d(!0),()=>{m.removeEventListener("resize",p),u()}}function KO(e,t,r,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:m=!1}=i,p=Tp(e),y=o||l?[...p?dl(p):[],...t?dl(t):[]]:[];y.forEach(R=>{o&&R.addEventListener("scroll",r),l&&R.addEventListener("resize",r)});const v=p&&d?ZO(p,r,l):null;let b=-1,x=null;u&&(x=new ResizeObserver(R=>{let[T]=R;T&&T.target===p&&x&&t&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var O;(O=x)==null||O.observe(t)})),r()}),p&&!m&&x.observe(p),t&&x.observe(t));let w,_=m?ji(e):null;m&&E();function E(){const R=ji(e);_&&!gS(_,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,m&&cancelAnimationFrame(w)}}const YO=CO,QO=EO,XO=wO,JO=jO,WO=SO,tx=xO,eA=RO,tA=(e,t,r)=>{const i=new Map,o=r??{},l={...GO,...o.platform,_c:i};return bO(e,t,{...o,platform:l})};var nA=typeof document<"u",rA=function(){},lu=nA?S.useLayoutEffect:rA;function bu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,i,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(i=r;i--!==0;)if(!bu(e[i],t[i]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(t,o[i]))return!1;for(i=r;i--!==0;){const l=o[i];if(!(l==="_owner"&&e.$$typeof)&&!bu(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function vS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nx(e,t){const r=vS(e);return Math.round(t*r)/r}function Uh(e){const t=S.useRef(e);return lu(()=>{t.current=e}),t}function aA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:i=[],platform:o,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:m,open:p}=e,[y,v]=S.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=S.useState(i);bu(b,i)||x(i);const[w,_]=S.useState(null),[E,R]=S.useState(null),T=S.useCallback(ie=>{ie!==B.current&&(B.current=ie,_(ie))},[]),O=S.useCallback(ie=>{ie!==V.current&&(V.current=ie,R(ie))},[]),M=l||w,k=u||E,B=S.useRef(null),V=S.useRef(null),P=S.useRef(y),pe=m!=null,ne=Uh(m),ce=Uh(o),me=Uh(p),fe=S.useCallback(()=>{if(!B.current||!V.current)return;const ie={placement:t,strategy:r,middleware:b};ce.current&&(ie.platform=ce.current),tA(B.current,V.current,ie).then(J=>{const te={...J,isPositioned:me.current!==!1};Z.current&&!bu(P.current,te)&&(P.current=te,zi.flushSync(()=>{v(te)}))})},[b,t,r,ce,me]);lu(()=>{p===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,v(ie=>({...ie,isPositioned:!1})))},[p]);const Z=S.useRef(!1);lu(()=>(Z.current=!0,()=>{Z.current=!1}),[]),lu(()=>{if(M&&(B.current=M),k&&(V.current=k),M&&k){if(ne.current)return ne.current(M,k,fe);fe()}},[M,k,fe,ne,pe]);const Se=S.useMemo(()=>({reference:B,floating:V,setReference:T,setFloating:O}),[T,O]),L=S.useMemo(()=>({reference:M,floating:k}),[M,k]),K=S.useMemo(()=>{const ie={position:r,left:0,top:0};if(!L.floating)return ie;const J=nx(L.floating,y.x),te=nx(L.floating,y.y);return d?{...ie,transform:"translate("+J+"px, "+te+"px)",...vS(L.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:J,top:te}},[r,d,L.floating,y.x,y.y]);return S.useMemo(()=>({...y,update:fe,refs:Se,elements:L,floatingStyles:K}),[y,fe,Se,L,K])}const iA=e=>{function t(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&&t(i)?i.current!=null?tx({element:i.current,padding:o}).fn(r):{}:i?tx({element:i,padding:o}).fn(r):{}}}},sA=(e,t)=>{const r=YO(e);return{name:r.name,fn:r.fn,options:[e,t]}},oA=(e,t)=>{const r=QO(e);return{name:r.name,fn:r.fn,options:[e,t]}},lA=(e,t)=>({fn:eA(e).fn,options:[e,t]}),cA=(e,t)=>{const r=XO(e);return{name:r.name,fn:r.fn,options:[e,t]}},uA=(e,t)=>{const r=JO(e);return{name:r.name,fn:r.fn,options:[e,t]}},dA=(e,t)=>{const r=WO(e);return{name:r.name,fn:r.fn,options:[e,t]}},fA=(e,t)=>{const r=iA(e);return{name:r.name,fn:r.fn,options:[e,t]}};var hA="Arrow",yS=S.forwardRef((e,t)=>{const{children:r,width:i=10,height:o=5,...l}=e;return f.jsx(Pe.svg,{...l,ref:t,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"})})});yS.displayName=hA;var mA=yS,Op="Popper",[bS,Ws]=Ka(Op),[pA,xS]=bS(Op),wS=e=>{const{__scopePopper:t,children:r}=e,[i,o]=S.useState(null),[l,u]=S.useState(void 0);return f.jsx(pA,{scope:t,anchor:i,onAnchorChange:o,placementState:l,setPlacementState:u,children:r})};wS.displayName=Op;var SS="PopperAnchor",_S=S.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:i,...o}=e,l=xS(SS,r),u=S.useRef(null),d=l.onAnchorChange,m=S.useCallback(w=>{u.current=w,w&&d(w)},[d]),p=at(t,m),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&&Mp(l.placementState),b=v?.[0],x=v?.[1];return i?null:f.jsx(Pe.div,{"data-radix-popper-side":b,"data-radix-popper-align":x,...o,ref:p})});_S.displayName=SS;var Ap="PopperContent",[gA,vA]=bS(Ap),CS=S.forwardRef((e,t)=>{const{__scopePopper:r,side:i="bottom",sideOffset:o=0,align:l="center",alignOffset:u=0,arrowPadding:d=0,avoidCollisions:m=!0,collisionBoundary:p=[],collisionPadding:y=0,sticky:v="partial",hideWhenDetached:b=!1,updatePositionStrategy:x="optimized",onPlaced:w,..._}=e,E=xS(Ap,r),[R,T]=S.useState(null),O=at(t,T),[M,k]=S.useState(null),B=oO(M),V=B?.width??0,P=B?.height??0,pe=i+(l!=="center"?"-"+l:""),ne=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},ce=Array.isArray(p)?p:[p],me=ce.length>0,fe={padding:ne,boundary:ce.filter(bA),altBoundary:me},{refs:Z,floatingStyles:Se,placement:L,isPositioned:K,middlewareData:ie}=aA({strategy:"fixed",placement:pe,whileElementsMounted:(...be)=>KO(...be,{animationFrame:x==="always"}),elements:{reference:E.anchor},middleware:[sA({mainAxis:o+P,alignmentAxis:u}),m&&oA({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?lA():void 0,...fe}),m&&cA({...fe}),uA({...fe,apply:({elements:be,rects:xe,availableWidth:Me,availableHeight:Fe})=>{const{width:He,height:ct}=xe.reference,Je=be.floating.style;Je.setProperty("--radix-popper-available-width",`${Me}px`),Je.setProperty("--radix-popper-available-height",`${Fe}px`),Je.setProperty("--radix-popper-anchor-width",`${He}px`),Je.setProperty("--radix-popper-anchor-height",`${ct}px`)}}),M&&fA({element:M,padding:d}),xA({arrowWidth:V,arrowHeight:P}),b&&dA({strategy:"referenceHidden",...fe,boundary:me?fe.boundary:void 0})]}),J=E.setPlacementState;Qt(()=>(J(L),()=>{J(void 0)}),[L,J]);const[te,D]=Mp(L),N=tr(w);Qt(()=>{K&&N?.()},[K,N]);const H=ie.arrow?.x,X=ie.arrow?.y,Y=ie.arrow?.centerOffset!==0,[he,re]=S.useState();return Qt(()=>{R&&re(window.getComputedStyle(R).zIndex)},[R]),f.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...Se,transform:K?Se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[ie.transformOrigin?.x,ie.transformOrigin?.y].join(" "),...ie.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(gA,{scope:r,placedSide:te,placedAlign:D,onArrowChange:k,arrowX:H,arrowY:X,shouldHideArrow:Y,children:f.jsx(Pe.div,{"data-side":te,"data-align":D,..._,ref:O,style:{..._.style,animation:K?void 0:"none"}})})})});CS.displayName=Ap;var ES="PopperArrow",yA={top:"bottom",right:"left",bottom:"top",left:"right"},RS=S.forwardRef(function(t,r){const{__scopePopper:i,...o}=t,l=vA(ES,i),u=yA[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(mA,{...o,ref:r,style:{...o.style,display:"block"}})})});RS.displayName=ES;function bA(e){return e!==null}var xA=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:i,middlewareData:o}=t,u=o.arrow?.centerOffset!==0,d=u?0:e.arrowWidth,m=u?0:e.arrowHeight,[p,y]=Mp(r),v={start:"0%",center:"50%",end:"100%"}[y],b=(o.arrow?.x??0)+d/2,x=(o.arrow?.y??0)+m/2;let w="",_="";return p==="bottom"?(w=u?v:`${b}px`,_=`${-m}px`):p==="top"?(w=u?v:`${b}px`,_=`${i.floating.height+m}px`):p==="right"?(w=`${-m}px`,_=u?v:`${x}px`):p==="left"&&(w=`${i.floating.width+m}px`,_=u?v:`${x}px`),{data:{x:w,y:_}}}});function Mp(e){const[t,r="center"]=e.split("-");return[t,r]}var Np=wS,Dp=_S,kp=CS,zp=RS,Hh=!1;function wA(){const[e,t]=S.useState(Hh);return S.useEffect(()=>{Hh||(Hh=!0,t(!0))},[]),e}var jS=Mu[" useSyncExternalStore ".trim().toString()];function SA(){return()=>{}}function _A(){return jS(SA,()=>!0,()=>!1)}var CA=typeof jS=="function"?_A:wA,Bh="rovingFocusGroup.onEntryFocus",EA={bubbles:!1,cancelable:!0},wl="RovingFocusGroup",[Rm,TS,RA]=fp(wl),[jA,OS]=Ka(wl,[RA]),[TA,OA]=jA(wl),AS=S.forwardRef((e,t)=>f.jsx(Rm.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Rm.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(AA,{...e,ref:t})})}));AS.displayName=wl;var AA=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:i,loop:o=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:m,onEntryFocus:p,preventScrollOnEntryFocus:y=!1,...v}=e,b=S.useRef(null),x=at(t,b),w=hp(l),[_,E]=Zs({prop:u,defaultProp:d??null,onChange:m,caller:wl}),[R,T]=S.useState(!1),O=tr(p),M=TS(r),k=S.useRef(!1),[B,V]=S.useState(0);return S.useEffect(()=>{const P=b.current;if(P)return P.addEventListener(Bh,O),()=>P.removeEventListener(Bh,O)},[O]),f.jsx(TA,{scope:r,orientation:i,dir:w,loop:o,currentTabStopId:_,onItemFocus:S.useCallback(P=>E(P),[E]),onItemShiftTab:S.useCallback(()=>T(!0),[]),onFocusableItemAdd:S.useCallback(()=>V(P=>P+1),[]),onFocusableItemRemove:S.useCallback(()=>V(P=>P-1),[]),children:f.jsx(Pe.div,{tabIndex:R||B===0?-1:0,"data-orientation":i,...v,ref:x,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{k.current=!0}),onFocus:Te(e.onFocus,P=>{const pe=!k.current;if(P.target===P.currentTarget&&pe&&!R){const ne=new CustomEvent(Bh,EA);if(P.currentTarget.dispatchEvent(ne),!ne.defaultPrevented){const ce=M().filter(L=>L.focusable),me=ce.find(L=>L.active),fe=ce.find(L=>L.id===_),Se=[me,fe,...ce].filter(Boolean).map(L=>L.ref.current);DS(Se,y)}}k.current=!1}),onBlur:Te(e.onBlur,()=>T(!1))})})}),MS="RovingFocusGroupItem",NS=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:l,children:u,...d}=e,m=fn(),p=l||m,y=OA(MS,r),v=y.currentTabStopId===p,b=TS(r),{onFocusableItemAdd:x,onFocusableItemRemove:w,currentTabStopId:_}=y,E=CA();return Qt(()=>{if(!(!E||!i))return x(),()=>w()},[E,i,x,w]),S.useEffect(()=>{if(!(E||!i))return x(),()=>w()},[E,i,x,w]),f.jsx(Rm.ItemSlot,{scope:r,id:p,focusable:i,active:o,children:f.jsx(Pe.span,{tabIndex:v?0:-1,"data-orientation":y.orientation,...d,ref:t,onMouseDown:Te(e.onMouseDown,R=>{i?y.onItemFocus(p):R.preventDefault()}),onFocus:Te(e.onFocus,()=>y.onItemFocus(p)),onKeyDown:Te(e.onKeyDown,R=>{if(R.key==="Tab"&&R.shiftKey){y.onItemShiftTab();return}if(R.target!==R.currentTarget)return;const T=DA(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(k=>k.focusable).map(k=>k.ref.current);if(T==="last")M.reverse();else if(T==="prev"||T==="next"){T==="prev"&&M.reverse();const k=M.indexOf(R.currentTarget);M=y.loop?kA(M,k+1):M.slice(k+1)}setTimeout(()=>DS(M))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:_!=null}):u})})});NS.displayName=MS;var MA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function NA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function DA(e,t,r){const i=NA(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return MA[i]}function DS(e,t=!1){const r=document.activeElement;for(const i of e)if(i===r||(i.focus({preventScroll:t}),document.activeElement!==r))return}function kA(e,t){return e.map((r,i)=>e[(t+i)%e.length])}var zA=AS,LA=NS,jm=["Enter"," "],$A=["ArrowDown","PageUp","Home"],kS=["ArrowUp","PageDown","End"],IA=[...$A,...kS],PA={ltr:[...jm,"ArrowRight"],rtl:[...jm,"ArrowLeft"]},FA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sl="Menu",[fl,VA,UA]=fp(Sl),[Li,zS]=Ka(Sl,[UA,Ws,OS]),Uu=Ws(),LS=OS(),[HA,$i]=Li(Sl),[BA,_l]=Li(Sl),$S=e=>{const{__scopeMenu:t,open:r=!1,children:i,dir:o,onOpenChange:l,modal:u=!0}=e,d=Uu(t),[m,p]=S.useState(null),y=S.useRef(!1),v=tr(l),b=hp(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(Np,{...d,children:f.jsx(HA,{scope:t,open:r,onOpenChange:v,content:m,onContentChange:p,children:f.jsx(BA,{scope:t,onClose:S.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:y,dir:b,modal:u,children:i})})})};$S.displayName=Sl;var qA="MenuAnchor",Lp=S.forwardRef((e,t)=>{const{__scopeMenu:r,...i}=e,o=Uu(r);return f.jsx(Dp,{...o,...i,ref:t})});Lp.displayName=qA;var $p="MenuPortal",[GA,IS]=Li($p,{forceMount:void 0}),PS=e=>{const{__scopeMenu:t,forceMount:r,children:i,container:o}=e,l=$i($p,t);return f.jsx(GA,{scope:t,forceMount:r,children:f.jsx(gr,{present:r||l.open,children:f.jsx(xl,{asChild:!0,container:o,children:i})})})};PS.displayName=$p;var er="MenuContent",[ZA,Ip]=Li(er),FS=S.forwardRef((e,t)=>{const r=IS(er,e.__scopeMenu),{forceMount:i=r.forceMount,...o}=e,l=$i(er,e.__scopeMenu),u=_l(er,e.__scopeMenu);return f.jsx(fl.Provider,{scope:e.__scopeMenu,children:f.jsx(gr,{present:i||l.open,children:f.jsx(fl.Slot,{scope:e.__scopeMenu,children:u.modal?f.jsx(KA,{...o,ref:t}):f.jsx(YA,{...o,ref:t})})})})}),KA=S.forwardRef((e,t)=>{const r=$i(er,e.__scopeMenu),i=S.useRef(null),o=at(t,i);return S.useEffect(()=>{const l=i.current;if(l)return gp(l)},[]),f.jsx(Pp,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),YA=S.forwardRef((e,t)=>{const r=$i(er,e.__scopeMenu);return f.jsx(Pp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),QA=Ei("MenuContent.ScrollLock"),Pp=S.forwardRef((e,t)=>{const{__scopeMenu:r,loop:i=!1,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:d,onEntryFocus:m,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:x,disableOutsideScroll:w,..._}=e,E=$i(er,r),R=_l(er,r),T=Uu(r),O=LS(r),M=VA(r),[k,B]=S.useState(null),V=S.useRef(null),P=at(t,V,E.onContentChange),pe=S.useRef(0),ne=S.useRef(""),ce=S.useRef(0),me=S.useRef(null),fe=S.useRef("right"),Z=S.useRef(0),Se=w?zu:S.Fragment,L=w?{as:QA,allowPinchZoom:!0}:void 0,K=J=>{const te=ne.current+J,D=M().filter(re=>!re.disabled),N=document.activeElement,H=D.find(re=>re.ref.current===N)?.textValue,X=D.map(re=>re.textValue),Y=lM(X,te,H),he=D.find(re=>re.textValue===Y)?.ref.current;(function re(be){ne.current=be,window.clearTimeout(pe.current),be!==""&&(pe.current=window.setTimeout(()=>re(""),1e3))})(te),he&&setTimeout(()=>he.focus())};S.useEffect(()=>()=>window.clearTimeout(pe.current),[]),pp();const ie=S.useCallback(J=>fe.current===me.current?.side&&uM(J,me.current?.area),[]);return f.jsx(ZA,{scope:r,searchRef:ne,onItemEnter:S.useCallback(J=>{ie(J)&&J.preventDefault()},[ie]),onItemLeave:S.useCallback(J=>{ie(J)||(V.current?.focus(),B(null))},[ie]),onTriggerLeave:S.useCallback(J=>{ie(J)&&J.preventDefault()},[ie]),pointerGraceTimerRef:ce,onPointerGraceIntentChange:S.useCallback(J=>{me.current=J},[]),children:f.jsx(Se,{...L,children:f.jsx(Du,{asChild:!0,trapped:o,onMountAutoFocus:Te(l,J=>{J.preventDefault(),V.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:f.jsx(bl,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:x,children:f.jsx(zA,{asChild:!0,...O,dir:R.dir,orientation:"vertical",loop:i,currentTabStopId:k,onCurrentTabStopIdChange:B,onEntryFocus:Te(m,J=>{R.isUsingKeyboardRef.current||J.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(kp,{role:"menu","aria-orientation":"vertical","data-state":n1(E.open),"data-radix-menu-content":"",dir:R.dir,...T,..._,ref:P,style:{outline:"none",..._.style},onKeyDown:Te(_.onKeyDown,J=>{const D=J.target.closest("[data-radix-menu-content]")===J.currentTarget,N=J.ctrlKey||J.altKey||J.metaKey,H=J.key.length===1;D&&(J.key==="Tab"&&J.preventDefault(),!N&&H&&K(J.key));const X=V.current;if(J.target!==X||!IA.includes(J.key))return;J.preventDefault();const he=M().filter(re=>!re.disabled).map(re=>re.ref.current);kS.includes(J.key)&&he.reverse(),sM(he)}),onBlur:Te(e.onBlur,J=>{J.currentTarget.contains(J.target)||(window.clearTimeout(pe.current),ne.current="")}),onPointerMove:Te(e.onPointerMove,hl(J=>{const te=J.target,D=Z.current!==J.clientX;if(J.currentTarget.contains(te)&&D){const N=J.clientX>Z.current?"right":"left";fe.current=N,Z.current=J.clientX}}))})})})})})})});FS.displayName=er;var XA="MenuGroup",Fp=S.forwardRef((e,t)=>{const{__scopeMenu:r,...i}=e;return f.jsx(Pe.div,{role:"group",...i,ref:t})});Fp.displayName=XA;var JA="MenuLabel",VS=S.forwardRef((e,t)=>{const{__scopeMenu:r,...i}=e;return f.jsx(Pe.div,{...i,ref:t})});VS.displayName=JA;var xu="MenuItem",rx="menu.itemSelect",Hu=S.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:i,...o}=e,l=S.useRef(null),u=_l(xu,e.__scopeMenu),d=Ip(xu,e.__scopeMenu),m=at(t,l),p=S.useRef(!1),y=()=>{const v=l.current;if(!r&&v){const b=new CustomEvent(rx,{bubbles:!0,cancelable:!0});v.addEventListener(rx,x=>i?.(x),{once:!0}),Pw(v,b),b.defaultPrevented?p.current=!1:u.onClose()}};return f.jsx(US,{...o,ref:m,disabled:r,onClick:Te(e.onClick,y),onPointerDown:v=>{e.onPointerDown?.(v),p.current=!0},onPointerUp:Te(e.onPointerUp,v=>{p.current||v.currentTarget?.click()}),onKeyDown:Te(e.onKeyDown,v=>{r||v.target!==v.currentTarget||d.searchRef.current!==""&&v.key===" "||jm.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});Hu.displayName=xu;var US=S.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:i=!1,textValue:o,...l}=e,u=Ip(xu,r),d=LS(r),m=S.useRef(null),p=at(t,m),[y,v]=S.useState(!1),[b,x]=S.useState("");return S.useEffect(()=>{const w=m.current;w&&x((w.textContent??"").trim())},[l.children]),f.jsx(fl.ItemSlot,{scope:r,disabled:i,textValue:o??b,children:f.jsx(LA,{asChild:!0,...d,focusable:!i,children:f.jsx(Pe.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...l,ref:p,onPointerMove:Te(e.onPointerMove,hl(w=>{i?u.onItemLeave(w):(u.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,hl(w=>u.onItemLeave(w))),onFocus:Te(e.onFocus,()=>v(!0)),onBlur:Te(e.onBlur,()=>v(!1))})})})}),WA="MenuCheckboxItem",HS=S.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:i,...o}=e;return f.jsx(KS,{scope:e.__scopeMenu,checked:r,children:f.jsx(Hu,{role:"menuitemcheckbox","aria-checked":wu(r)?"mixed":r,...o,ref:t,"data-state":Up(r),onSelect:Te(o.onSelect,()=>i?.(wu(r)?!0:!r),{checkForDefaultPrevented:!1})})})});HS.displayName=WA;var BS="MenuRadioGroup",[eM,tM]=Li(BS,{value:void 0,onValueChange:()=>{}}),qS=S.forwardRef((e,t)=>{const{value:r,onValueChange:i,...o}=e,l=tr(i);return f.jsx(eM,{scope:e.__scopeMenu,value:r,onValueChange:l,children:f.jsx(Fp,{...o,ref:t})})});qS.displayName=BS;var GS="MenuRadioItem",ZS=S.forwardRef((e,t)=>{const{value:r,...i}=e,o=tM(GS,e.__scopeMenu),l=r===o.value;return f.jsx(KS,{scope:e.__scopeMenu,checked:l,children:f.jsx(Hu,{role:"menuitemradio","aria-checked":l,...i,ref:t,"data-state":Up(l),onSelect:Te(i.onSelect,()=>o.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});ZS.displayName=GS;var Vp="MenuItemIndicator",[KS,nM]=Li(Vp,{checked:!1}),YS=S.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:i,...o}=e,l=nM(Vp,r);return f.jsx(gr,{present:i||wu(l.checked)||l.checked===!0,children:f.jsx(Pe.span,{...o,ref:t,"data-state":Up(l.checked)})})});YS.displayName=Vp;var rM="MenuSeparator",QS=S.forwardRef((e,t)=>{const{__scopeMenu:r,...i}=e;return f.jsx(Pe.div,{role:"separator","aria-orientation":"horizontal",...i,ref:t})});QS.displayName=rM;var aM="MenuArrow",XS=S.forwardRef((e,t)=>{const{__scopeMenu:r,...i}=e,o=Uu(r);return f.jsx(zp,{...o,...i,ref:t})});XS.displayName=aM;var iM="MenuSub",[RF,JS]=Li(iM),Wo="MenuSubTrigger",WS=S.forwardRef((e,t)=>{const r=$i(Wo,e.__scopeMenu),i=_l(Wo,e.__scopeMenu),o=JS(Wo,e.__scopeMenu),l=Ip(Wo,e.__scopeMenu),u=S.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:m}=l,p={__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),m(null)}},[d,m]);const v=at(t,o.onTriggerChange);return f.jsx(Lp,{asChild:!0,...p,children:f.jsx(US,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":n1(r.open),...e,ref:v,onClick:b=>{e.onClick?.(b),!(e.disabled||b.defaultPrevented)&&(b.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,hl(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:Te(e.onPointerLeave,hl(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:Te(e.onKeyDown,b=>{e.disabled||b.target!==b.currentTarget||l.searchRef.current!==""&&b.key===" "||PA[i.dir].includes(b.key)&&(r.onOpenChange(!0),r.content?.focus(),b.preventDefault())})})})});WS.displayName=Wo;var e1="MenuSubContent",t1=S.forwardRef((e,t)=>{const r=IS(er,e.__scopeMenu),{forceMount:i=r.forceMount,align:o="start",...l}=e,u=$i(er,e.__scopeMenu),d=_l(er,e.__scopeMenu),m=JS(e1,e.__scopeMenu),p=S.useRef(null),y=at(t,p);return f.jsx(fl.Provider,{scope:e.__scopeMenu,children:f.jsx(gr,{present:i||u.open,children:f.jsx(fl.Slot,{scope:e.__scopeMenu,children:f.jsx(Pp,{id:m.contentId,"aria-labelledby":m.triggerId,...l,ref:y,align:o,side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{d.isUsingKeyboardRef.current&&p.current?.focus(),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:Te(e.onFocusOutside,v=>{v.target!==m.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,v=>{d.onClose(),v.preventDefault()}),onKeyDown:Te(e.onKeyDown,v=>{const b=v.currentTarget.contains(v.target),x=FA[d.dir].includes(v.key);b&&x&&(u.onOpenChange(!1),m.trigger?.focus(),v.preventDefault())})})})})})});t1.displayName=e1;function n1(e){return e?"open":"closed"}function wu(e){return e==="indeterminate"}function Up(e){return wu(e)?"indeterminate":e?"checked":"unchecked"}function sM(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function oM(e,t){return e.map((r,i)=>e[(t+i)%e.length])}function lM(e,t,r){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,l=r?e.indexOf(r):-1;let u=oM(e,Math.max(l,0));o.length===1&&(u=u.filter(p=>p!==r));const m=u.find(p=>p.toLowerCase().startsWith(o.toLowerCase()));return m!==r?m:void 0}function cM(e,t){const{x:r,y:i}=e;let o=!1;for(let l=0,u=t.length-1;li!=b>i&&r<(v-p)*(i-y)/(b-y)+p&&(o=!o)}return o}function uM(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return cM(r,t)}function hl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var dM=$S,fM=Lp,hM=PS,mM=FS,pM=Fp,gM=VS,vM=Hu,yM=HS,bM=qS,xM=ZS,wM=YS,SM=QS,_M=XS,CM=WS,EM=t1,Bu="DropdownMenu",[RM]=Ka(Bu,[zS]),vn=zS(),[jM,r1]=RM(Bu),a1=e=>{const{__scopeDropdownMenu:t,children:r,dir:i,open:o,defaultOpen:l,onOpenChange:u,modal:d=!0}=e,m=vn(t),p=S.useRef(null),[y,v]=Zs({prop:o,defaultProp:l??!1,onChange:u,caller:Bu});return f.jsx(jM,{scope:t,triggerId:fn(),triggerRef:p,contentId:fn(),open:y,onOpenChange:v,onOpenToggle:S.useCallback(()=>v(b=>!b),[v]),modal:d,children:f.jsx(dM,{...m,open:y,onOpenChange:v,dir:i,modal:d,children:r})})};a1.displayName=Bu;var i1="DropdownMenuTrigger",s1=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:i=!1,...o}=e,l=r1(i1,r),u=vn(r),d=at(t,l.triggerRef);return f.jsx(fM,{asChild:!0,...u,children:f.jsx(Pe.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:Te(e.onPointerDown,m=>{!i&&m.button===0&&m.ctrlKey===!1&&(l.onOpenToggle(),l.open||m.preventDefault())}),onKeyDown:Te(e.onKeyDown,m=>{i||(["Enter"," "].includes(m.key)&&l.onOpenToggle(),m.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(m.key)&&m.preventDefault())})})})});s1.displayName=i1;var TM="DropdownMenuPortal",o1=e=>{const{__scopeDropdownMenu:t,...r}=e,i=vn(t);return f.jsx(hM,{...i,...r})};o1.displayName=TM;var l1="DropdownMenuContent",c1=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=r1(l1,r),l=vn(r),u=S.useRef(!1);return f.jsx(mM,{id:o.contentId,"aria-labelledby":o.triggerId,...l,...i,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,d=>{u.current||o.triggerRef.current?.focus(),u.current=!1,d.preventDefault()}),onInteractOutside:Te(e.onInteractOutside,d=>{const m=d.detail.originalEvent,p=m.button===0&&m.ctrlKey===!0,y=m.button===2||p;(!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)"}})});c1.displayName=l1;var OM="DropdownMenuGroup",AM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(pM,{...o,...i,ref:t})});AM.displayName=OM;var MM="DropdownMenuLabel",u1=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(gM,{...o,...i,ref:t})});u1.displayName=MM;var NM="DropdownMenuItem",d1=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(vM,{...o,...i,ref:t})});d1.displayName=NM;var DM="DropdownMenuCheckboxItem",kM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(yM,{...o,...i,ref:t})});kM.displayName=DM;var zM="DropdownMenuRadioGroup",LM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(bM,{...o,...i,ref:t})});LM.displayName=zM;var $M="DropdownMenuRadioItem",IM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(xM,{...o,...i,ref:t})});IM.displayName=$M;var PM="DropdownMenuItemIndicator",FM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(wM,{...o,...i,ref:t})});FM.displayName=PM;var VM="DropdownMenuSeparator",UM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(SM,{...o,...i,ref:t})});UM.displayName=VM;var HM="DropdownMenuArrow",BM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(_M,{...o,...i,ref:t})});BM.displayName=HM;var qM="DropdownMenuSubTrigger",GM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(CM,{...o,...i,ref:t})});GM.displayName=qM;var ZM="DropdownMenuSubContent",KM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(EM,{...o,...i,ref:t,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)"}})});KM.displayName=ZM;var YM=a1,QM=s1,XM=o1,JM=c1,WM=u1,eN=d1,tN="Label",f1=S.forwardRef((e,t)=>f.jsx(Pe.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));f1.displayName=tN;var nN=f1;function ax(e,[t,r]){return Math.min(r,Math.max(t,e))}var rN=[" ","Enter","ArrowUp","ArrowDown"],aN=[" ","Enter"],Ti="Select",[qu,Gu,iN]=fp(Ti),[Ii]=Ka(Ti,[iN,Ws]),Zu=Ws(),[sN,Qa]=Ii(Ti),[oN,lN]=Ii(Ti),cN="SelectProvider";function h1(e){const{__scopeSelect:t,children:r,open:i,defaultOpen:o,onOpenChange:l,value:u,defaultValue:d,onValueChange:m,dir:p,name:y,autoComplete:v,disabled:b,required:x,form:w,internal_do_not_use_render:_}=e,E=Zu(t),[R,T]=S.useState(null),[O,M]=S.useState(null),[k,B]=S.useState(!1),V=hp(p),[P,pe]=Zs({prop:i,defaultProp:o??!1,onChange:l,caller:Ti}),[ne,ce]=Zs({prop:u,defaultProp:d,onChange:m,caller:Ti}),me=S.useRef(null),fe=S.useRef(ne);S.useEffect(()=>{const N=w?R?.ownerDocument.getElementById(w):R?.form;if(N instanceof HTMLFormElement){const H=()=>ce(fe.current);return N.addEventListener("reset",H),()=>N.removeEventListener("reset",H)}},[w,R,ce]);const Z=R?!!w||!!R.closest("form"):!0,[Se,L]=S.useState(new Set),K=fn(),ie=Array.from(Se).map(N=>N.props.value).join(";"),J=S.useCallback(N=>{L(H=>new Set(H).add(N))},[]),te=S.useCallback(N=>{L(H=>{const X=new Set(H);return X.delete(N),X})},[]),D={required:x,trigger:R,onTriggerChange:T,valueNode:O,onValueNodeChange:M,valueNodeHasChildren:k,onValueNodeHasChildrenChange:B,contentId:K,value:ne,onValueChange:ce,open:P,onOpenChange:pe,dir:V,triggerPointerDownPosRef:me,disabled:b,name:y,autoComplete:v,form:w,nativeOptions:Se,nativeSelectKey:ie,isFormControl:Z};return f.jsx(Np,{...E,children:f.jsx(sN,{scope:t,...D,children:f.jsx(qu.Provider,{scope:t,children:f.jsx(oN,{scope:t,onNativeOptionAdd:J,onNativeOptionRemove:te,children:RN(_)?_(D):r})})})})}h1.displayName=cN;var m1=e=>{const{__scopeSelect:t,children:r,...i}=e;return f.jsx(h1,{__scopeSelect:t,...i,internal_do_not_use_render:({isFormControl:o})=>f.jsxs(f.Fragment,{children:[r,o?f.jsx(F1,{__scopeSelect:t}):null]})})};m1.displayName=Ti;var p1="SelectTrigger",g1=S.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:i=!1,...o}=e,l=Zu(r),u=Qa(p1,r),d=u.disabled||i,m=at(t,u.onTriggerChange),p=Gu(r),y=S.useRef("touch"),[v,b,x]=V1(_=>{const E=p().filter(O=>!O.disabled),R=E.find(O=>O.value===u.value),T=U1(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(Dp,{asChild:!0,...l,children:f.jsx(Pe.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":Ku(u.value)?"":void 0,...o,ref:m,onClick:Te(o.onClick,_=>{_.currentTarget.focus(),y.current!=="mouse"&&w(_)}),onPointerDown:Te(o.onPointerDown,_=>{y.current=_.pointerType;const E=_.target;E.hasPointerCapture(_.pointerId)&&E.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(w(_),_.preventDefault())}),onKeyDown:Te(o.onKeyDown,_=>{const E=v.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&b(_.key),!(E&&_.key===" ")&&rN.includes(_.key)&&(w(),_.preventDefault())})})})});g1.displayName=p1;var v1="SelectValue",y1=S.forwardRef((e,t)=>{const{__scopeSelect:r,className:i,style:o,children:l,placeholder:u="",...d}=e,m=Qa(v1,r),{onValueNodeHasChildrenChange:p}=m,y=l!==void 0,v=at(t,m.onValueNodeChange);Qt(()=>{p(y)},[p,y]);const b=Ku(m.value);return f.jsx(Pe.span,{...d,asChild:b?!1:d.asChild,ref:v,style:{pointerEvents:"none"},children:f.jsx(S.Fragment,{children:b?u:l},b?"placeholder":"value")})});y1.displayName=v1;var uN="SelectIcon",b1=S.forwardRef((e,t)=>{const{__scopeSelect:r,children:i,...o}=e;return f.jsx(Pe.span,{"aria-hidden":!0,...o,ref:t,children:i||"▼"})});b1.displayName=uN;var x1="SelectPortal",[dN,fN]=Ii(x1,{forceMount:void 0}),w1=e=>{const{__scopeSelect:t,forceMount:r,...i}=e;return f.jsx(dN,{scope:e.__scopeSelect,forceMount:r,children:f.jsx(xl,{asChild:!0,...i})})};w1.displayName=x1;var qa="SelectContent",S1=S.forwardRef((e,t)=>{const r=fN(qa,e.__scopeSelect),{forceMount:i=r.forceMount,...o}=e,l=Qa(qa,e.__scopeSelect),[u,d]=S.useState();return Qt(()=>{d(new DocumentFragment)},[]),f.jsx(gr,{present:i||l.open,children:({present:m})=>m?f.jsx(E1,{...o,ref:t}):f.jsx(_1,{...o,fragment:u})})});S1.displayName=qa;var _1=S.forwardRef((e,t)=>{const{__scopeSelect:r,children:i,fragment:o}=e;return o?zi.createPortal(f.jsx(C1,{scope:r,children:f.jsx(qu.Slot,{scope:r,children:f.jsx("div",{ref:t,children:i})})}),o):null});_1.displayName="SelectContentFragment";var dr=10,[C1,Xa]=Ii(qa),hN="SelectContentImpl",mN=Ei("SelectContent.RemoveScroll"),E1=S.forwardRef((e,t)=>{const{__scopeSelect:r}=e,{position:i="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:u,side:d,sideOffset:m,align:p,alignOffset:y,arrowPadding:v,collisionBoundary:b,collisionPadding:x,sticky:w,hideWhenDetached:_,avoidCollisions:E,...R}=e,T=Qa(qa,r),[O,M]=S.useState(null),[k,B]=S.useState(null),V=at(t,M),[P,pe]=S.useState(null),[ne,ce]=S.useState(null),me=Gu(r),[fe,Z]=S.useState(!1),Se=S.useRef(!1);S.useEffect(()=>{if(O)return gp(O)},[O]),pp();const L=S.useCallback(re=>{const[be,...xe]=me().map(He=>He.ref.current),[Me]=xe.slice(-1),Fe=document.activeElement;for(const He of re)if(He===Fe||(He?.scrollIntoView({block:"nearest"}),He===be&&k&&(k.scrollTop=0),He===Me&&k&&(k.scrollTop=k.scrollHeight),He?.focus(),document.activeElement!==Fe))return},[me,k]),K=S.useCallback(()=>L([P,O]),[L,P,O]);S.useEffect(()=>{fe&&K()},[fe,K]);const{onOpenChange:ie,triggerPointerDownPosRef:J}=T;S.useEffect(()=>{if(O){let re={x:0,y:0};const be=Me=>{re={x:Math.abs(Math.round(Me.pageX)-(J.current?.x??0)),y:Math.abs(Math.round(Me.pageY)-(J.current?.y??0))}},xe=Me=>{re.x<=10&&re.y<=10?Me.preventDefault():Me.composedPath().includes(O)||ie(!1),document.removeEventListener("pointermove",be),J.current=null};return J.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",xe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",xe,{capture:!0})}}},[O,ie,J]),S.useEffect(()=>{const re=()=>ie(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[ie]);const[te,D]=V1(re=>{const be=me().filter(Fe=>!Fe.disabled),xe=be.find(Fe=>Fe.ref.current===document.activeElement),Me=U1(be,re,xe);Me&&setTimeout(()=>Me.ref.current?.focus())}),N=S.useCallback((re,be,xe)=>{const Me=!Se.current&&!xe;(T.value!==void 0&&T.value===be||Me)&&(pe(re),Me&&(Se.current=!0))},[T.value]),H=S.useCallback(()=>O?.focus(),[O]),X=S.useCallback((re,be,xe)=>{const Me=!Se.current&&!xe;(T.value!==void 0&&T.value===be||Me)&&ce(re)},[T.value]),Y=i==="popper"?Tm:R1,he=Y===Tm?{side:d,sideOffset:m,align:p,alignOffset:y,arrowPadding:v,collisionBoundary:b,collisionPadding:x,sticky:w,hideWhenDetached:_,avoidCollisions:E}:{};return f.jsx(C1,{scope:r,content:O,viewport:k,onViewportChange:B,itemRefCallback:N,selectedItem:P,onItemLeave:H,itemTextRefCallback:X,focusSelectedItem:K,selectedItemText:ne,position:i,isPositioned:fe,searchRef:te,children:f.jsx(zu,{as:mN,allowPinchZoom:!0,children:f.jsx(Du,{asChild:!0,trapped:T.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:Te(o,re=>{T.trigger?.focus({preventScroll:!0}),re.preventDefault()}),children:f.jsx(bl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:f.jsx(Y,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:re=>re.preventDefault(),...R,...he,onPlaced:()=>Z(!0),ref:V,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Te(R.onKeyDown,re=>{const be=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!be&&re.key.length===1&&D(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let Me=me().filter(Fe=>!Fe.disabled).map(Fe=>Fe.ref.current);if(["ArrowUp","End"].includes(re.key)&&(Me=Me.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const Fe=re.target,He=Me.indexOf(Fe);Me=Me.slice(He+1)}setTimeout(()=>L(Me)),re.preventDefault()}})})})})})})});E1.displayName=hN;var pN="SelectItemAlignedPosition",R1=S.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:i,...o}=e,l=Qa(qa,r),u=Xa(qa,r),[d,m]=S.useState(null),[p,y]=S.useState(null),v=at(t,y),b=Gu(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&&p&&_&&E&&R){const V=l.trigger.getBoundingClientRect(),P=p.getBoundingClientRect(),pe=l.valueNode.getBoundingClientRect(),ne=R.getBoundingClientRect();if(l.dir!=="rtl"){const Fe=ne.left-P.left,He=pe.left-Fe,ct=V.left-He,Je=V.width+ct,hn=Math.max(Je,P.width),mn=window.innerWidth-dr,Xt=ax(He,[dr,Math.max(dr,mn-hn)]);d.style.minWidth=Je+"px",d.style.left=Xt+"px"}else{const Fe=P.right-ne.right,He=window.innerWidth-pe.right-Fe,ct=window.innerWidth-V.right-He,Je=V.width+ct,hn=Math.max(Je,P.width),mn=window.innerWidth-dr,Xt=ax(He,[dr,Math.max(dr,mn-hn)]);d.style.minWidth=Je+"px",d.style.right=Xt+"px"}const ce=b(),me=window.innerHeight-dr*2,fe=_.scrollHeight,Z=window.getComputedStyle(p),Se=parseInt(Z.borderTopWidth,10),L=parseInt(Z.paddingTop,10),K=parseInt(Z.borderBottomWidth,10),ie=parseInt(Z.paddingBottom,10),J=Se+L+fe+ie+K,te=Math.min(E.offsetHeight*5,J),D=window.getComputedStyle(_),N=parseInt(D.paddingTop,10),H=parseInt(D.paddingBottom,10),X=V.top+V.height/2-dr,Y=me-X,he=E.offsetHeight/2,re=E.offsetTop+he,be=Se+L+re,xe=J-be;if(be<=X){const Fe=ce.length>0&&E===ce[ce.length-1].ref.current;d.style.bottom="0px";const He=p.clientHeight-_.offsetTop-_.offsetHeight,ct=Math.max(Y,he+(Fe?H:0)+He+K),Je=be+ct;d.style.height=Je+"px"}else{const Fe=ce.length>0&&E===ce[0].ref.current;d.style.top="0px";const ct=Math.max(X,Se+_.offsetTop+(Fe?N:0)+he)+xe;d.style.height=ct+"px",_.scrollTop=be-X+_.offsetTop}d.style.margin=`${dr}px 0`,d.style.minHeight=te+"px",d.style.maxHeight=me+"px",i?.(),requestAnimationFrame(()=>x.current=!0)}},[b,l.trigger,l.valueNode,d,p,_,E,R,l.dir,i]);Qt(()=>O(),[O]);const[M,k]=S.useState();Qt(()=>{p&&k(window.getComputedStyle(p).zIndex)},[p]);const B=S.useCallback(V=>{V&&w.current===!0&&(O(),T?.(),w.current=!1)},[O,T]);return f.jsx(vN,{scope:r,contentWrapper:d,shouldExpandOnScrollRef:x,onScrollButtonChange:B,children:f.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:f.jsx(Pe.div,{...o,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});R1.displayName=pN;var gN="SelectPopperPosition",Tm=S.forwardRef((e,t)=>{const{__scopeSelect:r,align:i="start",collisionPadding:o=dr,...l}=e,u=Zu(r);return f.jsx(kp,{...u,...l,ref:t,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)"}})});Tm.displayName=gN;var[vN,Hp]=Ii(qa,{}),Om="SelectViewport",j1=S.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:i,...o}=e,l=Xa(Om,r),u=Hp(Om,r),d=at(t,l.onViewportChange),m=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(qu.Slot,{scope:r,children:f.jsx(Pe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Te(o.onScroll,p=>{const y=p.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:b}=u;if(b?.current&&v){const x=Math.abs(m.current-y.scrollTop);if(x>0){const w=window.innerHeight-dr*2,_=parseFloat(v.style.minHeight),E=parseFloat(v.style.height),R=Math.max(_,E);if(R0?M:0,v.style.justifyContent="flex-end")}}}m.current=y.scrollTop})})})]})});j1.displayName=Om;var T1="SelectGroup",[yN,bN]=Ii(T1),xN=S.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,o=fn();return f.jsx(yN,{scope:r,id:o,children:f.jsx(Pe.div,{role:"group","aria-labelledby":o,...i,ref:t})})});xN.displayName=T1;var O1="SelectLabel",wN=S.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,o=bN(O1,r);return f.jsx(Pe.div,{id:o.id,...i,ref:t})});wN.displayName=O1;var Su="SelectItem",[SN,A1]=Ii(Su),M1=S.forwardRef((e,t)=>{const{__scopeSelect:r,value:i,disabled:o=!1,textValue:l,...u}=e,d=Qa(Su,r),m=Xa(Su,r),p=d.value===i,[y,v]=S.useState(l??""),[b,x]=S.useState(!1),w=tr(O=>m.itemRefCallback?.(O,i,o)),_=at(t,w),E=fn(),R=S.useRef("touch"),T=()=>{o||(d.onValueChange(i),d.onOpenChange(!1))};return f.jsx(SN,{scope:r,value:i,disabled:o,textId:E,isSelected:p,onItemTextChange:S.useCallback(O=>{v(M=>M||(O?.textContent??"").trim())},[]),children:f.jsx(qu.ItemSlot,{scope:r,value:i,disabled:o,textValue:y,children:f.jsx(Pe.div,{role:"option","aria-labelledby":E,"data-highlighted":b?"":void 0,"aria-selected":p&&b,"data-state":p?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...u,ref:_,onFocus:Te(u.onFocus,()=>x(!0)),onBlur:Te(u.onBlur,()=>x(!1)),onClick:Te(u.onClick,()=>{R.current!=="mouse"&&T()}),onPointerUp:Te(u.onPointerUp,()=>{R.current==="mouse"&&T()}),onPointerDown:Te(u.onPointerDown,O=>{R.current=O.pointerType}),onPointerMove:Te(u.onPointerMove,O=>{R.current=O.pointerType,o?m.onItemLeave?.():R.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(u.onPointerLeave,O=>{O.currentTarget===document.activeElement&&m.onItemLeave?.()}),onKeyDown:Te(u.onKeyDown,O=>{o||O.target!==O.currentTarget||m.searchRef?.current!==""&&O.key===" "||(aN.includes(O.key)&&T(),O.key===" "&&O.preventDefault())})})})})});M1.displayName=Su;var el="SelectItemText",N1=S.forwardRef((e,t)=>{const{__scopeSelect:r,className:i,style:o,...l}=e,u=Qa(el,r),d=Xa(el,r),m=A1(el,r),p=lN(el,r),[y,v]=S.useState(null),b=tr(T=>d.itemTextRefCallback?.(T,m.value,m.disabled)),x=at(t,v,m.onItemTextChange,b),w=y?.textContent,_=S.useMemo(()=>f.jsx("option",{value:m.value,disabled:m.disabled,children:w},m.value),[m.disabled,m.value,w]),{onNativeOptionAdd:E,onNativeOptionRemove:R}=p;return Qt(()=>(E(_),()=>R(_)),[E,R,_]),f.jsxs(f.Fragment,{children:[f.jsx(Pe.span,{id:m.textId,...l,ref:x}),m.isSelected&&u.valueNode&&!u.valueNodeHasChildren&&!Ku(u.value)?zi.createPortal(l.children,u.valueNode):null]})});N1.displayName=el;var D1="SelectItemIndicator",k1=S.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e;return A1(D1,r).isSelected?f.jsx(Pe.span,{"aria-hidden":!0,...i,ref:t}):null});k1.displayName=D1;var Am="SelectScrollUpButton",z1=S.forwardRef((e,t)=>{const r=Xa(Am,e.__scopeSelect),i=Hp(Am,e.__scopeSelect),[o,l]=S.useState(!1),u=at(t,i.onScrollButtonChange);return Qt(()=>{if(r.viewport&&r.isPositioned){let d=function(){const p=m.scrollTop>0;l(p)};const m=r.viewport;return d(),m.addEventListener("scroll",d),()=>m.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),o?f.jsx($1,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:m}=r;d&&m&&(d.scrollTop=d.scrollTop-m.offsetHeight)}}):null});z1.displayName=Am;var Mm="SelectScrollDownButton",L1=S.forwardRef((e,t)=>{const r=Xa(Mm,e.__scopeSelect),i=Hp(Mm,e.__scopeSelect),[o,l]=S.useState(!1),u=at(t,i.onScrollButtonChange);return Qt(()=>{if(r.viewport&&r.isPositioned){let d=function(){const p=m.scrollHeight-m.clientHeight,y=Math.ceil(m.scrollTop)m.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),o?f.jsx($1,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:m}=r;d&&m&&(d.scrollTop=d.scrollTop+m.offsetHeight)}}):null});L1.displayName=Mm;var $1=S.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:i,...o}=e,l=Xa("SelectScrollButton",r),u=S.useRef(null),d=Gu(r),m=S.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return S.useEffect(()=>()=>m(),[m]),Qt(()=>{d().find(y=>y.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[d]),f.jsx(Pe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Te(o.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(i,50))}),onPointerMove:Te(o.onPointerMove,()=>{l.onItemLeave?.(),u.current===null&&(u.current=window.setInterval(i,50))}),onPointerLeave:Te(o.onPointerLeave,()=>{m()})})}),_N="SelectSeparator",CN=S.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e;return f.jsx(Pe.div,{"aria-hidden":!0,...i,ref:t})});CN.displayName=_N;var I1="SelectArrow",EN=S.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,o=Zu(r);return Xa(I1,r).position==="popper"?f.jsx(zp,{...o,...i,ref:t}):null});EN.displayName=I1;var P1="SelectBubbleInput",F1=S.forwardRef(({__scopeSelect:e,...t},r)=>{const i=Qa(P1,e),{value:o,onValueChange:l,required:u,disabled:d,name:m,autoComplete:p,form:y}=i,{nativeOptions:v,nativeSelectKey:b}=i,x=S.useRef(null),w=at(r,x),_=o??"",E=sO(_),R=Array.from(v).some(T=>(T.props.value??"")==="");return S.useEffect(()=>{const T=x.current;if(!T)return;const O=window.HTMLSelectElement.prototype,k=Object.getOwnPropertyDescriptor(O,"value").set;if(E!==_&&k){const B=new Event("change",{bubbles:!0});k.call(T,_),T.dispatchEvent(B)}},[E,_]),f.jsxs(Pe.select,{"aria-hidden":!0,required:u,tabIndex:-1,name:m,autoComplete:p,disabled:d,form:y,onChange:T=>l(T.target.value),...t,style:{...Fw,...t.style},ref:w,defaultValue:_,children:[Ku(o)&&!R?f.jsx("option",{value:""}):null,Array.from(v)]},b)});F1.displayName=P1;function RN(e){return typeof e=="function"}function Ku(e){return e===""||e===void 0}function V1(e){const t=tr(e),r=S.useRef(""),i=S.useRef(0),o=S.useCallback(u=>{const d=r.current+u;t(d),(function m(p){r.current=p,window.clearTimeout(i.current),p!==""&&(i.current=window.setTimeout(()=>m(""),1e3))})(d)},[t]),l=S.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,o,l]}function U1(e,t,r){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,l=r?e.indexOf(r):-1;let u=jN(e,Math.max(l,0));o.length===1&&(u=u.filter(p=>p!==r));const m=u.find(p=>p.textValue.toLowerCase().startsWith(o.toLowerCase()));return m!==r?m:void 0}function jN(e,t){return e.map((r,i)=>e[(t+i)%e.length])}var TN="Separator",ix="horizontal",ON=["horizontal","vertical"],H1=S.forwardRef((e,t)=>{const{decorative:r,orientation:i=ix,...o}=e,l=AN(i)?i:ix,d=r?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return f.jsx(Pe.div,{"data-orientation":l,...d,...o,ref:t})});H1.displayName=TN;function AN(e){return ON.includes(e)}var MN=H1,[Yu]=Ka("Tooltip",[Ws]),Qu=Ws(),B1="TooltipProvider",NN=700,Nm="tooltip.open",[DN,Bp]=Yu(B1),q1=e=>{const{__scopeTooltip:t,delayDuration:r=NN,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:l}=e,u=S.useRef(!0),d=S.useRef(!1),m=S.useRef(0);return S.useEffect(()=>{const p=m.current;return()=>window.clearTimeout(p)},[]),f.jsx(DN,{scope:t,isOpenDelayedRef:u,delayDuration:r,onOpen:S.useCallback(()=>{i<=0||(window.clearTimeout(m.current),u.current=!1)},[i]),onClose:S.useCallback(()=>{i<=0||(window.clearTimeout(m.current),m.current=window.setTimeout(()=>u.current=!0,i))},[i]),isPointerInTransitRef:d,onPointerInTransitChange:S.useCallback(p=>{d.current=p},[]),disableHoverableContent:o,children:l})};q1.displayName=B1;var ml="Tooltip",[kN,Cl]=Yu(ml),G1=e=>{const{__scopeTooltip:t,children:r,open:i,defaultOpen:o,onOpenChange:l,disableHoverableContent:u,delayDuration:d}=e,m=Bp(ml,e.__scopeTooltip),p=Qu(t),[y,v]=S.useState(null),b=fn(),x=S.useRef(0),w=u??m.disableHoverableContent,_=d??m.delayDuration,E=S.useRef(!1),[R,T]=Zs({prop:i,defaultProp:o??!1,onChange:V=>{V?(m.onOpen(),document.dispatchEvent(new CustomEvent(Nm))):m.onClose(),l?.(V)},caller:ml}),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]),k=S.useCallback(()=>{window.clearTimeout(x.current),x.current=0,T(!1)},[T]),B=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(Np,{...p,children:f.jsx(kN,{scope:t,contentId:b,open:R,stateAttribute:O,trigger:y,onTriggerChange:v,onTriggerEnter:S.useCallback(()=>{m.isOpenDelayedRef.current?B():M()},[m.isOpenDelayedRef,B,M]),onTriggerLeave:S.useCallback(()=>{w?k():(window.clearTimeout(x.current),x.current=0)},[k,w]),onOpen:M,onClose:k,disableHoverableContent:w,children:r})})};G1.displayName=ml;var Dm="TooltipTrigger",Z1=S.forwardRef((e,t)=>{const{__scopeTooltip:r,...i}=e,o=Cl(Dm,r),l=Bp(Dm,r),u=Qu(r),d=S.useRef(null),m=at(t,d,o.onTriggerChange),p=S.useRef(!1),y=S.useRef(!1),v=S.useCallback(()=>p.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),f.jsx(Dp,{asChild:!0,...u,children:f.jsx(Pe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:m,onPointerMove:Te(e.onPointerMove,b=>{b.pointerType!=="touch"&&!y.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),y.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{o.onTriggerLeave(),y.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{o.open&&o.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Te(e.onFocus,()=>{p.current||o.onOpen()}),onBlur:Te(e.onBlur,o.onClose),onClick:Te(e.onClick,o.onClose)})})});Z1.displayName=Dm;var qp="TooltipPortal",[zN,LN]=Yu(qp,{forceMount:void 0}),K1=e=>{const{__scopeTooltip:t,forceMount:r,children:i,container:o}=e,l=Cl(qp,t);return f.jsx(zN,{scope:t,forceMount:r,children:f.jsx(gr,{present:r||l.open,children:f.jsx(xl,{asChild:!0,container:o,children:i})})})};K1.displayName=qp;var Ys="TooltipContent",Y1=S.forwardRef((e,t)=>{const r=LN(Ys,e.__scopeTooltip),{forceMount:i=r.forceMount,side:o="top",...l}=e,u=Cl(Ys,e.__scopeTooltip);return f.jsx(gr,{present:i||u.open,children:u.disableHoverableContent?f.jsx(Q1,{side:o,...l,ref:t}):f.jsx($N,{side:o,...l,ref:t})})}),$N=S.forwardRef((e,t)=>{const r=Cl(Ys,e.__scopeTooltip),i=Bp(Ys,e.__scopeTooltip),o=S.useRef(null),l=at(t,o),[u,d]=S.useState(null),{trigger:m,onClose:p}=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=VN(R,E.getBoundingClientRect()),O=UN(R,T),M=HN(_.getBoundingClientRect()),k=qN([...O,...M]);d(k),v(!0)},[v]);return S.useEffect(()=>()=>b(),[b]),S.useEffect(()=>{if(m&&y){const w=E=>x(E,y),_=E=>x(E,m);return m.addEventListener("pointerleave",w),y.addEventListener("pointerleave",_),()=>{m.removeEventListener("pointerleave",w),y.removeEventListener("pointerleave",_)}}},[m,y,x,b]),S.useEffect(()=>{if(u){const w=_=>{const E=_.target,R={x:_.clientX,y:_.clientY},T=m?.contains(E)||y?.contains(E),O=!BN(R,u);T?b():O&&(b(),p())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[m,y,u,p,b]),f.jsx(Q1,{...e,ref:l})}),[IN,PN]=Yu(ml,{isInside:!1}),FN=j2("TooltipContent"),Q1=S.forwardRef((e,t)=>{const{__scopeTooltip:r,children:i,"aria-label":o,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,m=Cl(Ys,r),p=Qu(r),{onClose:y}=m;return S.useEffect(()=>(document.addEventListener(Nm,y),()=>document.removeEventListener(Nm,y)),[y]),S.useEffect(()=>{if(m.trigger){const v=b=>{b.target instanceof Node&&b.target.contains(m.trigger)&&y()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[m.trigger,y]),f.jsx(bl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:v=>v.preventDefault(),onDismiss:y,children:f.jsxs(kp,{"data-state":m.stateAttribute,...p,...d,ref:t,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(FN,{children:i}),f.jsx(IN,{scope:r,isInside:!0,children:f.jsx(I2,{id:m.contentId,role:"tooltip",children:o||i})})]})})});Y1.displayName=Ys;var X1="TooltipArrow",J1=S.forwardRef((e,t)=>{const{__scopeTooltip:r,...i}=e,o=Qu(r);return PN(X1,r).isInside?null:f.jsx(zp,{...o,...i,ref:t})});J1.displayName=X1;function VN(e,t){const r=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),l=Math.abs(t.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 UN(e,t,r=5){const i=[];switch(t){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 HN(e){const{top:t,right:r,bottom:i,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:i},{x:o,y:i}]}function BN(e,t){const{x:r,y:i}=e;let o=!1;for(let l=0,u=t.length-1;li!=b>i&&r<(v-p)*(i-y)/(b-y)+p&&(o=!o)}return o}function qN(e){const t=e.slice();return t.sort((r,i)=>r.xi.x?1:r.yi.y?1:0),GN(t)}function GN(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const l=t[t.length-1],u=t[t.length-2];if((l.x-u.x)*(o.y-u.y)>=(l.y-u.y)*(o.x-u.x))t.pop();else break}t.push(o)}t.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(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var ZN=q1,KN=G1,YN=Z1,QN=K1,XN=Y1,JN=J1;function W1(e){var t,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(t=0;t{const r=new Array(e.length+t.length);for(let i=0;i({classGroupId:e,validator:t}),t_=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),_u="-",sx=[],tD="arbitrary..",nD=e=>{const t=aD(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return rD(u);const d=u.split(_u),m=d[0]===""&&d.length>1?1:0;return n_(d,m,t)},getConflictingClassGroupIds:(u,d)=>{if(d){const m=i[u],p=r[u];return m?p?WN(p,m):m:p||sx}return r[u]||sx}}},n_=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],l=r.nextPart.get(o);if(l){const p=n_(e,t+1,l);if(p)return p}const u=r.validators;if(u===null)return;const d=t===0?e.join(_u):e.slice(t).join(_u),m=u.length;for(let p=0;pe.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),i=t.slice(0,r);return i?tD+i:void 0})(),aD=e=>{const{theme:t,classGroups:r}=e;return iD(r,t)},iD=(e,t)=>{const r=t_();for(const i in e){const o=e[i];Gp(o,r,i,t)}return r},Gp=(e,t,r,i)=>{const o=e.length;for(let l=0;l{if(typeof e=="string"){oD(e,t,r);return}if(typeof e=="function"){lD(e,t,r,i);return}cD(e,t,r,i)},oD=(e,t,r)=>{const i=e===""?t:r_(t,e);i.classGroupId=r},lD=(e,t,r,i)=>{if(uD(e)){Gp(e(i),t,r,i);return}t.validators===null&&(t.validators=[]),t.validators.push(eD(r,e))},cD=(e,t,r,i)=>{const o=Object.entries(e),l=o.length;for(let u=0;u{let r=e;const i=t.split(_u),o=i.length;for(let l=0;l"isThemeGetter"in e&&e.isThemeGetter===!0,dD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),i=Object.create(null);const o=(l,u)=>{r[l]=u,t++,t>e&&(t=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)}}},km="!",ox=":",fD=[],lx=(e,t,r,i,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:i,isExternal:o}),hD=e=>{const{prefix:t,experimentalParseClassName:r}=e;let i=o=>{const l=[];let u=0,d=0,m=0,p;const y=o.length;for(let _=0;_m?p-m:void 0;return lx(l,x,b,w)};if(t){const o=t+ox,l=i;i=u=>u.startsWith(o)?l(u.slice(o.length)):lx(fD,!1,u,void 0,!0)}if(r){const o=i;i=l=>r({className:l,parseClassName:o})}return i},mD=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,i)=>{t.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}},pD=e=>({cache:dD(e.cacheSize),parseClassName:hD(e),sortModifiers:mD(e),postfixLookupClassGroupIds:gD(e),...nD(e)}),gD=e=>{const t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let i=0;i{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:l,postfixLookupClassGroupIds:u}=t,d=[],m=e.trim().split(vD);let p="";for(let y=m.length-1;y>=0;y-=1){const v=m[y],{isExternal:b,modifiers:x,hasImportantModifier:w,baseClassName:_,maybePostfixModifierPosition:E}=r(v);if(b){p=v+(p.length>0?" "+p:p);continue}let R=!!E,T;if(R){const V=_.substring(0,E);T=i(V);const P=T&&u[T]?i(_):void 0;P&&P!==T&&(T=P,R=!1)}else T=i(_);if(!T){if(!R){p=v+(p.length>0?" "+p:p);continue}if(T=i(_),!T){p=v+(p.length>0?" "+p:p);continue}R=!1}const O=x.length===0?"":x.length===1?x[0]:l(x).join(":"),M=w?O+km:O,k=M+T;if(d.indexOf(k)>-1)continue;d.push(k);const B=o(T,R);for(let V=0;V0?" "+p:p)}return p},bD=(...e)=>{let t=0,r,i,o="";for(;t{if(typeof e=="string")return e;let t,r="";for(let i=0;i{let r,i,o,l;const u=m=>{const p=t.reduce((y,v)=>v(y),e());return r=pD(p),i=r.cache.get,o=r.cache.set,l=d,d(m)},d=m=>{const p=i(m);if(p)return p;const y=yD(m,r);return o(m,y),y};return l=u,(...m)=>l(bD(...m))},wD=[],Bt=e=>{const t=r=>r[e]||wD;return t.isThemeGetter=!0,t},i_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,s_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,SD=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_D=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,CD=/\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$/,ED=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,RD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Da=e=>SD.test(e),Ge=e=>!!e&&!Number.isNaN(Number(e)),Cr=e=>!!e&&Number.isInteger(Number(e)),qh=e=>e.endsWith("%")&&Ge(e.slice(0,-1)),Jr=e=>_D.test(e),o_=()=>!0,TD=e=>CD.test(e)&&!ED.test(e),Zp=()=>!1,OD=e=>RD.test(e),AD=e=>jD.test(e),MD=e=>!Ce(e)&&!Ee(e),ND=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)),DD=e=>Ja(e,u_,Zp),Ce=e=>i_.test(e),xi=e=>Ja(e,d_,TD),cx=e=>Ja(e,VD,Ge),kD=e=>Ja(e,h_,o_),zD=e=>Ja(e,f_,Zp),ux=e=>Ja(e,l_,Zp),LD=e=>Ja(e,c_,AD),Qc=e=>Ja(e,m_,OD),Ee=e=>s_.test(e),Ko=e=>Pi(e,d_),$D=e=>Pi(e,f_),dx=e=>Pi(e,l_),ID=e=>Pi(e,u_),PD=e=>Pi(e,c_),Xc=e=>Pi(e,m_,!0),FD=e=>Pi(e,h_,!0),Ja=(e,t,r)=>{const i=i_.exec(e);return i?i[1]?t(i[1]):r(i[2]):!1},Pi=(e,t,r=!1)=>{const i=s_.exec(e);return i?i[1]?t(i[1]):r:!1},l_=e=>e==="position"||e==="percentage",c_=e=>e==="image"||e==="url",u_=e=>e==="length"||e==="size"||e==="bg-size",d_=e=>e==="length",VD=e=>e==="number",f_=e=>e==="family-name",h_=e=>e==="number"||e==="weight",m_=e=>e==="shadow",UD=()=>{const e=Bt("color"),t=Bt("font"),r=Bt("text"),i=Bt("font-weight"),o=Bt("tracking"),l=Bt("leading"),u=Bt("breakpoint"),d=Bt("container"),m=Bt("spacing"),p=Bt("radius"),y=Bt("shadow"),v=Bt("inset-shadow"),b=Bt("text-shadow"),x=Bt("drop-shadow"),w=Bt("blur"),_=Bt("perspective"),E=Bt("aspect"),R=Bt("ease"),T=Bt("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"],k=()=>[...M(),Ee,Ce],B=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto","contain","none"],P=()=>[Ee,Ce,m],pe=()=>[Da,"full","auto",...P()],ne=()=>[Cr,"none","subgrid",Ee,Ce],ce=()=>["auto",{span:["full",Cr,Ee,Ce]},Cr,Ee,Ce],me=()=>[Cr,"auto",Ee,Ce],fe=()=>["auto","min","max","fr",Ee,Ce],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Se=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...P()],K=()=>[Da,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],ie=()=>[Da,"screen","full","dvw","lvw","svw","min","max","fit",...P()],J=()=>[Da,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],te=()=>[e,Ee,Ce],D=()=>[...M(),dx,ux,{position:[Ee,Ce]}],N=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",ID,DD,{size:[Ee,Ce]}],X=()=>[qh,Ko,xi],Y=()=>["","none","full",p,Ee,Ce],he=()=>["",Ge,Ko,xi],re=()=>["solid","dashed","dotted","double"],be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[Ge,qh,dx,ux],Me=()=>["","none",w,Ee,Ce],Fe=()=>["none",Ge,Ee,Ce],He=()=>["none",Ge,Ee,Ce],ct=()=>[Ge,Ee,Ce],Je=()=>[Da,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jr],breakpoint:[Jr],color:[o_],container:[Jr],"drop-shadow":[Jr],ease:["in","out","in-out"],font:[MD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jr],shadow:[Jr],spacing:["px",Ge],text:[Jr],"text-shadow":[Jr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Da,Ce,Ee,E]}],container:["container"],"container-type":[{"@container":["","normal","size",Ee,Ce]}],"container-named":[ND],columns:[{columns:[Ge,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:k()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:pe()}],"inset-x":[{"inset-x":pe()}],"inset-y":[{"inset-y":pe()}],start:[{"inset-s":pe(),start:pe()}],end:[{"inset-e":pe(),end:pe()}],"inset-bs":[{"inset-bs":pe()}],"inset-be":[{"inset-be":pe()}],top:[{top:pe()}],right:[{right:pe()}],bottom:[{bottom:pe()}],left:[{left:pe()}],visibility:["visible","invisible","collapse"],z:[{z:[Cr,"auto",Ee,Ce]}],basis:[{basis:[Da,"full","auto",d,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ge,Da,"auto","initial","none",Ce]}],grow:[{grow:["",Ge,Ee,Ce]}],shrink:[{shrink:["",Ge,Ee,Ce]}],order:[{order:[Cr,"first","last","none",Ee,Ce]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:ce()}],"col-start":[{"col-start":me()}],"col-end":[{"col-end":me()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:ce()}],"row-start":[{"row-start":me()}],"row-end":[{"row-end":me()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":fe()}],"auto-rows":[{"auto-rows":fe()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...Se(),"normal"]}],"justify-self":[{"justify-self":["auto",...Se()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...Se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Se(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...Se(),"baseline"]}],"place-self":[{"place-self":["auto",...Se()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],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":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...ie()]}],"min-inline-size":[{"min-inline":["auto",...ie()]}],"max-inline-size":[{"max-inline":["none",...ie()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[d,"screen",...K()]}],"min-w":[{"min-w":[d,"screen","none",...K()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",r,Ko,xi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,FD,kD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qh,Ce]}],"font-family":[{font:[$D,zD,t]}],"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":[Ge,"none",Ee,cx]}],leading:[{leading:[l,...P()]}],"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:te()}],"text-color":[{text:te()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ge,"from-font","auto",Ee,xi]}],"text-decoration-color":[{decoration:te()}],"underline-offset":[{"underline-offset":[Ge,"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:P()}],"tab-size":[{tab:[Cr,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:D()}],"bg-repeat":[{bg:N()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Cr,Ee,Ce],radial:["",Ee,Ce],conic:[Cr,Ee,Ce]},PD,LD]}],"bg-color":[{bg:te()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:te()}],"gradient-via":[{via:te()}],"gradient-to":[{to:te()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:te()}],"border-color-x":[{"border-x":te()}],"border-color-y":[{"border-y":te()}],"border-color-s":[{"border-s":te()}],"border-color-e":[{"border-e":te()}],"border-color-bs":[{"border-bs":te()}],"border-color-be":[{"border-be":te()}],"border-color-t":[{"border-t":te()}],"border-color-r":[{"border-r":te()}],"border-color-b":[{"border-b":te()}],"border-color-l":[{"border-l":te()}],"divide-color":[{divide:te()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ge,Ee,Ce]}],"outline-w":[{outline:["",Ge,Ko,xi]}],"outline-color":[{outline:te()}],shadow:[{shadow:["","none",y,Xc,Qc]}],"shadow-color":[{shadow:te()}],"inset-shadow":[{"inset-shadow":["none",v,Xc,Qc]}],"inset-shadow-color":[{"inset-shadow":te()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:te()}],"ring-offset-w":[{"ring-offset":[Ge,xi]}],"ring-offset-color":[{"ring-offset":te()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":te()}],"text-shadow":[{"text-shadow":["none",b,Xc,Qc]}],"text-shadow-color":[{"text-shadow":te()}],opacity:[{opacity:[Ge,Ee,Ce]}],"mix-blend":[{"mix-blend":[...be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":be()}],"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":[Ge]}],"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":te()}],"mask-image-linear-to-color":[{"mask-linear-to":te()}],"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":te()}],"mask-image-t-to-color":[{"mask-t-to":te()}],"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":te()}],"mask-image-r-to-color":[{"mask-r-to":te()}],"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":te()}],"mask-image-b-to-color":[{"mask-b-to":te()}],"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":te()}],"mask-image-l-to-color":[{"mask-l-to":te()}],"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":te()}],"mask-image-x-to-color":[{"mask-x-to":te()}],"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":te()}],"mask-image-y-to-color":[{"mask-y-to":te()}],"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":te()}],"mask-image-radial-to-color":[{"mask-radial-to":te()}],"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":[Ge]}],"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":te()}],"mask-image-conic-to-color":[{"mask-conic-to":te()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:N()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ce]}],filter:[{filter:["","none",Ee,Ce]}],blur:[{blur:Me()}],brightness:[{brightness:[Ge,Ee,Ce]}],contrast:[{contrast:[Ge,Ee,Ce]}],"drop-shadow":[{"drop-shadow":["","none",x,Xc,Qc]}],"drop-shadow-color":[{"drop-shadow":te()}],grayscale:[{grayscale:["",Ge,Ee,Ce]}],"hue-rotate":[{"hue-rotate":[Ge,Ee,Ce]}],invert:[{invert:["",Ge,Ee,Ce]}],saturate:[{saturate:[Ge,Ee,Ce]}],sepia:[{sepia:["",Ge,Ee,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ce]}],"backdrop-blur":[{"backdrop-blur":Me()}],"backdrop-brightness":[{"backdrop-brightness":[Ge,Ee,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[Ge,Ee,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ge,Ee,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ge,Ee,Ce]}],"backdrop-invert":[{"backdrop-invert":["",Ge,Ee,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[Ge,Ee,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[Ge,Ee,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Ge,Ee,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"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:[Ge,"initial",Ee,Ce]}],ease:[{ease:["linear","initial",R,Ee,Ce]}],delay:[{delay:[Ge,Ee,Ce]}],animate:[{animate:["none",T,Ee,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Ee,Ce]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:Fe()}],"rotate-x":[{"rotate-x":Fe()}],"rotate-y":[{"rotate-y":Fe()}],"rotate-z":[{"rotate-z":Fe()}],scale:[{scale:He()}],"scale-x":[{"scale-x":He()}],"scale-y":[{"scale-y":He()}],"scale-z":[{"scale-z":He()}],"scale-3d":["scale-3d"],skew:[{skew:ct()}],"skew-x":[{"skew-x":ct()}],"skew-y":[{"skew-y":ct()}],transform:[{transform:[Ee,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Je()}],"translate-x":[{"translate-x":Je()}],"translate-y":[{"translate-y":Je()}],"translate-z":[{"translate-z":Je()}],"translate-none":["translate-none"],zoom:[{zoom:[Cr,Ee,Ce]}],accent:[{accent:te()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:te()}],"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":te()}],"scrollbar-track-color":[{"scrollbar-track":te()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",...te()]}],"stroke-w":[{stroke:[Ge,Ko,xi,cx]}],stroke:[{stroke:["none",...te()]}],"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"]}},HD=xD(UD);function We(...e){return HD(e_(e))}function BD({delayDuration:e=0,...t}){return f.jsx(ZN,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function qD({...e}){return f.jsx(KN,{"data-slot":"tooltip",...e})}function GD({...e}){return f.jsx(YN,{"data-slot":"tooltip-trigger",...e})}function ZD({className:e,sideOffset:t=0,children:r,...i}){return f.jsx(QN,{children:f.jsxs(XN,{"data-slot":"tooltip-content",sideOffset:t,className:We("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(JN,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const zm=new Set;function KD(e){return zm.add(e),()=>zm.delete(e)}function YD(){for(const e of zm)e()}const p_=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim();const QD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const XD=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase());const fx=e=>{const t=XD(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Gh={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 JD=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},WD=S.createContext({}),ek=()=>S.useContext(WD),tk=S.forwardRef(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:i,className:o="",children:l,iconNode:u,...d},m)=>{const{size:p=24,strokeWidth:y=2,absoluteStrokeWidth:v=!1,color:b="currentColor",className:x=""}=ek()??{},w=i??v?Number(r??y)*24/Number(t??p):r??y;return S.createElement("svg",{ref:m,...Gh,width:t??p??Gh.width,height:t??p??Gh.height,stroke:e??b,strokeWidth:w,className:p_("lucide",x,o),...!l&&!JD(d)&&{"aria-hidden":"true"},...d},[...u.map(([_,E])=>S.createElement(_,E)),...Array.isArray(l)?l:[l]])});const De=(e,t)=>{const r=S.forwardRef(({className:i,...o},l)=>S.createElement(tk,{ref:l,iconNode:t,className:p_(`lucide-${QD(fx(e))}`,`lucide-${e}`,i),...o}));return r.displayName=fx(e),r};const nk=[["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"}]],rk=De("beaker",nk);const ak=[["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"}]],ik=De("book-open",ak);const sk=[["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"}]],ok=De("briefcase",sk);const lk=[["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"}]],ck=De("bug",lk);const uk=[["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"}]],dk=De("calendar",uk);const fk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],g_=De("check",fk);const hk=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Kp=De("chevron-down",hk);const mk=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],pk=De("chevron-right",mk);const gk=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],vk=De("chevron-up",gk);const yk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],bk=De("circle-check",yk);const xk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],v_=De("clock",xk);const wk=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Sk=De("code",wk);const _k=[["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"}]],Ck=De("compass",_k);const Ek=[["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"}]],Rk=De("copy",Ek);const jk=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Tk=De("credit-card",jk);const Ok=[["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"}]],Ak=De("database",Ok);const Mk=[["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"}]],Nk=De("download",Mk);const Dk=[["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"}]],kk=De("ellipsis",Dk);const zk=[["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"}]],y_=De("file-text",zk);const Lk=[["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"}]],$k=De("flag",Lk);const Ik=[["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"}]],Yp=De("folder",Ik);const Pk=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Fk=De("gauge",Pk);const Vk=[["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"}]],Uk=De("gavel",Vk);const Hk=[["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"}]],b_=De("globe",Hk);const Bk=[["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"}]],qk=De("graduation-cap",Bk);const Gk=[["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"}]],Zk=De("heart",Gk);const Kk=[["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"}]],Yk=De("history",Kk);const Qk=[["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"}]],Xk=De("image",Qk);const Jk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Wk=De("info",Jk);const ez=[["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"}]],tz=De("layout-dashboard",ez);const nz=[["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"}]],rz=De("lightbulb",nz);const az=[["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"}]],iz=De("link",az);const sz=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],oz=De("loader-circle",sz);const lz=[["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"}]],x_=De("lock",lz);const cz=[["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"}]],uz=De("log-out",cz);const dz=[["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"}]],fz=De("megaphone",dz);const hz=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],mz=De("menu",hz);const pz=[["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"}]],gz=De("music",pz);const vz=[["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"}]],yz=De("octagon-x",vz);const bz=[["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"}]],xz=De("package",bz);const wz=[["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"}]],Sz=De("pen-line",wz);const _z=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Cz=De("plus",_z);const Ez=[["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"}]],Rz=De("rocket",Ez);const jz=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],w_=De("search",jz);const Tz=[["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"}]],Oz=De("settings",Tz);const Az=[["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"}]],Mz=De("share-2",Az);const Nz=[["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"}]],S_=De("shield",Nz);const Dz=[["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"}]],__=De("square-terminal",Dz);const kz=[["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"}]],zz=De("star",kz);const Lz=[["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"}]],$z=De("trash-2",Lz);const Iz=[["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"}]],C_=De("triangle-alert",Iz);const Pz=[["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"}]],Fz=De("upload",Pz);const Vz=[["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"}]],E_=De("users",Vz);const Uz=[["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"}]],Hz=De("wrench",Uz);const Bz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],R_=De("x",Bz);function qz(){const e=!document.body.classList.contains("sb-open");document.body.classList.toggle("sb-open"),Xu(),e?document.getElementById("sidebar")?.querySelector(Gz)?.focus():document.getElementById("menu-btn")?.focus()}const Gz='a[href], button:not(:disabled), select, input, [tabindex]:not([tabindex="-1"])';function hr(){const e=document.body.classList.contains("sb-open");document.body.classList.remove("sb-open"),Xu(),e&&window.innerWidth<=cu&&document.getElementById("menu-btn")?.focus()}const cu=900;function Xu(){const e=document.getElementById("sidebar");if(!e)return;const t=document.body.classList.contains("sb-open");window.innerWidth<=cu&&!t?e.setAttribute("inert",""):e.removeAttribute("inert");const i=document.getElementById("main");i&&(t&&window.innerWidth<=cu?i.setAttribute("inert",""):i.removeAttribute("inert")),e.setAttribute("aria-modal",String(t&&window.innerWidth<=cu)),document.getElementById("menu-btn")?.setAttribute("aria-expanded",String(t))}typeof window<"u"&&(window.addEventListener("resize",Xu),window.addEventListener("keydown",e=>{e.key==="Escape"&&document.body.classList.contains("sb-open")&&hr()}));const Zz={alert:C_,card:Tk,check:g_,chev:pk,chevd:Kp,clock:v_,copy:Rk,doc:y_,dots:kk,download:Nk,folder:Yp,dashboard:tz,gear:Oz,globe:b_,hist:Yk,link:iz,lock:x_,menu:mz,plus:Cz,power:uz,search:w_,share:Mz,shield:S_,terminal:__,trash:$z,upload:Fz,users:E_,x:R_};function nt({name:e}){const t=Zz[e];return t?f.jsx(t,{className:"ico","aria-hidden":"true"}):null}const Lm={folder:Yp,"book-open":ik,"file-text":y_,"pen-line":Sz,users:E_,briefcase:ok,megaphone:fz,rocket:Rz,lightbulb:rz,flag:$k,star:zz,heart:Zk,code:Sk,"square-terminal":__,bug:ck,wrench:Hz,database:Ak,package:xz,beaker:rk,gauge:Fk,shield:S_,lock:x_,gavel:Uk,globe:b_,compass:Ck,calendar:dk,clock:v_,"graduation-cap":qk,image:Xk,music:gz};function Vs({name:e,className:t}){const r=e??"",i=Object.hasOwn(Lm,r)?Lm[r]:Yp;return f.jsx(i,{className:t,"aria-hidden":"true"})}function Kz({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 al(e){const t=["page",e.width??"app",e.className].filter(Boolean).join(" ");return f.jsx("div",{className:t,children:e.children})}function Yz(e){e&&Xu()}function Us(e){return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"sb-backdrop",onClick:hr}),f.jsxs("aside",{id:"sidebar",ref:Yz,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 Ju(e){const{name:t,onHome:r,showSignout:i,search:o,beta:l}=e;return f.jsxs("header",{id:"vault",children:[f.jsx("span",{id:"vault-badge",children:f.jsx(Kz,{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:u=>{r&&(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),r())},children:t}),l&&f.jsx("span",{id:"vault-beta",children:"Beta"}),f.jsxs("div",{className:"vault-actions",children:[o&&f.jsxs(qD,{delayDuration:150,children:[f.jsx(GD,{asChild:!0,children:f.jsx("button",{id:"search-btn",className:"icon-btn2","aria-label":"Search",onClick:()=>{YD(),hr()},children:f.jsx(nt,{name:"search"})})}),f.jsxs(ZD,{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(nt,{name:"power"})})]})]})}function Hs(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:qz,children:f.jsx(nt,{name:"menu"})}),f.jsx("span",{id:"crumb",children:e.crumb}),f.jsx("span",{id:"meta",children:e.meta}),e.actions]})}function Qz(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const Xz=e=>{switch(e){case"success":return e3;case"info":return n3;case"warning":return t3;case"error":return r3;default:return null}},Jz=Array(12).fill(0),Wz=({visible:e,className:t})=>ve.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ve.createElement("div",{className:"sonner-spinner"},Jz.map((r,i)=>ve.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),e3=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),t3=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ve.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"})),n3=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),r3=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),a3=ve.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"},ve.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ve.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),i3=()=>{const[e,t]=ve.useState(document.hidden);return ve.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let $m=1;class s3{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:i,...o}=t,l=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:$m++,u=this.toasts.find(m=>m.id===l),d=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),u?this.toasts=this.toasts.map(m=>m.id===l?(this.publish({...m,...t,id:l,title:i}),{...m,...t,id:l,dismissible:d,title:i}):m):this.addToast({title:i,...o,dismissible:d,id:l}),l},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(i=>i({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let i;r.loading!==void 0&&(i=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let l=i!==void 0,u;const d=o.then(async p=>{if(u=["resolve",p],ve.isValidElement(p))l=!1,this.create({id:i,type:"default",message:p});else if(l3(p)&&!p.ok){l=!1;const v=typeof r.error=="function"?await r.error(`HTTP error! status: ${p.status}`):r.error,b=typeof r.description=="function"?await r.description(`HTTP error! status: ${p.status}`):r.description,w=typeof v=="object"&&!ve.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:b,...w})}else if(p instanceof Error){l=!1;const v=typeof r.error=="function"?await r.error(p):r.error,b=typeof r.description=="function"?await r.description(p):r.description,w=typeof v=="object"&&!ve.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(p):r.success,b=typeof r.description=="function"?await r.description(p):r.description,w=typeof v=="object"&&!ve.isValidElement(v)?v:{message:v};this.create({id:i,type:"success",description:b,...w})}}).catch(async p=>{if(u=["reject",p],r.error!==void 0){l=!1;const y=typeof r.error=="function"?await r.error(p):r.error,v=typeof r.description=="function"?await r.description(p):r.description,x=typeof y=="object"&&!ve.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)}),m=()=>new Promise((p,y)=>d.then(()=>u[0]==="reject"?y(u[1]):p(u[1])).catch(y));return typeof i!="string"&&typeof i!="number"?{unwrap:m}:Object.assign(i,{unwrap:m})},this.custom=(t,r)=>{const i=r?.id||$m++;return this.create({jsx:t(i),id:i,...r}),i},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Tn=new s3,o3=(e,t)=>{const r=t?.id||$m++;return Tn.addToast({title:e,...t,id:r}),r},l3=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",c3=o3,u3=()=>Tn.toasts,d3=()=>Tn.getActiveToasts(),hx=Object.assign(c3,{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:u3,getToasts:d3});Qz("[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 Jc(e){return e.label!==void 0}const f3=3,h3="24px",m3="16px",mx=4e3,p3=356,g3=14,v3=45,y3=200;function Er(...e){return e.filter(Boolean).join(" ")}function b3(e){const[t,r]=e.split("-"),i=[];return t&&i.push(t),r&&i.push(r),i}const x3=e=>{var t,r,i,o,l,u,d,m,p;const{invert:y,toast:v,unstyled:b,interacting:x,setHeights:w,visibleToasts:_,heights:E,index:R,toasts:T,expanded:O,removeToast:M,defaultRichColors:k,closeButton:B,style:V,cancelButtonStyle:P,actionButtonStyle:pe,className:ne="",descriptionClassName:ce="",duration:me,position:fe,gap:Z,expandByDefault:Se,classNames:L,icons:K,closeButtonAriaLabel:ie="Close toast"}=e,[J,te]=ve.useState(null),[D,N]=ve.useState(null),[H,X]=ve.useState(!1),[Y,he]=ve.useState(!1),[re,be]=ve.useState(!1),[xe,Me]=ve.useState(!1),[Fe,He]=ve.useState(!1),[ct,Je]=ve.useState(0),[hn,mn]=ve.useState(0),Xt=ve.useRef(v.duration||me||mx),yr=ve.useRef(null),At=ve.useRef(null),rr=R===0,br=R+1<=_,Rt=v.type,Vn=v.dismissible!==!1,zt=v.className||"",Dr=v.descriptionClassName||"",ar=ve.useMemo(()=>E.findIndex(Ae=>Ae.toastId===v.id)||0,[E,v.id]),oa=ve.useMemo(()=>{var Ae;return(Ae=v.closeButton)!=null?Ae:B},[v.closeButton,B]),ir=ve.useMemo(()=>v.duration||me||mx,[v.duration,me]),la=ve.useRef(0),Jt=ve.useRef(0),A=ve.useRef(0),I=ve.useRef(null),[F,de]=fe.split("-"),oe=ve.useMemo(()=>E.reduce((Ae,ut,st)=>st>=ar?Ae:Ae+ut.height,0),[E,ar]),ye=i3(),we=v.invert||y,ee=Rt==="loading";Jt.current=ve.useMemo(()=>ar*Z+oe,[ar,oe]),ve.useEffect(()=>{Xt.current=ir},[ir]),ve.useEffect(()=>{X(!0)},[]),ve.useEffect(()=>{const Ae=At.current;if(Ae){const ut=Ae.getBoundingClientRect().height;return mn(ut),w(st=>[{toastId:v.id,height:ut,position:v.position},...st]),()=>w(st=>st.filter(Gt=>Gt.toastId!==v.id))}},[w,v.id]),ve.useLayoutEffect(()=>{if(!H)return;const Ae=At.current,ut=Ae.style.height;Ae.style.height="auto";const st=Ae.getBoundingClientRect().height;Ae.style.height=ut,mn(st),w(Gt=>Gt.find(Ct=>Ct.toastId===v.id)?Gt.map(Ct=>Ct.toastId===v.id?{...Ct,height:st}:Ct):[{toastId:v.id,height:st,position:v.position},...Gt])},[H,v.title,v.description,w,v.id,v.jsx,v.action,v.cancel]);const le=ve.useCallback(()=>{he(!0),Je(Jt.current),w(Ae=>Ae.filter(ut=>ut.toastId!==v.id)),setTimeout(()=>{M(v)},y3)},[v,M,w,Jt]);ve.useEffect(()=>{if(v.promise&&Rt==="loading"||v.duration===1/0||v.type==="loading")return;let Ae;return O||x||ye?(()=>{if(A.current{v.onAutoClose==null||v.onAutoClose.call(v,v),le()},Xt.current)),()=>clearTimeout(Ae)},[O,x,v,Rt,ye,le]),ve.useEffect(()=>{v.delete&&(le(),v.onDismiss==null||v.onDismiss.call(v,v))},[le,v.delete]);function Re(){var Ae;if(K?.loading){var ut;return ve.createElement("div",{className:Er(L?.loader,v==null||(ut=v.classNames)==null?void 0:ut.loader,"sonner-loader"),"data-visible":Rt==="loading"},K.loading)}return ve.createElement(Wz,{className:Er(L?.loader,v==null||(Ae=v.classNames)==null?void 0:Ae.loader),visible:Rt==="loading"})}const ze=v.icon||K?.[Rt]||Xz(Rt);var it,_t;return ve.createElement("li",{tabIndex:0,ref:At,className:Er(ne,zt,L?.toast,v==null||(t=v.classNames)==null?void 0:t.toast,L?.default,L?.[Rt],v==null||(r=v.classNames)==null?void 0:r[Rt]),"data-sonner-toast":"","data-rich-colors":(it=v.richColors)!=null?it:k,"data-styled":!(v.jsx||v.unstyled||b),"data-mounted":H,"data-promise":!!v.promise,"data-swiped":Fe,"data-removed":Y,"data-visible":br,"data-y-position":F,"data-x-position":de,"data-index":R,"data-front":rr,"data-swiping":re,"data-dismissible":Vn,"data-type":Rt,"data-invert":we,"data-swipe-out":xe,"data-swipe-direction":D,"data-expanded":!!(O||Se&&H),"data-testid":v.testId,style:{"--index":R,"--toasts-before":R,"--z-index":T.length-R,"--offset":`${Y?ct:Jt.current}px`,"--initial-height":Se?"auto":`${hn}px`,...V,...v.style},onDragEnd:()=>{be(!1),te(null),I.current=null},onPointerDown:Ae=>{Ae.button!==2&&(ee||!Vn||(yr.current=new Date,Je(Jt.current),Ae.target.setPointerCapture(Ae.pointerId),Ae.target.tagName!=="BUTTON"&&(be(!0),I.current={x:Ae.clientX,y:Ae.clientY})))},onPointerUp:()=>{var Ae,ut,st;if(xe||!Vn)return;I.current=null;const Gt=Number(((Ae=At.current)==null?void 0:Ae.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),sr=Number(((ut=At.current)==null?void 0:ut.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ct=new Date().getTime()-((st=yr.current)==null?void 0:st.getTime()),yn=J==="x"?Gt:sr,ti=Math.abs(yn)/Ct;if(Math.abs(yn)>=v3||ti>.11){Je(Jt.current),v.onDismiss==null||v.onDismiss.call(v,v),N(J==="x"?Gt>0?"right":"left":sr>0?"down":"up"),le(),Me(!0);return}else{var bn,xn;(bn=At.current)==null||bn.style.setProperty("--swipe-amount-x","0px"),(xn=At.current)==null||xn.style.setProperty("--swipe-amount-y","0px")}He(!1),be(!1),te(null)},onPointerMove:Ae=>{var ut,st,Gt;if(!I.current||!Vn||((ut=window.getSelection())==null?void 0:ut.toString().length)>0)return;const Ct=Ae.clientY-I.current.y,yn=Ae.clientX-I.current.x;var ti;const bn=(ti=e.swipeDirections)!=null?ti:b3(fe);!J&&(Math.abs(yn)>1||Math.abs(Ct)>1)&&te(Math.abs(yn)>Math.abs(Ct)?"x":"y");let xn={x:0,y:0};const Vi=or=>1/(1.5+Math.abs(or)/20);if(J==="y"){if(bn.includes("top")||bn.includes("bottom"))if(bn.includes("top")&&Ct<0||bn.includes("bottom")&&Ct>0)xn.y=Ct;else{const or=Ct*Vi(Ct);xn.y=Math.abs(or)0)xn.x=yn;else{const or=yn*Vi(yn);xn.x=Math.abs(or)0||Math.abs(xn.y)>0)&&He(!0),(st=At.current)==null||st.style.setProperty("--swipe-amount-x",`${xn.x}px`),(Gt=At.current)==null||Gt.style.setProperty("--swipe-amount-y",`${xn.y}px`)}},oa&&!v.jsx&&Rt!=="loading"?ve.createElement("button",{"aria-label":ie,"data-disabled":ee,"data-close-button":!0,onClick:ee||!Vn?()=>{}:()=>{le(),v.onDismiss==null||v.onDismiss.call(v,v)},className:Er(L?.closeButton,v==null||(i=v.classNames)==null?void 0:i.closeButton)},(_t=K?.close)!=null?_t:a3):null,(Rt||v.icon||v.promise)&&v.icon!==null&&(K?.[Rt]!==null||v.icon)?ve.createElement("div",{"data-icon":"",className:Er(L?.icon,v==null||(o=v.classNames)==null?void 0:o.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||Re():null,v.type!=="loading"?ze:null):null,ve.createElement("div",{"data-content":"",className:Er(L?.content,v==null||(l=v.classNames)==null?void 0:l.content)},ve.createElement("div",{"data-title":"",className:Er(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?ve.createElement("div",{"data-description":"",className:Er(ce,Dr,L?.description,v==null||(d=v.classNames)==null?void 0:d.description)},typeof v.description=="function"?v.description():v.description):null),ve.isValidElement(v.cancel)?v.cancel:v.cancel&&Jc(v.cancel)?ve.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||P,onClick:Ae=>{Jc(v.cancel)&&Vn&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,Ae),le())},className:Er(L?.cancelButton,v==null||(m=v.classNames)==null?void 0:m.cancelButton)},v.cancel.label):null,ve.isValidElement(v.action)?v.action:v.action&&Jc(v.action)?ve.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||pe,onClick:Ae=>{Jc(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,Ae),!Ae.defaultPrevented&&le())},className:Er(L?.actionButton,v==null||(p=v.classNames)==null?void 0:p.actionButton)},v.action.label):null)};function px(){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 w3(e,t){const r={};return[e,t].forEach((i,o)=>{const l=o===1,u=l?"--mobile-offset":"--offset",d=l?m3:h3;function m(p){["top","right","bottom","left"].forEach(y=>{r[`${u}-${y}`]=typeof p=="number"?`${p}px`:p})}typeof i=="number"||typeof i=="string"?m(i):typeof i=="object"?["top","right","bottom","left"].forEach(p=>{i[p]===void 0?r[`${u}-${p}`]=d:r[`${u}-${p}`]=typeof i[p]=="number"?`${i[p]}px`:i[p]}):m(d)}),r}const S3=ve.forwardRef(function(t,r){const{id:i,invert:o,position:l="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:m,className:p,offset:y,mobileOffset:v,theme:b="light",richColors:x,duration:w,style:_,visibleToasts:E=f3,toastOptions:R,dir:T=px(),gap:O=g3,icons:M,containerAriaLabel:k="Notifications"}=t,[B,V]=ve.useState([]),P=ve.useMemo(()=>i?B.filter(H=>H.toasterId===i):B.filter(H=>!H.toasterId),[B,i]),pe=ve.useMemo(()=>Array.from(new Set([l].concat(P.filter(H=>H.position).map(H=>H.position)))),[P,l]),[ne,ce]=ve.useState([]),[me,fe]=ve.useState(!1),[Z,Se]=ve.useState(!1),[L,K]=ve.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ie=ve.useRef(null),J=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),te=ve.useRef(null),D=ve.useRef(!1),N=ve.useCallback(H=>{V(X=>{var Y;return(Y=X.find(he=>he.id===H.id))!=null&&Y.delete||Tn.dismiss(H.id),X.filter(({id:he})=>he!==H.id)})},[]);return ve.useEffect(()=>Tn.subscribe(H=>{if(H.dismiss){requestAnimationFrame(()=>{V(X=>X.map(Y=>Y.id===H.id?{...Y,delete:!0}:Y))});return}setTimeout(()=>{E2.flushSync(()=>{V(X=>{const Y=X.findIndex(he=>he.id===H.id);return Y!==-1?[...X.slice(0,Y),{...X[Y],...H},...X.slice(Y+1)]:[H,...X]})})})}),[B]),ve.useEffect(()=>{if(b!=="system"){K(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:X})=>{K(X?"dark":"light")})}catch{H.addListener(({matches:Y})=>{try{K(Y?"dark":"light")}catch(he){console.error(he)}})}},[b]),ve.useEffect(()=>{B.length<=1&&fe(!1)},[B]),ve.useEffect(()=>{const H=X=>{var Y;if(u.every(be=>X[be]||X.code===be)){var re;fe(!0),(re=ie.current)==null||re.focus()}X.code==="Escape"&&(document.activeElement===ie.current||(Y=ie.current)!=null&&Y.contains(document.activeElement))&&fe(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[u]),ve.useEffect(()=>{if(ie.current)return()=>{te.current&&(te.current.focus({preventScroll:!0}),te.current=null,D.current=!1)}},[ie.current]),ve.createElement("section",{ref:r,"aria-label":`${k} ${J}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},pe.map((H,X)=>{var Y;const[he,re]=H.split("-");return P.length?ve.createElement("ol",{key:H,dir:T==="auto"?px():T,tabIndex:-1,ref:ie,className:p,"data-sonner-toaster":!0,"data-sonner-theme":L,"data-y-position":he,"data-x-position":re,style:{"--front-toast-height":`${((Y=ne[0])==null?void 0:Y.height)||0}px`,"--width":`${p3}px`,"--gap":`${O}px`,..._,...w3(y,v)},onBlur:be=>{D.current&&!be.currentTarget.contains(be.relatedTarget)&&(D.current=!1,te.current&&(te.current.focus({preventScroll:!0}),te.current=null))},onFocus:be=>{be.target instanceof HTMLElement&&be.target.dataset.dismissible==="false"||D.current||(D.current=!0,te.current=be.relatedTarget)},onMouseEnter:()=>fe(!0),onMouseMove:()=>fe(!0),onMouseLeave:()=>{Z||fe(!1)},onDragEnd:()=>fe(!1),onPointerDown:be=>{be.target instanceof HTMLElement&&be.target.dataset.dismissible==="false"||Se(!0)},onPointerUp:()=>Se(!1)},P.filter(be=>!be.position&&X===0||be.position===H).map((be,xe)=>{var Me,Fe;return ve.createElement(x3,{key:be.id,icons:M,index:xe,toast:be,defaultRichColors:x,duration:(Me=R?.duration)!=null?Me:w,className:R?.className,descriptionClassName:R?.descriptionClassName,invert:o,visibleToasts:E,closeButton:(Fe=R?.closeButton)!=null?Fe:m,interacting:Z,position:H,style:R?.style,unstyled:R?.unstyled,classNames:R?.classNames,cancelButtonStyle:R?.cancelButtonStyle,actionButtonStyle:R?.actionButtonStyle,closeButtonAriaLabel:R?.closeButtonAriaLabel,removeToast:N,toasts:P.filter(He=>He.position==be.position),heights:ne.filter(He=>He.position==be.position),setHeights:ce,expandByDefault:d,gap:O,expanded:me,swipeDirections:t.swipeDirections})})):null}))}),_3=({...e})=>f.jsx(S3,{theme:"dark",className:"toaster group",icons:{success:f.jsx(bk,{className:"size-4"}),info:f.jsx(Wk,{className:"size-4"}),warning:f.jsx(C_,{className:"size-4"}),error:f.jsx(yz,{className:"size-4"}),loading:f.jsx(oz,{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 qe(e,t=!1){t?hx.error(e,{duration:1/0,closeButton:!0}):hx(e)}function C3(){return f.jsx(_3,{position:"bottom-center"})}const gx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,vx=e_,E3=(e,t)=>r=>{var i;if(t?.variants==null)return vx(e,r?.class,r?.className);const{variants:o,defaultVariants:l}=t,u=Object.keys(o).map(p=>{const y=r?.[p],v=l?.[p];if(y===null)return null;const b=gx(y)||gx(v);return o[p][b]}),d=r&&Object.entries(r).reduce((p,y)=>{let[v,b]=y;return b===void 0||(p[v]=b),p},{}),m=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((p,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})?[...p,v,b]:p},[]);return vx(e,u,m,r?.class,r?.className)},R3=E3("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 xt({className:e,variant:t="default",size:r="default",asChild:i=!1,...o}){const l=i?R2:"button";return f.jsx(l,{"data-slot":"button","data-variant":t,"data-size":r,className:We(R3({variant:t,size:r,className:e})),...o})}function Wu({...e}){return f.jsx(vp,{"data-slot":"dialog",...e})}function j3({...e}){return f.jsx(bp,{"data-slot":"dialog-portal",...e})}function T3({className:e,...t}){return f.jsx(xp,{"data-slot":"dialog-overlay",className:We("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),...t})}function ed({className:e,children:t,showCloseButton:r=!0,...i}){return f.jsxs(j3,{"data-slot":"dialog-portal",children:[f.jsx(T3,{}),f.jsxs(wp,{"data-slot":"dialog-content",className:We("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:[t,r&&f.jsxs(sS,{"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(R_,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function El({className:e,...t}){return f.jsx(rS,{"data-slot":"dialog-title",className:We("text-lg leading-none font-semibold",e),...t})}let j_=null,uu=[];function Rl(e){j_=e,uu.forEach(t=>t())}function T_(e,t,r="",i="OK",o={}){return new Promise(l=>Rl({kind:"prompt",title:e,label:t,value:r,okLabel:i,...o,resolve:l}))}function za(e,t,r="Confirm",i=!1){return new Promise(o=>Rl({kind:"confirm",title:e,message:t,confirmLabel:r,danger:i,resolve:o}))}function O3(){const e=S.useSyncExternalStore(r=>(uu.push(r),()=>{uu=uu.filter(i=>i!==r)}),()=>j_);if(!e)return null;const t=()=>{Rl(null),e.kind==="prompt"?e.resolve(null):e.resolve(!1)};return f.jsx(Wu,{open:!0,onOpenChange:r=>!r&&t(),children:f.jsx(ed,{className:"modal",showCloseButton:!1,children:e.kind==="prompt"?f.jsx(A3,{m:e}):f.jsx(M3,{m:e})})})}function A3({m:e}){const t=S.useRef(null),r=p=>{Rl(null),e.resolve(p)},[i,o]=S.useState(""),[l,u]=S.useState(e.value),d=e.match===void 0||l.trim()===e.match,m=()=>{const p=l;if(d){if(!p.trim()){o("Give it a name."),t.current.focus();return}r(p)}};return f.jsxs(f.Fragment,{children:[f.jsx(El,{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:t,id:"modal-input",autoFocus:!0,onFocus:p=>p.currentTarget.select(),"aria-invalid":!!i,"aria-describedby":i?"modal-input-err":void 0,onChange:p=>{u(p.currentTarget.value),i&&o("")},onKeyDown:p=>p.key==="Enter"&&m()}),i&&f.jsx("span",{id:"modal-input-err",role:"alert",className:"field-err",children:i}),f.jsxs("div",{className:"modal-actions",children:[f.jsx(xt,{variant:"subtle",onClick:()=>r(null),children:"Cancel"}),f.jsx(xt,{variant:e.danger?"danger":"primary",onClick:m,disabled:!d,children:e.okLabel})]})]})}function M3({m:e}){const t=r=>{Rl(null),e.resolve(r)};return f.jsxs(f.Fragment,{children:[f.jsx(El,{asChild:!0,children:f.jsx("h3",{children:e.title})}),f.jsx("div",{className:"modal-msg",children:e.message}),f.jsxs("div",{className:"modal-actions",children:[f.jsx(xt,{variant:"subtle",onClick:()=>t(!1),autoFocus:e.danger,children:"Cancel"}),f.jsx(xt,{variant:e.danger?"danger":"primary",onClick:()=>t(!0),autoFocus:!e.danger,children:e.confirmLabel})]})]})}function N3(e){return Ft({queryKey:["projects"],queryFn:()=>qt("/api/projects"),enabled:e,refetchInterval:3e4,select:t=>t.projects||[]})}function D3(e){return Ft({queryKey:["orgs"],queryFn:()=>qt("/api/orgs"),enabled:e,select:t=>t.orgs||[]})}function k3(e){return Ft({queryKey:["permissions",e],queryFn:()=>qt(`/api/p/${e}/permissions`),enabled:!!e})}function O_(e,t=!0){return Ft({queryKey:["shares",e],queryFn:()=>qt(`/api/p/${e}/shares`),enabled:!!e&&t,select:r=>r.shares||[]})}function A_(e){return Ft({queryKey:["admin","pending"],queryFn:()=>qt("/api/admin/pending"),enabled:e,select:t=>t.pending||[]})}function M_(){const e=ki();return()=>Promise.all([e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["orgs"]})]).then(()=>{})}function N_(e){return e.split("/").map(encodeURIComponent).join("/")}function z3(e){try{return decodeURIComponent(e)}catch{return e}}function td(e){return e.split("/").map(z3).join("/")}const L3=new Set(["dashboard","history","install","settings"]),yx={insights:"dashboard"};function $3(e){return Object.hasOwn(yx,e)?yx[e]:void 0}const Qp=["q","user","since","until"];function Xp(e){return!!e&&Qp.some(t=>!!e[t])}function D_(e){const t=new URLSearchParams;for(const i of Qp)e?.[i]&&t.set(i,e[i]);const r=t.toString();return r?"?"+r:""}function k_(e,t){const r=e.indexOf("?"),i=r===-1?null:new URLSearchParams(e.slice(r)),o=i?.get("v")||"",l=i?.get("connect")||"",u=I3(r===-1?e:e.slice(0,r),t);o&&(u.version=o),l&&(u.connect=l);const d={};for(const m of Qp){const p=i?.get(m);p&&(d[m]=p)}if(Xp(d)&&(u.filters=d),u.view==="history"&&!u.viewTarget){const m=(i?.get("path")||i?.get("prefix")||"").replace(/^\/+|\/+$/g,"");m&&(u.viewTarget=td(m),u.queryTarget=!0)}return u}function bx(e,t){const r=t.replace(/\/+$/,"");return r!==t&&(e.trailingSlash=!0),e.path=r?td(r):"",e}function I3(e,t){const r=e.replace(/^\/+/,"");if(t!=="hub")return bx({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=bx({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=$3(u);return(L3.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 Oi(e,t,r){const i=N_(e),o=r?"?v="+r:"";return t?"/"+t+(i?"/"+i:"")+o:"/"+i+o}function An(e,t,r,i){let o=(t?"/"+t:"")+"/"+e;return r&&(o+="/"+N_(r.replace(/\/+$/,""))),o+(e==="history"?D_(i):"")}function P3(e,t){const r=td(t).toLowerCase(),i=e.filter(o=>o.name.toLowerCase()===r);return i.length===1?i[0].id:void 0}let Jp="POP";const Im=new Set;function z_(){for(const e of Im)e()}window.addEventListener("popstate",()=>{Jp="POP",z_()});function Yt(e,t){const r=location.pathname+location.search;!t?.replace&&r===e||(history[t?.replace?"replaceState":"pushState"](null,"",e),Jp=t?.replace?"REPLACE":"PUSH",z_())}function Wp(){return S.useSyncExternalStore(e=>(Im.add(e),()=>{Im.delete(e)}),()=>location.pathname+location.search)}function F3(){return Jp}function Qs(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(),Yt(e),document.body.classList.remove("sb-open"))}}:{href:e,target:"_blank",rel:"noopener noreferrer"}}function Ds({to:e}){return S.useEffect(()=>{Yt(e,{replace:!0})},[e]),null}function L_(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function La(e,t){return typeof e=="function"?e(t):e}function Fn(e,t){return r=>{t.setState(i=>({...i,[e]:La(r,i[e])}))}}function nd(e){return e instanceof Function}function V3(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function U3(e,t){const r=[],i=o=>{o.forEach(l=>{r.push(l);const u=t(l);u!=null&&u.length&&i(u)})};return i(e),r}function Le(e,t,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 p;if(r.key&&r.debug&&(p=Date.now()),o=t(...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()-p)*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`,` +`)},GT=0,Ts=[];function ZT(e){var t=S.useRef([]),r=S.useRef([0,0]),i=S.useRef(),o=S.useState(GT++)[0],l=S.useState(Zw)[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 _=mT([e.lockRef.current],(e.shards||[]).map(Gb),!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=Gc(_),T=r.current,O="deltaX"in _?_.deltaX:T[0]-R[0],M="deltaY"in _?_.deltaY:T[1]-R[1],k,B=_.target,V=Math.abs(O)>Math.abs(M)?"h":"v";if("touches"in _&&V==="h"&&B.type==="range")return!1;var P=window.getSelection(),pe=P&&P.anchorNode,ne=pe?pe===B||pe.contains(B):!1;if(ne)return!1;var ce=Bb(V,B);if(!ce)return!0;if(ce?k=V:(k=V==="v"?"h":"v",ce=Bb(V,B)),!ce)return!1;if(!i.current&&"changedTouches"in _&&(O||M)&&(i.current=k),!k)return!0;var me=i.current||k;return HT(me,E,_,me==="h"?O:M)},[]),m=S.useCallback(function(_){var E=_;if(!(!Ts.length||Ts[Ts.length-1]!==l)){var R="deltaY"in E?qb(E):Gc(E),T=t.current.filter(function(k){return k.name===E.type&&(k.target===E.target||E.target===k.shadowParent)&&BT(k.delta,R)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var O=(u.current.shards||[]).map(Gb).filter(Boolean).filter(function(k){return k.contains(E.target)}),M=O.length>0?d(E,O[0]):!u.current.noIsolation;M&&E.cancelable&&E.preventDefault()}}},[]),p=S.useCallback(function(_,E,R,T){var O={name:_,delta:E,target:R,should:T,shadowParent:KT(R)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(M){return M!==O})},1)},[]),y=S.useCallback(function(_){r.current=Gc(_),i.current=void 0},[]),v=S.useCallback(function(_){p(_.type,qb(_),_.target,d(_,e.lockRef.current))},[]),b=S.useCallback(function(_){p(_.type,Gc(_),_.target,d(_,e.lockRef.current))},[]);S.useEffect(function(){return Ts.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:b}),document.addEventListener("wheel",m,js),document.addEventListener("touchmove",m,js),document.addEventListener("touchstart",y,js),function(){Ts=Ts.filter(function(_){return _!==l}),document.removeEventListener("wheel",m,js),document.removeEventListener("touchmove",m,js),document.removeEventListener("touchstart",y,js)}},[]);var x=e.removeScrollBar,w=e.inert;return S.createElement(S.Fragment,null,w?S.createElement(l,{styles:qT(o)}):null,x?S.createElement(LT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function KT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const YT=_T(Gw,ZT);var zu=S.forwardRef(function(e,t){return S.createElement(ku,Tr({},e,{ref:t,sideCar:YT}))});zu.classNames=ku.classNames;var QT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Os=new WeakMap,Zc=new WeakMap,Kc={},Ph=0,Xw=function(e){return e&&(e.host||Xw(e.parentNode))},XT=function(e,t){return t.map(function(r){if(e.contains(r))return r;var i=Xw(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})},JT=function(e,t,r,i){var o=XT(t,Array.isArray(e)?e:[e]);Kc[r]||(Kc[r]=new WeakMap);var l=Kc[r],u=[],d=new Set,m=new Set(o),p=function(v){!v||d.has(v)||(d.add(v),p(v.parentNode))};o.forEach(p);var y=function(v){!v||m.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",_=(Os.get(b)||0)+1,E=(l.get(b)||0)+1;Os.set(b,_),l.set(b,E),u.push(b),_===1&&w&&Zc.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(t),d.clear(),Ph++,function(){u.forEach(function(v){var b=Os.get(v)-1,x=l.get(v)-1;Os.set(v,b),l.set(v,x),b||(Zc.has(v)||v.removeAttribute(i),Zc.delete(v)),x||v.removeAttribute(r)}),Ph--,Ph||(Os=new WeakMap,Os=new WeakMap,Zc=new WeakMap,Kc={})}},gp=function(e,t,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),o=QT(e);return o?(i.push.apply(i,Array.from(o.querySelectorAll("[aria-live], script"))),JT(i,o,r,"aria-hidden")):function(){return null}},Lu="Dialog",[Jw]=Ka(Lu),[WT,vr]=Jw(Lu),vp=e=>{const{__scopeDialog:t,children:r,open:i,defaultOpen:o,onOpenChange:l,modal:u=!0}=e,d=S.useRef(null),m=S.useRef(null),[p,y]=Zs({prop:i,defaultProp:o??!1,onChange:l,caller:Lu});return f.jsx(WT,{scope:t,triggerRef:d,contentRef:m,contentId:fn(),titleId:fn(),descriptionId:fn(),open:p,onOpenChange:y,onOpenToggle:S.useCallback(()=>y(v=>!v),[y]),modal:u,children:r})};vp.displayName=Lu;var Ww="DialogTrigger",eO=S.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,o=vr(Ww,r),l=at(t,o.triggerRef);return f.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":Sp(o.open),...i,ref:l,onClick:Te(e.onClick,o.onOpenToggle)})});eO.displayName=Ww;var yp="DialogPortal",[tO,eS]=Jw(yp,{forceMount:void 0}),bp=e=>{const{__scopeDialog:t,forceMount:r,children:i,container:o}=e,l=vr(yp,t);return f.jsx(tO,{scope:t,forceMount:r,children:S.Children.map(i,u=>f.jsx(gr,{present:r||l.open,children:f.jsx(xl,{asChild:!0,container:o,children:u})}))})};bp.displayName=yp;var pu="DialogOverlay",xp=S.forwardRef((e,t)=>{const r=eS(pu,e.__scopeDialog),{forceMount:i=r.forceMount,...o}=e,l=vr(pu,e.__scopeDialog);return l.modal?f.jsx(gr,{present:i||l.open,children:f.jsx(rO,{...o,ref:t})}):null});xp.displayName=pu;var nO=Ei("DialogOverlay.RemoveScroll"),rO=S.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,o=vr(pu,r),l=nT(),u=at(t,l);return f.jsx(zu,{as:nO,allowPinchZoom:!0,shards:[o.contentRef],children:f.jsx(Pe.div,{"data-state":Sp(o.open),...i,ref:u,style:{pointerEvents:"auto",...i.style}})})}),Ks="DialogContent",wp=S.forwardRef((e,t)=>{const r=eS(Ks,e.__scopeDialog),{forceMount:i=r.forceMount,...o}=e,l=vr(Ks,e.__scopeDialog);return f.jsx(gr,{present:i||l.open,children:l.modal?f.jsx(aO,{...o,ref:t}):f.jsx(iO,{...o,ref:t})})});wp.displayName=Ks;var aO=S.forwardRef((e,t)=>{const r=vr(Ks,e.__scopeDialog),i=S.useRef(null),o=at(t,r.contentRef,i);return S.useEffect(()=>{const l=i.current;if(l)return gp(l)},[]),f.jsx(tS,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Te(e.onCloseAutoFocus,l=>{l.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0;(u.button===2||d)&&l.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault())})}),iO=S.forwardRef((e,t)=>{const r=vr(Ks,e.__scopeDialog),i=S.useRef(!1),o=S.useRef(!1);return f.jsx(tS,{...e,ref:t,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()}})}),tS=S.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:l,...u}=e,d=vr(Ks,r);return pp(),f.jsx(f.Fragment,{children:f.jsx(Du,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:l,children:f.jsx(bl,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Sp(d.open),...u,ref:t,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1)})})})}),nS="DialogTitle",rS=S.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,o=vr(nS,r);return f.jsx(Pe.h2,{id:o.titleId,...i,ref:t})});rS.displayName=nS;var aS="DialogDescription",sO=S.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,o=vr(aS,r);return f.jsx(Pe.p,{id:o.descriptionId,...i,ref:t})});sO.displayName=aS;var iS="DialogClose",sS=S.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,o=vr(iS,r);return f.jsx(Pe.button,{type:"button",...i,ref:t,onClick:Te(e.onClick,()=>o.onOpenChange(!1))})});sS.displayName=iS;function Sp(e){return e?"open":"closed"}function oO(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function lO(e){const[t,r]=S.useState(void 0);return Qt(()=>{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 m=l.borderBoxSize,p=Array.isArray(m)?m[0]:m;u=p.inlineSize,d=p.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]),t}const cO=["top","right","bottom","left"],Ha=Math.min,ra=Math.max,gu=Math.round,Yc=Math.floor,aa=e=>({x:e,y:e}),uO={left:"right",right:"left",bottom:"top",top:"bottom"};function oS(e,t,r){return ra(e,Ha(t,r))}function ia(e,t){return typeof e=="function"?e(t):e}function Ba(e){return e.split("-")[0]}function Xs(e){return e.split("-")[1]}function _p(e){return e==="x"?"y":"x"}function Cp(e){return e==="y"?"height":"width"}function Or(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ep(e){return _p(Or(e))}function dO(e,t,r){r===void 0&&(r=!1);const i=Xs(e),o=Ep(e),l=Cp(o);let u=o==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=vu(u)),[u,vu(u)]}function fO(e){const t=vu(e);return[Cm(e),t,Cm(t)]}function Cm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Zb=["left","right"],Kb=["right","left"],hO=["top","bottom"],mO=["bottom","top"];function pO(e,t,r){switch(e){case"top":case"bottom":return r?t?Kb:Zb:t?Zb:Kb;case"left":case"right":return t?hO:mO;default:return[]}}function gO(e,t,r,i){const o=Xs(e);let l=pO(Ba(e),r==="start",i);return o&&(l=l.map(u=>u+"-"+o),t&&(l=l.concat(l.map(Cm)))),l}function vu(e){const t=Ba(e);return uO[t]+e.slice(t.length)}function vO(e){var t,r,i,o;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(i=e.bottom)!=null?i:0,left:(o=e.left)!=null?o:0}}function lS(e){return typeof e!="number"?vO(e):{top:e,right:e,bottom:e,left:e}}function yu(e){const{x:t,y:r,width:i,height:o}=e;return{width:i,height:o,top:r,left:t,right:t+i,bottom:r+o,x:t,y:r}}function Yb(e,t,r){let{reference:i,floating:o}=e;const l=Or(t),u=Ep(t),d=Cp(u),m=Ba(t),p=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(m){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=Xs(t);return w&&(x[u]+=b*(w==="end"?1:-1)*(r&&p?-1:1)),x}async function yO(e,t){var r;t===void 0&&(t={});const{x:i,y:o,platform:l,rects:u,elements:d,strategy:m}=e,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:v="floating",altBoundary:b=!1,padding:x=0}=ia(t,e),w=lS(x),E=d[b?v==="floating"?"reference":"floating":v],R=yu(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:p,rootBoundary:y,strategy:m})),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},k=yu(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:T,offsetParent:O,strategy:m}):T);return{top:(R.top-k.top+w.top)/M.y,bottom:(k.bottom-R.bottom+w.bottom)/M.y,left:(R.left-k.left+w.left)/M.x,right:(k.right-R.right+w.right)/M.x}}const bO=50,xO=async(e,t,r)=>{const{placement:i="bottom",strategy:o="absolute",middleware:l=[],platform:u}=r,d=u.detectOverflow?u:{...u,detectOverflow:yO},m=await(u.isRTL==null?void 0:u.isRTL(t));let p=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:y,y:v}=Yb(p,i,m),b=i,x=0;const w={};for(let _=0;_({name:"arrow",options:e,async fn(t){const{x:r,y:i,placement:o,rects:l,platform:u,elements:d,middlewareData:m}=t,{element:p,padding:y=0}=ia(e,t)||{};if(p==null)return{};const v=lS(y),b={x:r,y:i},x=Ep(o),w=Cp(x),_=await u.getDimensions(p),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],k=b[x]-l.reference[x],B=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let V=B?B[O]:0;(!V||!await(u.isElement==null?void 0:u.isElement(B)))&&(V=d.floating[O]||l.floating[w]);const P=M/2-k/2,pe=V/2-_[w]/2-1,ne=Ha(v[R],pe),ce=Ha(v[T],pe),me=V-_[w]-ce,fe=V/2-_[w]/2+P,Z=oS(ne,fe,me),Se=!m.arrow&&Xs(o)!=null&&fe!==Z&&l.reference[w]/2-(feZ<=0)){var ce,me;const Z=(((ce=l.flip)==null?void 0:ce.index)||0)+1,Se=V[Z];if(Se&&(!(v==="alignment"?T!==Or(Se):!1)||ne.every(ie=>Or(ie.placement)===T?ie.overflows[0]>0:!0)))return{data:{index:Z,overflows:ne},reset:{placement:Se}};let L=(me=ne.filter(K=>K.overflows[0]<=0).sort((K,ie)=>K.overflows[1]-ie.overflows[1])[0])==null?void 0:me.placement;if(!L)switch(x){case"bestFit":{var fe;const K=(fe=ne.filter(ie=>{if(B){const J=Or(ie.placement);return J===T||J==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(J=>J>0).reduce((J,te)=>J+te,0)]).sort((ie,J)=>ie[1]-J[1])[0])==null?void 0:fe[0];K&&(L=K);break}case"initialPlacement":L=d;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function Qb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xb(e){return cO.some(t=>e[t]>=0)}const _O=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:i}=t,{strategy:o="referenceHidden",...l}=ia(e,t);switch(o){case"referenceHidden":{const u=await i.detectOverflow(t,{...l,elementContext:"reference"}),d=Qb(u,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Xb(d)}}}case"escaped":{const u=await i.detectOverflow(t,{...l,altBoundary:!0}),d=Qb(u,r.floating);return{data:{escapedOffsets:d,escaped:Xb(d)}}}default:return{}}}}},cS=new Set(["left","top"]);async function CO(e,t){const{placement:r,platform:i,elements:o}=e,l=await(i.isRTL==null?void 0:i.isRTL(o.floating)),u=Ba(r),d=Xs(r),m=Or(r)==="y",p=cS.has(u)?-1:1,y=l&&m?-1:1,v=ia(t,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),m?{x:x*y,y:b*p}:{x:b*p,y:x*y}}const EO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,i;const{x:o,y:l,placement:u,middlewareData:d}=t,m=await CO(t,e);return u===((r=d.offset)==null?void 0:r.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:o+m.x,y:l+m.y,data:{...m,placement:u}}}}},RO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:i,placement:o,platform:l}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:m={fn:T=>{let{x:O,y:M}=T;return{x:O,y:M}}},...p}=ia(e,t),y={x:r,y:i},v=await l.detectOverflow(t,p),b=Or(o),x=_p(b);let w=y[x],_=y[b];const E=(T,O)=>oS(O+v[T==="y"?"top":"left"],O,O-v[T==="y"?"bottom":"right"]);u&&(w=E(x,w)),d&&(_=E(b,_));const R=m.fn({...t,[x]:w,[b]:_});return{...R,data:{x:R.x-r,y:R.y-i,enabled:{[x]:u,[b]:d}}}}}},jO=function(e){return e===void 0&&(e={}),{options:e,fn(t){var r,i;const{x:o,y:l,placement:u,rects:d,middlewareData:m}=t,{offset:p=0,mainAxis:y=!0,crossAxis:v=!0}=ia(e,t),b={x:o,y:l},x=Or(u),w=_p(x);let _=b[w],E=b[x];const R=ia(p,t),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 k=w==="y"?"height":"width",B=d.reference[w]-d.floating[k]+T.mainAxis,V=d.reference[w]+d.reference[k]-T.mainAxis;_V&&(_=V)}if(v){var O,M;const k=w==="y"?"width":"height",B=cS.has(Ba(u)),V=d.reference[x]-d.floating[k]+(B&&((O=m.offset)==null?void 0:O[x])||0)+(B?0:T.crossAxis),P=d.reference[x]+d.reference[k]+(B?0:((M=m.offset)==null?void 0:M[x])||0)-(B?T.crossAxis:0);EP&&(E=P)}return{[w]:_,[x]:E}}}},TO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:i,platform:o,elements:l}=t,{apply:u=()=>{},...d}=ia(e,t),m=await o.detectOverflow(t,d),p=Ba(r),y=Xs(r),v=Or(r)==="y",{width:b,height:x}=i.floating;let w,_;p==="top"||p==="bottom"?(w=p,_=y===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(_=p,w=y==="end"?"top":"bottom");const E=x-m.top-m.bottom,R=b-m.left-m.right,T=Ha(x-m[w],E),O=Ha(b-m[_],R),M=t.middlewareData.shift,k=!M;let B=T,V=O;M!=null&&M.enabled.x&&(V=R),M!=null&&M.enabled.y&&(B=E),k&&!y&&(v?V=b-2*ra(m.left,m.right):B=x-2*ra(m.top,m.bottom)),await u({...t,availableWidth:V,availableHeight:B});const P=await o.getDimensions(l.floating);return b!==P.width||x!==P.height?{reset:{rects:!0}}:{}}}};function $u(){return typeof window<"u"}function Js(e){return uS(e)?(e.nodeName||"").toLowerCase():"#document"}function Mn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sa(e){var t;return(t=(uS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function uS(e){return $u()?e instanceof Node||e instanceof Mn(e).Node:!1}function Ar(e){return $u()?e instanceof Element||e instanceof Mn(e).Element:!1}function Ya(e){return $u()?e instanceof HTMLElement||e instanceof Mn(e).HTMLElement:!1}function Jb(e){return!$u()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mn(e).ShadowRoot}function Iu(e){const{overflow:t,overflowX:r,overflowY:i,display:o}=Mr(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+r)&&o!=="inline"&&o!=="contents"}function OO(e){return/^(table|td|th)$/.test(Js(e))}function Pu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const AO=/transform|translate|scale|rotate|perspective|filter/,MO=/paint|layout|strict|content/,bi=e=>!!e&&e!=="none";let Fh;function Rp(e){const t=Ar(e)?Mr(e):e;return bi(t.transform)||bi(t.translate)||bi(t.scale)||bi(t.rotate)||bi(t.perspective)||!jp()&&(bi(t.backdropFilter)||bi(t.filter))||AO.test(t.willChange||"")||MO.test(t.contain||"")}function NO(e){let t=Ri(e);for(;Ya(t)&&!ul(t);){if(Rp(t))return t;if(Pu(t))return null;t=Ri(t)}return null}function jp(){return Fh==null&&(Fh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Fh}function ul(e){return/^(html|body|#document)$/.test(Js(e))}function Mr(e){return Mn(e).getComputedStyle(e)}function Fu(e){return Ar(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ri(e){if(Js(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Jb(e)&&e.host||sa(e);return Jb(t)?t.host:t}function dS(e){const t=Ri(e);return ul(t)?(e.ownerDocument||e).body:Ya(t)&&Iu(t)?t:dS(t)}function dl(e,t,r){var i;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=dS(e),l=o===((i=e.ownerDocument)==null?void 0:i.body),u=Mn(o);if(l){const d=Em(u);return t.concat(u,u.visualViewport||[],Iu(o)?o:[],d&&r?dl(d):[])}else return t.concat(o,dl(o,[],r))}function Em(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fS(e){const t=Mr(e);let r=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=Ya(e),l=o?e.offsetWidth:r,u=o?e.offsetHeight:i,d=gu(r)!==l||gu(i)!==u;return d&&(r=l,i=u),{width:r,height:i,$:d}}function Tp(e){return Ar(e)?e:e.contextElement}function Fs(e){const t=Tp(e);if(!Ya(t))return aa(1);const r=t.getBoundingClientRect(),{width:i,height:o,$:l}=fS(t);let u=(l?gu(r.width):r.width)/i,d=(l?gu(r.height):r.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const DO=aa(0);function hS(e){const t=Mn(e);return!jp()||!t.visualViewport?DO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kO(e,t,r){return t===void 0&&(t=!1),!!r&&t&&r===Mn(e)}function ji(e,t,r,i){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),l=Tp(e);let u=aa(1);t&&(i?Ar(i)&&(u=Fs(i)):u=Fs(e));const d=kO(l,r,i)?hS(l):aa(0);let m=(o.left+d.x)/u.x,p=(o.top+d.y)/u.y,y=o.width/u.x,v=o.height/u.y;if(l&&i){const b=Mn(l),x=Ar(i)?Mn(i):i;let w=b,_=Em(w);for(;_&&x!==w;){const E=Fs(_),R=_.getBoundingClientRect(),T=Mr(_),O=R.left+(_.clientLeft+parseFloat(T.paddingLeft))*E.x,M=R.top+(_.clientTop+parseFloat(T.paddingTop))*E.y;m*=E.x,p*=E.y,y*=E.x,v*=E.y,m+=O,p+=M,w=Mn(_),_=Em(w)}}return yu({width:y,height:v,x:m,y:p})}function Vu(e,t){const r=Fu(e).scrollLeft;return t?t.left+r:ji(sa(e)).left+r}function mS(e,t){const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-Vu(e,r),o=r.top+t.scrollTop;return{x:i,y:o}}function zO(e){let{elements:t,rect:r,offsetParent:i,strategy:o}=e;const l=o==="fixed",u=sa(i),d=t?Pu(t.floating):!1;if(i===u||d&&l)return r;let m={scrollLeft:0,scrollTop:0},p=aa(1);const y=aa(0),v=Ya(i);if((v||!l)&&((Js(i)!=="body"||Iu(u))&&(m=Fu(i)),v)){const x=ji(i);p=Fs(i),y.x=x.x+i.clientLeft,y.y=x.y+i.clientTop}const b=u&&!v&&!l?mS(u,m):aa(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-m.scrollLeft*p.x+y.x+b.x,y:r.y*p.y-m.scrollTop*p.y+y.y+b.y}}function LO(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function $O(e){const t=Fu(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=-t.scrollLeft+Vu(e);const u=-t.scrollTop;return Mr(r).direction==="rtl"&&(l+=ra(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:u}}const IO=25;function PO(e,t,r){r===void 0&&(r="viewport");const i=r==="layoutViewport",o=Mn(e),l=sa(e),u=o.visualViewport;let d=l.clientWidth,m=l.clientHeight,p=0,y=0;if(u){const b=!jp()||t==="fixed";i?b||(p=-u.offsetLeft,y=-u.offsetTop):(d=u.width,m=u.height,b&&(p=u.offsetLeft,y=u.offsetTop))}if(Vu(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<=IO&&(d-=R)}return{width:d,height:m,x:p,y}}function FO(e,t){const r=ji(e,!0,t==="fixed"),i=r.top+e.clientTop,o=r.left+e.clientLeft,l=Fs(e),u=e.clientWidth*l.x,d=e.clientHeight*l.y,m=o*l.x,p=i*l.y;return{width:u,height:d,x:m,y:p}}function Wb(e,t,r){let i;if(t==="viewport"||t==="layoutViewport")i=PO(e,r,t);else if(t==="document")i=$O(sa(e));else if(Ar(t))i=FO(t,r);else{const o=hS(e);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return yu(i)}function VO(e,t){const r=t.get(e);if(r)return r;let i=dl(e,[],!1).filter(d=>Ar(d)&&Js(d)!=="body"),o=null;const l=Mr(e).position==="fixed";let u=l?Ri(e):e;for(;Ar(u)&&!ul(u);){const d=Mr(u),m=Rp(u),p=o?o.position:l?"fixed":"";!m&&(p==="fixed"||p==="absolute"&&d.position==="static")?i=i.filter(v=>v!==u):o=d,u=Ri(u)}return t.set(e,i),i}function UO(e){let{element:t,boundary:r,rootBoundary:i,strategy:o}=e;const u=[...r==="clippingAncestors"?Pu(t)?[]:VO(t,this._c):[].concat(r),i],d=Wb(t,u[0],o);let m=d.top,p=d.right,y=d.bottom,v=d.left;for(let b=1;b{d(!1,1e-7)},1e3)}V=!1}try{i=new IntersectionObserver(P,{...B,root:l.ownerDocument})}catch{i=new IntersectionObserver(P,B)}i.observe(e)}const m=Mn(e),p=()=>d(r);return m.addEventListener("resize",p),d(!0),()=>{m.removeEventListener("resize",p),u()}}function YO(e,t,r,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:m=!1}=i,p=Tp(e),y=o||l?[...p?dl(p):[],...t?dl(t):[]]:[];y.forEach(R=>{o&&R.addEventListener("scroll",r),l&&R.addEventListener("resize",r)});const v=p&&d?KO(p,r,l):null;let b=-1,x=null;u&&(x=new ResizeObserver(R=>{let[T]=R;T&&T.target===p&&x&&t&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var O;(O=x)==null||O.observe(t)})),r()}),p&&!m&&x.observe(p),t&&x.observe(t));let w,_=m?ji(e):null;m&&E();function E(){const R=ji(e);_&&!gS(_,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,m&&cancelAnimationFrame(w)}}const QO=EO,XO=RO,JO=SO,WO=TO,eA=_O,tx=wO,tA=jO,nA=(e,t,r)=>{const i=new Map,o=r??{},l={...ZO,...o.platform,_c:i};return xO(e,t,{...o,platform:l})};var rA=typeof document<"u",aA=function(){},lu=rA?S.useLayoutEffect:aA;function bu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,i,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(i=r;i--!==0;)if(!bu(e[i],t[i]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(t,o[i]))return!1;for(i=r;i--!==0;){const l=o[i];if(!(l==="_owner"&&e.$$typeof)&&!bu(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function vS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nx(e,t){const r=vS(e);return Math.round(t*r)/r}function Uh(e){const t=S.useRef(e);return lu(()=>{t.current=e}),t}function iA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:i=[],platform:o,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:m,open:p}=e,[y,v]=S.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=S.useState(i);bu(b,i)||x(i);const[w,_]=S.useState(null),[E,R]=S.useState(null),T=S.useCallback(ie=>{ie!==B.current&&(B.current=ie,_(ie))},[]),O=S.useCallback(ie=>{ie!==V.current&&(V.current=ie,R(ie))},[]),M=l||w,k=u||E,B=S.useRef(null),V=S.useRef(null),P=S.useRef(y),pe=m!=null,ne=Uh(m),ce=Uh(o),me=Uh(p),fe=S.useCallback(()=>{if(!B.current||!V.current)return;const ie={placement:t,strategy:r,middleware:b};ce.current&&(ie.platform=ce.current),nA(B.current,V.current,ie).then(J=>{const te={...J,isPositioned:me.current!==!1};Z.current&&!bu(P.current,te)&&(P.current=te,zi.flushSync(()=>{v(te)}))})},[b,t,r,ce,me]);lu(()=>{p===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,v(ie=>({...ie,isPositioned:!1})))},[p]);const Z=S.useRef(!1);lu(()=>(Z.current=!0,()=>{Z.current=!1}),[]),lu(()=>{if(M&&(B.current=M),k&&(V.current=k),M&&k){if(ne.current)return ne.current(M,k,fe);fe()}},[M,k,fe,ne,pe]);const Se=S.useMemo(()=>({reference:B,floating:V,setReference:T,setFloating:O}),[T,O]),L=S.useMemo(()=>({reference:M,floating:k}),[M,k]),K=S.useMemo(()=>{const ie={position:r,left:0,top:0};if(!L.floating)return ie;const J=nx(L.floating,y.x),te=nx(L.floating,y.y);return d?{...ie,transform:"translate("+J+"px, "+te+"px)",...vS(L.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:J,top:te}},[r,d,L.floating,y.x,y.y]);return S.useMemo(()=>({...y,update:fe,refs:Se,elements:L,floatingStyles:K}),[y,fe,Se,L,K])}const sA=e=>{function t(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&&t(i)?i.current!=null?tx({element:i.current,padding:o}).fn(r):{}:i?tx({element:i,padding:o}).fn(r):{}}}},oA=(e,t)=>{const r=QO(e);return{name:r.name,fn:r.fn,options:[e,t]}},lA=(e,t)=>{const r=XO(e);return{name:r.name,fn:r.fn,options:[e,t]}},cA=(e,t)=>({fn:tA(e).fn,options:[e,t]}),uA=(e,t)=>{const r=JO(e);return{name:r.name,fn:r.fn,options:[e,t]}},dA=(e,t)=>{const r=WO(e);return{name:r.name,fn:r.fn,options:[e,t]}},fA=(e,t)=>{const r=eA(e);return{name:r.name,fn:r.fn,options:[e,t]}},hA=(e,t)=>{const r=sA(e);return{name:r.name,fn:r.fn,options:[e,t]}};var mA="Arrow",yS=S.forwardRef((e,t)=>{const{children:r,width:i=10,height:o=5,...l}=e;return f.jsx(Pe.svg,{...l,ref:t,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"})})});yS.displayName=mA;var pA=yS,Op="Popper",[bS,Ws]=Ka(Op),[gA,xS]=bS(Op),wS=e=>{const{__scopePopper:t,children:r}=e,[i,o]=S.useState(null),[l,u]=S.useState(void 0);return f.jsx(gA,{scope:t,anchor:i,onAnchorChange:o,placementState:l,setPlacementState:u,children:r})};wS.displayName=Op;var SS="PopperAnchor",_S=S.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:i,...o}=e,l=xS(SS,r),u=S.useRef(null),d=l.onAnchorChange,m=S.useCallback(w=>{u.current=w,w&&d(w)},[d]),p=at(t,m),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&&Mp(l.placementState),b=v?.[0],x=v?.[1];return i?null:f.jsx(Pe.div,{"data-radix-popper-side":b,"data-radix-popper-align":x,...o,ref:p})});_S.displayName=SS;var Ap="PopperContent",[vA,yA]=bS(Ap),CS=S.forwardRef((e,t)=>{const{__scopePopper:r,side:i="bottom",sideOffset:o=0,align:l="center",alignOffset:u=0,arrowPadding:d=0,avoidCollisions:m=!0,collisionBoundary:p=[],collisionPadding:y=0,sticky:v="partial",hideWhenDetached:b=!1,updatePositionStrategy:x="optimized",onPlaced:w,..._}=e,E=xS(Ap,r),[R,T]=S.useState(null),O=at(t,T),[M,k]=S.useState(null),B=lO(M),V=B?.width??0,P=B?.height??0,pe=i+(l!=="center"?"-"+l:""),ne=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},ce=Array.isArray(p)?p:[p],me=ce.length>0,fe={padding:ne,boundary:ce.filter(xA),altBoundary:me},{refs:Z,floatingStyles:Se,placement:L,isPositioned:K,middlewareData:ie}=iA({strategy:"fixed",placement:pe,whileElementsMounted:(...be)=>YO(...be,{animationFrame:x==="always"}),elements:{reference:E.anchor},middleware:[oA({mainAxis:o+P,alignmentAxis:u}),m&&lA({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?cA():void 0,...fe}),m&&uA({...fe}),dA({...fe,apply:({elements:be,rects:xe,availableWidth:Me,availableHeight:Fe})=>{const{width:He,height:ct}=xe.reference,Je=be.floating.style;Je.setProperty("--radix-popper-available-width",`${Me}px`),Je.setProperty("--radix-popper-available-height",`${Fe}px`),Je.setProperty("--radix-popper-anchor-width",`${He}px`),Je.setProperty("--radix-popper-anchor-height",`${ct}px`)}}),M&&hA({element:M,padding:d}),wA({arrowWidth:V,arrowHeight:P}),b&&fA({strategy:"referenceHidden",...fe,boundary:me?fe.boundary:void 0})]}),J=E.setPlacementState;Qt(()=>(J(L),()=>{J(void 0)}),[L,J]);const[te,D]=Mp(L),N=tr(w);Qt(()=>{K&&N?.()},[K,N]);const H=ie.arrow?.x,X=ie.arrow?.y,Y=ie.arrow?.centerOffset!==0,[he,re]=S.useState();return Qt(()=>{R&&re(window.getComputedStyle(R).zIndex)},[R]),f.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...Se,transform:K?Se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[ie.transformOrigin?.x,ie.transformOrigin?.y].join(" "),...ie.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(vA,{scope:r,placedSide:te,placedAlign:D,onArrowChange:k,arrowX:H,arrowY:X,shouldHideArrow:Y,children:f.jsx(Pe.div,{"data-side":te,"data-align":D,..._,ref:O,style:{..._.style,animation:K?void 0:"none"}})})})});CS.displayName=Ap;var ES="PopperArrow",bA={top:"bottom",right:"left",bottom:"top",left:"right"},RS=S.forwardRef(function(t,r){const{__scopePopper:i,...o}=t,l=yA(ES,i),u=bA[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(pA,{...o,ref:r,style:{...o.style,display:"block"}})})});RS.displayName=ES;function xA(e){return e!==null}var wA=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:i,middlewareData:o}=t,u=o.arrow?.centerOffset!==0,d=u?0:e.arrowWidth,m=u?0:e.arrowHeight,[p,y]=Mp(r),v={start:"0%",center:"50%",end:"100%"}[y],b=(o.arrow?.x??0)+d/2,x=(o.arrow?.y??0)+m/2;let w="",_="";return p==="bottom"?(w=u?v:`${b}px`,_=`${-m}px`):p==="top"?(w=u?v:`${b}px`,_=`${i.floating.height+m}px`):p==="right"?(w=`${-m}px`,_=u?v:`${x}px`):p==="left"&&(w=`${i.floating.width+m}px`,_=u?v:`${x}px`),{data:{x:w,y:_}}}});function Mp(e){const[t,r="center"]=e.split("-");return[t,r]}var Np=wS,Dp=_S,kp=CS,zp=RS,Hh=!1;function SA(){const[e,t]=S.useState(Hh);return S.useEffect(()=>{Hh||(Hh=!0,t(!0))},[]),e}var jS=Mu[" useSyncExternalStore ".trim().toString()];function _A(){return()=>{}}function CA(){return jS(_A,()=>!0,()=>!1)}var EA=typeof jS=="function"?CA:SA,Bh="rovingFocusGroup.onEntryFocus",RA={bubbles:!1,cancelable:!0},wl="RovingFocusGroup",[Rm,TS,jA]=fp(wl),[TA,OS]=Ka(wl,[jA]),[OA,AA]=TA(wl),AS=S.forwardRef((e,t)=>f.jsx(Rm.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Rm.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(MA,{...e,ref:t})})}));AS.displayName=wl;var MA=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:i,loop:o=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:m,onEntryFocus:p,preventScrollOnEntryFocus:y=!1,...v}=e,b=S.useRef(null),x=at(t,b),w=hp(l),[_,E]=Zs({prop:u,defaultProp:d??null,onChange:m,caller:wl}),[R,T]=S.useState(!1),O=tr(p),M=TS(r),k=S.useRef(!1),[B,V]=S.useState(0);return S.useEffect(()=>{const P=b.current;if(P)return P.addEventListener(Bh,O),()=>P.removeEventListener(Bh,O)},[O]),f.jsx(OA,{scope:r,orientation:i,dir:w,loop:o,currentTabStopId:_,onItemFocus:S.useCallback(P=>E(P),[E]),onItemShiftTab:S.useCallback(()=>T(!0),[]),onFocusableItemAdd:S.useCallback(()=>V(P=>P+1),[]),onFocusableItemRemove:S.useCallback(()=>V(P=>P-1),[]),children:f.jsx(Pe.div,{tabIndex:R||B===0?-1:0,"data-orientation":i,...v,ref:x,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{k.current=!0}),onFocus:Te(e.onFocus,P=>{const pe=!k.current;if(P.target===P.currentTarget&&pe&&!R){const ne=new CustomEvent(Bh,RA);if(P.currentTarget.dispatchEvent(ne),!ne.defaultPrevented){const ce=M().filter(L=>L.focusable),me=ce.find(L=>L.active),fe=ce.find(L=>L.id===_),Se=[me,fe,...ce].filter(Boolean).map(L=>L.ref.current);DS(Se,y)}}k.current=!1}),onBlur:Te(e.onBlur,()=>T(!1))})})}),MS="RovingFocusGroupItem",NS=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:l,children:u,...d}=e,m=fn(),p=l||m,y=AA(MS,r),v=y.currentTabStopId===p,b=TS(r),{onFocusableItemAdd:x,onFocusableItemRemove:w,currentTabStopId:_}=y,E=EA();return Qt(()=>{if(!(!E||!i))return x(),()=>w()},[E,i,x,w]),S.useEffect(()=>{if(!(E||!i))return x(),()=>w()},[E,i,x,w]),f.jsx(Rm.ItemSlot,{scope:r,id:p,focusable:i,active:o,children:f.jsx(Pe.span,{tabIndex:v?0:-1,"data-orientation":y.orientation,...d,ref:t,onMouseDown:Te(e.onMouseDown,R=>{i?y.onItemFocus(p):R.preventDefault()}),onFocus:Te(e.onFocus,()=>y.onItemFocus(p)),onKeyDown:Te(e.onKeyDown,R=>{if(R.key==="Tab"&&R.shiftKey){y.onItemShiftTab();return}if(R.target!==R.currentTarget)return;const T=kA(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(k=>k.focusable).map(k=>k.ref.current);if(T==="last")M.reverse();else if(T==="prev"||T==="next"){T==="prev"&&M.reverse();const k=M.indexOf(R.currentTarget);M=y.loop?zA(M,k+1):M.slice(k+1)}setTimeout(()=>DS(M))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:_!=null}):u})})});NS.displayName=MS;var NA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function DA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function kA(e,t,r){const i=DA(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return NA[i]}function DS(e,t=!1){const r=document.activeElement;for(const i of e)if(i===r||(i.focus({preventScroll:t}),document.activeElement!==r))return}function zA(e,t){return e.map((r,i)=>e[(t+i)%e.length])}var LA=AS,$A=NS,jm=["Enter"," "],IA=["ArrowDown","PageUp","Home"],kS=["ArrowUp","PageDown","End"],PA=[...IA,...kS],FA={ltr:[...jm,"ArrowRight"],rtl:[...jm,"ArrowLeft"]},VA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sl="Menu",[fl,UA,HA]=fp(Sl),[Li,zS]=Ka(Sl,[HA,Ws,OS]),Uu=Ws(),LS=OS(),[BA,$i]=Li(Sl),[qA,_l]=Li(Sl),$S=e=>{const{__scopeMenu:t,open:r=!1,children:i,dir:o,onOpenChange:l,modal:u=!0}=e,d=Uu(t),[m,p]=S.useState(null),y=S.useRef(!1),v=tr(l),b=hp(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(Np,{...d,children:f.jsx(BA,{scope:t,open:r,onOpenChange:v,content:m,onContentChange:p,children:f.jsx(qA,{scope:t,onClose:S.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:y,dir:b,modal:u,children:i})})})};$S.displayName=Sl;var GA="MenuAnchor",Lp=S.forwardRef((e,t)=>{const{__scopeMenu:r,...i}=e,o=Uu(r);return f.jsx(Dp,{...o,...i,ref:t})});Lp.displayName=GA;var $p="MenuPortal",[ZA,IS]=Li($p,{forceMount:void 0}),PS=e=>{const{__scopeMenu:t,forceMount:r,children:i,container:o}=e,l=$i($p,t);return f.jsx(ZA,{scope:t,forceMount:r,children:f.jsx(gr,{present:r||l.open,children:f.jsx(xl,{asChild:!0,container:o,children:i})})})};PS.displayName=$p;var er="MenuContent",[KA,Ip]=Li(er),FS=S.forwardRef((e,t)=>{const r=IS(er,e.__scopeMenu),{forceMount:i=r.forceMount,...o}=e,l=$i(er,e.__scopeMenu),u=_l(er,e.__scopeMenu);return f.jsx(fl.Provider,{scope:e.__scopeMenu,children:f.jsx(gr,{present:i||l.open,children:f.jsx(fl.Slot,{scope:e.__scopeMenu,children:u.modal?f.jsx(YA,{...o,ref:t}):f.jsx(QA,{...o,ref:t})})})})}),YA=S.forwardRef((e,t)=>{const r=$i(er,e.__scopeMenu),i=S.useRef(null),o=at(t,i);return S.useEffect(()=>{const l=i.current;if(l)return gp(l)},[]),f.jsx(Pp,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),QA=S.forwardRef((e,t)=>{const r=$i(er,e.__scopeMenu);return f.jsx(Pp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),XA=Ei("MenuContent.ScrollLock"),Pp=S.forwardRef((e,t)=>{const{__scopeMenu:r,loop:i=!1,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:d,onEntryFocus:m,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:x,disableOutsideScroll:w,..._}=e,E=$i(er,r),R=_l(er,r),T=Uu(r),O=LS(r),M=UA(r),[k,B]=S.useState(null),V=S.useRef(null),P=at(t,V,E.onContentChange),pe=S.useRef(0),ne=S.useRef(""),ce=S.useRef(0),me=S.useRef(null),fe=S.useRef("right"),Z=S.useRef(0),Se=w?zu:S.Fragment,L=w?{as:XA,allowPinchZoom:!0}:void 0,K=J=>{const te=ne.current+J,D=M().filter(re=>!re.disabled),N=document.activeElement,H=D.find(re=>re.ref.current===N)?.textValue,X=D.map(re=>re.textValue),Y=cM(X,te,H),he=D.find(re=>re.textValue===Y)?.ref.current;(function re(be){ne.current=be,window.clearTimeout(pe.current),be!==""&&(pe.current=window.setTimeout(()=>re(""),1e3))})(te),he&&setTimeout(()=>he.focus())};S.useEffect(()=>()=>window.clearTimeout(pe.current),[]),pp();const ie=S.useCallback(J=>fe.current===me.current?.side&&dM(J,me.current?.area),[]);return f.jsx(KA,{scope:r,searchRef:ne,onItemEnter:S.useCallback(J=>{ie(J)&&J.preventDefault()},[ie]),onItemLeave:S.useCallback(J=>{ie(J)||(V.current?.focus(),B(null))},[ie]),onTriggerLeave:S.useCallback(J=>{ie(J)&&J.preventDefault()},[ie]),pointerGraceTimerRef:ce,onPointerGraceIntentChange:S.useCallback(J=>{me.current=J},[]),children:f.jsx(Se,{...L,children:f.jsx(Du,{asChild:!0,trapped:o,onMountAutoFocus:Te(l,J=>{J.preventDefault(),V.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:f.jsx(bl,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:x,children:f.jsx(LA,{asChild:!0,...O,dir:R.dir,orientation:"vertical",loop:i,currentTabStopId:k,onCurrentTabStopIdChange:B,onEntryFocus:Te(m,J=>{R.isUsingKeyboardRef.current||J.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(kp,{role:"menu","aria-orientation":"vertical","data-state":n1(E.open),"data-radix-menu-content":"",dir:R.dir,...T,..._,ref:P,style:{outline:"none",..._.style},onKeyDown:Te(_.onKeyDown,J=>{const D=J.target.closest("[data-radix-menu-content]")===J.currentTarget,N=J.ctrlKey||J.altKey||J.metaKey,H=J.key.length===1;D&&(J.key==="Tab"&&J.preventDefault(),!N&&H&&K(J.key));const X=V.current;if(J.target!==X||!PA.includes(J.key))return;J.preventDefault();const he=M().filter(re=>!re.disabled).map(re=>re.ref.current);kS.includes(J.key)&&he.reverse(),oM(he)}),onBlur:Te(e.onBlur,J=>{J.currentTarget.contains(J.target)||(window.clearTimeout(pe.current),ne.current="")}),onPointerMove:Te(e.onPointerMove,hl(J=>{const te=J.target,D=Z.current!==J.clientX;if(J.currentTarget.contains(te)&&D){const N=J.clientX>Z.current?"right":"left";fe.current=N,Z.current=J.clientX}}))})})})})})})});FS.displayName=er;var JA="MenuGroup",Fp=S.forwardRef((e,t)=>{const{__scopeMenu:r,...i}=e;return f.jsx(Pe.div,{role:"group",...i,ref:t})});Fp.displayName=JA;var WA="MenuLabel",VS=S.forwardRef((e,t)=>{const{__scopeMenu:r,...i}=e;return f.jsx(Pe.div,{...i,ref:t})});VS.displayName=WA;var xu="MenuItem",rx="menu.itemSelect",Hu=S.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:i,...o}=e,l=S.useRef(null),u=_l(xu,e.__scopeMenu),d=Ip(xu,e.__scopeMenu),m=at(t,l),p=S.useRef(!1),y=()=>{const v=l.current;if(!r&&v){const b=new CustomEvent(rx,{bubbles:!0,cancelable:!0});v.addEventListener(rx,x=>i?.(x),{once:!0}),Pw(v,b),b.defaultPrevented?p.current=!1:u.onClose()}};return f.jsx(US,{...o,ref:m,disabled:r,onClick:Te(e.onClick,y),onPointerDown:v=>{e.onPointerDown?.(v),p.current=!0},onPointerUp:Te(e.onPointerUp,v=>{p.current||v.currentTarget?.click()}),onKeyDown:Te(e.onKeyDown,v=>{r||v.target!==v.currentTarget||d.searchRef.current!==""&&v.key===" "||jm.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});Hu.displayName=xu;var US=S.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:i=!1,textValue:o,...l}=e,u=Ip(xu,r),d=LS(r),m=S.useRef(null),p=at(t,m),[y,v]=S.useState(!1),[b,x]=S.useState("");return S.useEffect(()=>{const w=m.current;w&&x((w.textContent??"").trim())},[l.children]),f.jsx(fl.ItemSlot,{scope:r,disabled:i,textValue:o??b,children:f.jsx($A,{asChild:!0,...d,focusable:!i,children:f.jsx(Pe.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...l,ref:p,onPointerMove:Te(e.onPointerMove,hl(w=>{i?u.onItemLeave(w):(u.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,hl(w=>u.onItemLeave(w))),onFocus:Te(e.onFocus,()=>v(!0)),onBlur:Te(e.onBlur,()=>v(!1))})})})}),eM="MenuCheckboxItem",HS=S.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:i,...o}=e;return f.jsx(KS,{scope:e.__scopeMenu,checked:r,children:f.jsx(Hu,{role:"menuitemcheckbox","aria-checked":wu(r)?"mixed":r,...o,ref:t,"data-state":Up(r),onSelect:Te(o.onSelect,()=>i?.(wu(r)?!0:!r),{checkForDefaultPrevented:!1})})})});HS.displayName=eM;var BS="MenuRadioGroup",[tM,nM]=Li(BS,{value:void 0,onValueChange:()=>{}}),qS=S.forwardRef((e,t)=>{const{value:r,onValueChange:i,...o}=e,l=tr(i);return f.jsx(tM,{scope:e.__scopeMenu,value:r,onValueChange:l,children:f.jsx(Fp,{...o,ref:t})})});qS.displayName=BS;var GS="MenuRadioItem",ZS=S.forwardRef((e,t)=>{const{value:r,...i}=e,o=nM(GS,e.__scopeMenu),l=r===o.value;return f.jsx(KS,{scope:e.__scopeMenu,checked:l,children:f.jsx(Hu,{role:"menuitemradio","aria-checked":l,...i,ref:t,"data-state":Up(l),onSelect:Te(i.onSelect,()=>o.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});ZS.displayName=GS;var Vp="MenuItemIndicator",[KS,rM]=Li(Vp,{checked:!1}),YS=S.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:i,...o}=e,l=rM(Vp,r);return f.jsx(gr,{present:i||wu(l.checked)||l.checked===!0,children:f.jsx(Pe.span,{...o,ref:t,"data-state":Up(l.checked)})})});YS.displayName=Vp;var aM="MenuSeparator",QS=S.forwardRef((e,t)=>{const{__scopeMenu:r,...i}=e;return f.jsx(Pe.div,{role:"separator","aria-orientation":"horizontal",...i,ref:t})});QS.displayName=aM;var iM="MenuArrow",XS=S.forwardRef((e,t)=>{const{__scopeMenu:r,...i}=e,o=Uu(r);return f.jsx(zp,{...o,...i,ref:t})});XS.displayName=iM;var sM="MenuSub",[MF,JS]=Li(sM),Wo="MenuSubTrigger",WS=S.forwardRef((e,t)=>{const r=$i(Wo,e.__scopeMenu),i=_l(Wo,e.__scopeMenu),o=JS(Wo,e.__scopeMenu),l=Ip(Wo,e.__scopeMenu),u=S.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:m}=l,p={__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),m(null)}},[d,m]);const v=at(t,o.onTriggerChange);return f.jsx(Lp,{asChild:!0,...p,children:f.jsx(US,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":n1(r.open),...e,ref:v,onClick:b=>{e.onClick?.(b),!(e.disabled||b.defaultPrevented)&&(b.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,hl(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:Te(e.onPointerLeave,hl(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:Te(e.onKeyDown,b=>{e.disabled||b.target!==b.currentTarget||l.searchRef.current!==""&&b.key===" "||FA[i.dir].includes(b.key)&&(r.onOpenChange(!0),r.content?.focus(),b.preventDefault())})})})});WS.displayName=Wo;var e1="MenuSubContent",t1=S.forwardRef((e,t)=>{const r=IS(er,e.__scopeMenu),{forceMount:i=r.forceMount,align:o="start",...l}=e,u=$i(er,e.__scopeMenu),d=_l(er,e.__scopeMenu),m=JS(e1,e.__scopeMenu),p=S.useRef(null),y=at(t,p);return f.jsx(fl.Provider,{scope:e.__scopeMenu,children:f.jsx(gr,{present:i||u.open,children:f.jsx(fl.Slot,{scope:e.__scopeMenu,children:f.jsx(Pp,{id:m.contentId,"aria-labelledby":m.triggerId,...l,ref:y,align:o,side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{d.isUsingKeyboardRef.current&&p.current?.focus(),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:Te(e.onFocusOutside,v=>{v.target!==m.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,v=>{d.onClose(),v.preventDefault()}),onKeyDown:Te(e.onKeyDown,v=>{const b=v.currentTarget.contains(v.target),x=VA[d.dir].includes(v.key);b&&x&&(u.onOpenChange(!1),m.trigger?.focus(),v.preventDefault())})})})})})});t1.displayName=e1;function n1(e){return e?"open":"closed"}function wu(e){return e==="indeterminate"}function Up(e){return wu(e)?"indeterminate":e?"checked":"unchecked"}function oM(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function lM(e,t){return e.map((r,i)=>e[(t+i)%e.length])}function cM(e,t,r){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,l=r?e.indexOf(r):-1;let u=lM(e,Math.max(l,0));o.length===1&&(u=u.filter(p=>p!==r));const m=u.find(p=>p.toLowerCase().startsWith(o.toLowerCase()));return m!==r?m:void 0}function uM(e,t){const{x:r,y:i}=e;let o=!1;for(let l=0,u=t.length-1;li!=b>i&&r<(v-p)*(i-y)/(b-y)+p&&(o=!o)}return o}function dM(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return uM(r,t)}function hl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var fM=$S,hM=Lp,mM=PS,pM=FS,gM=Fp,vM=VS,yM=Hu,bM=HS,xM=qS,wM=ZS,SM=YS,_M=QS,CM=XS,EM=WS,RM=t1,Bu="DropdownMenu",[jM]=Ka(Bu,[zS]),vn=zS(),[TM,r1]=jM(Bu),a1=e=>{const{__scopeDropdownMenu:t,children:r,dir:i,open:o,defaultOpen:l,onOpenChange:u,modal:d=!0}=e,m=vn(t),p=S.useRef(null),[y,v]=Zs({prop:o,defaultProp:l??!1,onChange:u,caller:Bu});return f.jsx(TM,{scope:t,triggerId:fn(),triggerRef:p,contentId:fn(),open:y,onOpenChange:v,onOpenToggle:S.useCallback(()=>v(b=>!b),[v]),modal:d,children:f.jsx(fM,{...m,open:y,onOpenChange:v,dir:i,modal:d,children:r})})};a1.displayName=Bu;var i1="DropdownMenuTrigger",s1=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:i=!1,...o}=e,l=r1(i1,r),u=vn(r),d=at(t,l.triggerRef);return f.jsx(hM,{asChild:!0,...u,children:f.jsx(Pe.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:Te(e.onPointerDown,m=>{!i&&m.button===0&&m.ctrlKey===!1&&(l.onOpenToggle(),l.open||m.preventDefault())}),onKeyDown:Te(e.onKeyDown,m=>{i||(["Enter"," "].includes(m.key)&&l.onOpenToggle(),m.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(m.key)&&m.preventDefault())})})})});s1.displayName=i1;var OM="DropdownMenuPortal",o1=e=>{const{__scopeDropdownMenu:t,...r}=e,i=vn(t);return f.jsx(mM,{...i,...r})};o1.displayName=OM;var l1="DropdownMenuContent",c1=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=r1(l1,r),l=vn(r),u=S.useRef(!1);return f.jsx(pM,{id:o.contentId,"aria-labelledby":o.triggerId,...l,...i,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,d=>{u.current||o.triggerRef.current?.focus(),u.current=!1,d.preventDefault()}),onInteractOutside:Te(e.onInteractOutside,d=>{const m=d.detail.originalEvent,p=m.button===0&&m.ctrlKey===!0,y=m.button===2||p;(!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)"}})});c1.displayName=l1;var AM="DropdownMenuGroup",MM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(gM,{...o,...i,ref:t})});MM.displayName=AM;var NM="DropdownMenuLabel",u1=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(vM,{...o,...i,ref:t})});u1.displayName=NM;var DM="DropdownMenuItem",d1=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(yM,{...o,...i,ref:t})});d1.displayName=DM;var kM="DropdownMenuCheckboxItem",zM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(bM,{...o,...i,ref:t})});zM.displayName=kM;var LM="DropdownMenuRadioGroup",$M=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(xM,{...o,...i,ref:t})});$M.displayName=LM;var IM="DropdownMenuRadioItem",PM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(wM,{...o,...i,ref:t})});PM.displayName=IM;var FM="DropdownMenuItemIndicator",VM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(SM,{...o,...i,ref:t})});VM.displayName=FM;var UM="DropdownMenuSeparator",HM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(_M,{...o,...i,ref:t})});HM.displayName=UM;var BM="DropdownMenuArrow",qM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(CM,{...o,...i,ref:t})});qM.displayName=BM;var GM="DropdownMenuSubTrigger",ZM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(EM,{...o,...i,ref:t})});ZM.displayName=GM;var KM="DropdownMenuSubContent",YM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(RM,{...o,...i,ref:t,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)"}})});YM.displayName=KM;var QM=a1,XM=s1,JM=o1,WM=c1,eN=u1,tN=d1,nN="Label",f1=S.forwardRef((e,t)=>f.jsx(Pe.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));f1.displayName=nN;var rN=f1;function ax(e,[t,r]){return Math.min(r,Math.max(t,e))}var aN=[" ","Enter","ArrowUp","ArrowDown"],iN=[" ","Enter"],Ti="Select",[qu,Gu,sN]=fp(Ti),[Ii]=Ka(Ti,[sN,Ws]),Zu=Ws(),[oN,Qa]=Ii(Ti),[lN,cN]=Ii(Ti),uN="SelectProvider";function h1(e){const{__scopeSelect:t,children:r,open:i,defaultOpen:o,onOpenChange:l,value:u,defaultValue:d,onValueChange:m,dir:p,name:y,autoComplete:v,disabled:b,required:x,form:w,internal_do_not_use_render:_}=e,E=Zu(t),[R,T]=S.useState(null),[O,M]=S.useState(null),[k,B]=S.useState(!1),V=hp(p),[P,pe]=Zs({prop:i,defaultProp:o??!1,onChange:l,caller:Ti}),[ne,ce]=Zs({prop:u,defaultProp:d,onChange:m,caller:Ti}),me=S.useRef(null),fe=S.useRef(ne);S.useEffect(()=>{const N=w?R?.ownerDocument.getElementById(w):R?.form;if(N instanceof HTMLFormElement){const H=()=>ce(fe.current);return N.addEventListener("reset",H),()=>N.removeEventListener("reset",H)}},[w,R,ce]);const Z=R?!!w||!!R.closest("form"):!0,[Se,L]=S.useState(new Set),K=fn(),ie=Array.from(Se).map(N=>N.props.value).join(";"),J=S.useCallback(N=>{L(H=>new Set(H).add(N))},[]),te=S.useCallback(N=>{L(H=>{const X=new Set(H);return X.delete(N),X})},[]),D={required:x,trigger:R,onTriggerChange:T,valueNode:O,onValueNodeChange:M,valueNodeHasChildren:k,onValueNodeHasChildrenChange:B,contentId:K,value:ne,onValueChange:ce,open:P,onOpenChange:pe,dir:V,triggerPointerDownPosRef:me,disabled:b,name:y,autoComplete:v,form:w,nativeOptions:Se,nativeSelectKey:ie,isFormControl:Z};return f.jsx(Np,{...E,children:f.jsx(oN,{scope:t,...D,children:f.jsx(qu.Provider,{scope:t,children:f.jsx(lN,{scope:t,onNativeOptionAdd:J,onNativeOptionRemove:te,children:jN(_)?_(D):r})})})})}h1.displayName=uN;var m1=e=>{const{__scopeSelect:t,children:r,...i}=e;return f.jsx(h1,{__scopeSelect:t,...i,internal_do_not_use_render:({isFormControl:o})=>f.jsxs(f.Fragment,{children:[r,o?f.jsx(F1,{__scopeSelect:t}):null]})})};m1.displayName=Ti;var p1="SelectTrigger",g1=S.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:i=!1,...o}=e,l=Zu(r),u=Qa(p1,r),d=u.disabled||i,m=at(t,u.onTriggerChange),p=Gu(r),y=S.useRef("touch"),[v,b,x]=V1(_=>{const E=p().filter(O=>!O.disabled),R=E.find(O=>O.value===u.value),T=U1(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(Dp,{asChild:!0,...l,children:f.jsx(Pe.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":Ku(u.value)?"":void 0,...o,ref:m,onClick:Te(o.onClick,_=>{_.currentTarget.focus(),y.current!=="mouse"&&w(_)}),onPointerDown:Te(o.onPointerDown,_=>{y.current=_.pointerType;const E=_.target;E.hasPointerCapture(_.pointerId)&&E.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(w(_),_.preventDefault())}),onKeyDown:Te(o.onKeyDown,_=>{const E=v.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&b(_.key),!(E&&_.key===" ")&&aN.includes(_.key)&&(w(),_.preventDefault())})})})});g1.displayName=p1;var v1="SelectValue",y1=S.forwardRef((e,t)=>{const{__scopeSelect:r,className:i,style:o,children:l,placeholder:u="",...d}=e,m=Qa(v1,r),{onValueNodeHasChildrenChange:p}=m,y=l!==void 0,v=at(t,m.onValueNodeChange);Qt(()=>{p(y)},[p,y]);const b=Ku(m.value);return f.jsx(Pe.span,{...d,asChild:b?!1:d.asChild,ref:v,style:{pointerEvents:"none"},children:f.jsx(S.Fragment,{children:b?u:l},b?"placeholder":"value")})});y1.displayName=v1;var dN="SelectIcon",b1=S.forwardRef((e,t)=>{const{__scopeSelect:r,children:i,...o}=e;return f.jsx(Pe.span,{"aria-hidden":!0,...o,ref:t,children:i||"▼"})});b1.displayName=dN;var x1="SelectPortal",[fN,hN]=Ii(x1,{forceMount:void 0}),w1=e=>{const{__scopeSelect:t,forceMount:r,...i}=e;return f.jsx(fN,{scope:e.__scopeSelect,forceMount:r,children:f.jsx(xl,{asChild:!0,...i})})};w1.displayName=x1;var qa="SelectContent",S1=S.forwardRef((e,t)=>{const r=hN(qa,e.__scopeSelect),{forceMount:i=r.forceMount,...o}=e,l=Qa(qa,e.__scopeSelect),[u,d]=S.useState();return Qt(()=>{d(new DocumentFragment)},[]),f.jsx(gr,{present:i||l.open,children:({present:m})=>m?f.jsx(E1,{...o,ref:t}):f.jsx(_1,{...o,fragment:u})})});S1.displayName=qa;var _1=S.forwardRef((e,t)=>{const{__scopeSelect:r,children:i,fragment:o}=e;return o?zi.createPortal(f.jsx(C1,{scope:r,children:f.jsx(qu.Slot,{scope:r,children:f.jsx("div",{ref:t,children:i})})}),o):null});_1.displayName="SelectContentFragment";var dr=10,[C1,Xa]=Ii(qa),mN="SelectContentImpl",pN=Ei("SelectContent.RemoveScroll"),E1=S.forwardRef((e,t)=>{const{__scopeSelect:r}=e,{position:i="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:u,side:d,sideOffset:m,align:p,alignOffset:y,arrowPadding:v,collisionBoundary:b,collisionPadding:x,sticky:w,hideWhenDetached:_,avoidCollisions:E,...R}=e,T=Qa(qa,r),[O,M]=S.useState(null),[k,B]=S.useState(null),V=at(t,M),[P,pe]=S.useState(null),[ne,ce]=S.useState(null),me=Gu(r),[fe,Z]=S.useState(!1),Se=S.useRef(!1);S.useEffect(()=>{if(O)return gp(O)},[O]),pp();const L=S.useCallback(re=>{const[be,...xe]=me().map(He=>He.ref.current),[Me]=xe.slice(-1),Fe=document.activeElement;for(const He of re)if(He===Fe||(He?.scrollIntoView({block:"nearest"}),He===be&&k&&(k.scrollTop=0),He===Me&&k&&(k.scrollTop=k.scrollHeight),He?.focus(),document.activeElement!==Fe))return},[me,k]),K=S.useCallback(()=>L([P,O]),[L,P,O]);S.useEffect(()=>{fe&&K()},[fe,K]);const{onOpenChange:ie,triggerPointerDownPosRef:J}=T;S.useEffect(()=>{if(O){let re={x:0,y:0};const be=Me=>{re={x:Math.abs(Math.round(Me.pageX)-(J.current?.x??0)),y:Math.abs(Math.round(Me.pageY)-(J.current?.y??0))}},xe=Me=>{re.x<=10&&re.y<=10?Me.preventDefault():Me.composedPath().includes(O)||ie(!1),document.removeEventListener("pointermove",be),J.current=null};return J.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",xe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",xe,{capture:!0})}}},[O,ie,J]),S.useEffect(()=>{const re=()=>ie(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[ie]);const[te,D]=V1(re=>{const be=me().filter(Fe=>!Fe.disabled),xe=be.find(Fe=>Fe.ref.current===document.activeElement),Me=U1(be,re,xe);Me&&setTimeout(()=>Me.ref.current?.focus())}),N=S.useCallback((re,be,xe)=>{const Me=!Se.current&&!xe;(T.value!==void 0&&T.value===be||Me)&&(pe(re),Me&&(Se.current=!0))},[T.value]),H=S.useCallback(()=>O?.focus(),[O]),X=S.useCallback((re,be,xe)=>{const Me=!Se.current&&!xe;(T.value!==void 0&&T.value===be||Me)&&ce(re)},[T.value]),Y=i==="popper"?Tm:R1,he=Y===Tm?{side:d,sideOffset:m,align:p,alignOffset:y,arrowPadding:v,collisionBoundary:b,collisionPadding:x,sticky:w,hideWhenDetached:_,avoidCollisions:E}:{};return f.jsx(C1,{scope:r,content:O,viewport:k,onViewportChange:B,itemRefCallback:N,selectedItem:P,onItemLeave:H,itemTextRefCallback:X,focusSelectedItem:K,selectedItemText:ne,position:i,isPositioned:fe,searchRef:te,children:f.jsx(zu,{as:pN,allowPinchZoom:!0,children:f.jsx(Du,{asChild:!0,trapped:T.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:Te(o,re=>{T.trigger?.focus({preventScroll:!0}),re.preventDefault()}),children:f.jsx(bl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:f.jsx(Y,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:re=>re.preventDefault(),...R,...he,onPlaced:()=>Z(!0),ref:V,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Te(R.onKeyDown,re=>{const be=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!be&&re.key.length===1&&D(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let Me=me().filter(Fe=>!Fe.disabled).map(Fe=>Fe.ref.current);if(["ArrowUp","End"].includes(re.key)&&(Me=Me.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const Fe=re.target,He=Me.indexOf(Fe);Me=Me.slice(He+1)}setTimeout(()=>L(Me)),re.preventDefault()}})})})})})})});E1.displayName=mN;var gN="SelectItemAlignedPosition",R1=S.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:i,...o}=e,l=Qa(qa,r),u=Xa(qa,r),[d,m]=S.useState(null),[p,y]=S.useState(null),v=at(t,y),b=Gu(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&&p&&_&&E&&R){const V=l.trigger.getBoundingClientRect(),P=p.getBoundingClientRect(),pe=l.valueNode.getBoundingClientRect(),ne=R.getBoundingClientRect();if(l.dir!=="rtl"){const Fe=ne.left-P.left,He=pe.left-Fe,ct=V.left-He,Je=V.width+ct,hn=Math.max(Je,P.width),mn=window.innerWidth-dr,Xt=ax(He,[dr,Math.max(dr,mn-hn)]);d.style.minWidth=Je+"px",d.style.left=Xt+"px"}else{const Fe=P.right-ne.right,He=window.innerWidth-pe.right-Fe,ct=window.innerWidth-V.right-He,Je=V.width+ct,hn=Math.max(Je,P.width),mn=window.innerWidth-dr,Xt=ax(He,[dr,Math.max(dr,mn-hn)]);d.style.minWidth=Je+"px",d.style.right=Xt+"px"}const ce=b(),me=window.innerHeight-dr*2,fe=_.scrollHeight,Z=window.getComputedStyle(p),Se=parseInt(Z.borderTopWidth,10),L=parseInt(Z.paddingTop,10),K=parseInt(Z.borderBottomWidth,10),ie=parseInt(Z.paddingBottom,10),J=Se+L+fe+ie+K,te=Math.min(E.offsetHeight*5,J),D=window.getComputedStyle(_),N=parseInt(D.paddingTop,10),H=parseInt(D.paddingBottom,10),X=V.top+V.height/2-dr,Y=me-X,he=E.offsetHeight/2,re=E.offsetTop+he,be=Se+L+re,xe=J-be;if(be<=X){const Fe=ce.length>0&&E===ce[ce.length-1].ref.current;d.style.bottom="0px";const He=p.clientHeight-_.offsetTop-_.offsetHeight,ct=Math.max(Y,he+(Fe?H:0)+He+K),Je=be+ct;d.style.height=Je+"px"}else{const Fe=ce.length>0&&E===ce[0].ref.current;d.style.top="0px";const ct=Math.max(X,Se+_.offsetTop+(Fe?N:0)+he)+xe;d.style.height=ct+"px",_.scrollTop=be-X+_.offsetTop}d.style.margin=`${dr}px 0`,d.style.minHeight=te+"px",d.style.maxHeight=me+"px",i?.(),requestAnimationFrame(()=>x.current=!0)}},[b,l.trigger,l.valueNode,d,p,_,E,R,l.dir,i]);Qt(()=>O(),[O]);const[M,k]=S.useState();Qt(()=>{p&&k(window.getComputedStyle(p).zIndex)},[p]);const B=S.useCallback(V=>{V&&w.current===!0&&(O(),T?.(),w.current=!1)},[O,T]);return f.jsx(yN,{scope:r,contentWrapper:d,shouldExpandOnScrollRef:x,onScrollButtonChange:B,children:f.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:f.jsx(Pe.div,{...o,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});R1.displayName=gN;var vN="SelectPopperPosition",Tm=S.forwardRef((e,t)=>{const{__scopeSelect:r,align:i="start",collisionPadding:o=dr,...l}=e,u=Zu(r);return f.jsx(kp,{...u,...l,ref:t,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)"}})});Tm.displayName=vN;var[yN,Hp]=Ii(qa,{}),Om="SelectViewport",j1=S.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:i,...o}=e,l=Xa(Om,r),u=Hp(Om,r),d=at(t,l.onViewportChange),m=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(qu.Slot,{scope:r,children:f.jsx(Pe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Te(o.onScroll,p=>{const y=p.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:b}=u;if(b?.current&&v){const x=Math.abs(m.current-y.scrollTop);if(x>0){const w=window.innerHeight-dr*2,_=parseFloat(v.style.minHeight),E=parseFloat(v.style.height),R=Math.max(_,E);if(R0?M:0,v.style.justifyContent="flex-end")}}}m.current=y.scrollTop})})})]})});j1.displayName=Om;var T1="SelectGroup",[bN,xN]=Ii(T1),wN=S.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,o=fn();return f.jsx(bN,{scope:r,id:o,children:f.jsx(Pe.div,{role:"group","aria-labelledby":o,...i,ref:t})})});wN.displayName=T1;var O1="SelectLabel",SN=S.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,o=xN(O1,r);return f.jsx(Pe.div,{id:o.id,...i,ref:t})});SN.displayName=O1;var Su="SelectItem",[_N,A1]=Ii(Su),M1=S.forwardRef((e,t)=>{const{__scopeSelect:r,value:i,disabled:o=!1,textValue:l,...u}=e,d=Qa(Su,r),m=Xa(Su,r),p=d.value===i,[y,v]=S.useState(l??""),[b,x]=S.useState(!1),w=tr(O=>m.itemRefCallback?.(O,i,o)),_=at(t,w),E=fn(),R=S.useRef("touch"),T=()=>{o||(d.onValueChange(i),d.onOpenChange(!1))};return f.jsx(_N,{scope:r,value:i,disabled:o,textId:E,isSelected:p,onItemTextChange:S.useCallback(O=>{v(M=>M||(O?.textContent??"").trim())},[]),children:f.jsx(qu.ItemSlot,{scope:r,value:i,disabled:o,textValue:y,children:f.jsx(Pe.div,{role:"option","aria-labelledby":E,"data-highlighted":b?"":void 0,"aria-selected":p&&b,"data-state":p?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...u,ref:_,onFocus:Te(u.onFocus,()=>x(!0)),onBlur:Te(u.onBlur,()=>x(!1)),onClick:Te(u.onClick,()=>{R.current!=="mouse"&&T()}),onPointerUp:Te(u.onPointerUp,()=>{R.current==="mouse"&&T()}),onPointerDown:Te(u.onPointerDown,O=>{R.current=O.pointerType}),onPointerMove:Te(u.onPointerMove,O=>{R.current=O.pointerType,o?m.onItemLeave?.():R.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(u.onPointerLeave,O=>{O.currentTarget===document.activeElement&&m.onItemLeave?.()}),onKeyDown:Te(u.onKeyDown,O=>{o||O.target!==O.currentTarget||m.searchRef?.current!==""&&O.key===" "||(iN.includes(O.key)&&T(),O.key===" "&&O.preventDefault())})})})})});M1.displayName=Su;var el="SelectItemText",N1=S.forwardRef((e,t)=>{const{__scopeSelect:r,className:i,style:o,...l}=e,u=Qa(el,r),d=Xa(el,r),m=A1(el,r),p=cN(el,r),[y,v]=S.useState(null),b=tr(T=>d.itemTextRefCallback?.(T,m.value,m.disabled)),x=at(t,v,m.onItemTextChange,b),w=y?.textContent,_=S.useMemo(()=>f.jsx("option",{value:m.value,disabled:m.disabled,children:w},m.value),[m.disabled,m.value,w]),{onNativeOptionAdd:E,onNativeOptionRemove:R}=p;return Qt(()=>(E(_),()=>R(_)),[E,R,_]),f.jsxs(f.Fragment,{children:[f.jsx(Pe.span,{id:m.textId,...l,ref:x}),m.isSelected&&u.valueNode&&!u.valueNodeHasChildren&&!Ku(u.value)?zi.createPortal(l.children,u.valueNode):null]})});N1.displayName=el;var D1="SelectItemIndicator",k1=S.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e;return A1(D1,r).isSelected?f.jsx(Pe.span,{"aria-hidden":!0,...i,ref:t}):null});k1.displayName=D1;var Am="SelectScrollUpButton",z1=S.forwardRef((e,t)=>{const r=Xa(Am,e.__scopeSelect),i=Hp(Am,e.__scopeSelect),[o,l]=S.useState(!1),u=at(t,i.onScrollButtonChange);return Qt(()=>{if(r.viewport&&r.isPositioned){let d=function(){const p=m.scrollTop>0;l(p)};const m=r.viewport;return d(),m.addEventListener("scroll",d),()=>m.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),o?f.jsx($1,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:m}=r;d&&m&&(d.scrollTop=d.scrollTop-m.offsetHeight)}}):null});z1.displayName=Am;var Mm="SelectScrollDownButton",L1=S.forwardRef((e,t)=>{const r=Xa(Mm,e.__scopeSelect),i=Hp(Mm,e.__scopeSelect),[o,l]=S.useState(!1),u=at(t,i.onScrollButtonChange);return Qt(()=>{if(r.viewport&&r.isPositioned){let d=function(){const p=m.scrollHeight-m.clientHeight,y=Math.ceil(m.scrollTop)m.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),o?f.jsx($1,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:m}=r;d&&m&&(d.scrollTop=d.scrollTop+m.offsetHeight)}}):null});L1.displayName=Mm;var $1=S.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:i,...o}=e,l=Xa("SelectScrollButton",r),u=S.useRef(null),d=Gu(r),m=S.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return S.useEffect(()=>()=>m(),[m]),Qt(()=>{d().find(y=>y.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[d]),f.jsx(Pe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Te(o.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(i,50))}),onPointerMove:Te(o.onPointerMove,()=>{l.onItemLeave?.(),u.current===null&&(u.current=window.setInterval(i,50))}),onPointerLeave:Te(o.onPointerLeave,()=>{m()})})}),CN="SelectSeparator",EN=S.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e;return f.jsx(Pe.div,{"aria-hidden":!0,...i,ref:t})});EN.displayName=CN;var I1="SelectArrow",RN=S.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,o=Zu(r);return Xa(I1,r).position==="popper"?f.jsx(zp,{...o,...i,ref:t}):null});RN.displayName=I1;var P1="SelectBubbleInput",F1=S.forwardRef(({__scopeSelect:e,...t},r)=>{const i=Qa(P1,e),{value:o,onValueChange:l,required:u,disabled:d,name:m,autoComplete:p,form:y}=i,{nativeOptions:v,nativeSelectKey:b}=i,x=S.useRef(null),w=at(r,x),_=o??"",E=oO(_),R=Array.from(v).some(T=>(T.props.value??"")==="");return S.useEffect(()=>{const T=x.current;if(!T)return;const O=window.HTMLSelectElement.prototype,k=Object.getOwnPropertyDescriptor(O,"value").set;if(E!==_&&k){const B=new Event("change",{bubbles:!0});k.call(T,_),T.dispatchEvent(B)}},[E,_]),f.jsxs(Pe.select,{"aria-hidden":!0,required:u,tabIndex:-1,name:m,autoComplete:p,disabled:d,form:y,onChange:T=>l(T.target.value),...t,style:{...Fw,...t.style},ref:w,defaultValue:_,children:[Ku(o)&&!R?f.jsx("option",{value:""}):null,Array.from(v)]},b)});F1.displayName=P1;function jN(e){return typeof e=="function"}function Ku(e){return e===""||e===void 0}function V1(e){const t=tr(e),r=S.useRef(""),i=S.useRef(0),o=S.useCallback(u=>{const d=r.current+u;t(d),(function m(p){r.current=p,window.clearTimeout(i.current),p!==""&&(i.current=window.setTimeout(()=>m(""),1e3))})(d)},[t]),l=S.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,o,l]}function U1(e,t,r){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,l=r?e.indexOf(r):-1;let u=TN(e,Math.max(l,0));o.length===1&&(u=u.filter(p=>p!==r));const m=u.find(p=>p.textValue.toLowerCase().startsWith(o.toLowerCase()));return m!==r?m:void 0}function TN(e,t){return e.map((r,i)=>e[(t+i)%e.length])}var ON="Separator",ix="horizontal",AN=["horizontal","vertical"],H1=S.forwardRef((e,t)=>{const{decorative:r,orientation:i=ix,...o}=e,l=MN(i)?i:ix,d=r?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return f.jsx(Pe.div,{"data-orientation":l,...d,...o,ref:t})});H1.displayName=ON;function MN(e){return AN.includes(e)}var NN=H1,[Yu]=Ka("Tooltip",[Ws]),Qu=Ws(),B1="TooltipProvider",DN=700,Nm="tooltip.open",[kN,Bp]=Yu(B1),q1=e=>{const{__scopeTooltip:t,delayDuration:r=DN,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:l}=e,u=S.useRef(!0),d=S.useRef(!1),m=S.useRef(0);return S.useEffect(()=>{const p=m.current;return()=>window.clearTimeout(p)},[]),f.jsx(kN,{scope:t,isOpenDelayedRef:u,delayDuration:r,onOpen:S.useCallback(()=>{i<=0||(window.clearTimeout(m.current),u.current=!1)},[i]),onClose:S.useCallback(()=>{i<=0||(window.clearTimeout(m.current),m.current=window.setTimeout(()=>u.current=!0,i))},[i]),isPointerInTransitRef:d,onPointerInTransitChange:S.useCallback(p=>{d.current=p},[]),disableHoverableContent:o,children:l})};q1.displayName=B1;var ml="Tooltip",[zN,Cl]=Yu(ml),G1=e=>{const{__scopeTooltip:t,children:r,open:i,defaultOpen:o,onOpenChange:l,disableHoverableContent:u,delayDuration:d}=e,m=Bp(ml,e.__scopeTooltip),p=Qu(t),[y,v]=S.useState(null),b=fn(),x=S.useRef(0),w=u??m.disableHoverableContent,_=d??m.delayDuration,E=S.useRef(!1),[R,T]=Zs({prop:i,defaultProp:o??!1,onChange:V=>{V?(m.onOpen(),document.dispatchEvent(new CustomEvent(Nm))):m.onClose(),l?.(V)},caller:ml}),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]),k=S.useCallback(()=>{window.clearTimeout(x.current),x.current=0,T(!1)},[T]),B=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(Np,{...p,children:f.jsx(zN,{scope:t,contentId:b,open:R,stateAttribute:O,trigger:y,onTriggerChange:v,onTriggerEnter:S.useCallback(()=>{m.isOpenDelayedRef.current?B():M()},[m.isOpenDelayedRef,B,M]),onTriggerLeave:S.useCallback(()=>{w?k():(window.clearTimeout(x.current),x.current=0)},[k,w]),onOpen:M,onClose:k,disableHoverableContent:w,children:r})})};G1.displayName=ml;var Dm="TooltipTrigger",Z1=S.forwardRef((e,t)=>{const{__scopeTooltip:r,...i}=e,o=Cl(Dm,r),l=Bp(Dm,r),u=Qu(r),d=S.useRef(null),m=at(t,d,o.onTriggerChange),p=S.useRef(!1),y=S.useRef(!1),v=S.useCallback(()=>p.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),f.jsx(Dp,{asChild:!0,...u,children:f.jsx(Pe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:m,onPointerMove:Te(e.onPointerMove,b=>{b.pointerType!=="touch"&&!y.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),y.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{o.onTriggerLeave(),y.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{o.open&&o.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Te(e.onFocus,()=>{p.current||o.onOpen()}),onBlur:Te(e.onBlur,o.onClose),onClick:Te(e.onClick,o.onClose)})})});Z1.displayName=Dm;var qp="TooltipPortal",[LN,$N]=Yu(qp,{forceMount:void 0}),K1=e=>{const{__scopeTooltip:t,forceMount:r,children:i,container:o}=e,l=Cl(qp,t);return f.jsx(LN,{scope:t,forceMount:r,children:f.jsx(gr,{present:r||l.open,children:f.jsx(xl,{asChild:!0,container:o,children:i})})})};K1.displayName=qp;var Ys="TooltipContent",Y1=S.forwardRef((e,t)=>{const r=$N(Ys,e.__scopeTooltip),{forceMount:i=r.forceMount,side:o="top",...l}=e,u=Cl(Ys,e.__scopeTooltip);return f.jsx(gr,{present:i||u.open,children:u.disableHoverableContent?f.jsx(Q1,{side:o,...l,ref:t}):f.jsx(IN,{side:o,...l,ref:t})})}),IN=S.forwardRef((e,t)=>{const r=Cl(Ys,e.__scopeTooltip),i=Bp(Ys,e.__scopeTooltip),o=S.useRef(null),l=at(t,o),[u,d]=S.useState(null),{trigger:m,onClose:p}=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=UN(R,E.getBoundingClientRect()),O=HN(R,T),M=BN(_.getBoundingClientRect()),k=GN([...O,...M]);d(k),v(!0)},[v]);return S.useEffect(()=>()=>b(),[b]),S.useEffect(()=>{if(m&&y){const w=E=>x(E,y),_=E=>x(E,m);return m.addEventListener("pointerleave",w),y.addEventListener("pointerleave",_),()=>{m.removeEventListener("pointerleave",w),y.removeEventListener("pointerleave",_)}}},[m,y,x,b]),S.useEffect(()=>{if(u){const w=_=>{const E=_.target,R={x:_.clientX,y:_.clientY},T=m?.contains(E)||y?.contains(E),O=!qN(R,u);T?b():O&&(b(),p())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[m,y,u,p,b]),f.jsx(Q1,{...e,ref:l})}),[PN,FN]=Yu(ml,{isInside:!1}),VN=T2("TooltipContent"),Q1=S.forwardRef((e,t)=>{const{__scopeTooltip:r,children:i,"aria-label":o,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,m=Cl(Ys,r),p=Qu(r),{onClose:y}=m;return S.useEffect(()=>(document.addEventListener(Nm,y),()=>document.removeEventListener(Nm,y)),[y]),S.useEffect(()=>{if(m.trigger){const v=b=>{b.target instanceof Node&&b.target.contains(m.trigger)&&y()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[m.trigger,y]),f.jsx(bl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:v=>v.preventDefault(),onDismiss:y,children:f.jsxs(kp,{"data-state":m.stateAttribute,...p,...d,ref:t,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(VN,{children:i}),f.jsx(PN,{scope:r,isInside:!0,children:f.jsx(P2,{id:m.contentId,role:"tooltip",children:o||i})})]})})});Y1.displayName=Ys;var X1="TooltipArrow",J1=S.forwardRef((e,t)=>{const{__scopeTooltip:r,...i}=e,o=Qu(r);return FN(X1,r).isInside?null:f.jsx(zp,{...o,...i,ref:t})});J1.displayName=X1;function UN(e,t){const r=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),l=Math.abs(t.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 HN(e,t,r=5){const i=[];switch(t){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 BN(e){const{top:t,right:r,bottom:i,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:i},{x:o,y:i}]}function qN(e,t){const{x:r,y:i}=e;let o=!1;for(let l=0,u=t.length-1;li!=b>i&&r<(v-p)*(i-y)/(b-y)+p&&(o=!o)}return o}function GN(e){const t=e.slice();return t.sort((r,i)=>r.xi.x?1:r.yi.y?1:0),ZN(t)}function ZN(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const l=t[t.length-1],u=t[t.length-2];if((l.x-u.x)*(o.y-u.y)>=(l.y-u.y)*(o.x-u.x))t.pop();else break}t.push(o)}t.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(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var KN=q1,YN=G1,QN=Z1,XN=K1,JN=Y1,WN=J1;function W1(e){var t,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(t=0;t{const r=new Array(e.length+t.length);for(let i=0;i({classGroupId:e,validator:t}),t_=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),_u="-",sx=[],nD="arbitrary..",rD=e=>{const t=iD(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return aD(u);const d=u.split(_u),m=d[0]===""&&d.length>1?1:0;return n_(d,m,t)},getConflictingClassGroupIds:(u,d)=>{if(d){const m=i[u],p=r[u];return m?p?eD(p,m):m:p||sx}return r[u]||sx}}},n_=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],l=r.nextPart.get(o);if(l){const p=n_(e,t+1,l);if(p)return p}const u=r.validators;if(u===null)return;const d=t===0?e.join(_u):e.slice(t).join(_u),m=u.length;for(let p=0;pe.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),i=t.slice(0,r);return i?nD+i:void 0})(),iD=e=>{const{theme:t,classGroups:r}=e;return sD(r,t)},sD=(e,t)=>{const r=t_();for(const i in e){const o=e[i];Gp(o,r,i,t)}return r},Gp=(e,t,r,i)=>{const o=e.length;for(let l=0;l{if(typeof e=="string"){lD(e,t,r);return}if(typeof e=="function"){cD(e,t,r,i);return}uD(e,t,r,i)},lD=(e,t,r)=>{const i=e===""?t:r_(t,e);i.classGroupId=r},cD=(e,t,r,i)=>{if(dD(e)){Gp(e(i),t,r,i);return}t.validators===null&&(t.validators=[]),t.validators.push(tD(r,e))},uD=(e,t,r,i)=>{const o=Object.entries(e),l=o.length;for(let u=0;u{let r=e;const i=t.split(_u),o=i.length;for(let l=0;l"isThemeGetter"in e&&e.isThemeGetter===!0,fD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),i=Object.create(null);const o=(l,u)=>{r[l]=u,t++,t>e&&(t=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)}}},km="!",ox=":",hD=[],lx=(e,t,r,i,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:i,isExternal:o}),mD=e=>{const{prefix:t,experimentalParseClassName:r}=e;let i=o=>{const l=[];let u=0,d=0,m=0,p;const y=o.length;for(let _=0;_m?p-m:void 0;return lx(l,x,b,w)};if(t){const o=t+ox,l=i;i=u=>u.startsWith(o)?l(u.slice(o.length)):lx(hD,!1,u,void 0,!0)}if(r){const o=i;i=l=>r({className:l,parseClassName:o})}return i},pD=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,i)=>{t.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}},gD=e=>({cache:fD(e.cacheSize),parseClassName:mD(e),sortModifiers:pD(e),postfixLookupClassGroupIds:vD(e),...rD(e)}),vD=e=>{const t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let i=0;i{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:l,postfixLookupClassGroupIds:u}=t,d=[],m=e.trim().split(yD);let p="";for(let y=m.length-1;y>=0;y-=1){const v=m[y],{isExternal:b,modifiers:x,hasImportantModifier:w,baseClassName:_,maybePostfixModifierPosition:E}=r(v);if(b){p=v+(p.length>0?" "+p:p);continue}let R=!!E,T;if(R){const V=_.substring(0,E);T=i(V);const P=T&&u[T]?i(_):void 0;P&&P!==T&&(T=P,R=!1)}else T=i(_);if(!T){if(!R){p=v+(p.length>0?" "+p:p);continue}if(T=i(_),!T){p=v+(p.length>0?" "+p:p);continue}R=!1}const O=x.length===0?"":x.length===1?x[0]:l(x).join(":"),M=w?O+km:O,k=M+T;if(d.indexOf(k)>-1)continue;d.push(k);const B=o(T,R);for(let V=0;V0?" "+p:p)}return p},xD=(...e)=>{let t=0,r,i,o="";for(;t{if(typeof e=="string")return e;let t,r="";for(let i=0;i{let r,i,o,l;const u=m=>{const p=t.reduce((y,v)=>v(y),e());return r=gD(p),i=r.cache.get,o=r.cache.set,l=d,d(m)},d=m=>{const p=i(m);if(p)return p;const y=bD(m,r);return o(m,y),y};return l=u,(...m)=>l(xD(...m))},SD=[],Bt=e=>{const t=r=>r[e]||SD;return t.isThemeGetter=!0,t},i_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,s_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,_D=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,CD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ED=/\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$/,RD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,TD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Da=e=>_D.test(e),Ge=e=>!!e&&!Number.isNaN(Number(e)),Cr=e=>!!e&&Number.isInteger(Number(e)),qh=e=>e.endsWith("%")&&Ge(e.slice(0,-1)),Jr=e=>CD.test(e),o_=()=>!0,OD=e=>ED.test(e)&&!RD.test(e),Zp=()=>!1,AD=e=>jD.test(e),MD=e=>TD.test(e),ND=e=>!Ce(e)&&!Ee(e),DD=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)),kD=e=>Ja(e,u_,Zp),Ce=e=>i_.test(e),xi=e=>Ja(e,d_,OD),cx=e=>Ja(e,UD,Ge),zD=e=>Ja(e,h_,o_),LD=e=>Ja(e,f_,Zp),ux=e=>Ja(e,l_,Zp),$D=e=>Ja(e,c_,MD),Qc=e=>Ja(e,m_,AD),Ee=e=>s_.test(e),Ko=e=>Pi(e,d_),ID=e=>Pi(e,f_),dx=e=>Pi(e,l_),PD=e=>Pi(e,u_),FD=e=>Pi(e,c_),Xc=e=>Pi(e,m_,!0),VD=e=>Pi(e,h_,!0),Ja=(e,t,r)=>{const i=i_.exec(e);return i?i[1]?t(i[1]):r(i[2]):!1},Pi=(e,t,r=!1)=>{const i=s_.exec(e);return i?i[1]?t(i[1]):r:!1},l_=e=>e==="position"||e==="percentage",c_=e=>e==="image"||e==="url",u_=e=>e==="length"||e==="size"||e==="bg-size",d_=e=>e==="length",UD=e=>e==="number",f_=e=>e==="family-name",h_=e=>e==="number"||e==="weight",m_=e=>e==="shadow",HD=()=>{const e=Bt("color"),t=Bt("font"),r=Bt("text"),i=Bt("font-weight"),o=Bt("tracking"),l=Bt("leading"),u=Bt("breakpoint"),d=Bt("container"),m=Bt("spacing"),p=Bt("radius"),y=Bt("shadow"),v=Bt("inset-shadow"),b=Bt("text-shadow"),x=Bt("drop-shadow"),w=Bt("blur"),_=Bt("perspective"),E=Bt("aspect"),R=Bt("ease"),T=Bt("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"],k=()=>[...M(),Ee,Ce],B=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto","contain","none"],P=()=>[Ee,Ce,m],pe=()=>[Da,"full","auto",...P()],ne=()=>[Cr,"none","subgrid",Ee,Ce],ce=()=>["auto",{span:["full",Cr,Ee,Ce]},Cr,Ee,Ce],me=()=>[Cr,"auto",Ee,Ce],fe=()=>["auto","min","max","fr",Ee,Ce],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Se=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...P()],K=()=>[Da,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],ie=()=>[Da,"screen","full","dvw","lvw","svw","min","max","fit",...P()],J=()=>[Da,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],te=()=>[e,Ee,Ce],D=()=>[...M(),dx,ux,{position:[Ee,Ce]}],N=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",PD,kD,{size:[Ee,Ce]}],X=()=>[qh,Ko,xi],Y=()=>["","none","full",p,Ee,Ce],he=()=>["",Ge,Ko,xi],re=()=>["solid","dashed","dotted","double"],be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[Ge,qh,dx,ux],Me=()=>["","none",w,Ee,Ce],Fe=()=>["none",Ge,Ee,Ce],He=()=>["none",Ge,Ee,Ce],ct=()=>[Ge,Ee,Ce],Je=()=>[Da,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jr],breakpoint:[Jr],color:[o_],container:[Jr],"drop-shadow":[Jr],ease:["in","out","in-out"],font:[ND],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jr],shadow:[Jr],spacing:["px",Ge],text:[Jr],"text-shadow":[Jr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Da,Ce,Ee,E]}],container:["container"],"container-type":[{"@container":["","normal","size",Ee,Ce]}],"container-named":[DD],columns:[{columns:[Ge,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:k()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:pe()}],"inset-x":[{"inset-x":pe()}],"inset-y":[{"inset-y":pe()}],start:[{"inset-s":pe(),start:pe()}],end:[{"inset-e":pe(),end:pe()}],"inset-bs":[{"inset-bs":pe()}],"inset-be":[{"inset-be":pe()}],top:[{top:pe()}],right:[{right:pe()}],bottom:[{bottom:pe()}],left:[{left:pe()}],visibility:["visible","invisible","collapse"],z:[{z:[Cr,"auto",Ee,Ce]}],basis:[{basis:[Da,"full","auto",d,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ge,Da,"auto","initial","none",Ce]}],grow:[{grow:["",Ge,Ee,Ce]}],shrink:[{shrink:["",Ge,Ee,Ce]}],order:[{order:[Cr,"first","last","none",Ee,Ce]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:ce()}],"col-start":[{"col-start":me()}],"col-end":[{"col-end":me()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:ce()}],"row-start":[{"row-start":me()}],"row-end":[{"row-end":me()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":fe()}],"auto-rows":[{"auto-rows":fe()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...Se(),"normal"]}],"justify-self":[{"justify-self":["auto",...Se()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...Se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Se(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...Se(),"baseline"]}],"place-self":[{"place-self":["auto",...Se()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],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":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...ie()]}],"min-inline-size":[{"min-inline":["auto",...ie()]}],"max-inline-size":[{"max-inline":["none",...ie()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[d,"screen",...K()]}],"min-w":[{"min-w":[d,"screen","none",...K()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",r,Ko,xi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,VD,zD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qh,Ce]}],"font-family":[{font:[ID,LD,t]}],"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":[Ge,"none",Ee,cx]}],leading:[{leading:[l,...P()]}],"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:te()}],"text-color":[{text:te()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ge,"from-font","auto",Ee,xi]}],"text-decoration-color":[{decoration:te()}],"underline-offset":[{"underline-offset":[Ge,"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:P()}],"tab-size":[{tab:[Cr,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:D()}],"bg-repeat":[{bg:N()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Cr,Ee,Ce],radial:["",Ee,Ce],conic:[Cr,Ee,Ce]},FD,$D]}],"bg-color":[{bg:te()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:te()}],"gradient-via":[{via:te()}],"gradient-to":[{to:te()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:te()}],"border-color-x":[{"border-x":te()}],"border-color-y":[{"border-y":te()}],"border-color-s":[{"border-s":te()}],"border-color-e":[{"border-e":te()}],"border-color-bs":[{"border-bs":te()}],"border-color-be":[{"border-be":te()}],"border-color-t":[{"border-t":te()}],"border-color-r":[{"border-r":te()}],"border-color-b":[{"border-b":te()}],"border-color-l":[{"border-l":te()}],"divide-color":[{divide:te()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ge,Ee,Ce]}],"outline-w":[{outline:["",Ge,Ko,xi]}],"outline-color":[{outline:te()}],shadow:[{shadow:["","none",y,Xc,Qc]}],"shadow-color":[{shadow:te()}],"inset-shadow":[{"inset-shadow":["none",v,Xc,Qc]}],"inset-shadow-color":[{"inset-shadow":te()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:te()}],"ring-offset-w":[{"ring-offset":[Ge,xi]}],"ring-offset-color":[{"ring-offset":te()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":te()}],"text-shadow":[{"text-shadow":["none",b,Xc,Qc]}],"text-shadow-color":[{"text-shadow":te()}],opacity:[{opacity:[Ge,Ee,Ce]}],"mix-blend":[{"mix-blend":[...be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":be()}],"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":[Ge]}],"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":te()}],"mask-image-linear-to-color":[{"mask-linear-to":te()}],"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":te()}],"mask-image-t-to-color":[{"mask-t-to":te()}],"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":te()}],"mask-image-r-to-color":[{"mask-r-to":te()}],"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":te()}],"mask-image-b-to-color":[{"mask-b-to":te()}],"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":te()}],"mask-image-l-to-color":[{"mask-l-to":te()}],"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":te()}],"mask-image-x-to-color":[{"mask-x-to":te()}],"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":te()}],"mask-image-y-to-color":[{"mask-y-to":te()}],"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":te()}],"mask-image-radial-to-color":[{"mask-radial-to":te()}],"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":[Ge]}],"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":te()}],"mask-image-conic-to-color":[{"mask-conic-to":te()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:N()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ce]}],filter:[{filter:["","none",Ee,Ce]}],blur:[{blur:Me()}],brightness:[{brightness:[Ge,Ee,Ce]}],contrast:[{contrast:[Ge,Ee,Ce]}],"drop-shadow":[{"drop-shadow":["","none",x,Xc,Qc]}],"drop-shadow-color":[{"drop-shadow":te()}],grayscale:[{grayscale:["",Ge,Ee,Ce]}],"hue-rotate":[{"hue-rotate":[Ge,Ee,Ce]}],invert:[{invert:["",Ge,Ee,Ce]}],saturate:[{saturate:[Ge,Ee,Ce]}],sepia:[{sepia:["",Ge,Ee,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ce]}],"backdrop-blur":[{"backdrop-blur":Me()}],"backdrop-brightness":[{"backdrop-brightness":[Ge,Ee,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[Ge,Ee,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ge,Ee,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ge,Ee,Ce]}],"backdrop-invert":[{"backdrop-invert":["",Ge,Ee,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[Ge,Ee,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[Ge,Ee,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Ge,Ee,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"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:[Ge,"initial",Ee,Ce]}],ease:[{ease:["linear","initial",R,Ee,Ce]}],delay:[{delay:[Ge,Ee,Ce]}],animate:[{animate:["none",T,Ee,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Ee,Ce]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:Fe()}],"rotate-x":[{"rotate-x":Fe()}],"rotate-y":[{"rotate-y":Fe()}],"rotate-z":[{"rotate-z":Fe()}],scale:[{scale:He()}],"scale-x":[{"scale-x":He()}],"scale-y":[{"scale-y":He()}],"scale-z":[{"scale-z":He()}],"scale-3d":["scale-3d"],skew:[{skew:ct()}],"skew-x":[{"skew-x":ct()}],"skew-y":[{"skew-y":ct()}],transform:[{transform:[Ee,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Je()}],"translate-x":[{"translate-x":Je()}],"translate-y":[{"translate-y":Je()}],"translate-z":[{"translate-z":Je()}],"translate-none":["translate-none"],zoom:[{zoom:[Cr,Ee,Ce]}],accent:[{accent:te()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:te()}],"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":te()}],"scrollbar-track-color":[{"scrollbar-track":te()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",...te()]}],"stroke-w":[{stroke:[Ge,Ko,xi,cx]}],stroke:[{stroke:["none",...te()]}],"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"]}},BD=wD(HD);function We(...e){return BD(e_(e))}function qD({delayDuration:e=0,...t}){return f.jsx(KN,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function GD({...e}){return f.jsx(YN,{"data-slot":"tooltip",...e})}function ZD({...e}){return f.jsx(QN,{"data-slot":"tooltip-trigger",...e})}function KD({className:e,sideOffset:t=0,children:r,...i}){return f.jsx(XN,{children:f.jsxs(JN,{"data-slot":"tooltip-content",sideOffset:t,className:We("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(WN,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const zm=new Set;function YD(e){return zm.add(e),()=>zm.delete(e)}function QD(){for(const e of zm)e()}const p_=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim();const XD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const JD=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase());const fx=e=>{const t=JD(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Gh={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 WD=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},ek=S.createContext({}),tk=()=>S.useContext(ek),nk=S.forwardRef(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:i,className:o="",children:l,iconNode:u,...d},m)=>{const{size:p=24,strokeWidth:y=2,absoluteStrokeWidth:v=!1,color:b="currentColor",className:x=""}=tk()??{},w=i??v?Number(r??y)*24/Number(t??p):r??y;return S.createElement("svg",{ref:m,...Gh,width:t??p??Gh.width,height:t??p??Gh.height,stroke:e??b,strokeWidth:w,className:p_("lucide",x,o),...!l&&!WD(d)&&{"aria-hidden":"true"},...d},[...u.map(([_,E])=>S.createElement(_,E)),...Array.isArray(l)?l:[l]])});const De=(e,t)=>{const r=S.forwardRef(({className:i,...o},l)=>S.createElement(nk,{ref:l,iconNode:t,className:p_(`lucide-${XD(fx(e))}`,`lucide-${e}`,i),...o}));return r.displayName=fx(e),r};const rk=[["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"}]],ak=De("beaker",rk);const ik=[["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"}]],sk=De("book-open",ik);const ok=[["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"}]],lk=De("briefcase",ok);const ck=[["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"}]],uk=De("bug",ck);const dk=[["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"}]],fk=De("calendar",dk);const hk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],g_=De("check",hk);const mk=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Kp=De("chevron-down",mk);const pk=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],gk=De("chevron-right",pk);const vk=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],yk=De("chevron-up",vk);const bk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],xk=De("circle-check",bk);const wk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],v_=De("clock",wk);const Sk=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],_k=De("code",Sk);const Ck=[["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"}]],Ek=De("compass",Ck);const Rk=[["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"}]],jk=De("copy",Rk);const Tk=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Ok=De("credit-card",Tk);const Ak=[["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"}]],Mk=De("database",Ak);const Nk=[["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"}]],Dk=De("download",Nk);const kk=[["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"}]],zk=De("ellipsis",kk);const Lk=[["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"}]],y_=De("file-text",Lk);const $k=[["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"}]],Ik=De("flag",$k);const Pk=[["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"}]],Yp=De("folder",Pk);const Fk=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Vk=De("gauge",Fk);const Uk=[["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"}]],Hk=De("gavel",Uk);const Bk=[["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"}]],b_=De("globe",Bk);const qk=[["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"}]],Gk=De("graduation-cap",qk);const Zk=[["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"}]],Kk=De("heart",Zk);const Yk=[["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"}]],Qk=De("history",Yk);const Xk=[["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"}]],Jk=De("image",Xk);const Wk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ez=De("info",Wk);const tz=[["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"}]],nz=De("layout-dashboard",tz);const rz=[["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"}]],az=De("lightbulb",rz);const iz=[["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"}]],sz=De("link",iz);const oz=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],lz=De("loader-circle",oz);const cz=[["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"}]],x_=De("lock",cz);const uz=[["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"}]],dz=De("log-out",uz);const fz=[["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"}]],hz=De("megaphone",fz);const mz=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],pz=De("menu",mz);const gz=[["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"}]],vz=De("music",gz);const yz=[["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"}]],bz=De("octagon-x",yz);const xz=[["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"}]],wz=De("package",xz);const Sz=[["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"}]],_z=De("pen-line",Sz);const Cz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ez=De("plus",Cz);const Rz=[["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"}]],jz=De("rocket",Rz);const Tz=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],w_=De("search",Tz);const Oz=[["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"}]],Az=De("settings",Oz);const Mz=[["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"}]],Nz=De("share-2",Mz);const Dz=[["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"}]],S_=De("shield",Dz);const kz=[["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"}]],__=De("square-terminal",kz);const zz=[["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"}]],Lz=De("star",zz);const $z=[["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"}]],Iz=De("trash-2",$z);const Pz=[["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"}]],C_=De("triangle-alert",Pz);const Fz=[["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"}]],Vz=De("upload",Fz);const Uz=[["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"}]],E_=De("users",Uz);const Hz=[["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"}]],Bz=De("wrench",Hz);const qz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],R_=De("x",qz);function Gz(){const e=!document.body.classList.contains("sb-open");document.body.classList.toggle("sb-open"),Xu(),e?document.getElementById("sidebar")?.querySelector(Zz)?.focus():document.getElementById("menu-btn")?.focus()}const Zz='a[href], button:not(:disabled), select, input, [tabindex]:not([tabindex="-1"])';function hr(){const e=document.body.classList.contains("sb-open");document.body.classList.remove("sb-open"),Xu(),e&&window.innerWidth<=cu&&document.getElementById("menu-btn")?.focus()}const cu=900;function Xu(){const e=document.getElementById("sidebar");if(!e)return;const t=document.body.classList.contains("sb-open");window.innerWidth<=cu&&!t?e.setAttribute("inert",""):e.removeAttribute("inert");const i=document.getElementById("main");i&&(t&&window.innerWidth<=cu?i.setAttribute("inert",""):i.removeAttribute("inert")),e.setAttribute("aria-modal",String(t&&window.innerWidth<=cu)),document.getElementById("menu-btn")?.setAttribute("aria-expanded",String(t))}typeof window<"u"&&(window.addEventListener("resize",Xu),window.addEventListener("keydown",e=>{e.key==="Escape"&&document.body.classList.contains("sb-open")&&hr()}));const Kz={alert:C_,card:Ok,check:g_,chev:gk,chevd:Kp,clock:v_,copy:jk,doc:y_,dots:zk,download:Dk,folder:Yp,dashboard:nz,gear:Az,globe:b_,hist:Qk,link:sz,lock:x_,menu:pz,plus:Ez,power:dz,search:w_,share:Nz,shield:S_,terminal:__,trash:Iz,upload:Vz,users:E_,x:R_};function nt({name:e}){const t=Kz[e];return t?f.jsx(t,{className:"ico","aria-hidden":"true"}):null}const Lm={folder:Yp,"book-open":sk,"file-text":y_,"pen-line":_z,users:E_,briefcase:lk,megaphone:hz,rocket:jz,lightbulb:az,flag:Ik,star:Lz,heart:Kk,code:_k,"square-terminal":__,bug:uk,wrench:Bz,database:Mk,package:wz,beaker:ak,gauge:Vk,shield:S_,lock:x_,gavel:Hk,globe:b_,compass:Ek,calendar:fk,clock:v_,"graduation-cap":Gk,image:Jk,music:vz};function Vs({name:e,className:t}){const r=e??"",i=Object.hasOwn(Lm,r)?Lm[r]:Yp;return f.jsx(i,{className:t,"aria-hidden":"true"})}function Yz({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 al(e){const t=["page",e.width??"app",e.className].filter(Boolean).join(" ");return f.jsx("div",{className:t,children:e.children})}function Qz(e){e&&Xu()}function Us(e){return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"sb-backdrop",onClick:hr}),f.jsxs("aside",{id:"sidebar",ref:Qz,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 Ju(e){const{name:t,onHome:r,showSignout:i,search:o,beta:l}=e;return f.jsxs("header",{id:"vault",children:[f.jsx("span",{id:"vault-badge",children:f.jsx(Yz,{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:u=>{r&&(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),r())},children:t}),l&&f.jsx("span",{id:"vault-beta",children:"Beta"}),f.jsxs("div",{className:"vault-actions",children:[o&&f.jsxs(GD,{delayDuration:150,children:[f.jsx(ZD,{asChild:!0,children:f.jsx("button",{id:"search-btn",className:"icon-btn2","aria-label":"Search",onClick:()=>{QD(),hr()},children:f.jsx(nt,{name:"search"})})}),f.jsxs(KD,{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(nt,{name:"power"})})]})]})}function Hs(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:Gz,children:f.jsx(nt,{name:"menu"})}),f.jsx("span",{id:"crumb",children:e.crumb}),f.jsx("span",{id:"meta",children:e.meta}),e.actions]})}function Xz(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const Jz=e=>{switch(e){case"success":return t3;case"info":return r3;case"warning":return n3;case"error":return a3;default:return null}},Wz=Array(12).fill(0),e3=({visible:e,className:t})=>ve.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ve.createElement("div",{className:"sonner-spinner"},Wz.map((r,i)=>ve.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),t3=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),n3=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ve.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"})),r3=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),a3=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),i3=ve.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"},ve.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ve.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),s3=()=>{const[e,t]=ve.useState(document.hidden);return ve.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let $m=1;class o3{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:i,...o}=t,l=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:$m++,u=this.toasts.find(m=>m.id===l),d=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),u?this.toasts=this.toasts.map(m=>m.id===l?(this.publish({...m,...t,id:l,title:i}),{...m,...t,id:l,dismissible:d,title:i}):m):this.addToast({title:i,...o,dismissible:d,id:l}),l},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(i=>i({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let i;r.loading!==void 0&&(i=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let l=i!==void 0,u;const d=o.then(async p=>{if(u=["resolve",p],ve.isValidElement(p))l=!1,this.create({id:i,type:"default",message:p});else if(c3(p)&&!p.ok){l=!1;const v=typeof r.error=="function"?await r.error(`HTTP error! status: ${p.status}`):r.error,b=typeof r.description=="function"?await r.description(`HTTP error! status: ${p.status}`):r.description,w=typeof v=="object"&&!ve.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:b,...w})}else if(p instanceof Error){l=!1;const v=typeof r.error=="function"?await r.error(p):r.error,b=typeof r.description=="function"?await r.description(p):r.description,w=typeof v=="object"&&!ve.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(p):r.success,b=typeof r.description=="function"?await r.description(p):r.description,w=typeof v=="object"&&!ve.isValidElement(v)?v:{message:v};this.create({id:i,type:"success",description:b,...w})}}).catch(async p=>{if(u=["reject",p],r.error!==void 0){l=!1;const y=typeof r.error=="function"?await r.error(p):r.error,v=typeof r.description=="function"?await r.description(p):r.description,x=typeof y=="object"&&!ve.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)}),m=()=>new Promise((p,y)=>d.then(()=>u[0]==="reject"?y(u[1]):p(u[1])).catch(y));return typeof i!="string"&&typeof i!="number"?{unwrap:m}:Object.assign(i,{unwrap:m})},this.custom=(t,r)=>{const i=r?.id||$m++;return this.create({jsx:t(i),id:i,...r}),i},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Tn=new o3,l3=(e,t)=>{const r=t?.id||$m++;return Tn.addToast({title:e,...t,id:r}),r},c3=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",u3=l3,d3=()=>Tn.toasts,f3=()=>Tn.getActiveToasts(),hx=Object.assign(u3,{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:d3,getToasts:f3});Xz("[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 Jc(e){return e.label!==void 0}const h3=3,m3="24px",p3="16px",mx=4e3,g3=356,v3=14,y3=45,b3=200;function Er(...e){return e.filter(Boolean).join(" ")}function x3(e){const[t,r]=e.split("-"),i=[];return t&&i.push(t),r&&i.push(r),i}const w3=e=>{var t,r,i,o,l,u,d,m,p;const{invert:y,toast:v,unstyled:b,interacting:x,setHeights:w,visibleToasts:_,heights:E,index:R,toasts:T,expanded:O,removeToast:M,defaultRichColors:k,closeButton:B,style:V,cancelButtonStyle:P,actionButtonStyle:pe,className:ne="",descriptionClassName:ce="",duration:me,position:fe,gap:Z,expandByDefault:Se,classNames:L,icons:K,closeButtonAriaLabel:ie="Close toast"}=e,[J,te]=ve.useState(null),[D,N]=ve.useState(null),[H,X]=ve.useState(!1),[Y,he]=ve.useState(!1),[re,be]=ve.useState(!1),[xe,Me]=ve.useState(!1),[Fe,He]=ve.useState(!1),[ct,Je]=ve.useState(0),[hn,mn]=ve.useState(0),Xt=ve.useRef(v.duration||me||mx),yr=ve.useRef(null),At=ve.useRef(null),rr=R===0,br=R+1<=_,Rt=v.type,Vn=v.dismissible!==!1,zt=v.className||"",Dr=v.descriptionClassName||"",ar=ve.useMemo(()=>E.findIndex(Ae=>Ae.toastId===v.id)||0,[E,v.id]),oa=ve.useMemo(()=>{var Ae;return(Ae=v.closeButton)!=null?Ae:B},[v.closeButton,B]),ir=ve.useMemo(()=>v.duration||me||mx,[v.duration,me]),la=ve.useRef(0),Jt=ve.useRef(0),A=ve.useRef(0),I=ve.useRef(null),[F,de]=fe.split("-"),oe=ve.useMemo(()=>E.reduce((Ae,ut,st)=>st>=ar?Ae:Ae+ut.height,0),[E,ar]),ye=s3(),we=v.invert||y,ee=Rt==="loading";Jt.current=ve.useMemo(()=>ar*Z+oe,[ar,oe]),ve.useEffect(()=>{Xt.current=ir},[ir]),ve.useEffect(()=>{X(!0)},[]),ve.useEffect(()=>{const Ae=At.current;if(Ae){const ut=Ae.getBoundingClientRect().height;return mn(ut),w(st=>[{toastId:v.id,height:ut,position:v.position},...st]),()=>w(st=>st.filter(Gt=>Gt.toastId!==v.id))}},[w,v.id]),ve.useLayoutEffect(()=>{if(!H)return;const Ae=At.current,ut=Ae.style.height;Ae.style.height="auto";const st=Ae.getBoundingClientRect().height;Ae.style.height=ut,mn(st),w(Gt=>Gt.find(Ct=>Ct.toastId===v.id)?Gt.map(Ct=>Ct.toastId===v.id?{...Ct,height:st}:Ct):[{toastId:v.id,height:st,position:v.position},...Gt])},[H,v.title,v.description,w,v.id,v.jsx,v.action,v.cancel]);const le=ve.useCallback(()=>{he(!0),Je(Jt.current),w(Ae=>Ae.filter(ut=>ut.toastId!==v.id)),setTimeout(()=>{M(v)},b3)},[v,M,w,Jt]);ve.useEffect(()=>{if(v.promise&&Rt==="loading"||v.duration===1/0||v.type==="loading")return;let Ae;return O||x||ye?(()=>{if(A.current{v.onAutoClose==null||v.onAutoClose.call(v,v),le()},Xt.current)),()=>clearTimeout(Ae)},[O,x,v,Rt,ye,le]),ve.useEffect(()=>{v.delete&&(le(),v.onDismiss==null||v.onDismiss.call(v,v))},[le,v.delete]);function Re(){var Ae;if(K?.loading){var ut;return ve.createElement("div",{className:Er(L?.loader,v==null||(ut=v.classNames)==null?void 0:ut.loader,"sonner-loader"),"data-visible":Rt==="loading"},K.loading)}return ve.createElement(e3,{className:Er(L?.loader,v==null||(Ae=v.classNames)==null?void 0:Ae.loader),visible:Rt==="loading"})}const ze=v.icon||K?.[Rt]||Jz(Rt);var it,_t;return ve.createElement("li",{tabIndex:0,ref:At,className:Er(ne,zt,L?.toast,v==null||(t=v.classNames)==null?void 0:t.toast,L?.default,L?.[Rt],v==null||(r=v.classNames)==null?void 0:r[Rt]),"data-sonner-toast":"","data-rich-colors":(it=v.richColors)!=null?it:k,"data-styled":!(v.jsx||v.unstyled||b),"data-mounted":H,"data-promise":!!v.promise,"data-swiped":Fe,"data-removed":Y,"data-visible":br,"data-y-position":F,"data-x-position":de,"data-index":R,"data-front":rr,"data-swiping":re,"data-dismissible":Vn,"data-type":Rt,"data-invert":we,"data-swipe-out":xe,"data-swipe-direction":D,"data-expanded":!!(O||Se&&H),"data-testid":v.testId,style:{"--index":R,"--toasts-before":R,"--z-index":T.length-R,"--offset":`${Y?ct:Jt.current}px`,"--initial-height":Se?"auto":`${hn}px`,...V,...v.style},onDragEnd:()=>{be(!1),te(null),I.current=null},onPointerDown:Ae=>{Ae.button!==2&&(ee||!Vn||(yr.current=new Date,Je(Jt.current),Ae.target.setPointerCapture(Ae.pointerId),Ae.target.tagName!=="BUTTON"&&(be(!0),I.current={x:Ae.clientX,y:Ae.clientY})))},onPointerUp:()=>{var Ae,ut,st;if(xe||!Vn)return;I.current=null;const Gt=Number(((Ae=At.current)==null?void 0:Ae.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),sr=Number(((ut=At.current)==null?void 0:ut.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ct=new Date().getTime()-((st=yr.current)==null?void 0:st.getTime()),yn=J==="x"?Gt:sr,ti=Math.abs(yn)/Ct;if(Math.abs(yn)>=y3||ti>.11){Je(Jt.current),v.onDismiss==null||v.onDismiss.call(v,v),N(J==="x"?Gt>0?"right":"left":sr>0?"down":"up"),le(),Me(!0);return}else{var bn,xn;(bn=At.current)==null||bn.style.setProperty("--swipe-amount-x","0px"),(xn=At.current)==null||xn.style.setProperty("--swipe-amount-y","0px")}He(!1),be(!1),te(null)},onPointerMove:Ae=>{var ut,st,Gt;if(!I.current||!Vn||((ut=window.getSelection())==null?void 0:ut.toString().length)>0)return;const Ct=Ae.clientY-I.current.y,yn=Ae.clientX-I.current.x;var ti;const bn=(ti=e.swipeDirections)!=null?ti:x3(fe);!J&&(Math.abs(yn)>1||Math.abs(Ct)>1)&&te(Math.abs(yn)>Math.abs(Ct)?"x":"y");let xn={x:0,y:0};const Vi=or=>1/(1.5+Math.abs(or)/20);if(J==="y"){if(bn.includes("top")||bn.includes("bottom"))if(bn.includes("top")&&Ct<0||bn.includes("bottom")&&Ct>0)xn.y=Ct;else{const or=Ct*Vi(Ct);xn.y=Math.abs(or)0)xn.x=yn;else{const or=yn*Vi(yn);xn.x=Math.abs(or)0||Math.abs(xn.y)>0)&&He(!0),(st=At.current)==null||st.style.setProperty("--swipe-amount-x",`${xn.x}px`),(Gt=At.current)==null||Gt.style.setProperty("--swipe-amount-y",`${xn.y}px`)}},oa&&!v.jsx&&Rt!=="loading"?ve.createElement("button",{"aria-label":ie,"data-disabled":ee,"data-close-button":!0,onClick:ee||!Vn?()=>{}:()=>{le(),v.onDismiss==null||v.onDismiss.call(v,v)},className:Er(L?.closeButton,v==null||(i=v.classNames)==null?void 0:i.closeButton)},(_t=K?.close)!=null?_t:i3):null,(Rt||v.icon||v.promise)&&v.icon!==null&&(K?.[Rt]!==null||v.icon)?ve.createElement("div",{"data-icon":"",className:Er(L?.icon,v==null||(o=v.classNames)==null?void 0:o.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||Re():null,v.type!=="loading"?ze:null):null,ve.createElement("div",{"data-content":"",className:Er(L?.content,v==null||(l=v.classNames)==null?void 0:l.content)},ve.createElement("div",{"data-title":"",className:Er(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?ve.createElement("div",{"data-description":"",className:Er(ce,Dr,L?.description,v==null||(d=v.classNames)==null?void 0:d.description)},typeof v.description=="function"?v.description():v.description):null),ve.isValidElement(v.cancel)?v.cancel:v.cancel&&Jc(v.cancel)?ve.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||P,onClick:Ae=>{Jc(v.cancel)&&Vn&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,Ae),le())},className:Er(L?.cancelButton,v==null||(m=v.classNames)==null?void 0:m.cancelButton)},v.cancel.label):null,ve.isValidElement(v.action)?v.action:v.action&&Jc(v.action)?ve.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||pe,onClick:Ae=>{Jc(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,Ae),!Ae.defaultPrevented&&le())},className:Er(L?.actionButton,v==null||(p=v.classNames)==null?void 0:p.actionButton)},v.action.label):null)};function px(){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 S3(e,t){const r={};return[e,t].forEach((i,o)=>{const l=o===1,u=l?"--mobile-offset":"--offset",d=l?p3:m3;function m(p){["top","right","bottom","left"].forEach(y=>{r[`${u}-${y}`]=typeof p=="number"?`${p}px`:p})}typeof i=="number"||typeof i=="string"?m(i):typeof i=="object"?["top","right","bottom","left"].forEach(p=>{i[p]===void 0?r[`${u}-${p}`]=d:r[`${u}-${p}`]=typeof i[p]=="number"?`${i[p]}px`:i[p]}):m(d)}),r}const _3=ve.forwardRef(function(t,r){const{id:i,invert:o,position:l="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:m,className:p,offset:y,mobileOffset:v,theme:b="light",richColors:x,duration:w,style:_,visibleToasts:E=h3,toastOptions:R,dir:T=px(),gap:O=v3,icons:M,containerAriaLabel:k="Notifications"}=t,[B,V]=ve.useState([]),P=ve.useMemo(()=>i?B.filter(H=>H.toasterId===i):B.filter(H=>!H.toasterId),[B,i]),pe=ve.useMemo(()=>Array.from(new Set([l].concat(P.filter(H=>H.position).map(H=>H.position)))),[P,l]),[ne,ce]=ve.useState([]),[me,fe]=ve.useState(!1),[Z,Se]=ve.useState(!1),[L,K]=ve.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ie=ve.useRef(null),J=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),te=ve.useRef(null),D=ve.useRef(!1),N=ve.useCallback(H=>{V(X=>{var Y;return(Y=X.find(he=>he.id===H.id))!=null&&Y.delete||Tn.dismiss(H.id),X.filter(({id:he})=>he!==H.id)})},[]);return ve.useEffect(()=>Tn.subscribe(H=>{if(H.dismiss){requestAnimationFrame(()=>{V(X=>X.map(Y=>Y.id===H.id?{...Y,delete:!0}:Y))});return}setTimeout(()=>{R2.flushSync(()=>{V(X=>{const Y=X.findIndex(he=>he.id===H.id);return Y!==-1?[...X.slice(0,Y),{...X[Y],...H},...X.slice(Y+1)]:[H,...X]})})})}),[B]),ve.useEffect(()=>{if(b!=="system"){K(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:X})=>{K(X?"dark":"light")})}catch{H.addListener(({matches:Y})=>{try{K(Y?"dark":"light")}catch(he){console.error(he)}})}},[b]),ve.useEffect(()=>{B.length<=1&&fe(!1)},[B]),ve.useEffect(()=>{const H=X=>{var Y;if(u.every(be=>X[be]||X.code===be)){var re;fe(!0),(re=ie.current)==null||re.focus()}X.code==="Escape"&&(document.activeElement===ie.current||(Y=ie.current)!=null&&Y.contains(document.activeElement))&&fe(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[u]),ve.useEffect(()=>{if(ie.current)return()=>{te.current&&(te.current.focus({preventScroll:!0}),te.current=null,D.current=!1)}},[ie.current]),ve.createElement("section",{ref:r,"aria-label":`${k} ${J}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},pe.map((H,X)=>{var Y;const[he,re]=H.split("-");return P.length?ve.createElement("ol",{key:H,dir:T==="auto"?px():T,tabIndex:-1,ref:ie,className:p,"data-sonner-toaster":!0,"data-sonner-theme":L,"data-y-position":he,"data-x-position":re,style:{"--front-toast-height":`${((Y=ne[0])==null?void 0:Y.height)||0}px`,"--width":`${g3}px`,"--gap":`${O}px`,..._,...S3(y,v)},onBlur:be=>{D.current&&!be.currentTarget.contains(be.relatedTarget)&&(D.current=!1,te.current&&(te.current.focus({preventScroll:!0}),te.current=null))},onFocus:be=>{be.target instanceof HTMLElement&&be.target.dataset.dismissible==="false"||D.current||(D.current=!0,te.current=be.relatedTarget)},onMouseEnter:()=>fe(!0),onMouseMove:()=>fe(!0),onMouseLeave:()=>{Z||fe(!1)},onDragEnd:()=>fe(!1),onPointerDown:be=>{be.target instanceof HTMLElement&&be.target.dataset.dismissible==="false"||Se(!0)},onPointerUp:()=>Se(!1)},P.filter(be=>!be.position&&X===0||be.position===H).map((be,xe)=>{var Me,Fe;return ve.createElement(w3,{key:be.id,icons:M,index:xe,toast:be,defaultRichColors:x,duration:(Me=R?.duration)!=null?Me:w,className:R?.className,descriptionClassName:R?.descriptionClassName,invert:o,visibleToasts:E,closeButton:(Fe=R?.closeButton)!=null?Fe:m,interacting:Z,position:H,style:R?.style,unstyled:R?.unstyled,classNames:R?.classNames,cancelButtonStyle:R?.cancelButtonStyle,actionButtonStyle:R?.actionButtonStyle,closeButtonAriaLabel:R?.closeButtonAriaLabel,removeToast:N,toasts:P.filter(He=>He.position==be.position),heights:ne.filter(He=>He.position==be.position),setHeights:ce,expandByDefault:d,gap:O,expanded:me,swipeDirections:t.swipeDirections})})):null}))}),C3=({...e})=>f.jsx(_3,{theme:"dark",className:"toaster group",icons:{success:f.jsx(xk,{className:"size-4"}),info:f.jsx(ez,{className:"size-4"}),warning:f.jsx(C_,{className:"size-4"}),error:f.jsx(bz,{className:"size-4"}),loading:f.jsx(lz,{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 qe(e,t=!1){t?hx.error(e,{duration:1/0,closeButton:!0}):hx(e)}function E3(){return f.jsx(C3,{position:"bottom-center"})}const gx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,vx=e_,R3=(e,t)=>r=>{var i;if(t?.variants==null)return vx(e,r?.class,r?.className);const{variants:o,defaultVariants:l}=t,u=Object.keys(o).map(p=>{const y=r?.[p],v=l?.[p];if(y===null)return null;const b=gx(y)||gx(v);return o[p][b]}),d=r&&Object.entries(r).reduce((p,y)=>{let[v,b]=y;return b===void 0||(p[v]=b),p},{}),m=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((p,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})?[...p,v,b]:p},[]);return vx(e,u,m,r?.class,r?.className)},j3=R3("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 xt({className:e,variant:t="default",size:r="default",asChild:i=!1,...o}){const l=i?j2:"button";return f.jsx(l,{"data-slot":"button","data-variant":t,"data-size":r,className:We(j3({variant:t,size:r,className:e})),...o})}function Wu({...e}){return f.jsx(vp,{"data-slot":"dialog",...e})}function T3({...e}){return f.jsx(bp,{"data-slot":"dialog-portal",...e})}function O3({className:e,...t}){return f.jsx(xp,{"data-slot":"dialog-overlay",className:We("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),...t})}function ed({className:e,children:t,showCloseButton:r=!0,...i}){return f.jsxs(T3,{"data-slot":"dialog-portal",children:[f.jsx(O3,{}),f.jsxs(wp,{"data-slot":"dialog-content",className:We("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:[t,r&&f.jsxs(sS,{"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(R_,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function El({className:e,...t}){return f.jsx(rS,{"data-slot":"dialog-title",className:We("text-lg leading-none font-semibold",e),...t})}let j_=null,uu=[];function Rl(e){j_=e,uu.forEach(t=>t())}function T_(e,t,r="",i="OK",o={}){return new Promise(l=>Rl({kind:"prompt",title:e,label:t,value:r,okLabel:i,...o,resolve:l}))}function za(e,t,r="Confirm",i=!1){return new Promise(o=>Rl({kind:"confirm",title:e,message:t,confirmLabel:r,danger:i,resolve:o}))}function A3(){const e=S.useSyncExternalStore(r=>(uu.push(r),()=>{uu=uu.filter(i=>i!==r)}),()=>j_);if(!e)return null;const t=()=>{Rl(null),e.kind==="prompt"?e.resolve(null):e.resolve(!1)};return f.jsx(Wu,{open:!0,onOpenChange:r=>!r&&t(),children:f.jsx(ed,{className:"modal",showCloseButton:!1,children:e.kind==="prompt"?f.jsx(M3,{m:e}):f.jsx(N3,{m:e})})})}function M3({m:e}){const t=S.useRef(null),r=p=>{Rl(null),e.resolve(p)},[i,o]=S.useState(""),[l,u]=S.useState(e.value),d=e.match===void 0||l.trim()===e.match,m=()=>{const p=l;if(d){if(!p.trim()){o("Give it a name."),t.current.focus();return}r(p)}};return f.jsxs(f.Fragment,{children:[f.jsx(El,{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:t,id:"modal-input",autoFocus:!0,onFocus:p=>p.currentTarget.select(),"aria-invalid":!!i,"aria-describedby":i?"modal-input-err":void 0,onChange:p=>{u(p.currentTarget.value),i&&o("")},onKeyDown:p=>p.key==="Enter"&&m()}),i&&f.jsx("span",{id:"modal-input-err",role:"alert",className:"field-err",children:i}),f.jsxs("div",{className:"modal-actions",children:[f.jsx(xt,{variant:"subtle",onClick:()=>r(null),children:"Cancel"}),f.jsx(xt,{variant:e.danger?"danger":"primary",onClick:m,disabled:!d,children:e.okLabel})]})]})}function N3({m:e}){const t=r=>{Rl(null),e.resolve(r)};return f.jsxs(f.Fragment,{children:[f.jsx(El,{asChild:!0,children:f.jsx("h3",{children:e.title})}),f.jsx("div",{className:"modal-msg",children:e.message}),f.jsxs("div",{className:"modal-actions",children:[f.jsx(xt,{variant:"subtle",onClick:()=>t(!1),autoFocus:e.danger,children:"Cancel"}),f.jsx(xt,{variant:e.danger?"danger":"primary",onClick:()=>t(!0),autoFocus:!e.danger,children:e.confirmLabel})]})]})}function D3(e){return Ft({queryKey:["projects"],queryFn:()=>qt("/api/projects"),enabled:e,refetchInterval:3e4,select:t=>t.projects||[]})}function k3(e){return Ft({queryKey:["orgs"],queryFn:()=>qt("/api/orgs"),enabled:e,select:t=>t.orgs||[]})}function z3(e){return Ft({queryKey:["permissions",e],queryFn:()=>qt(`/api/p/${e}/permissions`),enabled:!!e})}function O_(e,t=!0){return Ft({queryKey:["shares",e],queryFn:()=>qt(`/api/p/${e}/shares`),enabled:!!e&&t,select:r=>r.shares||[]})}function A_(e){return Ft({queryKey:["admin","pending"],queryFn:()=>qt("/api/admin/pending"),enabled:e,select:t=>t.pending||[]})}function M_(){const e=ki();return()=>Promise.all([e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["orgs"]})]).then(()=>{})}function N_(e){return e.split("/").map(encodeURIComponent).join("/")}function L3(e){try{return decodeURIComponent(e)}catch{return e}}function td(e){return e.split("/").map(L3).join("/")}const $3=new Set(["dashboard","history","install","settings"]),yx={insights:"dashboard"};function I3(e){return Object.hasOwn(yx,e)?yx[e]:void 0}const Qp=["q","user","since","until"];function Xp(e){return!!e&&Qp.some(t=>!!e[t])}function D_(e){const t=new URLSearchParams;for(const i of Qp)e?.[i]&&t.set(i,e[i]);const r=t.toString();return r?"?"+r:""}function k_(e,t){const r=e.indexOf("?"),i=r===-1?null:new URLSearchParams(e.slice(r)),o=i?.get("v")||"",l=i?.get("connect")||"",u=P3(r===-1?e:e.slice(0,r),t);o&&(u.version=o),l&&(u.connect=l);const d={};for(const m of Qp){const p=i?.get(m);p&&(d[m]=p)}if(Xp(d)&&(u.filters=d),u.view==="history"&&!u.viewTarget){const m=(i?.get("path")||i?.get("prefix")||"").replace(/^\/+|\/+$/g,"");m&&(u.viewTarget=td(m),u.queryTarget=!0)}return u}function bx(e,t){const r=t.replace(/\/+$/,"");return r!==t&&(e.trailingSlash=!0),e.path=r?td(r):"",e}function P3(e,t){const r=e.replace(/^\/+/,"");if(t!=="hub")return bx({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=bx({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=I3(u);return($3.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 Oi(e,t,r){const i=N_(e),o=r?"?v="+r:"";return t?"/"+t+(i?"/"+i:"")+o:"/"+i+o}function An(e,t,r,i){let o=(t?"/"+t:"")+"/"+e;return r&&(o+="/"+N_(r.replace(/\/+$/,""))),o+(e==="history"?D_(i):"")}function F3(e,t){const r=td(t).toLowerCase(),i=e.filter(o=>o.name.toLowerCase()===r);return i.length===1?i[0].id:void 0}let Jp="POP";const Im=new Set;function z_(){for(const e of Im)e()}window.addEventListener("popstate",()=>{Jp="POP",z_()});function Yt(e,t){const r=location.pathname+location.search;!t?.replace&&r===e||(history[t?.replace?"replaceState":"pushState"](null,"",e),Jp=t?.replace?"REPLACE":"PUSH",z_())}function Wp(){return S.useSyncExternalStore(e=>(Im.add(e),()=>{Im.delete(e)}),()=>location.pathname+location.search)}function V3(){return Jp}function Qs(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(),Yt(e),document.body.classList.remove("sb-open"))}}:{href:e,target:"_blank",rel:"noopener noreferrer"}}function Ds({to:e}){return S.useEffect(()=>{Yt(e,{replace:!0})},[e]),null}function L_(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function La(e,t){return typeof e=="function"?e(t):e}function Fn(e,t){return r=>{t.setState(i=>({...i,[e]:La(r,i[e])}))}}function nd(e){return e instanceof Function}function U3(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function H3(e,t){const r=[],i=o=>{o.forEach(l=>{r.push(l);const u=t(l);u!=null&&u.length&&i(u)})};return i(e),r}function Le(e,t,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 p;if(r.key&&r.debug&&(p=Date.now()),o=t(...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()-p)*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 $e(e,t,r,i){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[t]},key:!1,onChange:i}}function H3(e,t,r,i){const o=()=>{var u;return(u=l.getValue())!=null?u:e.options.renderFallbackValue},l={id:`${t.id}_${r.id}`,row:t,column:r,getValue:()=>t.getValue(i),renderValue:o,getContext:Le(()=>[e,r,t,l],(u,d,m,p)=>({table:u,column:d,row:m,cell:p,getValue:p.getValue,renderValue:p.renderValue}),$e(e.options,"debugCells"))};return e._features.forEach(u=>{u.createCell==null||u.createCell(l,r,t,e)},{}),l}function B3(e,t,r,i){var o,l;const d={...e._getDefaultColumnDef(),...t},m=d.accessorKey;let p=(o=(l=d.id)!=null?l:m?typeof String.prototype.replaceAll=="function"?m.replaceAll(".","_"):m.replace(/\./g,"_"):void 0)!=null?o:typeof d.header=="string"?d.header:void 0,y;if(d.accessorFn?y=d.accessorFn:m&&(m.includes(".")?y=b=>{let x=b;for(const _ of m.split(".")){var w;x=(w=x)==null?void 0:w[_]}return x}:y=b=>b[d.accessorKey]),!p)throw new Error;let v={id:`${String(p)}`,accessorFn:y,parent:i,depth:r,columnDef:d,columns:[],getFlatColumns:Le(()=>[!0],()=>{var b;return[v,...(b=v.columns)==null?void 0:b.flatMap(x=>x.getFlatColumns())]},$e(e.options,"debugColumns")),getLeafColumns:Le(()=>[e._getOrderColumnsFn()],b=>{var x;if((x=v.columns)!=null&&x.length){let w=v.columns.flatMap(_=>_.getLeafColumns());return b(w)}return[v]},$e(e.options,"debugColumns"))};for(const b of e._features)b.createColumn==null||b.createColumn(v,e);return v}const dn="debugHeaders";function xx(e,t,r){var i;let l={id:(i=r.id)!=null?i:t.id,column:t,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const u=[],d=m=>{m.subHeaders&&m.subHeaders.length&&m.subHeaders.map(d),u.push(m)};return d(l),u},getContext:()=>({table:e,header:l,column:t})};return e._features.forEach(u=>{u.createHeader==null||u.createHeader(l,e)}),l}const q3={createTable:e=>{e.getHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,i,o)=>{var l,u;const d=(l=i?.map(v=>r.find(b=>b.id===v)).filter(Boolean))!=null?l:[],m=(u=o?.map(v=>r.find(b=>b.id===v)).filter(Boolean))!=null?u:[],p=r.filter(v=>!(i!=null&&i.includes(v.id))&&!(o!=null&&o.includes(v.id)));return Wc(t,[...d,...p,...m],e)},$e(e.options,dn)),e.getCenterHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,i,o)=>(r=r.filter(l=>!(i!=null&&i.includes(l.id))&&!(o!=null&&o.includes(l.id))),Wc(t,r,e,"center")),$e(e.options,dn)),e.getLeftHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,r,i)=>{var o;const l=(o=i?.map(u=>r.find(d=>d.id===u)).filter(Boolean))!=null?o:[];return Wc(t,l,e,"left")},$e(e.options,dn)),e.getRightHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,r,i)=>{var o;const l=(o=i?.map(u=>r.find(d=>d.id===u)).filter(Boolean))!=null?o:[];return Wc(t,l,e,"right")},$e(e.options,dn)),e.getFooterGroups=Le(()=>[e.getHeaderGroups()],t=>[...t].reverse(),$e(e.options,dn)),e.getLeftFooterGroups=Le(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),$e(e.options,dn)),e.getCenterFooterGroups=Le(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),$e(e.options,dn)),e.getRightFooterGroups=Le(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),$e(e.options,dn)),e.getFlatHeaders=Le(()=>[e.getHeaderGroups()],t=>t.map(r=>r.headers).flat(),$e(e.options,dn)),e.getLeftFlatHeaders=Le(()=>[e.getLeftHeaderGroups()],t=>t.map(r=>r.headers).flat(),$e(e.options,dn)),e.getCenterFlatHeaders=Le(()=>[e.getCenterHeaderGroups()],t=>t.map(r=>r.headers).flat(),$e(e.options,dn)),e.getRightFlatHeaders=Le(()=>[e.getRightHeaderGroups()],t=>t.map(r=>r.headers).flat(),$e(e.options,dn)),e.getCenterLeafHeaders=Le(()=>[e.getCenterFlatHeaders()],t=>t.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),$e(e.options,dn)),e.getLeftLeafHeaders=Le(()=>[e.getLeftFlatHeaders()],t=>t.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),$e(e.options,dn)),e.getRightLeafHeaders=Le(()=>[e.getRightFlatHeaders()],t=>t.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),$e(e.options,dn)),e.getLeafHeaders=Le(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,r,i)=>{var o,l,u,d,m,p;return[...(o=(l=t[0])==null?void 0:l.headers)!=null?o:[],...(u=(d=r[0])==null?void 0:d.headers)!=null?u:[],...(m=(p=i[0])==null?void 0:p.headers)!=null?m:[]].map(y=>y.getLeafHeaders()).flat()},$e(e.options,dn))}};function Wc(e,t,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 m=[];const p=(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 k=xx(r,O,{id:[i,x,O.id,E?.id].filter(Boolean).join("_"),isPlaceholder:M,placeholderId:M?`${_.filter(B=>B.column===O).length}`:void 0,depth:x,index:_.length});k.subHeaders.push(E),_.push(k)}w.headers.push(E),E.headerGroup=w}),m.push(w),x>0&&p(_,x-1)},y=t.map((b,x)=>xx(r,b,{depth:u,index:x}));p(y,u-1),m.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:k}=O;_+=M,R.push(k)})):_=1;const T=Math.min(...R);return E=E+T,w.colSpan=_,w.rowSpan=E,{colSpan:_,rowSpan:E}});return v((o=(l=m[0])==null?void 0:l.headers)!=null?o:[]),m}const G3=(e,t,r,i,o,l,u)=>{let d={id:t,index:i,original:r,depth:o,parentId:u,_valuesCache:{},_uniqueValuesCache:{},getValue:m=>{if(d._valuesCache.hasOwnProperty(m))return d._valuesCache[m];const p=e.getColumn(m);if(p!=null&&p.accessorFn)return d._valuesCache[m]=p.accessorFn(d.original,i),d._valuesCache[m]},getUniqueValues:m=>{if(d._uniqueValuesCache.hasOwnProperty(m))return d._uniqueValuesCache[m];const p=e.getColumn(m);if(p!=null&&p.accessorFn)return p.columnDef.getUniqueValues?(d._uniqueValuesCache[m]=p.columnDef.getUniqueValues(d.original,i),d._uniqueValuesCache[m]):(d._uniqueValuesCache[m]=[d.getValue(m)],d._uniqueValuesCache[m])},renderValue:m=>{var p;return(p=d.getValue(m))!=null?p:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>U3(d.subRows,m=>m.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let m=[],p=d;for(;;){const y=p.getParentRow();if(!y)break;m.push(y),p=y}return m.reverse()},getAllCells:Le(()=>[e.getAllLeafColumns()],m=>m.map(p=>H3(e,d,p,p.id)),$e(e.options,"debugRows")),_getAllCellsByColumnId:Le(()=>[d.getAllCells()],m=>m.reduce((p,y)=>(p[y.column.id]=y,p),{}),$e(e.options,"debugRows"))};for(let m=0;m{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},$_=(e,t,r)=>{var i,o;const l=r==null||(i=r.toString())==null?void 0:i.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(l))};$_.autoRemove=e=>pr(e);const I_=(e,t,r)=>{var i;return!!(!((i=e.getValue(t))==null||(i=i.toString())==null)&&i.includes(r))};I_.autoRemove=e=>pr(e);const P_=(e,t,r)=>{var i;return((i=e.getValue(t))==null||(i=i.toString())==null?void 0:i.toLowerCase())===r?.toLowerCase()};P_.autoRemove=e=>pr(e);const F_=(e,t,r)=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)};F_.autoRemove=e=>pr(e);const V_=(e,t,r)=>!r.some(i=>{var o;return!((o=e.getValue(t))!=null&&o.includes(i))});V_.autoRemove=e=>pr(e)||!(e!=null&&e.length);const U_=(e,t,r)=>r.some(i=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(i)});U_.autoRemove=e=>pr(e)||!(e!=null&&e.length);const H_=(e,t,r)=>e.getValue(t)===r;H_.autoRemove=e=>pr(e);const B_=(e,t,r)=>e.getValue(t)==r;B_.autoRemove=e=>pr(e);const eg=(e,t,r)=>{let[i,o]=r;const l=e.getValue(t);return l>=i&&l<=o};eg.resolveFilterValue=e=>{let[t,r]=e,i=typeof t!="number"?parseFloat(t):t,o=typeof r!="number"?parseFloat(r):r,l=t===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]};eg.autoRemove=e=>pr(e)||pr(e[0])&&pr(e[1]);const Wr={includesString:$_,includesStringSensitive:I_,equalsString:P_,arrIncludes:F_,arrIncludesAll:V_,arrIncludesSome:U_,equals:H_,weakEquals:B_,inNumberRange:eg};function pr(e){return e==null||e===""}const K3={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Fn("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const r=t.getCoreRowModel().flatRows[0],i=r?.getValue(e.id);return typeof i=="string"?Wr.includesString:typeof i=="number"?Wr.inNumberRange:typeof i=="boolean"||i!==null&&typeof i=="object"?Wr.equals:Array.isArray(i)?Wr.arrIncludes:Wr.weakEquals},e.getFilterFn=()=>{var r,i;return nd(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(r=(i=t.options.filterFns)==null?void 0:i[e.columnDef.filterFn])!=null?r:Wr[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,i,o;return((r=e.columnDef.enableColumnFilter)!=null?r:!0)&&((i=t.options.enableColumnFilters)!=null?i:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return(r=t.getState().columnFilters)==null||(r=r.find(i=>i.id===e.id))==null?void 0:r.value},e.getFilterIndex=()=>{var r,i;return(r=(i=t.getState().columnFilters)==null?void 0:i.findIndex(o=>o.id===e.id))!=null?r:-1},e.setFilterValue=r=>{t.setColumnFilters(i=>{const o=e.getFilterFn(),l=i?.find(y=>y.id===e.id),u=La(r,l?l.value:void 0);if(wx(o,u,e)){var d;return(d=i?.filter(y=>y.id!==e.id))!=null?d:[]}const m={id:e.id,value:u};if(l){var p;return(p=i?.map(y=>y.id===e.id?m:y))!=null?p:[]}return i!=null&&i.length?[...i,m]:[m]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const r=e.getAllLeafColumns(),i=o=>{var l;return(l=La(t,o))==null?void 0:l.filter(u=>{const d=r.find(m=>m.id===u.id);if(d){const m=d.getFilterFn();if(wx(m,u.value,d))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(i)},e.resetColumnFilters=t=>{var r,i;e.setColumnFilters(t?[]:(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 wx(e,t,r){return(e&&e.autoRemove?e.autoRemove(t,r):!1)||typeof t>"u"||typeof t=="string"&&!t}const Y3=(e,t,r)=>r.reduce((i,o)=>{const l=o.getValue(e);return i+(typeof l=="number"?l:0)},0),Q3=(e,t,r)=>{let i;return r.forEach(o=>{const l=o.getValue(e);l!=null&&(i>l||i===void 0&&l>=l)&&(i=l)}),i},X3=(e,t,r)=>{let i;return r.forEach(o=>{const l=o.getValue(e);l!=null&&(i=l)&&(i=l)}),i},J3=(e,t,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(t.forEach(o=>{let l=o.getValue(e);l!=null&&(l=+l)>=l&&(++r,i+=l)}),r)return i/r},e4=(e,t)=>{if(!t.length)return;const r=t.map(l=>l.getValue(e));if(!V3(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},t4=(e,t)=>Array.from(new Set(t.map(r=>r.getValue(e))).values()),n4=(e,t)=>new Set(t.map(r=>r.getValue(e))).size,r4=(e,t)=>t.length,Zh={sum:Y3,min:Q3,max:X3,extent:J3,mean:W3,median:e4,unique:t4,uniqueCount:n4,count:r4},a4={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,r;return(t=(r=e.getValue())==null||r.toString==null?void 0:r.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Fn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.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=t.options.enableGrouping)!=null?i:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const r=e.getCanGroup();return()=>{r&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=t.getCoreRowModel().flatRows[0],i=r?.getValue(e.id);if(typeof i=="number")return Zh.sum;if(Object.prototype.toString.call(i)==="[object Date]")return Zh.extent},e.getAggregationFn=()=>{var r,i;if(!e)throw new Error;return nd(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(r=(i=t.options.aggregationFns)==null?void 0:i[e.columnDef.aggregationFn])!=null?r:Zh[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var r,i;e.setGrouping(t?[]:(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,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const i=t.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,t,r,i)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=r.subRows)!=null&&o.length)}}};function i4(e,t,r){if(!(t!=null&&t.length)||!r)return e;const i=e.filter(l=>!t.includes(l.id));return r==="remove"?i:[...t.map(l=>e.find(u=>u.id===l)).filter(Boolean),...i]}const s4={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Fn("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Le(r=>[il(t,r)],r=>r.findIndex(i=>i.id===e.id),$e(t.options,"debugColumns")),e.getIsFirstColumn=r=>{var i;return((i=il(t,r)[0])==null?void 0:i.id)===e.id},e.getIsLastColumn=r=>{var i;const o=il(t,r);return((i=o[o.length-1])==null?void 0:i.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var r;e.setColumnOrder(t?[]:(r=e.initialState.columnOrder)!=null?r:[])},e._getOrderColumnsFn=Le(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,r,i)=>o=>{let l=[];if(!(t!=null&&t.length))l=o;else{const u=[...t],d=[...o];for(;d.length&&u.length;){const m=u.shift(),p=d.findIndex(y=>y.id===m);p>-1&&l.push(d.splice(p,1)[0])}l=[...l,...d]}return i4(l,r,i)},$e(e.options,"debugTable"))}},Kh=()=>({left:[],right:[]}),o4={getInitialState:e=>({columnPinning:Kh(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Fn("columnPinning",e)}),createColumn:(e,t)=>{e.pin=r=>{const i=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var l,u;if(r==="right"){var d,m;return{left:((d=o?.left)!=null?d:[]).filter(v=>!(i!=null&&i.includes(v))),right:[...((m=o?.right)!=null?m:[]).filter(v=>!(i!=null&&i.includes(v))),...i]}}if(r==="left"){var p,y;return{left:[...((p=o?.left)!=null?p:[]).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=t.options.enableColumnPinning)!=null?u:t.options.enablePinning)!=null?l:!0)}),e.getIsPinned=()=>{const r=e.getLeafColumns().map(d=>d.id),{left:i,right:o}=t.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=t.getState().columnPinning)==null||(i=i[o])==null?void 0:i.indexOf(e.id))!=null?r:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(r,i,o)=>{const l=[...i??[],...o??[]];return r.filter(u=>!l.includes(u.column.id))},$e(t.options,"debugRows")),e.getLeftVisibleCells=Le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(r,i)=>(i??[]).map(l=>r.find(u=>u.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),$e(t.options,"debugRows")),e.getRightVisibleCells=Le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(r,i)=>(i??[]).map(l=>r.find(u=>u.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),$e(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var r,i;return e.setColumnPinning(t?Kh():(r=(i=e.initialState)==null?void 0:i.columnPinning)!=null?r:Kh())},e.getIsSomeColumnsPinned=t=>{var r;const i=e.getState().columnPinning;if(!t){var o,l;return!!((o=i.left)!=null&&o.length||(l=i.right)!=null&&l.length)}return!!((r=i[t])!=null&&r.length)},e.getLeftLeafColumns=Le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,r)=>(r??[]).map(i=>t.find(o=>o.id===i)).filter(Boolean),$e(e.options,"debugColumns")),e.getRightLeafColumns=Le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,r)=>(r??[]).map(i=>t.find(o=>o.id===i)).filter(Boolean),$e(e.options,"debugColumns")),e.getCenterLeafColumns=Le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,i)=>{const o=[...r??[],...i??[]];return t.filter(l=>!o.includes(l.id))},$e(e.options,"debugColumns"))}};function l4(e){return e||(typeof document<"u"?document:null)}const eu={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Yh=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),c4={getDefaultColumnDef:()=>eu,getInitialState:e=>({columnSizing:{},columnSizingInfo:Yh(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Fn("columnSizing",e),onColumnSizingInfoChange:Fn("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var r,i,o;const l=t.getState().columnSizing[e.id];return Math.min(Math.max((r=e.columnDef.minSize)!=null?r:eu.minSize,(i=l??e.columnDef.size)!=null?i:eu.size),(o=e.columnDef.maxSize)!=null?o:eu.maxSize)},e.getStart=Le(r=>[r,il(t,r),t.getState().columnSizing],(r,i)=>i.slice(0,e.getIndex(r)).reduce((o,l)=>o+l.getSize(),0),$e(t.options,"debugColumns")),e.getAfter=Le(r=>[r,il(t,r),t.getState().columnSizing],(r,i)=>i.slice(e.getIndex(r)+1).reduce((o,l)=>o+l.getSize(),0),$e(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(r=>{let{[e.id]:i,...o}=r;return o})},e.getCanResize=()=>{var r,i;return((r=e.columnDef.enableResizing)!=null?r:!0)&&((i=t.options.enableColumnResizing)!=null?i:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{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=t.getColumn(e.column.id),o=i?.getCanResize();return l=>{if(!i||!o||(l.persist==null||l.persist(),Qh(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()]],m=Qh(l)?Math.round(l.touches[0].clientX):l.clientX,p={},y=(R,T)=>{typeof T=="number"&&(t.setColumnSizingInfo(O=>{var M,k;const B=t.options.columnResizeDirection==="rtl"?-1:1,V=(T-((M=O?.startOffset)!=null?M:0))*B,P=Math.max(V/((k=O?.startSize)!=null?k:0),-.999999);return O.columnSizingStart.forEach(pe=>{let[ne,ce]=pe;p[ne]=Math.round(Math.max(ce+ce*P,0)*100)/100}),{...O,deltaOffset:V,deltaPercentage:P}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(O=>({...O,...p})))},v=R=>y("move",R),b=R=>{y("end",R),t.setColumnSizingInfo(T=>({...T,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},x=l4(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=u4()?{passive:!1}:!1;Qh(l)?(x?.addEventListener("touchmove",_.moveHandler,E),x?.addEventListener("touchend",_.upHandler,E)):(x?.addEventListener("mousemove",w.moveHandler,E),x?.addEventListener("mouseup",w.upHandler,E)),t.setColumnSizingInfo(R=>({...R,startOffset:m,startSize:u,deltaOffset:0,deltaPercentage:0,columnSizingStart:d,isResizingColumn:i.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var r;e.setColumnSizing(t?{}:(r=e.initialState.columnSizing)!=null?r:{})},e.resetHeaderSizeInfo=t=>{var r;e.setColumnSizingInfo(t?Yh():(r=e.initialState.columnSizingInfo)!=null?r:Yh())},e.getTotalSize=()=>{var t,r;return(t=(r=e.getHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,r;return(t=(r=e.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,r;return(t=(r=e.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,r;return(t=(r=e.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?t:0}}};let tu=null;function u4(){if(typeof tu=="boolean")return tu;let e=!1;try{const t={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,t),window.removeEventListener("test",r)}catch{e=!1}return tu=e,tu}function Qh(e){return e.type==="touchstart"}const d4={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Fn("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=r=>{e.getCanHide()&&t.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=t.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=t.options.enableHiding)!=null?i:!0)},e.getToggleVisibilityHandler=()=>r=>{e.toggleVisibility==null||e.toggleVisibility(r.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Le(()=>[e.getAllCells(),t.getState().columnVisibility],r=>r.filter(i=>i.column.getIsVisible()),$e(t.options,"debugRows")),e.getVisibleCells=Le(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(r,i,o)=>[...r,...i,...o],$e(t.options,"debugRows"))},createTable:e=>{const t=(r,i)=>Le(()=>[i(),i().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),$e(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("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 il(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const f4={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()}}},h4={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Fn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var r;const i=(r=e.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[t.id])==null?void 0:r.getValue();return typeof i=="string"||typeof i=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var r,i,o,l;return((r=e.columnDef.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableGlobalFilter)!=null?i:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((l=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Wr.includesString,e.getGlobalFilterFn=()=>{var t,r;const{globalFilterFn:i}=e.options;return nd(i)?i:i==="auto"?e.getGlobalAutoFilterFn():(t=(r=e.options.filterFns)==null?void 0:r[i])!=null?t:Wr[i]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},m4={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Fn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,r=!1;e._autoResetExpanded=()=>{var i,o;if(!t){e._queue(()=>{t=!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,t)=>{e.toggleExpanded=r=>{t.setExpanded(i=>{var o;const l=i===!0?!0:!!(i!=null&&i[e.id]);let u={};if(i===!0?Object.keys(t.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,...m}=u;return m}return i})},e.getIsExpanded=()=>{var r;const i=t.getState().expanded;return!!((r=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?r:i===!0||i?.[e.id])},e.getCanExpand=()=>{var r,i,o;return(r=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?r:((i=t.options.enableExpanding)!=null?i:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let r=!0,i=e;for(;r&&i.parentId;)i=t.getRow(i.parentId,!0),r=i.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const r=e.getCanExpand();return()=>{r&&e.toggleExpanded()}}}},Pm=0,Fm=10,Xh=()=>({pageIndex:Pm,pageSize:Fm}),p4={getInitialState:e=>({...e,pagination:{...Xh(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Fn("pagination",e)}),createTable:e=>{let t=!1,r=!1;e._autoResetPageIndex=()=>{var i,o;if(!t){e._queue(()=>{t=!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=>La(i,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=i=>{var o;e.setPagination(i?Xh():(o=e.initialState.pagination)!=null?o:Xh())},e.setPageIndex=i=>{e.setPagination(o=>{let l=La(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?Pm:(o=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?o:Pm)},e.resetPageSize=i=>{var o,l;e.setPageSize(i?Fm:(o=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?o:Fm)},e.setPageSize=i=>{e.setPagination(o=>{const l=Math.max(1,La(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=La(i,(l=e.options.pageCount)!=null?l:-1);return typeof u=="number"&&(u=Math.max(-1,u)),{...o,pageCount:u}}),e.getPageOptions=Le(()=>[e.getPageCount()],i=>{let o=[];return i&&i>0&&(o=[...new Array(i)].fill(null).map((l,u)=>u)),o},$e(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}}},Jh=()=>({top:[],bottom:[]}),g4={getInitialState:e=>({rowPinning:Jh(),...e}),getDefaultOptions:e=>({onRowPinningChange:Fn("rowPinning",e)}),createRow:(e,t)=>{e.pin=(r,i,o)=>{const l=i?e.getLeafRows().map(m=>{let{id:p}=m;return p}):[],u=o?e.getParentRows().map(m=>{let{id:p}=m;return p}):[],d=new Set([...u,e.id,...l]);t.setRowPinning(m=>{var p,y;if(r==="bottom"){var v,b;return{top:((v=m?.top)!=null?v:[]).filter(_=>!(d!=null&&d.has(_))),bottom:[...((b=m?.bottom)!=null?b:[]).filter(_=>!(d!=null&&d.has(_))),...Array.from(d)]}}if(r==="top"){var x,w;return{top:[...((x=m?.top)!=null?x:[]).filter(_=>!(d!=null&&d.has(_))),...Array.from(d)],bottom:((w=m?.bottom)!=null?w:[]).filter(_=>!(d!=null&&d.has(_)))}}return{top:((p=m?.top)!=null?p:[]).filter(_=>!(d!=null&&d.has(_))),bottom:((y=m?.bottom)!=null?y:[]).filter(_=>!(d!=null&&d.has(_)))}})},e.getCanPin=()=>{var r;const{enableRowPinning:i,enablePinning:o}=t.options;return typeof i=="function"?i(e):(r=i??o)!=null?r:!0},e.getIsPinned=()=>{const r=[e.id],{top:i,bottom:o}=t.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"?t.getTopRows():t.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=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var r,i;return e.setRowPinning(t?Jh():(r=(i=e.initialState)==null?void 0:i.rowPinning)!=null?r:Jh())},e.getIsSomeRowsPinned=t=>{var r;const i=e.getState().rowPinning;if(!t){var o,l;return!!((o=i.top)!=null&&o.length||(l=i.bottom)!=null&&l.length)}return!!((r=i[t])!=null&&r.length)},e._getPinnedRows=(t,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=>t.find(d=>d.id===u))).filter(Boolean).map(u=>({...u,position:i}))},e.getTopRows=Le(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,r)=>e._getPinnedRows(t,r,"top"),$e(e.options,"debugRows")),e.getBottomRows=Le(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,r)=>e._getPinnedRows(t,r,"bottom"),$e(e.options,"debugRows")),e.getCenterRows=Le(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,r,i)=>{const o=new Set([...r??[],...i??[]]);return t.filter(l=>!o.has(l.id))},$e(e.options,"debugRows"))}},v4={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Fn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var r;return e.setRowSelection(t?{}:(r=e.initialState.rowSelection)!=null?r:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(r=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const i={...r},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(l=>{l.getCanSelect()&&(i[l.id]=!0)}):o.forEach(l=>{delete i[l.id]}),i})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(r=>{const i=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...r};return e.getRowModel().rows.forEach(l=>{Vm(o,l.id,i,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Le(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,r)=>Object.keys(t).length?Wh(e,r):{rows:[],flatRows:[],rowsById:{}},$e(e.options,"debugTable")),e.getFilteredSelectedRowModel=Le(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,r)=>Object.keys(t).length?Wh(e,r):{rows:[],flatRows:[],rowsById:{}},$e(e.options,"debugTable")),e.getGroupedSelectedRowModel=Le(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,r)=>Object.keys(t).length?Wh(e,r):{rows:[],flatRows:[],rowsById:{}},$e(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let i=!!(t.length&&Object.keys(r).length);return i&&t.some(o=>o.getCanSelect()&&!r[o.id])&&(i=!1),i},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:r}=e.getState();let i=!!t.length;return i&&t.some(o=>!r[o.id])&&(i=!1),i},e.getIsSomeRowsSelected=()=>{var t;const r=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return r>0&&r{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(r,i)=>{const o=e.getIsSelected();t.setRowSelection(l=>{var u;if(r=typeof r<"u"?r:!o,e.getCanSelect()&&o===r)return l;const d={...l};return Vm(d,e.id,r,(u=i?.selectChildren)!=null?u:!0,t),d})},e.getIsSelected=()=>{const{rowSelection:r}=t.getState();return tg(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=t.getState();return Um(e,r)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=t.getState();return Um(e,r)==="all"},e.getCanSelect=()=>{var r;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(r=t.options.enableRowSelection)!=null?r:!0},e.getCanSelectSubRows=()=>{var r;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(r=t.options.enableSubRowSelection)!=null?r:!0},e.getCanMultiSelect=()=>{var r;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(r=t.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)}}}},Vm=(e,t,r,i,o)=>{var l;const u=o.getRow(t,!0);r?(u.getCanMultiSelect()||Object.keys(e).forEach(d=>delete e[d]),u.getCanSelect()&&(e[t]=!0)):delete e[t],i&&(l=u.subRows)!=null&&l.length&&u.getCanSelectSubRows()&&u.subRows.forEach(d=>Vm(e,d.id,r,i,o))};function Wh(e,t){const r=e.getState().rowSelection,i=[],o={},l=function(u,d){return u.map(m=>{var p;const y=tg(m,r);if(y&&(i.push(m),o[m.id]=m),(p=m.subRows)!=null&&p.length&&(m={...m,subRows:l(m.subRows)}),y)return m}).filter(Boolean)};return{rows:l(t.rows),flatRows:i,rowsById:o}}function tg(e,t){var r;return(r=t[e.id])!=null?r:!1}function Um(e,t,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()&&(tg(u,t)?l=!0:o=!1),u.subRows&&u.subRows.length)){const d=Um(u,t);d==="all"?l=!0:(d==="some"&&(l=!0),o=!1)}}),o?"all":l?"some":!1}const Hm=/([0-9]+)/gm,y4=(e,t,r)=>q_(Ga(e.getValue(r)).toLowerCase(),Ga(t.getValue(r)).toLowerCase()),b4=(e,t,r)=>q_(Ga(e.getValue(r)),Ga(t.getValue(r))),x4=(e,t,r)=>ng(Ga(e.getValue(r)).toLowerCase(),Ga(t.getValue(r)).toLowerCase()),w4=(e,t,r)=>ng(Ga(e.getValue(r)),Ga(t.getValue(r))),S4=(e,t,r)=>{const i=e.getValue(r),o=t.getValue(r);return i>o?1:ing(e.getValue(r),t.getValue(r));function ng(e,t){return e===t?0:e>t?1:-1}function Ga(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function q_(e,t){const r=e.split(Hm).filter(Boolean),i=t.split(Hm).filter(Boolean);for(;r.length&&i.length;){const o=r.shift(),l=i.shift(),u=parseInt(o,10),d=parseInt(l,10),m=[u,d].sort();if(isNaN(m[0])){if(o>l)return 1;if(l>o)return-1;continue}if(isNaN(m[1]))return isNaN(u)?-1:1;if(u>d)return 1;if(d>u)return-1}return r.length-i.length}const Yo={alphanumeric:y4,alphanumericCaseSensitive:b4,text:x4,textCaseSensitive:w4,datetime:S4,basic:_4},C4={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Fn("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const r=t.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 Yo.datetime;if(typeof l=="string"&&(i=!0,l.split(Hm).length>1))return Yo.alphanumeric}return i?Yo.text:Yo.basic},e.getAutoSortDir=()=>{const r=t.getFilteredRowModel().flatRows[0];return typeof r?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var r,i;if(!e)throw new Error;return nd(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(r=(i=t.options.sortingFns)==null?void 0:i[e.columnDef.sortingFn])!=null?r:Yo[e.columnDef.sortingFn]},e.toggleSorting=(r,i)=>{const o=e.getNextSortingOrder(),l=typeof r<"u"&&r!==null;t.setSorting(u=>{const d=u?.find(x=>x.id===e.id),m=u?.findIndex(x=>x.id===e.id);let p=[],y,v=l?r:o==="desc";if(u!=null&&u.length&&e.getCanMultiSort()&&i?d?y="toggle":y="add":u!=null&&u.length&&m!==u.length-1?y="replace":d?y="toggle":y="replace",y==="toggle"&&(l||o||(y="remove")),y==="add"){var b;p=[...u,{id:e.id,desc:v}],p.splice(0,p.length-((b=t.options.maxMultiSortColCount)!=null?b:Number.MAX_SAFE_INTEGER))}else y==="toggle"?p=u.map(x=>x.id===e.id?{...x,desc:v}:x):y==="remove"?p=u.filter(x=>x.id!==e.id):p=[{id:e.id,desc:v}];return p})},e.getFirstSortDir=()=>{var r,i;return((r=(i=e.columnDef.sortDescFirst)!=null?i:t.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=t.options.enableSortingRemoval)==null||i)&&(!(r&&(o=t.options.enableMultiRemove)!=null)||o)?!1:u==="desc"?"asc":"desc":l},e.getCanSort=()=>{var r,i;return((r=e.columnDef.enableSorting)!=null?r:!0)&&((i=t.options.enableSorting)!=null?i:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,i;return(r=(i=e.columnDef.enableMultiSort)!=null?i:t.options.enableMultiSort)!=null?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const i=(r=t.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=t.getState().sorting)==null?void 0:i.findIndex(o=>o.id===e.id))!=null?r:-1},e.clearSorting=()=>{t.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()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(i):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var r,i;e.setSorting(t?[]:(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())}},E4=[q3,d4,s4,o4,Z3,K3,f4,h4,C4,a4,m4,p4,g4,v4,c4];function R4(e){var t,r;const i=[...E4,...(t=e._features)!=null?t:[]];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 m={...{},...(r=e.initialState)!=null?r:{}};o._features.forEach(b=>{var x;m=(x=b.getInitialState==null?void 0:b.getInitialState(m))!=null?x:m});const p=[];let y=!1;const v={_features:i,options:{...l,...e},initialState:m,_queue:b=>{p.push(b),y||(y=!0,Promise.resolve().then(()=>{for(;p.length;)p.shift()();y=!1}).catch(x=>setTimeout(()=>{throw x})))},reset:()=>{o.setState(o.initialState)},setOptions:b=>{const x=La(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:Le(()=>[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}},$e(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:Le(()=>[o._getColumnDefs()],b=>{const x=function(w,_,E){return E===void 0&&(E=0),w.map(R=>{const T=B3(o,R,E,_),O=R;return T.columns=O.columns?x(O.columns,T,E+1):[],T})};return x(b)},$e(e,"debugColumns")),getAllFlatColumns:Le(()=>[o.getAllColumns()],b=>b.flatMap(x=>x.getFlatColumns()),$e(e,"debugColumns")),_getAllFlatColumnsById:Le(()=>[o.getAllFlatColumns()],b=>b.reduce((x,w)=>(x[w.id]=w,x),{}),$e(e,"debugColumns")),getAllLeafColumns:Le(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(b,x)=>{let w=b.flatMap(_=>_.getLeafColumns());return x(w)},$e(e,"debugColumns")),getColumn:b=>o._getAllFlatColumnsById()[b]};Object.assign(o,v);for(let b=0;bLe(()=>[e.options.data],t=>{const r={rows:[],flatRows:[],rowsById:{}},i=function(o,l,u){l===void 0&&(l=0);const d=[];for(let p=0;pe._autoResetPageIndex()))}function Z_(){return e=>Le(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,r)=>{if(!r.rows.length||!(t!=null&&t.length))return r;const i=e.getState().sorting,o=[],l=i.filter(m=>{var p;return(p=e.getColumn(m.id))==null?void 0:p.getCanSort()}),u={};l.forEach(m=>{const p=e.getColumn(m.id);p&&(u[m.id]={sortUndefined:p.columnDef.sortUndefined,invertSorting:p.columnDef.invertSorting,sortingFn:p.getSortingFn()})});const d=m=>{const p=m.map(y=>({...y}));return p.sort((y,v)=>{for(let x=0;x{var v;o.push(y),(v=y.subRows)!=null&&v.length&&(y.subRows=d(y.subRows))}),p};return{rows:d(r.rows),flatRows:o,rowsById:r.rowsById}},$e(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Bm(e,t){return e?j4(e)?S.createElement(e,t):e:null}function j4(e){return T4(e)||typeof e=="function"||O4(e)}function T4(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function O4(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function K_(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=S.useState(()=>({current:R4(t)})),[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 jl=e=>e.type==="checkbox",$a=e=>e instanceof Date,sn=e=>e==null;const rg=e=>typeof e=="object";var Ot=e=>!sn(e)&&!Array.isArray(e)&&rg(e)&&!$a(e),A4=e=>Ot(e)&&e.target?jl(e.target)?e.target.checked:e.target.value:e,M4=(e,t)=>t.split(".").some((r,i,o)=>!isNaN(Number(r))&&e.has(o.slice(0,i).join("."))),Y_=e=>{const t=e.constructor&&e.constructor.prototype;return Ot(t)&&t.hasOwnProperty("isPrototypeOf")},rd=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Dt(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(rd&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Ot(e)&&Y_(e)))return e;const i=r?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=Dt(e[o]));return i}const As={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},mr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},fr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Q_="root",ag=["__proto__","constructor","prototype"],N4=/^\w*$/;var Tl=e=>N4.test(e),bt=e=>e===void 0;const D4=/[.[\]'"]/;var ad=e=>e.split(D4).filter(Boolean),_e=(e,t,r)=>{if(!t||!Ot(e))return r;const i=Tl(t)?[t]:ad(t);if(i.some(l=>ag.includes(l)))return r;const o=i.reduce((l,u)=>sn(l)?void 0:l[u],e);return bt(o)||o===e?bt(e[t])?r:e[t]:o},Rr=e=>typeof e=="boolean",Jn=e=>typeof e=="function",mt=(e,t,r)=>{let i=-1;const o=Tl(t)?[t]:ad(t),l=o.length,u=l-1;for(;++i{const o={};for(const l in e)Object.defineProperty(o,l,{get:()=>{const u=l;return t._proxyFormState[u]!==mr.all&&(t._proxyFormState[u]=!i||mr.all),e[u]}});return o};const L4=rd?ve.useLayoutEffect:ve.useEffect;var ln=e=>typeof e=="string",$4=(e,t,r,i,o)=>ln(e)?(i&&t.watch.add(e),_e(r,e,o)):Array.isArray(e)?e.map(l=>(i&&t.watch.add(l),_e(r,l))):(i&&(t.watchAll=!0),r),qm=e=>sn(e)||!rg(e);const Sx=(e,t)=>t.length===0&&!Array.isArray(e)&&!Y_(e);function jr(e,t,r=new WeakMap){if(e===t)return!0;if(qm(e)||qm(t))return Object.is(e,t);if($a(e)&&$a(t))return Object.is(e.getTime(),t.getTime());const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;if(Sx(e,i)||Sx(t,o))return Object.is(e,t);if(!i.length&&Array.isArray(e)!==Array.isArray(t))return!1;const l=r.get(e);if(l&&l.has(t))return!0;if(l)l.add(t);else{const u=new WeakSet;u.add(t),r.set(e,u)}for(const u of i){const d=e[u];if(!(u in t))return!1;if(u!=="ref"){const m=t[u];if($a(d)&&$a(m)||(Ot(d)||Array.isArray(d))&&(Ot(m)||Array.isArray(m))?!jr(d,m,r):!Object.is(d,m))return!1}}return!0}var nu=e=>({isOnSubmit:!e||e===mr.onSubmit,isOnBlur:e===mr.onBlur,isOnChange:e===mr.onChange,isOnAll:e===mr.all,isOnTouch:e===mr.onTouched}),em=(e,t,r)=>{if(r)return!1;if(t.watchAll||t.watch.has(e))return!0;for(const i of t.watch)if(e.startsWith(i)&&e.charAt(i.length)===".")return!0;return!1};const sl=(e,t,r,i)=>{for(const o of r||Object.keys(e)){const l=_e(e,o);if(l){const{_f:u,...d}=l;if(u){if(u.refs&&u.refs[0]&&t(u.refs[0],o)&&!i)return!0;if(u.ref&&t(u.ref,u.name)&&!i)return!0;if(sl(d,t))break}else if(Ot(d)&&sl(d,t))break}}};var _x=(e,t,r)=>{const i=_e(e,r),o=Array.isArray(i)?i:[];return mt(o,Q_,t[r]),mt(e,r,o),e},an=e=>Ot(e)&&!Object.keys(e).length,ig=e=>e.type==="file",Cu=e=>{if(!rd)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},sg=e=>e.type==="radio",Eu=e=>e instanceof RegExp,og=(e,t,r,i,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[i]:o||!0}}:{};const Cx={value:!1,isValid:!1},Ex={value:!0,isValid:!0};var X_=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!bt(e[0].attributes.value)?bt(e[0].value)||e[0].value===""?Ex:{value:e[0].value,isValid:!0}:Ex:Cx}return Cx};const Rx={isValid:!1,value:null};var J_=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Rx):Rx;function jx(e,t,r="validate"){if(ln(e)||Array.isArray(e)&&e.every(ln)||Rr(e)&&!e)return{type:r,message:ln(e)?e:"",ref:t}}var Ms=e=>Ot(e)&&!Eu(e)?e:{value:e,message:""},Tx=async(e,t,r,i,o,l)=>{const{ref:u,refs:d,required:m,maxLength:p,minLength:y,min:v,max:b,pattern:x,validate:w,name:_,valueAsNumber:E,mount:R}=e._f,T=_e(r,_);if(!R||t.has(_))return{};const O=d?d[0]:u,M=me=>{if(o&&O.reportValidity){const fe=Rr(me)?"":me||"";d?d.forEach(Z=>Z.setCustomValidity(fe)):O.setCustomValidity(fe),O.reportValidity()}},k={},B=sg(u),V=jl(u),P=B||V,pe=(E||ig(u))&&bt(u.value)&&bt(T)||Cu(u)&&u.value===""||T===""||Array.isArray(T)&&!T.length,ne=og.bind(null,_,i,k),ce=(me,fe,Z,Se=fr.maxLength,L=fr.minLength)=>{const K=me?fe:Z;k[_]={type:me?Se:L,message:K,ref:u,...ne(me?Se:L,K)}};if(l?!Array.isArray(T)||!T.length:m&&(!P&&(pe||sn(T))||Rr(T)&&!T||V&&!X_(d).isValid||B&&!J_(d).isValid)){const{value:me,message:fe}=ln(m)?{value:!!m,message:m}:Ms(m);if(me&&(k[_]={type:fr.required,message:fe,ref:O,...ne(fr.required,fe)},!i))return M(fe),k}if(!pe&&(!sn(v)||!sn(b))){let me,fe;const Z=Ms(b),Se=Ms(v);if(!sn(T)&&!isNaN(T)){const L=u.valueAsNumber||T&&+T;sn(Z.value)||(me=L>Z.value),sn(Se.value)||(fe=Lnew Date(new Date().toDateString()+" "+te),ie=u.type=="time",J=u.type=="week";ln(Z.value)&&T&&(me=ie?K(T)>K(Z.value):J?T>Z.value:L>new Date(Z.value)),ln(Se.value)&&T&&(fe=ie?K(T)+me.value,Se=!sn(fe.value)&&T.length<+fe.value;if((Z||Se)&&(ce(Z,me.message,fe.message),!i))return M(k[_].message),k}if(x&&!pe&&ln(T)){const{value:me,message:fe}=Ms(x);if(Eu(me)&&!T.match(me)&&(k[_]={type:fr.pattern,message:fe,ref:u,...ne(fr.pattern,fe)},!i))return M(fe),k}if(w){if(Jn(w)){const me=await w(T,r),fe=jx(me,O);if(fe&&(k[_]={...fe,...ne(fr.validate,fe.message)},!i))return M(fe.message),k}else if(Ot(w)){let me={};for(const fe in w){if(!an(me)&&!i)break;const Z=jx(await w[fe](T,r),O,fe);Z&&(me={...Z,...ne(fe,Z.message)},M(Z.message),i&&(k[_]=me))}if(!an(me)&&(k[_]={ref:O,...me},!i))return k}}return M(!0),k},du=e=>Array.isArray(e)?e:[e],W_=e=>Array.isArray(e)?e.filter(Boolean):[];function I4(e,t){const r=t.slice(0,-1).length;let i=0;for(;iag.includes(String(u))))return e;const i=r.length===1?e:I4(e,r),o=r.length-1,l=r[o];return i&&delete i[l],o!==0&&(Ot(i)&&an(i)||Array.isArray(i)&&P4(i))&&kt(e,r.slice(0,-1)),e}const eC=e=>{const t={};for(const r of Object.keys(e))if(rg(e[r])&&e[r]!==null&&!$a(e[r])){const i=eC(e[r]);for(const o of Object.keys(i))t[`${r}.${o}`]=i[o]}else t[r]=e[r];return t},F4=ve.createContext(null);F4.displayName="HookFormContext";var Ox=()=>{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 tC(e,t){const r={};for(const i in e)if(e.hasOwnProperty(i)){const o=e[i],l=t[i];if(o&&Ot(o)&&l){const u=tC(o,l);Ot(u)&&(r[i]=u)}else e[i]&&(r[i]=l)}return r}var nC=e=>e.type==="select-multiple",V4=e=>sg(e)||jl(e),tm=e=>Cu(e)&&e.isConnected,U4=e=>{for(const t in e)if(Jn(e[t]))return!0;return!1};function rC(e){return Array.isArray(e)||Ot(e)&&!U4(e)}function aC(e){return!!(e&&"_f"in e)}function iC(e){return Array.isArray(e)?!e.some(t=>!bt(t)):!Object.keys(e).length}function Gm(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function Zm(e,t={},r){for(const i in e){const o=e[i],l=r&&r[i];rC(o)&&(!Array.isArray(o)||!aC(l))?(t[i]=Array.isArray(o)?[]:{},Zm(o,t[i],l),iC(t[i])&&Gm(t,i)):bt(o)||(t[i]=!0)}return t}function wi(e,t,r,i){r||(r=Zm(t,{},i));for(const o in e){const l=e[o],u=i&&i[o];rC(l)&&(!Array.isArray(l)||!aC(u))?(bt(t)||qm(r[o])?r[o]=Zm(l,Array.isArray(l)?[]:{},u):wi(l,sn(t)?{}:t[o],r[o],u),iC(r[o])&&Gm(r,o)):jr(l,t[o])?Gm(r,o):r[o]=!0}return r}var sC=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:i})=>bt(e)?e:t?e===""?NaN:e&&+e:r&&ln(e)?new Date(e):i?i(e):e;function Ax(e){const t=e.ref;return ig(t)?t.files:sg(t)?J_(e.refs).value:nC(t)?[...t.selectedOptions].map(({value:r})=>r):jl(t)?X_(e.refs).value:sC(bt(t.value)?e.ref.value:t.value,e)}var H4=(e,t,r,i)=>{const o={};for(const l of e){const u=_e(t,l);u&&mt(o,l,u._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:i}},Qo=e=>bt(e)?e:Eu(e)?e.source:Ot(e)?Eu(e.value)?e.value.source:e.value:e;const Mx="AsyncFunction";var B4=e=>{if(!e||!e.validate)return!1;if(Jn(e.validate))return e.validate.constructor.name===Mx;if(Ot(e.validate)){for(const t in e.validate)if(e.validate[t].constructor.name===Mx)return!0}return!1},q4=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Nx(e,t,r){const i=_e(e,r);if(i||Tl(r))return{error:i,name:r};const o=r.split(".");for(;o.length;){const l=o.join("."),u=_e(t,l),d=_e(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 G4=(e,t,r,i)=>{r(e);const{name:o,...l}=e,u=Object.keys(l);return!u.length||i&&u.length>=Object.keys(t).length||u.find(d=>t[d]===(!i||mr.all))},Z4=(e,t,r)=>!e||!t||e===t||du(e).some(i=>i&&(r?i===t||i.startsWith(t+"."):i.startsWith(t)||t.startsWith(i))),K4=(e,t,r,i,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?i.isOnBlur:o.isOnBlur)?!e:(r?i.isOnChange:o.isOnChange)?e:!0,Y4=(e,t)=>!W_(_e(e,t)).length&&kt(e,t);const Q4={mode:mr.onSubmit,reValidateMode:mr.onChange,shouldFocusError:!0},nm="form",oC={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function X4(e={}){let t={...Q4,...e},r={...Dt(oC),isLoading:Jn(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},i={},o=Ot(t.defaultValues)||Ot(t.values)?Dt(t.defaultValues||t.values)||{}:{},l=t.shouldUnregister?{}:Dt(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 m={},p={};let y=0,v=nu(t.mode),b=nu(t.reValidateMode);const x={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},w={...x};let _={...w};const E={array:Ox(),state:Ox()};let R=0;const T=t.criteriaMode===mr.all,O=(A,I)=>F=>{clearTimeout(p[A]),p[A]=setTimeout(I,F)},M=async A=>{if(!u.keepIsValid&&!t.disabled&&(w.isValid||_.isValid||A)){const I=++R;let F;t.resolver?(F=an((await Z()).errors),I===R&&k()):F=await K({fields:i,onlyCheckValid:!0,eventType:As.VALID}),I===R&&F!==r.isValid&&E.state.next({isValid:F})}},k=(A,I)=>{!t.disabled&&(w.isValidating||w.validatingFields||_.isValidating||_.validatingFields)&&((A||Array.from(d.mount)).forEach(F=>{F&&(I?mt(r.validatingFields,F,I):kt(r.validatingFields,F))}),E.state.next({validatingFields:r.validatingFields,isValidating:!an(r.validatingFields)}))},B=()=>{r.dirtyFields=wi(o,l,void 0,i)},V=(A,I=[],F,de,oe=!0,ye=!0)=>{if(de&&F&&!t.disabled){if(u.action=!0,ye&&Array.isArray(_e(i,A))){const we=F(_e(i,A),de.argA,de.argB);oe&&mt(i,A,we)}if(ye&&Array.isArray(_e(r.errors,A))){const we=F(_e(r.errors,A),de.argA,de.argB);oe&&mt(r.errors,A,we),Y4(r.errors,A)}if((w.touchedFields||_.touchedFields)&&ye&&Array.isArray(_e(r.touchedFields,A))){const we=F(_e(r.touchedFields,A),de.argA,de.argB);oe&&mt(r.touchedFields,A,we)}(w.dirtyFields||_.dirtyFields)&&B(),E.state.next({name:A,isDirty:J(A,I),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else mt(l,A,I)},P=(A,I)=>{mt(r.errors,A,I),r.errors={...r.errors},E.state.next({errors:r.errors})},pe=A=>{r.errors=A,E.state.next({errors:r.errors,isValid:!1})},ne=A=>{const I=Tl(A)?[A]:ad(A);let F=l,de=o;for(let oe=0;oe{const oe=_e(i,A);if(oe){if(ne(A))return;const ye=bt(_e(l,A)),we=_e(l,A,bt(F)?_e(o,A):F);bt(we)||de&&de.defaultChecked||I?mt(l,A,I?we:Ax(oe._f)):N(A,we),u.mount&&!u.action&&(M(),ye&&r.isDirty&&(w.isDirty||_.isDirty)&&(J()||(r.isDirty=!1,E.state.next({...r}))),e.shouldUnregister&&ye&&!bt(_e(l,A))&&em(A,d)&&(u.watch=!0))}},me=(A,I,F,de,oe)=>{let ye=!1,we=!1;const ee={name:A};if(!t.disabled||de===!0){if(!F||de){const le=jr(_e(o,A),I);(w.isDirty||_.isDirty)&&(we=r.isDirty,r.isDirty=ee.isDirty=!le||J(),ye=we!==ee.isDirty),we=!!_e(r.dirtyFields,A),le!==r.isDirty?r.dirtyFields=wi(o,l,void 0,i):le?kt(r.dirtyFields,A):mt(r.dirtyFields,A,!0),ee.dirtyFields=r.dirtyFields,ye=ye||(w.dirtyFields||_.dirtyFields)&&we!==!le}if(F){const le=_e(r.touchedFields,A);le||(mt(r.touchedFields,A,F),ee.touchedFields=r.touchedFields,ye=ye||(w.touchedFields||_.touchedFields)&&le!==F)}ye&&oe&&E.state.next(ee)}return ye?ee:{}},fe=(A,I,F,de)=>{const oe=_e(r.errors,A),ye=(w.isValid||_.isValid)&&Rr(I)&&r.isValid!==I;if(t.delayError&&F?(m[A]=O(A,()=>P(A,F)),m[A](t.delayError)):(clearTimeout(p[A]),delete m[A],F?mt(r.errors,A,F):kt(r.errors,A),r.errors={...r.errors}),(F?!jr(oe,F):oe)||!an(de)||ye){const we={...de,...ye&&Rr(I)?{isValid:I}:{},errors:r.errors,name:A};r={...r,...we},E.state.next(we)}},Z=async A=>(k(A,!0),await t.resolver(l,t.context,H4(A||d.mount,i,t.criteriaMode,t.shouldUseNativeValidation))),Se=async A=>{const{errors:I}=await Z(A);if(k(A),A){for(const F of A){const de=_e(I,F);de?d.array.has(F)&&Ot(de)&&!Object.keys(de).some(oe=>!Number.isNaN(Number(oe)))?_x(r.errors,{[F]:de},F):mt(r.errors,F,de):kt(r.errors,F)}r.errors={...r.errors}}else r.errors=I;return I},L=async({name:A,eventType:I})=>{if(e.validate){const F=await e.validate({formValues:l,formState:r,name:A,eventType:I});if(Ot(F))for(const de in F){const oe=F[de];oe&&ct(`${nm}.${de}`,{message:ln(oe.message)?oe.message:"",type:oe.type||fr.validate})}else ln(F)||!F?ct(nm,{message:F||"",type:fr.validate}):He(nm);return F}return!0},K=async({fields:A,onlyCheckValid:I,name:F,eventType:de,context:oe={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(oe.runRootValidation=!0,!await L({name:F,eventType:de})&&(oe.valid=!1,I)))return oe.valid;for(const ye in A){const we=A[ye];if(we){const{_f:ee,...le}=we;if(ee){const Re=d.array.has(ee.name),ze=we._f&&B4(we._f),it=w.validatingFields||w.isValidating||_.validatingFields||_.isValidating;ze&&it&&k([ee.name],!0);const _t=await Tx(we,d.disabled,l,T,t.shouldUseNativeValidation&&!I,Re);if(ze&&it&&k([ee.name]),_t[ee.name]&&(oe.valid=!1,I)||(!I&&(_e(_t,ee.name)?Re?_x(r.errors,_t,ee.name):mt(r.errors,ee.name,_t[ee.name]):kt(r.errors,ee.name)),e.shouldUseNativeValidation&&_t[ee.name]))break}!an(le)&&await K({context:oe,onlyCheckValid:I,fields:le,name:ye,eventType:de})}}return oe.valid},ie=()=>{for(const A of d.unMount){const I=_e(i,A);I&&(I._f.refs?I._f.refs.every(F=>!tm(F)):!tm(I._f.ref))&&Xt(A)}d.unMount=new Set},J=(A,I)=>(A&&I&&mt(l,A,I),!jr(u.mount?l:o,o)),te=(A,I,F)=>$4(A,d,{...u.mount?l:bt(I)?o:ln(A)?{[A]:I}:I},F,I),D=A=>W_(_e(u.mount?l:o,A,t.shouldUnregister?_e(o,A,[]):[])),N=(A,I,F={},de=!1,oe=!1)=>{const ye=_e(i,A);let we=I;if(ye){const ee=ye._f;ee&&(!ee.disabled&&mt(l,A,sC(I,ee)),we=Cu(ee.ref)&&sn(I)?"":I,nC(ee.ref)?[...ee.ref.options].forEach(le=>le.selected=we.includes(le.value)):ee.refs?jl(ee.ref)?ee.refs.forEach(le=>{(!le.defaultChecked||!le.disabled)&&(Array.isArray(we)?le.checked=!!we.find(Re=>Re===le.value):le.checked=we===le.value||!!we)}):ee.refs.forEach(le=>le.checked=le.value===we):ig(ee.ref)?ee.ref.value="":(ee.ref.value=we,!ee.ref.type&&!oe&&E.state.next({name:A,values:de?l:Dt(l)})))}(F.shouldDirty||F.shouldTouch)&&me(A,we,F.shouldTouch,F.shouldDirty,!oe),F.shouldValidate&&xe(A,{delayError:F.delayError})},H=(A,I,F,de=!1,oe=!1)=>{for(const ye in I){if(!I.hasOwnProperty(ye))return;const we=I[ye],ee=A+"."+ye,le=_e(i,ee);(d.array.has(A)||Ot(we)||le&&!le._f)&&!$a(we)?H(ee,we,F,de,oe):N(ee,we,F,de,oe)}},X=(A,I,F,de,oe=!1)=>{const ye=_e(i,A),we=d.array.has(A),ee=de?I:Dt(I),le=_e(l,A),Re=jr(le,ee);if(Re||mt(l,A,ee),we)E.array.next({name:A,values:de?l:Dt(l)}),(w.isDirty||w.dirtyFields||_.isDirty||_.dirtyFields)&&F.shouldDirty&&(B(),oe||E.state.next({name:A,dirtyFields:r.dirtyFields,isDirty:J(A,ee)}));else{const ze=Array.isArray(ee)&&!ee.length||an(ee);!ye||ye._f||sn(ee)||ze?N(A,ee,F,de,oe):H(A,ee,F,de,oe)}if(!Re&&!oe){const ze=em(A,d),it=de?l:Dt(l);E.state.next({...ze&&r,name:u.mount||ze?A:void 0,values:it})}},Y=(A,I,F={})=>X(A,I,F,!1),he=(A,I={})=>{const F=Jn(A)?A(l):A;if(!jr(l,F)){l={...l,...F};const de=eC(F);for(const oe of d.mount)oe in de&&X(oe,de[oe],I,!0,!0);E.state.next({...r,name:void 0,type:void 0,...y?{values:l}:{}}),I.shouldValidate&&M()}},re=async A=>{u.mount=!0;const I=A.target;let F=I.name,de=!0;const oe=_e(i,F),ye=we=>{de=Number.isNaN(we)||$a(we)&&isNaN(we.getTime())||jr(we,_e(l,F,we))};if(oe){let we,ee;const le=I.type?Ax(oe._f):A4(A),Re=A.type===As.BLUR||A.type===As.FOCUS_OUT,ze=!q4(oe._f)&&!e.validate&&!t.resolver&&!_e(r.errors,F)&&!oe._f.deps,it=ze||K4(Re,_e(r.touchedFields,F),r.isSubmitted,b,v),_t=em(F,d,Re);if(mt(l,F,le),Re){if(!I||!I.readOnly){oe._f.onBlur&&oe._f.onBlur(A);const st=m[F];st&&st(0)}}else oe._f.onChange&&oe._f.onChange(A);const Ae=me(F,le,Re),ut=!an(Ae)||_t;if(!Re&&E.state.next({name:F,type:A.type,...y?{values:Dt(l)}:{}}),it)return(!ze||!r.isValid)&&(w.isValid||_.isValid)&&(t.mode==="onBlur"?Re&&M():Re||M()),ut&&E.state.next({name:F,..._t?{}:Ae});if(!t.resolver&&e.validate&&await L({name:F,eventType:A.type}),!Re&&_t&&E.state.next({...r}),t.resolver){const{errors:st}=await Z([F]);if(k([F]),ye(le),!de){!an(Ae)&&E.state.next(Ae);return}const Gt=Nx(r.errors,i,F),sr=Nx(st,i,Gt.name||F);we=sr.error,F=sr.name,ee=an(st)}else k([F],!0),we=(await Tx(oe,d.disabled,l,T,t.shouldUseNativeValidation))[F],k([F]),ye(le),de&&(we?ee=!1:(w.isValid||_.isValid)&&(ee=await K({fields:i,onlyCheckValid:!0,name:F,eventType:A.type})));de&&(oe._f.deps&&(!Array.isArray(oe._f.deps)||oe._f.deps.length>0)&&xe(oe._f.deps),fe(F,ee,we,Ae))}},be=(A,I)=>{if(_e(r.errors,I)&&A.focus)return A.focus(),1},xe=async(A,I={})=>{let F,de;const oe=du(A);if(t.resolver){const ye=await Se(bt(A)?A:oe);F=an(ye),de=A?!oe.some(we=>_e(ye,we)):F}else A?(de=(await Promise.all(oe.map(async ye=>{const we=_e(i,ye);return await K({fields:we&&we._f?{[ye]:we}:we,eventType:As.TRIGGER})}))).every(Boolean),!(!de&&!r.isValid)&&M()):de=F=await K({fields:i,name:A,eventType:As.TRIGGER});if(I.delayError&&t.delayError&&ln(A)){const ye=_e(r.errors,A);ye?(kt(r.errors,A),m[A]=O(A,()=>P(A,ye)),m[A](t.delayError)):(clearTimeout(p[A]),delete m[A])}return E.state.next({...!ln(A)||(w.isValid||_.isValid)&&F!==r.isValid?{}:{name:A},...t.resolver||!A?{isValid:F}:{},errors:r.errors}),I.shouldFocus&&!de&&sl(i,be,A?oe:d.mount),de},Me=(A,I)=>{let F={...u.mount?l:o};return I&&(F=tC(I.dirtyFields?r.dirtyFields:r.touchedFields,F)),bt(A)?F:ln(A)?_e(F,A):A.map(de=>_e(F,de))},Fe=(A,I)=>({invalid:!!_e((I||r).errors,A),isDirty:!!_e((I||r).dirtyFields,A),error:_e((I||r).errors,A),isValidating:!!_e(r.validatingFields,A),isTouched:!!_e((I||r).touchedFields,A)}),He=A=>{const I=A?du(A):void 0;I?.forEach(F=>kt(r.errors,F)),I?I.forEach(F=>{E.state.next({name:F,errors:r.errors})}):E.state.next({errors:{}})},ct=(A,I,F)=>{const de=(_e(i,A,{_f:{}})._f||{}).ref,oe=_e(r.errors,A)||{},{ref:ye,message:we,type:ee,...le}=oe;mt(r.errors,A,{...le,...I,ref:de}),E.state.next({name:A,errors:r.errors,isValid:!1}),F&&F.shouldFocus&&de&&de.focus&&de.focus()},Je=(A,I)=>{if(Jn(A)){y++;const{unsubscribe:F}=E.state.subscribe({next:oe=>"values"in oe&&A(oe.values||te(void 0,I),oe)});let de=!1;return{unsubscribe:()=>{de||(de=!0,y--,F())}}}return te(A,I,!0)},hn=A=>{var I;const F=!!(!((I=A.formState)===null||I===void 0)&&I.values);F&&y++;const{unsubscribe:de}=E.state.subscribe({next:ye=>{if(Z4(A.name,ye.name,A.exact)&&G4(ye,A.formState||w,oa,A.reRenderRoot)){const we={...l};A.callback({values:we,...r,...ye,defaultValues:o})}}});if(!F)return de;let oe=!1;return()=>{oe||(oe=!0,y--,de())}},mn=A=>(u.mount=!0,_={..._,...A.formState},hn({...A,formState:{...x,...A.formState}})),Xt=(A,I={})=>{for(const F of A?du(A):d.mount)d.mount.delete(F),d.array.delete(F),I.keepValue||(kt(i,F),kt(l,F)),!I.keepError&&kt(r.errors,F),!I.keepDirty&&kt(r.dirtyFields,F),!I.keepTouched&&kt(r.touchedFields,F),!I.keepIsValidating&&kt(r.validatingFields,F),!t.shouldUnregister&&!I.keepDefaultValue&&kt(o,F);E.state.next({values:Dt(l)}),E.state.next({...r,...I.keepDirty?{isDirty:J()}:{}}),!I.keepIsValid&&M()},yr=({disabled:A,name:I})=>{if(Rr(A)&&u.mount||A||d.disabled.has(I)){const oe=d.disabled.has(I)!==!!A;A?d.disabled.add(I):d.disabled.delete(I),oe&&u.mount&&!u.action&&M()}},At=(A,I={})=>{let F=_e(i,A);const de=Rr(I.disabled)||Rr(t.disabled),oe=!d.registerName.has(A)&&F&&F._f&&!F._f.mount;return mt(i,A,{...F||{},_f:{...F&&F._f?F._f:{ref:{name:A}},name:A,mount:!0,...I}}),d.mount.add(A),F&&!oe?yr({disabled:Rr(I.disabled)?I.disabled:t.disabled,name:A}):ce(A,!0,I.value),{...de?{disabled:I.disabled||t.disabled}:{},...t.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:re,onBlur:re,ref:ye=>{if(ye){d.registerName.add(A),At(A,I),d.registerName.delete(A),F=_e(i,A);const we=bt(ye.value)&&ye.querySelectorAll&&ye.querySelectorAll("input,select,textarea")[0]||ye,ee=V4(we),le=F._f.refs||[];if(ee?le.find(Re=>Re===we):we===F._f.ref)return;mt(i,A,{_f:{...F._f,...ee?{refs:[...le.filter(tm),we,...Array.isArray(_e(o,A))?[{}]:[]],ref:{type:we.type,name:A}}:{ref:we}}}),ce(A,!1,void 0,we)}else F=_e(i,A,{}),F._f&&(F._f.mount=!1),(t.shouldUnregister||I.shouldUnregister)&&!(M4(d.array,A)&&u.action)&&d.unMount.add(A)}}},rr=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&sl(i,be,d.mount),br=A=>{Rr(A)&&(E.state.next({disabled:A}),sl(i,(I,F)=>{const de=_e(i,F);de&&(I.disabled=de._f.disabled||A,Array.isArray(de._f.refs)&&de._f.refs.forEach(oe=>{oe.disabled=de._f.disabled||A}))},0,!1))},Rt=(A,I)=>async F=>{let de;F&&(F.preventDefault&&F.preventDefault(),F.persist&&F.persist());let oe=Dt(l);if(E.state.next({isSubmitting:!0}),t.resolver){const{errors:ye,values:we}=await Z();k(),r.errors=ye,oe=Dt(we)}else await K({fields:i,eventType:As.SUBMIT});if(d.disabled.size)for(const ye of d.disabled)kt(oe,ye);if(kt(r.errors,Q_),an(r.errors)){E.state.next({errors:{}});try{await A(oe,F)}catch(ye){de=ye}}else I&&await I({...r.errors},F),rr(),setTimeout(rr);if(E.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:an(r.errors)&&!de,submitCount:r.submitCount+1,errors:r.errors}),de)throw de},Vn=(A,I={})=>{_e(i,A)&&(bt(I.defaultValue)?Y(A,Dt(_e(o,A))):(Y(A,I.defaultValue),mt(o,A,Dt(I.defaultValue))),I.keepTouched||kt(r.touchedFields,A),I.keepDirty||(kt(r.dirtyFields,A),r.isDirty=I.defaultValue?J(A,Dt(_e(o,A))):J()),I.keepError||(kt(r.errors,A),w.isValid&&M()),E.state.next({...r}))},zt=(A,I={})=>{const F=A?Dt(A):o,de=Dt(F),oe=an(A),ye=de,we=i;if(I.keepDefaultValues||(o=F),!I.keepValues){if(I.keepDirtyValues){const ee=new Set([...d.mount,...Object.keys(wi(o,l,void 0,we))]);for(const le of Array.from(ee)){const Re=_e(r.dirtyFields,le),ze=_e(l,le),it=_e(ye,le);Re&&!bt(ze)?mt(ye,le,ze):!Re&&!bt(it)&&Y(le,it)}}else{if(rd&&bt(A))for(const ee of d.mount){const le=_e(i,ee);if(le&&le._f){const Re=Array.isArray(le._f.refs)?le._f.refs[0]:le._f.ref;if(Cu(Re)){const ze=Re.closest("form");if(ze){ze.reset();break}}}}if(I.keepFieldsRef)for(const ee of d.mount)Y(ee,_e(ye,ee));else i={}}if(t.shouldUnregister){if(l=I.keepDefaultValues?Dt(o):{},I.keepFieldsRef)for(const ee of d.mount)mt(l,ee,_e(ye,ee))}else l=Dt(ye);E.array.next({values:{...ye}}),E.state.next({name:void 0,type:void 0,values:{...ye}})}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||!t.shouldUnregister&&!an(ye),u.watch=!!t.shouldUnregister,u.keepIsValid=!!I.keepIsValid,u.action=!1,I.keepErrors||(r.errors={}),E.state.next({submitCount:I.keepSubmitCount?r.submitCount:0,isDirty:oe?!1:I.keepDirty?r.isDirty:I.keepValues?J():!!(I.keepDefaultValues&&!jr(A,o)),isSubmitted:I.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:oe?{}:I.keepDirtyValues?I.keepDefaultValues&&l?wi(o,l,void 0,we):r.dirtyFields:I.keepDefaultValues&&A?wi(o,A,void 0,we):I.keepDirty?r.dirtyFields:{},touchedFields:I.keepTouched?r.touchedFields:{},errors:I.keepErrors?r.errors:{},isSubmitSuccessful:I.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Dr=(A,I)=>zt(Jn(A)?A(l):A,{...t.resetOptions,...I}),ar=(A,I={})=>{const F=_e(i,A),de=F&&F._f;if(de){const oe=de.refs?de.refs[0]:de.ref;oe.focus&&setTimeout(()=>{oe.focus(),I.shouldSelect&&Jn(oe.select)&&oe.select()})}},oa=A=>{const{name:I,type:F,values:de,...oe}=A;r={...r,...oe}},Jt={control:{register:At,unregister:Xt,getFieldState:Fe,handleSubmit:Rt,setError:ct,_subscribe:hn,_runSchema:Z,_updateIsValidating:k,_focusError:rr,_getWatch:te,_getDirty:J,_setValid:M,_setFieldArray:V,_setDisabledField:yr,_setErrors:pe,_getFieldArray:D,_reset:zt,_resetDefaultValues:()=>Jn(t.defaultValues)&&t.defaultValues().then(A=>{Dr(A,t.resetOptions),E.state.next({isLoading:!1})}),_removeUnmounted:ie,_disableForm:br,_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 t},set _options(A){t={...t,...A},v=nu(t.mode),b=nu(t.reValidateMode)}},subscribe:mn,trigger:xe,register:At,handleSubmit:Rt,watch:Je,setValue:Y,setValues:he,getValues:Me,reset:Dr,resetField:Vn,resetDefaultValues:(A,I={})=>{if(o=Dt(A),!I.keepDirty){const F=wi(o,l,void 0,i);r.dirtyFields=F,r.isDirty=!an(F)}I.keepIsValid||M(),E.state.next({...r,defaultValues:o})},clearErrors:He,unregister:Xt,setError:ct,setFocus:ar,getFieldState:Fe};return{...Jt,formControl:Jt}}function lg(e={}){const t=ve.useRef(void 0),r=ve.useRef(void 0),i=ve.useRef(e.formControl),[o,l]=ve.useState(()=>({...Dt(oC),isLoading:Jn(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Jn(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&i.current!==e.formControl)if(i.current=e.formControl,e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!Jn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:d,...m}=X4(e);t.current={...m,formState:o}}const u=t.current.control;return u._options=e,L4(()=>{const d=u._subscribe({formState:u._proxyFormState,callback:()=>l({...u._formState,defaultValues:u._defaultValues}),reRenderRoot:!0});return l(m=>({...m,isReady:!0})),u._formState.isReady=!0,d},[u]),ve.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),ve.useEffect(()=>{e.mode&&(u._options.mode=e.mode),e.reValidateMode&&(u._options.reValidateMode=e.reValidateMode)},[u,e.mode,e.reValidateMode]),ve.useEffect(()=>{e.errors&&(u._setErrors(e.errors),u._focusError())},[u,e.errors]),ve.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,e.shouldUnregister]),ve.useEffect(()=>{if(u._proxyFormState.isDirty){const d=u._getDirty();d!==o.isDirty&&u._subjects.state.next({isDirty:d})}},[u,o.isDirty]),ve.useEffect(()=>{var d;e.values&&!jr(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(m=>({...m}))):u._resetDefaultValues()},[u,e.values]),ve.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()}),t.current.formState=ve.useMemo(()=>z4(o,u),[u,o]),t.current}const Dx=(e,t,r)=>{if(e&&"reportValidity"in e){const i=_e(r,t);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},Km=(e,t)=>{for(const r in t.fields){const i=t.fields[r];i&&i.ref&&"reportValidity"in i.ref?Dx(i.ref,r,e):i&&i.refs&&i.refs.forEach(o=>Dx(o,r,e))}},kx=(e,t)=>{t.shouldUseNativeValidation&&Km(e,t);const r={};for(const i in e){const o=_e(t.fields,i),l=Object.assign(e[i]||{},{ref:o&&o.ref});if(J4(t.names||Object.keys(e),i)){const u=Object.assign({},_e(r,i));mt(u,"root",l),mt(r,i,u)}else mt(r,i,l)}return r},J4=(e,t)=>{const r=zx(t).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(i=>zx(i).match(`^${r}\\.\\d+`))};function zx(e){return e.replace(/[\[\]]/g,"")}var Lx;function ge(e,t,r){function i(d,m){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:m,constr:u,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,m);const p=u.prototype,y=Object.keys(p);for(let v=0;vr?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class Bs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class lC extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Lx=globalThis).__zod_globalConfig??(Lx.__zod_globalConfig={});const cg=globalThis.__zod_globalConfig;function Ai(e){return cg}function cC(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>t.indexOf(+i)===-1).map(([i,o])=>o)}function Ym(e,t){return typeof t=="bigint"?t.toString():t}function ug(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function dg(e){return e==null}function fg(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const $x=Symbol("evaluating");function pt(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==$x)return i===void 0&&(i=$x,i=r()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Fi(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Wa(...e){const t={};for(const r of e){const i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}function Ix(e){return JSON.stringify(e)}function W4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const uC="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ru(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const e5=ug(()=>{if(cg.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function pl(e){if(Ru(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(Ru(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function dC(e){return pl(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const t5=new Set(["string","number","symbol"]);function id(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ei(e,t,r){const i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}function Ie(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function n5(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function r5(e,t){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=Wa(e._zod.def,{get shape(){const u={};for(const d in t){if(!(d in r.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(u[d]=r.shape[d])}return Fi(this,"shape",u),u},checks:[]});return ei(e,l)}function a5(e,t){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=Wa(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const d in t){if(!(d in r.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete u[d]}return Fi(this,"shape",u),u},checks:[]});return ei(e,l)}function i5(e,t){if(!pl(t))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 t)if(Object.getOwnPropertyDescriptor(l,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Wa(e._zod.def,{get shape(){const l={...e._zod.def.shape,...t};return Fi(this,"shape",l),l}});return ei(e,o)}function s5(e,t){if(!pl(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Wa(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Fi(this,"shape",i),i}});return ei(e,r)}function o5(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=Wa(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Fi(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ei(e,r)}function l5(e,t,r){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Wa(t._zod.def,{get shape(){const d=t._zod.def.shape,m={...d};if(r)for(const p in r){if(!(p in d))throw new Error(`Unrecognized key: "${p}"`);r[p]&&(m[p]=e?new e({type:"optional",innerType:d[p]}):d[p])}else for(const p in d)m[p]=e?new e({type:"optional",innerType:d[p]}):d[p];return Fi(this,"shape",m),m},checks:[]});return ei(t,u)}function c5(e,t,r){const i=Wa(t._zod.def,{get shape(){const o=t._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 Fi(this,"shape",l),l}});return ei(t,i)}function $s(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function ru(e){return typeof e=="string"?e:e?.message}function Mi(e,t,r){const i=e.message?e.message:ru(e.inst?._zod.def?.error?.(e))??ru(t?.error?.(e))??ru(r.customError?.(e))??ru(r.localeError?.(e))??"Invalid input",{inst:o,continue:l,input:u,...d}=e;return d.path??(d.path=[]),d.message=i,t?.reportInput&&(d.input=u),d}function hg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function gl(...e){const[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}const hC=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ym,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},mg=ge("$ZodError",hC),sd=ge("$ZodError",hC,{Parent:Error});function d5(e,t=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(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:r}}function f5(e,t=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(t(u));else{let m=r,p=0;for(;p(t,r,i,o)=>{const l=i?{...i,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},l);if(u instanceof Promise)throw new Bs;if(u.issues.length){const d=new(o?.Err??e)(u.issues.map(m=>Mi(m,l,Ai())));throw uC(d,o?.callee),d}return u.value},h5=od(sd),ld=e=>async(t,r,i,o)=>{const l=i?{...i,async:!0}:{async:!0};let u=t._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(m=>Mi(m,l,Ai())));throw uC(d,o?.callee),d}return u.value},m5=ld(sd),cd=e=>(t,r,i)=>{const o=i?{...i,async:!1}:{async:!1},l=t._zod.run({value:r,issues:[]},o);if(l instanceof Promise)throw new Bs;return l.issues.length?{success:!1,error:new(e??mg)(l.issues.map(u=>Mi(u,o,Ai())))}:{success:!0,data:l.value}},p5=cd(sd),ud=e=>async(t,r,i)=>{const o=i?{...i,async:!0}:{async:!0};let l=t._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=>Mi(u,o,Ai())))}:{success:!0,data:l.value}},g5=ud(sd),v5=e=>(t,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return od(e)(t,r,o)},y5=e=>(t,r,i)=>od(e)(t,r,i),b5=e=>async(t,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return ld(e)(t,r,o)},x5=e=>async(t,r,i)=>ld(e)(t,r,i),w5=e=>(t,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return cd(e)(t,r,o)},S5=e=>(t,r,i)=>cd(e)(t,r,i),_5=e=>async(t,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return ud(e)(t,r,o)},C5=e=>async(t,r,i)=>ud(e)(t,r,i),E5=/^[cC][0-9a-z]{6,}$/,R5=/^[0-9a-z]+$/,j5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,T5=/^[0-9a-vA-V]{20}$/,O5=/^[A-Za-z0-9]{27}$/,A5=/^[a-zA-Z0-9_-]{21}$/,M5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,N5=/^([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})$/,Px=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)$/,D5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,k5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function z5(){return new RegExp(k5,"u")}const L5=/^(?:(?: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])$/,$5=/^(([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}|:))$/,I5=/^((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])$/,P5=/^(([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])$/,F5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mC=/^[A-Za-z0-9_-]*$/,V5=/^https?$/,U5=/^\+[1-9]\d{6,14}$/,pC="(?:(?:\\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])))",H5=new RegExp(`^${pC}$`);function gC(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function B5(e){return new RegExp(`^${gC(e)}$`)}function q5(e){const t=gC({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${r.join("|")})`;return new RegExp(`^${pC}T(?:${i})$`)}const G5=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Z5=/^(?:true|false)$/i,K5=/^[^A-Z]*$/,Y5=/^[^a-z]*$/,Nr=ge("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Q5=ge("$ZodCheckMaxLength",(e,t)=>{var r;Nr.init(e,t),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!dg(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=i.value;if(o.length<=t.maximum)return;const u=hg(o);i.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),X5=ge("$ZodCheckMinLength",(e,t)=>{var r;Nr.init(e,t),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!dg(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=t.minimum)return;const u=hg(o);i.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),J5=ge("$ZodCheckLengthEquals",(e,t)=>{var r;Nr.init(e,t),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!dg(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=i=>{const o=i.value,l=o.length;if(l===t.length)return;const u=hg(o),d=l>t.length;i.issues.push({origin:u,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),dd=ge("$ZodCheckStringFormat",(e,t)=>{var r,i;Nr.init(e,t),e._zod.onattach.push(o=>{const l=o._zod.bag;l.format=t.format,t.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),W5=ge("$ZodCheckRegex",(e,t)=>{dd.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),e6=ge("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=K5),dd.init(e,t)}),t6=ge("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Y5),dd.init(e,t)}),n6=ge("$ZodCheckIncludes",(e,t)=>{Nr.init(e,t);const r=id(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.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(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),r6=ge("$ZodCheckStartsWith",(e,t)=>{Nr.init(e,t);const r=new RegExp(`^${id(t.prefix)}.*`);t.pattern??(t.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(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),a6=ge("$ZodCheckEndsWith",(e,t)=>{Nr.init(e,t);const r=new RegExp(`.*${id(t.suffix)}$`);t.pattern??(t.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(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),i6=ge("$ZodCheckOverwrite",(e,t)=>{Nr.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class s6{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(` + color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,r?.key)}return o}}function $e(e,t,r,i){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[t]},key:!1,onChange:i}}function B3(e,t,r,i){const o=()=>{var u;return(u=l.getValue())!=null?u:e.options.renderFallbackValue},l={id:`${t.id}_${r.id}`,row:t,column:r,getValue:()=>t.getValue(i),renderValue:o,getContext:Le(()=>[e,r,t,l],(u,d,m,p)=>({table:u,column:d,row:m,cell:p,getValue:p.getValue,renderValue:p.renderValue}),$e(e.options,"debugCells"))};return e._features.forEach(u=>{u.createCell==null||u.createCell(l,r,t,e)},{}),l}function q3(e,t,r,i){var o,l;const d={...e._getDefaultColumnDef(),...t},m=d.accessorKey;let p=(o=(l=d.id)!=null?l:m?typeof String.prototype.replaceAll=="function"?m.replaceAll(".","_"):m.replace(/\./g,"_"):void 0)!=null?o:typeof d.header=="string"?d.header:void 0,y;if(d.accessorFn?y=d.accessorFn:m&&(m.includes(".")?y=b=>{let x=b;for(const _ of m.split(".")){var w;x=(w=x)==null?void 0:w[_]}return x}:y=b=>b[d.accessorKey]),!p)throw new Error;let v={id:`${String(p)}`,accessorFn:y,parent:i,depth:r,columnDef:d,columns:[],getFlatColumns:Le(()=>[!0],()=>{var b;return[v,...(b=v.columns)==null?void 0:b.flatMap(x=>x.getFlatColumns())]},$e(e.options,"debugColumns")),getLeafColumns:Le(()=>[e._getOrderColumnsFn()],b=>{var x;if((x=v.columns)!=null&&x.length){let w=v.columns.flatMap(_=>_.getLeafColumns());return b(w)}return[v]},$e(e.options,"debugColumns"))};for(const b of e._features)b.createColumn==null||b.createColumn(v,e);return v}const dn="debugHeaders";function xx(e,t,r){var i;let l={id:(i=r.id)!=null?i:t.id,column:t,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const u=[],d=m=>{m.subHeaders&&m.subHeaders.length&&m.subHeaders.map(d),u.push(m)};return d(l),u},getContext:()=>({table:e,header:l,column:t})};return e._features.forEach(u=>{u.createHeader==null||u.createHeader(l,e)}),l}const G3={createTable:e=>{e.getHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,i,o)=>{var l,u;const d=(l=i?.map(v=>r.find(b=>b.id===v)).filter(Boolean))!=null?l:[],m=(u=o?.map(v=>r.find(b=>b.id===v)).filter(Boolean))!=null?u:[],p=r.filter(v=>!(i!=null&&i.includes(v.id))&&!(o!=null&&o.includes(v.id)));return Wc(t,[...d,...p,...m],e)},$e(e.options,dn)),e.getCenterHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,i,o)=>(r=r.filter(l=>!(i!=null&&i.includes(l.id))&&!(o!=null&&o.includes(l.id))),Wc(t,r,e,"center")),$e(e.options,dn)),e.getLeftHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,r,i)=>{var o;const l=(o=i?.map(u=>r.find(d=>d.id===u)).filter(Boolean))!=null?o:[];return Wc(t,l,e,"left")},$e(e.options,dn)),e.getRightHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,r,i)=>{var o;const l=(o=i?.map(u=>r.find(d=>d.id===u)).filter(Boolean))!=null?o:[];return Wc(t,l,e,"right")},$e(e.options,dn)),e.getFooterGroups=Le(()=>[e.getHeaderGroups()],t=>[...t].reverse(),$e(e.options,dn)),e.getLeftFooterGroups=Le(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),$e(e.options,dn)),e.getCenterFooterGroups=Le(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),$e(e.options,dn)),e.getRightFooterGroups=Le(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),$e(e.options,dn)),e.getFlatHeaders=Le(()=>[e.getHeaderGroups()],t=>t.map(r=>r.headers).flat(),$e(e.options,dn)),e.getLeftFlatHeaders=Le(()=>[e.getLeftHeaderGroups()],t=>t.map(r=>r.headers).flat(),$e(e.options,dn)),e.getCenterFlatHeaders=Le(()=>[e.getCenterHeaderGroups()],t=>t.map(r=>r.headers).flat(),$e(e.options,dn)),e.getRightFlatHeaders=Le(()=>[e.getRightHeaderGroups()],t=>t.map(r=>r.headers).flat(),$e(e.options,dn)),e.getCenterLeafHeaders=Le(()=>[e.getCenterFlatHeaders()],t=>t.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),$e(e.options,dn)),e.getLeftLeafHeaders=Le(()=>[e.getLeftFlatHeaders()],t=>t.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),$e(e.options,dn)),e.getRightLeafHeaders=Le(()=>[e.getRightFlatHeaders()],t=>t.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),$e(e.options,dn)),e.getLeafHeaders=Le(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,r,i)=>{var o,l,u,d,m,p;return[...(o=(l=t[0])==null?void 0:l.headers)!=null?o:[],...(u=(d=r[0])==null?void 0:d.headers)!=null?u:[],...(m=(p=i[0])==null?void 0:p.headers)!=null?m:[]].map(y=>y.getLeafHeaders()).flat()},$e(e.options,dn))}};function Wc(e,t,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 m=[];const p=(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 k=xx(r,O,{id:[i,x,O.id,E?.id].filter(Boolean).join("_"),isPlaceholder:M,placeholderId:M?`${_.filter(B=>B.column===O).length}`:void 0,depth:x,index:_.length});k.subHeaders.push(E),_.push(k)}w.headers.push(E),E.headerGroup=w}),m.push(w),x>0&&p(_,x-1)},y=t.map((b,x)=>xx(r,b,{depth:u,index:x}));p(y,u-1),m.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:k}=O;_+=M,R.push(k)})):_=1;const T=Math.min(...R);return E=E+T,w.colSpan=_,w.rowSpan=E,{colSpan:_,rowSpan:E}});return v((o=(l=m[0])==null?void 0:l.headers)!=null?o:[]),m}const Z3=(e,t,r,i,o,l,u)=>{let d={id:t,index:i,original:r,depth:o,parentId:u,_valuesCache:{},_uniqueValuesCache:{},getValue:m=>{if(d._valuesCache.hasOwnProperty(m))return d._valuesCache[m];const p=e.getColumn(m);if(p!=null&&p.accessorFn)return d._valuesCache[m]=p.accessorFn(d.original,i),d._valuesCache[m]},getUniqueValues:m=>{if(d._uniqueValuesCache.hasOwnProperty(m))return d._uniqueValuesCache[m];const p=e.getColumn(m);if(p!=null&&p.accessorFn)return p.columnDef.getUniqueValues?(d._uniqueValuesCache[m]=p.columnDef.getUniqueValues(d.original,i),d._uniqueValuesCache[m]):(d._uniqueValuesCache[m]=[d.getValue(m)],d._uniqueValuesCache[m])},renderValue:m=>{var p;return(p=d.getValue(m))!=null?p:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>H3(d.subRows,m=>m.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let m=[],p=d;for(;;){const y=p.getParentRow();if(!y)break;m.push(y),p=y}return m.reverse()},getAllCells:Le(()=>[e.getAllLeafColumns()],m=>m.map(p=>B3(e,d,p,p.id)),$e(e.options,"debugRows")),_getAllCellsByColumnId:Le(()=>[d.getAllCells()],m=>m.reduce((p,y)=>(p[y.column.id]=y,p),{}),$e(e.options,"debugRows"))};for(let m=0;m{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},$_=(e,t,r)=>{var i,o;const l=r==null||(i=r.toString())==null?void 0:i.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(l))};$_.autoRemove=e=>pr(e);const I_=(e,t,r)=>{var i;return!!(!((i=e.getValue(t))==null||(i=i.toString())==null)&&i.includes(r))};I_.autoRemove=e=>pr(e);const P_=(e,t,r)=>{var i;return((i=e.getValue(t))==null||(i=i.toString())==null?void 0:i.toLowerCase())===r?.toLowerCase()};P_.autoRemove=e=>pr(e);const F_=(e,t,r)=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)};F_.autoRemove=e=>pr(e);const V_=(e,t,r)=>!r.some(i=>{var o;return!((o=e.getValue(t))!=null&&o.includes(i))});V_.autoRemove=e=>pr(e)||!(e!=null&&e.length);const U_=(e,t,r)=>r.some(i=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(i)});U_.autoRemove=e=>pr(e)||!(e!=null&&e.length);const H_=(e,t,r)=>e.getValue(t)===r;H_.autoRemove=e=>pr(e);const B_=(e,t,r)=>e.getValue(t)==r;B_.autoRemove=e=>pr(e);const eg=(e,t,r)=>{let[i,o]=r;const l=e.getValue(t);return l>=i&&l<=o};eg.resolveFilterValue=e=>{let[t,r]=e,i=typeof t!="number"?parseFloat(t):t,o=typeof r!="number"?parseFloat(r):r,l=t===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]};eg.autoRemove=e=>pr(e)||pr(e[0])&&pr(e[1]);const Wr={includesString:$_,includesStringSensitive:I_,equalsString:P_,arrIncludes:F_,arrIncludesAll:V_,arrIncludesSome:U_,equals:H_,weakEquals:B_,inNumberRange:eg};function pr(e){return e==null||e===""}const Y3={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Fn("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const r=t.getCoreRowModel().flatRows[0],i=r?.getValue(e.id);return typeof i=="string"?Wr.includesString:typeof i=="number"?Wr.inNumberRange:typeof i=="boolean"||i!==null&&typeof i=="object"?Wr.equals:Array.isArray(i)?Wr.arrIncludes:Wr.weakEquals},e.getFilterFn=()=>{var r,i;return nd(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(r=(i=t.options.filterFns)==null?void 0:i[e.columnDef.filterFn])!=null?r:Wr[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,i,o;return((r=e.columnDef.enableColumnFilter)!=null?r:!0)&&((i=t.options.enableColumnFilters)!=null?i:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return(r=t.getState().columnFilters)==null||(r=r.find(i=>i.id===e.id))==null?void 0:r.value},e.getFilterIndex=()=>{var r,i;return(r=(i=t.getState().columnFilters)==null?void 0:i.findIndex(o=>o.id===e.id))!=null?r:-1},e.setFilterValue=r=>{t.setColumnFilters(i=>{const o=e.getFilterFn(),l=i?.find(y=>y.id===e.id),u=La(r,l?l.value:void 0);if(wx(o,u,e)){var d;return(d=i?.filter(y=>y.id!==e.id))!=null?d:[]}const m={id:e.id,value:u};if(l){var p;return(p=i?.map(y=>y.id===e.id?m:y))!=null?p:[]}return i!=null&&i.length?[...i,m]:[m]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const r=e.getAllLeafColumns(),i=o=>{var l;return(l=La(t,o))==null?void 0:l.filter(u=>{const d=r.find(m=>m.id===u.id);if(d){const m=d.getFilterFn();if(wx(m,u.value,d))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(i)},e.resetColumnFilters=t=>{var r,i;e.setColumnFilters(t?[]:(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 wx(e,t,r){return(e&&e.autoRemove?e.autoRemove(t,r):!1)||typeof t>"u"||typeof t=="string"&&!t}const Q3=(e,t,r)=>r.reduce((i,o)=>{const l=o.getValue(e);return i+(typeof l=="number"?l:0)},0),X3=(e,t,r)=>{let i;return r.forEach(o=>{const l=o.getValue(e);l!=null&&(i>l||i===void 0&&l>=l)&&(i=l)}),i},J3=(e,t,r)=>{let i;return r.forEach(o=>{const l=o.getValue(e);l!=null&&(i=l)&&(i=l)}),i},W3=(e,t,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(t.forEach(o=>{let l=o.getValue(e);l!=null&&(l=+l)>=l&&(++r,i+=l)}),r)return i/r},t4=(e,t)=>{if(!t.length)return;const r=t.map(l=>l.getValue(e));if(!U3(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},n4=(e,t)=>Array.from(new Set(t.map(r=>r.getValue(e))).values()),r4=(e,t)=>new Set(t.map(r=>r.getValue(e))).size,a4=(e,t)=>t.length,Zh={sum:Q3,min:X3,max:J3,extent:W3,mean:e4,median:t4,unique:n4,uniqueCount:r4,count:a4},i4={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,r;return(t=(r=e.getValue())==null||r.toString==null?void 0:r.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Fn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.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=t.options.enableGrouping)!=null?i:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const r=e.getCanGroup();return()=>{r&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=t.getCoreRowModel().flatRows[0],i=r?.getValue(e.id);if(typeof i=="number")return Zh.sum;if(Object.prototype.toString.call(i)==="[object Date]")return Zh.extent},e.getAggregationFn=()=>{var r,i;if(!e)throw new Error;return nd(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(r=(i=t.options.aggregationFns)==null?void 0:i[e.columnDef.aggregationFn])!=null?r:Zh[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var r,i;e.setGrouping(t?[]:(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,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const i=t.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,t,r,i)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=r.subRows)!=null&&o.length)}}};function s4(e,t,r){if(!(t!=null&&t.length)||!r)return e;const i=e.filter(l=>!t.includes(l.id));return r==="remove"?i:[...t.map(l=>e.find(u=>u.id===l)).filter(Boolean),...i]}const o4={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Fn("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Le(r=>[il(t,r)],r=>r.findIndex(i=>i.id===e.id),$e(t.options,"debugColumns")),e.getIsFirstColumn=r=>{var i;return((i=il(t,r)[0])==null?void 0:i.id)===e.id},e.getIsLastColumn=r=>{var i;const o=il(t,r);return((i=o[o.length-1])==null?void 0:i.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var r;e.setColumnOrder(t?[]:(r=e.initialState.columnOrder)!=null?r:[])},e._getOrderColumnsFn=Le(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,r,i)=>o=>{let l=[];if(!(t!=null&&t.length))l=o;else{const u=[...t],d=[...o];for(;d.length&&u.length;){const m=u.shift(),p=d.findIndex(y=>y.id===m);p>-1&&l.push(d.splice(p,1)[0])}l=[...l,...d]}return s4(l,r,i)},$e(e.options,"debugTable"))}},Kh=()=>({left:[],right:[]}),l4={getInitialState:e=>({columnPinning:Kh(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Fn("columnPinning",e)}),createColumn:(e,t)=>{e.pin=r=>{const i=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var l,u;if(r==="right"){var d,m;return{left:((d=o?.left)!=null?d:[]).filter(v=>!(i!=null&&i.includes(v))),right:[...((m=o?.right)!=null?m:[]).filter(v=>!(i!=null&&i.includes(v))),...i]}}if(r==="left"){var p,y;return{left:[...((p=o?.left)!=null?p:[]).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=t.options.enableColumnPinning)!=null?u:t.options.enablePinning)!=null?l:!0)}),e.getIsPinned=()=>{const r=e.getLeafColumns().map(d=>d.id),{left:i,right:o}=t.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=t.getState().columnPinning)==null||(i=i[o])==null?void 0:i.indexOf(e.id))!=null?r:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(r,i,o)=>{const l=[...i??[],...o??[]];return r.filter(u=>!l.includes(u.column.id))},$e(t.options,"debugRows")),e.getLeftVisibleCells=Le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(r,i)=>(i??[]).map(l=>r.find(u=>u.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),$e(t.options,"debugRows")),e.getRightVisibleCells=Le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(r,i)=>(i??[]).map(l=>r.find(u=>u.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),$e(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var r,i;return e.setColumnPinning(t?Kh():(r=(i=e.initialState)==null?void 0:i.columnPinning)!=null?r:Kh())},e.getIsSomeColumnsPinned=t=>{var r;const i=e.getState().columnPinning;if(!t){var o,l;return!!((o=i.left)!=null&&o.length||(l=i.right)!=null&&l.length)}return!!((r=i[t])!=null&&r.length)},e.getLeftLeafColumns=Le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,r)=>(r??[]).map(i=>t.find(o=>o.id===i)).filter(Boolean),$e(e.options,"debugColumns")),e.getRightLeafColumns=Le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,r)=>(r??[]).map(i=>t.find(o=>o.id===i)).filter(Boolean),$e(e.options,"debugColumns")),e.getCenterLeafColumns=Le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,i)=>{const o=[...r??[],...i??[]];return t.filter(l=>!o.includes(l.id))},$e(e.options,"debugColumns"))}};function c4(e){return e||(typeof document<"u"?document:null)}const eu={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Yh=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),u4={getDefaultColumnDef:()=>eu,getInitialState:e=>({columnSizing:{},columnSizingInfo:Yh(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Fn("columnSizing",e),onColumnSizingInfoChange:Fn("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var r,i,o;const l=t.getState().columnSizing[e.id];return Math.min(Math.max((r=e.columnDef.minSize)!=null?r:eu.minSize,(i=l??e.columnDef.size)!=null?i:eu.size),(o=e.columnDef.maxSize)!=null?o:eu.maxSize)},e.getStart=Le(r=>[r,il(t,r),t.getState().columnSizing],(r,i)=>i.slice(0,e.getIndex(r)).reduce((o,l)=>o+l.getSize(),0),$e(t.options,"debugColumns")),e.getAfter=Le(r=>[r,il(t,r),t.getState().columnSizing],(r,i)=>i.slice(e.getIndex(r)+1).reduce((o,l)=>o+l.getSize(),0),$e(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(r=>{let{[e.id]:i,...o}=r;return o})},e.getCanResize=()=>{var r,i;return((r=e.columnDef.enableResizing)!=null?r:!0)&&((i=t.options.enableColumnResizing)!=null?i:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{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=t.getColumn(e.column.id),o=i?.getCanResize();return l=>{if(!i||!o||(l.persist==null||l.persist(),Qh(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()]],m=Qh(l)?Math.round(l.touches[0].clientX):l.clientX,p={},y=(R,T)=>{typeof T=="number"&&(t.setColumnSizingInfo(O=>{var M,k;const B=t.options.columnResizeDirection==="rtl"?-1:1,V=(T-((M=O?.startOffset)!=null?M:0))*B,P=Math.max(V/((k=O?.startSize)!=null?k:0),-.999999);return O.columnSizingStart.forEach(pe=>{let[ne,ce]=pe;p[ne]=Math.round(Math.max(ce+ce*P,0)*100)/100}),{...O,deltaOffset:V,deltaPercentage:P}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(O=>({...O,...p})))},v=R=>y("move",R),b=R=>{y("end",R),t.setColumnSizingInfo(T=>({...T,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},x=c4(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=d4()?{passive:!1}:!1;Qh(l)?(x?.addEventListener("touchmove",_.moveHandler,E),x?.addEventListener("touchend",_.upHandler,E)):(x?.addEventListener("mousemove",w.moveHandler,E),x?.addEventListener("mouseup",w.upHandler,E)),t.setColumnSizingInfo(R=>({...R,startOffset:m,startSize:u,deltaOffset:0,deltaPercentage:0,columnSizingStart:d,isResizingColumn:i.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var r;e.setColumnSizing(t?{}:(r=e.initialState.columnSizing)!=null?r:{})},e.resetHeaderSizeInfo=t=>{var r;e.setColumnSizingInfo(t?Yh():(r=e.initialState.columnSizingInfo)!=null?r:Yh())},e.getTotalSize=()=>{var t,r;return(t=(r=e.getHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,r;return(t=(r=e.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,r;return(t=(r=e.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,r;return(t=(r=e.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((i,o)=>i+o.getSize(),0))!=null?t:0}}};let tu=null;function d4(){if(typeof tu=="boolean")return tu;let e=!1;try{const t={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,t),window.removeEventListener("test",r)}catch{e=!1}return tu=e,tu}function Qh(e){return e.type==="touchstart"}const f4={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Fn("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=r=>{e.getCanHide()&&t.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=t.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=t.options.enableHiding)!=null?i:!0)},e.getToggleVisibilityHandler=()=>r=>{e.toggleVisibility==null||e.toggleVisibility(r.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Le(()=>[e.getAllCells(),t.getState().columnVisibility],r=>r.filter(i=>i.column.getIsVisible()),$e(t.options,"debugRows")),e.getVisibleCells=Le(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(r,i,o)=>[...r,...i,...o],$e(t.options,"debugRows"))},createTable:e=>{const t=(r,i)=>Le(()=>[i(),i().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),$e(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("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 il(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const h4={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()}}},m4={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Fn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var r;const i=(r=e.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[t.id])==null?void 0:r.getValue();return typeof i=="string"||typeof i=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var r,i,o,l;return((r=e.columnDef.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableGlobalFilter)!=null?i:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((l=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Wr.includesString,e.getGlobalFilterFn=()=>{var t,r;const{globalFilterFn:i}=e.options;return nd(i)?i:i==="auto"?e.getGlobalAutoFilterFn():(t=(r=e.options.filterFns)==null?void 0:r[i])!=null?t:Wr[i]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},p4={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Fn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,r=!1;e._autoResetExpanded=()=>{var i,o;if(!t){e._queue(()=>{t=!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,t)=>{e.toggleExpanded=r=>{t.setExpanded(i=>{var o;const l=i===!0?!0:!!(i!=null&&i[e.id]);let u={};if(i===!0?Object.keys(t.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,...m}=u;return m}return i})},e.getIsExpanded=()=>{var r;const i=t.getState().expanded;return!!((r=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?r:i===!0||i?.[e.id])},e.getCanExpand=()=>{var r,i,o;return(r=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?r:((i=t.options.enableExpanding)!=null?i:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let r=!0,i=e;for(;r&&i.parentId;)i=t.getRow(i.parentId,!0),r=i.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const r=e.getCanExpand();return()=>{r&&e.toggleExpanded()}}}},Pm=0,Fm=10,Xh=()=>({pageIndex:Pm,pageSize:Fm}),g4={getInitialState:e=>({...e,pagination:{...Xh(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Fn("pagination",e)}),createTable:e=>{let t=!1,r=!1;e._autoResetPageIndex=()=>{var i,o;if(!t){e._queue(()=>{t=!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=>La(i,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=i=>{var o;e.setPagination(i?Xh():(o=e.initialState.pagination)!=null?o:Xh())},e.setPageIndex=i=>{e.setPagination(o=>{let l=La(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?Pm:(o=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?o:Pm)},e.resetPageSize=i=>{var o,l;e.setPageSize(i?Fm:(o=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?o:Fm)},e.setPageSize=i=>{e.setPagination(o=>{const l=Math.max(1,La(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=La(i,(l=e.options.pageCount)!=null?l:-1);return typeof u=="number"&&(u=Math.max(-1,u)),{...o,pageCount:u}}),e.getPageOptions=Le(()=>[e.getPageCount()],i=>{let o=[];return i&&i>0&&(o=[...new Array(i)].fill(null).map((l,u)=>u)),o},$e(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}}},Jh=()=>({top:[],bottom:[]}),v4={getInitialState:e=>({rowPinning:Jh(),...e}),getDefaultOptions:e=>({onRowPinningChange:Fn("rowPinning",e)}),createRow:(e,t)=>{e.pin=(r,i,o)=>{const l=i?e.getLeafRows().map(m=>{let{id:p}=m;return p}):[],u=o?e.getParentRows().map(m=>{let{id:p}=m;return p}):[],d=new Set([...u,e.id,...l]);t.setRowPinning(m=>{var p,y;if(r==="bottom"){var v,b;return{top:((v=m?.top)!=null?v:[]).filter(_=>!(d!=null&&d.has(_))),bottom:[...((b=m?.bottom)!=null?b:[]).filter(_=>!(d!=null&&d.has(_))),...Array.from(d)]}}if(r==="top"){var x,w;return{top:[...((x=m?.top)!=null?x:[]).filter(_=>!(d!=null&&d.has(_))),...Array.from(d)],bottom:((w=m?.bottom)!=null?w:[]).filter(_=>!(d!=null&&d.has(_)))}}return{top:((p=m?.top)!=null?p:[]).filter(_=>!(d!=null&&d.has(_))),bottom:((y=m?.bottom)!=null?y:[]).filter(_=>!(d!=null&&d.has(_)))}})},e.getCanPin=()=>{var r;const{enableRowPinning:i,enablePinning:o}=t.options;return typeof i=="function"?i(e):(r=i??o)!=null?r:!0},e.getIsPinned=()=>{const r=[e.id],{top:i,bottom:o}=t.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"?t.getTopRows():t.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=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var r,i;return e.setRowPinning(t?Jh():(r=(i=e.initialState)==null?void 0:i.rowPinning)!=null?r:Jh())},e.getIsSomeRowsPinned=t=>{var r;const i=e.getState().rowPinning;if(!t){var o,l;return!!((o=i.top)!=null&&o.length||(l=i.bottom)!=null&&l.length)}return!!((r=i[t])!=null&&r.length)},e._getPinnedRows=(t,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=>t.find(d=>d.id===u))).filter(Boolean).map(u=>({...u,position:i}))},e.getTopRows=Le(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,r)=>e._getPinnedRows(t,r,"top"),$e(e.options,"debugRows")),e.getBottomRows=Le(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,r)=>e._getPinnedRows(t,r,"bottom"),$e(e.options,"debugRows")),e.getCenterRows=Le(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,r,i)=>{const o=new Set([...r??[],...i??[]]);return t.filter(l=>!o.has(l.id))},$e(e.options,"debugRows"))}},y4={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Fn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var r;return e.setRowSelection(t?{}:(r=e.initialState.rowSelection)!=null?r:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(r=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const i={...r},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(l=>{l.getCanSelect()&&(i[l.id]=!0)}):o.forEach(l=>{delete i[l.id]}),i})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(r=>{const i=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...r};return e.getRowModel().rows.forEach(l=>{Vm(o,l.id,i,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Le(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,r)=>Object.keys(t).length?Wh(e,r):{rows:[],flatRows:[],rowsById:{}},$e(e.options,"debugTable")),e.getFilteredSelectedRowModel=Le(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,r)=>Object.keys(t).length?Wh(e,r):{rows:[],flatRows:[],rowsById:{}},$e(e.options,"debugTable")),e.getGroupedSelectedRowModel=Le(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,r)=>Object.keys(t).length?Wh(e,r):{rows:[],flatRows:[],rowsById:{}},$e(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let i=!!(t.length&&Object.keys(r).length);return i&&t.some(o=>o.getCanSelect()&&!r[o.id])&&(i=!1),i},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:r}=e.getState();let i=!!t.length;return i&&t.some(o=>!r[o.id])&&(i=!1),i},e.getIsSomeRowsSelected=()=>{var t;const r=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return r>0&&r{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(r,i)=>{const o=e.getIsSelected();t.setRowSelection(l=>{var u;if(r=typeof r<"u"?r:!o,e.getCanSelect()&&o===r)return l;const d={...l};return Vm(d,e.id,r,(u=i?.selectChildren)!=null?u:!0,t),d})},e.getIsSelected=()=>{const{rowSelection:r}=t.getState();return tg(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=t.getState();return Um(e,r)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=t.getState();return Um(e,r)==="all"},e.getCanSelect=()=>{var r;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(r=t.options.enableRowSelection)!=null?r:!0},e.getCanSelectSubRows=()=>{var r;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(r=t.options.enableSubRowSelection)!=null?r:!0},e.getCanMultiSelect=()=>{var r;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(r=t.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)}}}},Vm=(e,t,r,i,o)=>{var l;const u=o.getRow(t,!0);r?(u.getCanMultiSelect()||Object.keys(e).forEach(d=>delete e[d]),u.getCanSelect()&&(e[t]=!0)):delete e[t],i&&(l=u.subRows)!=null&&l.length&&u.getCanSelectSubRows()&&u.subRows.forEach(d=>Vm(e,d.id,r,i,o))};function Wh(e,t){const r=e.getState().rowSelection,i=[],o={},l=function(u,d){return u.map(m=>{var p;const y=tg(m,r);if(y&&(i.push(m),o[m.id]=m),(p=m.subRows)!=null&&p.length&&(m={...m,subRows:l(m.subRows)}),y)return m}).filter(Boolean)};return{rows:l(t.rows),flatRows:i,rowsById:o}}function tg(e,t){var r;return(r=t[e.id])!=null?r:!1}function Um(e,t,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()&&(tg(u,t)?l=!0:o=!1),u.subRows&&u.subRows.length)){const d=Um(u,t);d==="all"?l=!0:(d==="some"&&(l=!0),o=!1)}}),o?"all":l?"some":!1}const Hm=/([0-9]+)/gm,b4=(e,t,r)=>q_(Ga(e.getValue(r)).toLowerCase(),Ga(t.getValue(r)).toLowerCase()),x4=(e,t,r)=>q_(Ga(e.getValue(r)),Ga(t.getValue(r))),w4=(e,t,r)=>ng(Ga(e.getValue(r)).toLowerCase(),Ga(t.getValue(r)).toLowerCase()),S4=(e,t,r)=>ng(Ga(e.getValue(r)),Ga(t.getValue(r))),_4=(e,t,r)=>{const i=e.getValue(r),o=t.getValue(r);return i>o?1:ing(e.getValue(r),t.getValue(r));function ng(e,t){return e===t?0:e>t?1:-1}function Ga(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function q_(e,t){const r=e.split(Hm).filter(Boolean),i=t.split(Hm).filter(Boolean);for(;r.length&&i.length;){const o=r.shift(),l=i.shift(),u=parseInt(o,10),d=parseInt(l,10),m=[u,d].sort();if(isNaN(m[0])){if(o>l)return 1;if(l>o)return-1;continue}if(isNaN(m[1]))return isNaN(u)?-1:1;if(u>d)return 1;if(d>u)return-1}return r.length-i.length}const Yo={alphanumeric:b4,alphanumericCaseSensitive:x4,text:w4,textCaseSensitive:S4,datetime:_4,basic:C4},E4={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Fn("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const r=t.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 Yo.datetime;if(typeof l=="string"&&(i=!0,l.split(Hm).length>1))return Yo.alphanumeric}return i?Yo.text:Yo.basic},e.getAutoSortDir=()=>{const r=t.getFilteredRowModel().flatRows[0];return typeof r?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var r,i;if(!e)throw new Error;return nd(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(r=(i=t.options.sortingFns)==null?void 0:i[e.columnDef.sortingFn])!=null?r:Yo[e.columnDef.sortingFn]},e.toggleSorting=(r,i)=>{const o=e.getNextSortingOrder(),l=typeof r<"u"&&r!==null;t.setSorting(u=>{const d=u?.find(x=>x.id===e.id),m=u?.findIndex(x=>x.id===e.id);let p=[],y,v=l?r:o==="desc";if(u!=null&&u.length&&e.getCanMultiSort()&&i?d?y="toggle":y="add":u!=null&&u.length&&m!==u.length-1?y="replace":d?y="toggle":y="replace",y==="toggle"&&(l||o||(y="remove")),y==="add"){var b;p=[...u,{id:e.id,desc:v}],p.splice(0,p.length-((b=t.options.maxMultiSortColCount)!=null?b:Number.MAX_SAFE_INTEGER))}else y==="toggle"?p=u.map(x=>x.id===e.id?{...x,desc:v}:x):y==="remove"?p=u.filter(x=>x.id!==e.id):p=[{id:e.id,desc:v}];return p})},e.getFirstSortDir=()=>{var r,i;return((r=(i=e.columnDef.sortDescFirst)!=null?i:t.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=t.options.enableSortingRemoval)==null||i)&&(!(r&&(o=t.options.enableMultiRemove)!=null)||o)?!1:u==="desc"?"asc":"desc":l},e.getCanSort=()=>{var r,i;return((r=e.columnDef.enableSorting)!=null?r:!0)&&((i=t.options.enableSorting)!=null?i:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,i;return(r=(i=e.columnDef.enableMultiSort)!=null?i:t.options.enableMultiSort)!=null?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const i=(r=t.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=t.getState().sorting)==null?void 0:i.findIndex(o=>o.id===e.id))!=null?r:-1},e.clearSorting=()=>{t.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()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(i):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var r,i;e.setSorting(t?[]:(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())}},R4=[G3,f4,o4,l4,K3,Y3,h4,m4,E4,i4,p4,g4,v4,y4,u4];function j4(e){var t,r;const i=[...R4,...(t=e._features)!=null?t:[]];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 m={...{},...(r=e.initialState)!=null?r:{}};o._features.forEach(b=>{var x;m=(x=b.getInitialState==null?void 0:b.getInitialState(m))!=null?x:m});const p=[];let y=!1;const v={_features:i,options:{...l,...e},initialState:m,_queue:b=>{p.push(b),y||(y=!0,Promise.resolve().then(()=>{for(;p.length;)p.shift()();y=!1}).catch(x=>setTimeout(()=>{throw x})))},reset:()=>{o.setState(o.initialState)},setOptions:b=>{const x=La(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:Le(()=>[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}},$e(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:Le(()=>[o._getColumnDefs()],b=>{const x=function(w,_,E){return E===void 0&&(E=0),w.map(R=>{const T=q3(o,R,E,_),O=R;return T.columns=O.columns?x(O.columns,T,E+1):[],T})};return x(b)},$e(e,"debugColumns")),getAllFlatColumns:Le(()=>[o.getAllColumns()],b=>b.flatMap(x=>x.getFlatColumns()),$e(e,"debugColumns")),_getAllFlatColumnsById:Le(()=>[o.getAllFlatColumns()],b=>b.reduce((x,w)=>(x[w.id]=w,x),{}),$e(e,"debugColumns")),getAllLeafColumns:Le(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(b,x)=>{let w=b.flatMap(_=>_.getLeafColumns());return x(w)},$e(e,"debugColumns")),getColumn:b=>o._getAllFlatColumnsById()[b]};Object.assign(o,v);for(let b=0;bLe(()=>[e.options.data],t=>{const r={rows:[],flatRows:[],rowsById:{}},i=function(o,l,u){l===void 0&&(l=0);const d=[];for(let p=0;pe._autoResetPageIndex()))}function Z_(){return e=>Le(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,r)=>{if(!r.rows.length||!(t!=null&&t.length))return r;const i=e.getState().sorting,o=[],l=i.filter(m=>{var p;return(p=e.getColumn(m.id))==null?void 0:p.getCanSort()}),u={};l.forEach(m=>{const p=e.getColumn(m.id);p&&(u[m.id]={sortUndefined:p.columnDef.sortUndefined,invertSorting:p.columnDef.invertSorting,sortingFn:p.getSortingFn()})});const d=m=>{const p=m.map(y=>({...y}));return p.sort((y,v)=>{for(let x=0;x{var v;o.push(y),(v=y.subRows)!=null&&v.length&&(y.subRows=d(y.subRows))}),p};return{rows:d(r.rows),flatRows:o,rowsById:r.rowsById}},$e(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Bm(e,t){return e?T4(e)?S.createElement(e,t):e:null}function T4(e){return O4(e)||typeof e=="function"||A4(e)}function O4(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function A4(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function K_(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=S.useState(()=>({current:j4(t)})),[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 jl=e=>e.type==="checkbox",$a=e=>e instanceof Date,sn=e=>e==null;const rg=e=>typeof e=="object";var Ot=e=>!sn(e)&&!Array.isArray(e)&&rg(e)&&!$a(e),M4=e=>Ot(e)&&e.target?jl(e.target)?e.target.checked:e.target.value:e,N4=(e,t)=>t.split(".").some((r,i,o)=>!isNaN(Number(r))&&e.has(o.slice(0,i).join("."))),Y_=e=>{const t=e.constructor&&e.constructor.prototype;return Ot(t)&&t.hasOwnProperty("isPrototypeOf")},rd=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Dt(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(rd&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Ot(e)&&Y_(e)))return e;const i=r?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=Dt(e[o]));return i}const As={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},mr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},fr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Q_="root",ag=["__proto__","constructor","prototype"],D4=/^\w*$/;var Tl=e=>D4.test(e),bt=e=>e===void 0;const k4=/[.[\]'"]/;var ad=e=>e.split(k4).filter(Boolean),_e=(e,t,r)=>{if(!t||!Ot(e))return r;const i=Tl(t)?[t]:ad(t);if(i.some(l=>ag.includes(l)))return r;const o=i.reduce((l,u)=>sn(l)?void 0:l[u],e);return bt(o)||o===e?bt(e[t])?r:e[t]:o},Rr=e=>typeof e=="boolean",Jn=e=>typeof e=="function",mt=(e,t,r)=>{let i=-1;const o=Tl(t)?[t]:ad(t),l=o.length,u=l-1;for(;++i{const o={};for(const l in e)Object.defineProperty(o,l,{get:()=>{const u=l;return t._proxyFormState[u]!==mr.all&&(t._proxyFormState[u]=!i||mr.all),e[u]}});return o};const $4=rd?ve.useLayoutEffect:ve.useEffect;var ln=e=>typeof e=="string",I4=(e,t,r,i,o)=>ln(e)?(i&&t.watch.add(e),_e(r,e,o)):Array.isArray(e)?e.map(l=>(i&&t.watch.add(l),_e(r,l))):(i&&(t.watchAll=!0),r),qm=e=>sn(e)||!rg(e);const Sx=(e,t)=>t.length===0&&!Array.isArray(e)&&!Y_(e);function jr(e,t,r=new WeakMap){if(e===t)return!0;if(qm(e)||qm(t))return Object.is(e,t);if($a(e)&&$a(t))return Object.is(e.getTime(),t.getTime());const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;if(Sx(e,i)||Sx(t,o))return Object.is(e,t);if(!i.length&&Array.isArray(e)!==Array.isArray(t))return!1;const l=r.get(e);if(l&&l.has(t))return!0;if(l)l.add(t);else{const u=new WeakSet;u.add(t),r.set(e,u)}for(const u of i){const d=e[u];if(!(u in t))return!1;if(u!=="ref"){const m=t[u];if($a(d)&&$a(m)||(Ot(d)||Array.isArray(d))&&(Ot(m)||Array.isArray(m))?!jr(d,m,r):!Object.is(d,m))return!1}}return!0}var nu=e=>({isOnSubmit:!e||e===mr.onSubmit,isOnBlur:e===mr.onBlur,isOnChange:e===mr.onChange,isOnAll:e===mr.all,isOnTouch:e===mr.onTouched}),em=(e,t,r)=>{if(r)return!1;if(t.watchAll||t.watch.has(e))return!0;for(const i of t.watch)if(e.startsWith(i)&&e.charAt(i.length)===".")return!0;return!1};const sl=(e,t,r,i)=>{for(const o of r||Object.keys(e)){const l=_e(e,o);if(l){const{_f:u,...d}=l;if(u){if(u.refs&&u.refs[0]&&t(u.refs[0],o)&&!i)return!0;if(u.ref&&t(u.ref,u.name)&&!i)return!0;if(sl(d,t))break}else if(Ot(d)&&sl(d,t))break}}};var _x=(e,t,r)=>{const i=_e(e,r),o=Array.isArray(i)?i:[];return mt(o,Q_,t[r]),mt(e,r,o),e},an=e=>Ot(e)&&!Object.keys(e).length,ig=e=>e.type==="file",Cu=e=>{if(!rd)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},sg=e=>e.type==="radio",Eu=e=>e instanceof RegExp,og=(e,t,r,i,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[i]:o||!0}}:{};const Cx={value:!1,isValid:!1},Ex={value:!0,isValid:!0};var X_=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!bt(e[0].attributes.value)?bt(e[0].value)||e[0].value===""?Ex:{value:e[0].value,isValid:!0}:Ex:Cx}return Cx};const Rx={isValid:!1,value:null};var J_=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Rx):Rx;function jx(e,t,r="validate"){if(ln(e)||Array.isArray(e)&&e.every(ln)||Rr(e)&&!e)return{type:r,message:ln(e)?e:"",ref:t}}var Ms=e=>Ot(e)&&!Eu(e)?e:{value:e,message:""},Tx=async(e,t,r,i,o,l)=>{const{ref:u,refs:d,required:m,maxLength:p,minLength:y,min:v,max:b,pattern:x,validate:w,name:_,valueAsNumber:E,mount:R}=e._f,T=_e(r,_);if(!R||t.has(_))return{};const O=d?d[0]:u,M=me=>{if(o&&O.reportValidity){const fe=Rr(me)?"":me||"";d?d.forEach(Z=>Z.setCustomValidity(fe)):O.setCustomValidity(fe),O.reportValidity()}},k={},B=sg(u),V=jl(u),P=B||V,pe=(E||ig(u))&&bt(u.value)&&bt(T)||Cu(u)&&u.value===""||T===""||Array.isArray(T)&&!T.length,ne=og.bind(null,_,i,k),ce=(me,fe,Z,Se=fr.maxLength,L=fr.minLength)=>{const K=me?fe:Z;k[_]={type:me?Se:L,message:K,ref:u,...ne(me?Se:L,K)}};if(l?!Array.isArray(T)||!T.length:m&&(!P&&(pe||sn(T))||Rr(T)&&!T||V&&!X_(d).isValid||B&&!J_(d).isValid)){const{value:me,message:fe}=ln(m)?{value:!!m,message:m}:Ms(m);if(me&&(k[_]={type:fr.required,message:fe,ref:O,...ne(fr.required,fe)},!i))return M(fe),k}if(!pe&&(!sn(v)||!sn(b))){let me,fe;const Z=Ms(b),Se=Ms(v);if(!sn(T)&&!isNaN(T)){const L=u.valueAsNumber||T&&+T;sn(Z.value)||(me=L>Z.value),sn(Se.value)||(fe=Lnew Date(new Date().toDateString()+" "+te),ie=u.type=="time",J=u.type=="week";ln(Z.value)&&T&&(me=ie?K(T)>K(Z.value):J?T>Z.value:L>new Date(Z.value)),ln(Se.value)&&T&&(fe=ie?K(T)+me.value,Se=!sn(fe.value)&&T.length<+fe.value;if((Z||Se)&&(ce(Z,me.message,fe.message),!i))return M(k[_].message),k}if(x&&!pe&&ln(T)){const{value:me,message:fe}=Ms(x);if(Eu(me)&&!T.match(me)&&(k[_]={type:fr.pattern,message:fe,ref:u,...ne(fr.pattern,fe)},!i))return M(fe),k}if(w){if(Jn(w)){const me=await w(T,r),fe=jx(me,O);if(fe&&(k[_]={...fe,...ne(fr.validate,fe.message)},!i))return M(fe.message),k}else if(Ot(w)){let me={};for(const fe in w){if(!an(me)&&!i)break;const Z=jx(await w[fe](T,r),O,fe);Z&&(me={...Z,...ne(fe,Z.message)},M(Z.message),i&&(k[_]=me))}if(!an(me)&&(k[_]={ref:O,...me},!i))return k}}return M(!0),k},du=e=>Array.isArray(e)?e:[e],W_=e=>Array.isArray(e)?e.filter(Boolean):[];function P4(e,t){const r=t.slice(0,-1).length;let i=0;for(;iag.includes(String(u))))return e;const i=r.length===1?e:P4(e,r),o=r.length-1,l=r[o];return i&&delete i[l],o!==0&&(Ot(i)&&an(i)||Array.isArray(i)&&F4(i))&&kt(e,r.slice(0,-1)),e}const eC=e=>{const t={};for(const r of Object.keys(e))if(rg(e[r])&&e[r]!==null&&!$a(e[r])){const i=eC(e[r]);for(const o of Object.keys(i))t[`${r}.${o}`]=i[o]}else t[r]=e[r];return t},V4=ve.createContext(null);V4.displayName="HookFormContext";var Ox=()=>{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 tC(e,t){const r={};for(const i in e)if(e.hasOwnProperty(i)){const o=e[i],l=t[i];if(o&&Ot(o)&&l){const u=tC(o,l);Ot(u)&&(r[i]=u)}else e[i]&&(r[i]=l)}return r}var nC=e=>e.type==="select-multiple",U4=e=>sg(e)||jl(e),tm=e=>Cu(e)&&e.isConnected,H4=e=>{for(const t in e)if(Jn(e[t]))return!0;return!1};function rC(e){return Array.isArray(e)||Ot(e)&&!H4(e)}function aC(e){return!!(e&&"_f"in e)}function iC(e){return Array.isArray(e)?!e.some(t=>!bt(t)):!Object.keys(e).length}function Gm(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function Zm(e,t={},r){for(const i in e){const o=e[i],l=r&&r[i];rC(o)&&(!Array.isArray(o)||!aC(l))?(t[i]=Array.isArray(o)?[]:{},Zm(o,t[i],l),iC(t[i])&&Gm(t,i)):bt(o)||(t[i]=!0)}return t}function wi(e,t,r,i){r||(r=Zm(t,{},i));for(const o in e){const l=e[o],u=i&&i[o];rC(l)&&(!Array.isArray(l)||!aC(u))?(bt(t)||qm(r[o])?r[o]=Zm(l,Array.isArray(l)?[]:{},u):wi(l,sn(t)?{}:t[o],r[o],u),iC(r[o])&&Gm(r,o)):jr(l,t[o])?Gm(r,o):r[o]=!0}return r}var sC=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:i})=>bt(e)?e:t?e===""?NaN:e&&+e:r&&ln(e)?new Date(e):i?i(e):e;function Ax(e){const t=e.ref;return ig(t)?t.files:sg(t)?J_(e.refs).value:nC(t)?[...t.selectedOptions].map(({value:r})=>r):jl(t)?X_(e.refs).value:sC(bt(t.value)?e.ref.value:t.value,e)}var B4=(e,t,r,i)=>{const o={};for(const l of e){const u=_e(t,l);u&&mt(o,l,u._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:i}},Qo=e=>bt(e)?e:Eu(e)?e.source:Ot(e)?Eu(e.value)?e.value.source:e.value:e;const Mx="AsyncFunction";var q4=e=>{if(!e||!e.validate)return!1;if(Jn(e.validate))return e.validate.constructor.name===Mx;if(Ot(e.validate)){for(const t in e.validate)if(e.validate[t].constructor.name===Mx)return!0}return!1},G4=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Nx(e,t,r){const i=_e(e,r);if(i||Tl(r))return{error:i,name:r};const o=r.split(".");for(;o.length;){const l=o.join("."),u=_e(t,l),d=_e(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 Z4=(e,t,r,i)=>{r(e);const{name:o,...l}=e,u=Object.keys(l);return!u.length||i&&u.length>=Object.keys(t).length||u.find(d=>t[d]===(!i||mr.all))},K4=(e,t,r)=>!e||!t||e===t||du(e).some(i=>i&&(r?i===t||i.startsWith(t+"."):i.startsWith(t)||t.startsWith(i))),Y4=(e,t,r,i,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?i.isOnBlur:o.isOnBlur)?!e:(r?i.isOnChange:o.isOnChange)?e:!0,Q4=(e,t)=>!W_(_e(e,t)).length&&kt(e,t);const X4={mode:mr.onSubmit,reValidateMode:mr.onChange,shouldFocusError:!0},nm="form",oC={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function J4(e={}){let t={...X4,...e},r={...Dt(oC),isLoading:Jn(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},i={},o=Ot(t.defaultValues)||Ot(t.values)?Dt(t.defaultValues||t.values)||{}:{},l=t.shouldUnregister?{}:Dt(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 m={},p={};let y=0,v=nu(t.mode),b=nu(t.reValidateMode);const x={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},w={...x};let _={...w};const E={array:Ox(),state:Ox()};let R=0;const T=t.criteriaMode===mr.all,O=(A,I)=>F=>{clearTimeout(p[A]),p[A]=setTimeout(I,F)},M=async A=>{if(!u.keepIsValid&&!t.disabled&&(w.isValid||_.isValid||A)){const I=++R;let F;t.resolver?(F=an((await Z()).errors),I===R&&k()):F=await K({fields:i,onlyCheckValid:!0,eventType:As.VALID}),I===R&&F!==r.isValid&&E.state.next({isValid:F})}},k=(A,I)=>{!t.disabled&&(w.isValidating||w.validatingFields||_.isValidating||_.validatingFields)&&((A||Array.from(d.mount)).forEach(F=>{F&&(I?mt(r.validatingFields,F,I):kt(r.validatingFields,F))}),E.state.next({validatingFields:r.validatingFields,isValidating:!an(r.validatingFields)}))},B=()=>{r.dirtyFields=wi(o,l,void 0,i)},V=(A,I=[],F,de,oe=!0,ye=!0)=>{if(de&&F&&!t.disabled){if(u.action=!0,ye&&Array.isArray(_e(i,A))){const we=F(_e(i,A),de.argA,de.argB);oe&&mt(i,A,we)}if(ye&&Array.isArray(_e(r.errors,A))){const we=F(_e(r.errors,A),de.argA,de.argB);oe&&mt(r.errors,A,we),Q4(r.errors,A)}if((w.touchedFields||_.touchedFields)&&ye&&Array.isArray(_e(r.touchedFields,A))){const we=F(_e(r.touchedFields,A),de.argA,de.argB);oe&&mt(r.touchedFields,A,we)}(w.dirtyFields||_.dirtyFields)&&B(),E.state.next({name:A,isDirty:J(A,I),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else mt(l,A,I)},P=(A,I)=>{mt(r.errors,A,I),r.errors={...r.errors},E.state.next({errors:r.errors})},pe=A=>{r.errors=A,E.state.next({errors:r.errors,isValid:!1})},ne=A=>{const I=Tl(A)?[A]:ad(A);let F=l,de=o;for(let oe=0;oe{const oe=_e(i,A);if(oe){if(ne(A))return;const ye=bt(_e(l,A)),we=_e(l,A,bt(F)?_e(o,A):F);bt(we)||de&&de.defaultChecked||I?mt(l,A,I?we:Ax(oe._f)):N(A,we),u.mount&&!u.action&&(M(),ye&&r.isDirty&&(w.isDirty||_.isDirty)&&(J()||(r.isDirty=!1,E.state.next({...r}))),e.shouldUnregister&&ye&&!bt(_e(l,A))&&em(A,d)&&(u.watch=!0))}},me=(A,I,F,de,oe)=>{let ye=!1,we=!1;const ee={name:A};if(!t.disabled||de===!0){if(!F||de){const le=jr(_e(o,A),I);(w.isDirty||_.isDirty)&&(we=r.isDirty,r.isDirty=ee.isDirty=!le||J(),ye=we!==ee.isDirty),we=!!_e(r.dirtyFields,A),le!==r.isDirty?r.dirtyFields=wi(o,l,void 0,i):le?kt(r.dirtyFields,A):mt(r.dirtyFields,A,!0),ee.dirtyFields=r.dirtyFields,ye=ye||(w.dirtyFields||_.dirtyFields)&&we!==!le}if(F){const le=_e(r.touchedFields,A);le||(mt(r.touchedFields,A,F),ee.touchedFields=r.touchedFields,ye=ye||(w.touchedFields||_.touchedFields)&&le!==F)}ye&&oe&&E.state.next(ee)}return ye?ee:{}},fe=(A,I,F,de)=>{const oe=_e(r.errors,A),ye=(w.isValid||_.isValid)&&Rr(I)&&r.isValid!==I;if(t.delayError&&F?(m[A]=O(A,()=>P(A,F)),m[A](t.delayError)):(clearTimeout(p[A]),delete m[A],F?mt(r.errors,A,F):kt(r.errors,A),r.errors={...r.errors}),(F?!jr(oe,F):oe)||!an(de)||ye){const we={...de,...ye&&Rr(I)?{isValid:I}:{},errors:r.errors,name:A};r={...r,...we},E.state.next(we)}},Z=async A=>(k(A,!0),await t.resolver(l,t.context,B4(A||d.mount,i,t.criteriaMode,t.shouldUseNativeValidation))),Se=async A=>{const{errors:I}=await Z(A);if(k(A),A){for(const F of A){const de=_e(I,F);de?d.array.has(F)&&Ot(de)&&!Object.keys(de).some(oe=>!Number.isNaN(Number(oe)))?_x(r.errors,{[F]:de},F):mt(r.errors,F,de):kt(r.errors,F)}r.errors={...r.errors}}else r.errors=I;return I},L=async({name:A,eventType:I})=>{if(e.validate){const F=await e.validate({formValues:l,formState:r,name:A,eventType:I});if(Ot(F))for(const de in F){const oe=F[de];oe&&ct(`${nm}.${de}`,{message:ln(oe.message)?oe.message:"",type:oe.type||fr.validate})}else ln(F)||!F?ct(nm,{message:F||"",type:fr.validate}):He(nm);return F}return!0},K=async({fields:A,onlyCheckValid:I,name:F,eventType:de,context:oe={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(oe.runRootValidation=!0,!await L({name:F,eventType:de})&&(oe.valid=!1,I)))return oe.valid;for(const ye in A){const we=A[ye];if(we){const{_f:ee,...le}=we;if(ee){const Re=d.array.has(ee.name),ze=we._f&&q4(we._f),it=w.validatingFields||w.isValidating||_.validatingFields||_.isValidating;ze&&it&&k([ee.name],!0);const _t=await Tx(we,d.disabled,l,T,t.shouldUseNativeValidation&&!I,Re);if(ze&&it&&k([ee.name]),_t[ee.name]&&(oe.valid=!1,I)||(!I&&(_e(_t,ee.name)?Re?_x(r.errors,_t,ee.name):mt(r.errors,ee.name,_t[ee.name]):kt(r.errors,ee.name)),e.shouldUseNativeValidation&&_t[ee.name]))break}!an(le)&&await K({context:oe,onlyCheckValid:I,fields:le,name:ye,eventType:de})}}return oe.valid},ie=()=>{for(const A of d.unMount){const I=_e(i,A);I&&(I._f.refs?I._f.refs.every(F=>!tm(F)):!tm(I._f.ref))&&Xt(A)}d.unMount=new Set},J=(A,I)=>(A&&I&&mt(l,A,I),!jr(u.mount?l:o,o)),te=(A,I,F)=>I4(A,d,{...u.mount?l:bt(I)?o:ln(A)?{[A]:I}:I},F,I),D=A=>W_(_e(u.mount?l:o,A,t.shouldUnregister?_e(o,A,[]):[])),N=(A,I,F={},de=!1,oe=!1)=>{const ye=_e(i,A);let we=I;if(ye){const ee=ye._f;ee&&(!ee.disabled&&mt(l,A,sC(I,ee)),we=Cu(ee.ref)&&sn(I)?"":I,nC(ee.ref)?[...ee.ref.options].forEach(le=>le.selected=we.includes(le.value)):ee.refs?jl(ee.ref)?ee.refs.forEach(le=>{(!le.defaultChecked||!le.disabled)&&(Array.isArray(we)?le.checked=!!we.find(Re=>Re===le.value):le.checked=we===le.value||!!we)}):ee.refs.forEach(le=>le.checked=le.value===we):ig(ee.ref)?ee.ref.value="":(ee.ref.value=we,!ee.ref.type&&!oe&&E.state.next({name:A,values:de?l:Dt(l)})))}(F.shouldDirty||F.shouldTouch)&&me(A,we,F.shouldTouch,F.shouldDirty,!oe),F.shouldValidate&&xe(A,{delayError:F.delayError})},H=(A,I,F,de=!1,oe=!1)=>{for(const ye in I){if(!I.hasOwnProperty(ye))return;const we=I[ye],ee=A+"."+ye,le=_e(i,ee);(d.array.has(A)||Ot(we)||le&&!le._f)&&!$a(we)?H(ee,we,F,de,oe):N(ee,we,F,de,oe)}},X=(A,I,F,de,oe=!1)=>{const ye=_e(i,A),we=d.array.has(A),ee=de?I:Dt(I),le=_e(l,A),Re=jr(le,ee);if(Re||mt(l,A,ee),we)E.array.next({name:A,values:de?l:Dt(l)}),(w.isDirty||w.dirtyFields||_.isDirty||_.dirtyFields)&&F.shouldDirty&&(B(),oe||E.state.next({name:A,dirtyFields:r.dirtyFields,isDirty:J(A,ee)}));else{const ze=Array.isArray(ee)&&!ee.length||an(ee);!ye||ye._f||sn(ee)||ze?N(A,ee,F,de,oe):H(A,ee,F,de,oe)}if(!Re&&!oe){const ze=em(A,d),it=de?l:Dt(l);E.state.next({...ze&&r,name:u.mount||ze?A:void 0,values:it})}},Y=(A,I,F={})=>X(A,I,F,!1),he=(A,I={})=>{const F=Jn(A)?A(l):A;if(!jr(l,F)){l={...l,...F};const de=eC(F);for(const oe of d.mount)oe in de&&X(oe,de[oe],I,!0,!0);E.state.next({...r,name:void 0,type:void 0,...y?{values:l}:{}}),I.shouldValidate&&M()}},re=async A=>{u.mount=!0;const I=A.target;let F=I.name,de=!0;const oe=_e(i,F),ye=we=>{de=Number.isNaN(we)||$a(we)&&isNaN(we.getTime())||jr(we,_e(l,F,we))};if(oe){let we,ee;const le=I.type?Ax(oe._f):M4(A),Re=A.type===As.BLUR||A.type===As.FOCUS_OUT,ze=!G4(oe._f)&&!e.validate&&!t.resolver&&!_e(r.errors,F)&&!oe._f.deps,it=ze||Y4(Re,_e(r.touchedFields,F),r.isSubmitted,b,v),_t=em(F,d,Re);if(mt(l,F,le),Re){if(!I||!I.readOnly){oe._f.onBlur&&oe._f.onBlur(A);const st=m[F];st&&st(0)}}else oe._f.onChange&&oe._f.onChange(A);const Ae=me(F,le,Re),ut=!an(Ae)||_t;if(!Re&&E.state.next({name:F,type:A.type,...y?{values:Dt(l)}:{}}),it)return(!ze||!r.isValid)&&(w.isValid||_.isValid)&&(t.mode==="onBlur"?Re&&M():Re||M()),ut&&E.state.next({name:F,..._t?{}:Ae});if(!t.resolver&&e.validate&&await L({name:F,eventType:A.type}),!Re&&_t&&E.state.next({...r}),t.resolver){const{errors:st}=await Z([F]);if(k([F]),ye(le),!de){!an(Ae)&&E.state.next(Ae);return}const Gt=Nx(r.errors,i,F),sr=Nx(st,i,Gt.name||F);we=sr.error,F=sr.name,ee=an(st)}else k([F],!0),we=(await Tx(oe,d.disabled,l,T,t.shouldUseNativeValidation))[F],k([F]),ye(le),de&&(we?ee=!1:(w.isValid||_.isValid)&&(ee=await K({fields:i,onlyCheckValid:!0,name:F,eventType:A.type})));de&&(oe._f.deps&&(!Array.isArray(oe._f.deps)||oe._f.deps.length>0)&&xe(oe._f.deps),fe(F,ee,we,Ae))}},be=(A,I)=>{if(_e(r.errors,I)&&A.focus)return A.focus(),1},xe=async(A,I={})=>{let F,de;const oe=du(A);if(t.resolver){const ye=await Se(bt(A)?A:oe);F=an(ye),de=A?!oe.some(we=>_e(ye,we)):F}else A?(de=(await Promise.all(oe.map(async ye=>{const we=_e(i,ye);return await K({fields:we&&we._f?{[ye]:we}:we,eventType:As.TRIGGER})}))).every(Boolean),!(!de&&!r.isValid)&&M()):de=F=await K({fields:i,name:A,eventType:As.TRIGGER});if(I.delayError&&t.delayError&&ln(A)){const ye=_e(r.errors,A);ye?(kt(r.errors,A),m[A]=O(A,()=>P(A,ye)),m[A](t.delayError)):(clearTimeout(p[A]),delete m[A])}return E.state.next({...!ln(A)||(w.isValid||_.isValid)&&F!==r.isValid?{}:{name:A},...t.resolver||!A?{isValid:F}:{},errors:r.errors}),I.shouldFocus&&!de&&sl(i,be,A?oe:d.mount),de},Me=(A,I)=>{let F={...u.mount?l:o};return I&&(F=tC(I.dirtyFields?r.dirtyFields:r.touchedFields,F)),bt(A)?F:ln(A)?_e(F,A):A.map(de=>_e(F,de))},Fe=(A,I)=>({invalid:!!_e((I||r).errors,A),isDirty:!!_e((I||r).dirtyFields,A),error:_e((I||r).errors,A),isValidating:!!_e(r.validatingFields,A),isTouched:!!_e((I||r).touchedFields,A)}),He=A=>{const I=A?du(A):void 0;I?.forEach(F=>kt(r.errors,F)),I?I.forEach(F=>{E.state.next({name:F,errors:r.errors})}):E.state.next({errors:{}})},ct=(A,I,F)=>{const de=(_e(i,A,{_f:{}})._f||{}).ref,oe=_e(r.errors,A)||{},{ref:ye,message:we,type:ee,...le}=oe;mt(r.errors,A,{...le,...I,ref:de}),E.state.next({name:A,errors:r.errors,isValid:!1}),F&&F.shouldFocus&&de&&de.focus&&de.focus()},Je=(A,I)=>{if(Jn(A)){y++;const{unsubscribe:F}=E.state.subscribe({next:oe=>"values"in oe&&A(oe.values||te(void 0,I),oe)});let de=!1;return{unsubscribe:()=>{de||(de=!0,y--,F())}}}return te(A,I,!0)},hn=A=>{var I;const F=!!(!((I=A.formState)===null||I===void 0)&&I.values);F&&y++;const{unsubscribe:de}=E.state.subscribe({next:ye=>{if(K4(A.name,ye.name,A.exact)&&Z4(ye,A.formState||w,oa,A.reRenderRoot)){const we={...l};A.callback({values:we,...r,...ye,defaultValues:o})}}});if(!F)return de;let oe=!1;return()=>{oe||(oe=!0,y--,de())}},mn=A=>(u.mount=!0,_={..._,...A.formState},hn({...A,formState:{...x,...A.formState}})),Xt=(A,I={})=>{for(const F of A?du(A):d.mount)d.mount.delete(F),d.array.delete(F),I.keepValue||(kt(i,F),kt(l,F)),!I.keepError&&kt(r.errors,F),!I.keepDirty&&kt(r.dirtyFields,F),!I.keepTouched&&kt(r.touchedFields,F),!I.keepIsValidating&&kt(r.validatingFields,F),!t.shouldUnregister&&!I.keepDefaultValue&&kt(o,F);E.state.next({values:Dt(l)}),E.state.next({...r,...I.keepDirty?{isDirty:J()}:{}}),!I.keepIsValid&&M()},yr=({disabled:A,name:I})=>{if(Rr(A)&&u.mount||A||d.disabled.has(I)){const oe=d.disabled.has(I)!==!!A;A?d.disabled.add(I):d.disabled.delete(I),oe&&u.mount&&!u.action&&M()}},At=(A,I={})=>{let F=_e(i,A);const de=Rr(I.disabled)||Rr(t.disabled),oe=!d.registerName.has(A)&&F&&F._f&&!F._f.mount;return mt(i,A,{...F||{},_f:{...F&&F._f?F._f:{ref:{name:A}},name:A,mount:!0,...I}}),d.mount.add(A),F&&!oe?yr({disabled:Rr(I.disabled)?I.disabled:t.disabled,name:A}):ce(A,!0,I.value),{...de?{disabled:I.disabled||t.disabled}:{},...t.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:re,onBlur:re,ref:ye=>{if(ye){d.registerName.add(A),At(A,I),d.registerName.delete(A),F=_e(i,A);const we=bt(ye.value)&&ye.querySelectorAll&&ye.querySelectorAll("input,select,textarea")[0]||ye,ee=U4(we),le=F._f.refs||[];if(ee?le.find(Re=>Re===we):we===F._f.ref)return;mt(i,A,{_f:{...F._f,...ee?{refs:[...le.filter(tm),we,...Array.isArray(_e(o,A))?[{}]:[]],ref:{type:we.type,name:A}}:{ref:we}}}),ce(A,!1,void 0,we)}else F=_e(i,A,{}),F._f&&(F._f.mount=!1),(t.shouldUnregister||I.shouldUnregister)&&!(N4(d.array,A)&&u.action)&&d.unMount.add(A)}}},rr=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&sl(i,be,d.mount),br=A=>{Rr(A)&&(E.state.next({disabled:A}),sl(i,(I,F)=>{const de=_e(i,F);de&&(I.disabled=de._f.disabled||A,Array.isArray(de._f.refs)&&de._f.refs.forEach(oe=>{oe.disabled=de._f.disabled||A}))},0,!1))},Rt=(A,I)=>async F=>{let de;F&&(F.preventDefault&&F.preventDefault(),F.persist&&F.persist());let oe=Dt(l);if(E.state.next({isSubmitting:!0}),t.resolver){const{errors:ye,values:we}=await Z();k(),r.errors=ye,oe=Dt(we)}else await K({fields:i,eventType:As.SUBMIT});if(d.disabled.size)for(const ye of d.disabled)kt(oe,ye);if(kt(r.errors,Q_),an(r.errors)){E.state.next({errors:{}});try{await A(oe,F)}catch(ye){de=ye}}else I&&await I({...r.errors},F),rr(),setTimeout(rr);if(E.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:an(r.errors)&&!de,submitCount:r.submitCount+1,errors:r.errors}),de)throw de},Vn=(A,I={})=>{_e(i,A)&&(bt(I.defaultValue)?Y(A,Dt(_e(o,A))):(Y(A,I.defaultValue),mt(o,A,Dt(I.defaultValue))),I.keepTouched||kt(r.touchedFields,A),I.keepDirty||(kt(r.dirtyFields,A),r.isDirty=I.defaultValue?J(A,Dt(_e(o,A))):J()),I.keepError||(kt(r.errors,A),w.isValid&&M()),E.state.next({...r}))},zt=(A,I={})=>{const F=A?Dt(A):o,de=Dt(F),oe=an(A),ye=de,we=i;if(I.keepDefaultValues||(o=F),!I.keepValues){if(I.keepDirtyValues){const ee=new Set([...d.mount,...Object.keys(wi(o,l,void 0,we))]);for(const le of Array.from(ee)){const Re=_e(r.dirtyFields,le),ze=_e(l,le),it=_e(ye,le);Re&&!bt(ze)?mt(ye,le,ze):!Re&&!bt(it)&&Y(le,it)}}else{if(rd&&bt(A))for(const ee of d.mount){const le=_e(i,ee);if(le&&le._f){const Re=Array.isArray(le._f.refs)?le._f.refs[0]:le._f.ref;if(Cu(Re)){const ze=Re.closest("form");if(ze){ze.reset();break}}}}if(I.keepFieldsRef)for(const ee of d.mount)Y(ee,_e(ye,ee));else i={}}if(t.shouldUnregister){if(l=I.keepDefaultValues?Dt(o):{},I.keepFieldsRef)for(const ee of d.mount)mt(l,ee,_e(ye,ee))}else l=Dt(ye);E.array.next({values:{...ye}}),E.state.next({name:void 0,type:void 0,values:{...ye}})}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||!t.shouldUnregister&&!an(ye),u.watch=!!t.shouldUnregister,u.keepIsValid=!!I.keepIsValid,u.action=!1,I.keepErrors||(r.errors={}),E.state.next({submitCount:I.keepSubmitCount?r.submitCount:0,isDirty:oe?!1:I.keepDirty?r.isDirty:I.keepValues?J():!!(I.keepDefaultValues&&!jr(A,o)),isSubmitted:I.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:oe?{}:I.keepDirtyValues?I.keepDefaultValues&&l?wi(o,l,void 0,we):r.dirtyFields:I.keepDefaultValues&&A?wi(o,A,void 0,we):I.keepDirty?r.dirtyFields:{},touchedFields:I.keepTouched?r.touchedFields:{},errors:I.keepErrors?r.errors:{},isSubmitSuccessful:I.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Dr=(A,I)=>zt(Jn(A)?A(l):A,{...t.resetOptions,...I}),ar=(A,I={})=>{const F=_e(i,A),de=F&&F._f;if(de){const oe=de.refs?de.refs[0]:de.ref;oe.focus&&setTimeout(()=>{oe.focus(),I.shouldSelect&&Jn(oe.select)&&oe.select()})}},oa=A=>{const{name:I,type:F,values:de,...oe}=A;r={...r,...oe}},Jt={control:{register:At,unregister:Xt,getFieldState:Fe,handleSubmit:Rt,setError:ct,_subscribe:hn,_runSchema:Z,_updateIsValidating:k,_focusError:rr,_getWatch:te,_getDirty:J,_setValid:M,_setFieldArray:V,_setDisabledField:yr,_setErrors:pe,_getFieldArray:D,_reset:zt,_resetDefaultValues:()=>Jn(t.defaultValues)&&t.defaultValues().then(A=>{Dr(A,t.resetOptions),E.state.next({isLoading:!1})}),_removeUnmounted:ie,_disableForm:br,_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 t},set _options(A){t={...t,...A},v=nu(t.mode),b=nu(t.reValidateMode)}},subscribe:mn,trigger:xe,register:At,handleSubmit:Rt,watch:Je,setValue:Y,setValues:he,getValues:Me,reset:Dr,resetField:Vn,resetDefaultValues:(A,I={})=>{if(o=Dt(A),!I.keepDirty){const F=wi(o,l,void 0,i);r.dirtyFields=F,r.isDirty=!an(F)}I.keepIsValid||M(),E.state.next({...r,defaultValues:o})},clearErrors:He,unregister:Xt,setError:ct,setFocus:ar,getFieldState:Fe};return{...Jt,formControl:Jt}}function lg(e={}){const t=ve.useRef(void 0),r=ve.useRef(void 0),i=ve.useRef(e.formControl),[o,l]=ve.useState(()=>({...Dt(oC),isLoading:Jn(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Jn(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&i.current!==e.formControl)if(i.current=e.formControl,e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!Jn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:d,...m}=J4(e);t.current={...m,formState:o}}const u=t.current.control;return u._options=e,$4(()=>{const d=u._subscribe({formState:u._proxyFormState,callback:()=>l({...u._formState,defaultValues:u._defaultValues}),reRenderRoot:!0});return l(m=>({...m,isReady:!0})),u._formState.isReady=!0,d},[u]),ve.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),ve.useEffect(()=>{e.mode&&(u._options.mode=e.mode),e.reValidateMode&&(u._options.reValidateMode=e.reValidateMode)},[u,e.mode,e.reValidateMode]),ve.useEffect(()=>{e.errors&&(u._setErrors(e.errors),u._focusError())},[u,e.errors]),ve.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,e.shouldUnregister]),ve.useEffect(()=>{if(u._proxyFormState.isDirty){const d=u._getDirty();d!==o.isDirty&&u._subjects.state.next({isDirty:d})}},[u,o.isDirty]),ve.useEffect(()=>{var d;e.values&&!jr(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(m=>({...m}))):u._resetDefaultValues()},[u,e.values]),ve.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()}),t.current.formState=ve.useMemo(()=>L4(o,u),[u,o]),t.current}const Dx=(e,t,r)=>{if(e&&"reportValidity"in e){const i=_e(r,t);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},Km=(e,t)=>{for(const r in t.fields){const i=t.fields[r];i&&i.ref&&"reportValidity"in i.ref?Dx(i.ref,r,e):i&&i.refs&&i.refs.forEach(o=>Dx(o,r,e))}},kx=(e,t)=>{t.shouldUseNativeValidation&&Km(e,t);const r={};for(const i in e){const o=_e(t.fields,i),l=Object.assign(e[i]||{},{ref:o&&o.ref});if(W4(t.names||Object.keys(e),i)){const u=Object.assign({},_e(r,i));mt(u,"root",l),mt(r,i,u)}else mt(r,i,l)}return r},W4=(e,t)=>{const r=zx(t).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(i=>zx(i).match(`^${r}\\.\\d+`))};function zx(e){return e.replace(/[\[\]]/g,"")}var Lx;function ge(e,t,r){function i(d,m){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:m,constr:u,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,m);const p=u.prototype,y=Object.keys(p);for(let v=0;vr?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class Bs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class lC extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Lx=globalThis).__zod_globalConfig??(Lx.__zod_globalConfig={});const cg=globalThis.__zod_globalConfig;function Ai(e){return cg}function cC(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>t.indexOf(+i)===-1).map(([i,o])=>o)}function Ym(e,t){return typeof t=="bigint"?t.toString():t}function ug(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function dg(e){return e==null}function fg(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const $x=Symbol("evaluating");function pt(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==$x)return i===void 0&&(i=$x,i=r()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Fi(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Wa(...e){const t={};for(const r of e){const i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}function Ix(e){return JSON.stringify(e)}function e5(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const uC="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ru(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const t5=ug(()=>{if(cg.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function pl(e){if(Ru(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(Ru(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function dC(e){return pl(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const n5=new Set(["string","number","symbol"]);function id(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ei(e,t,r){const i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}function Ie(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function r5(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function a5(e,t){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=Wa(e._zod.def,{get shape(){const u={};for(const d in t){if(!(d in r.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(u[d]=r.shape[d])}return Fi(this,"shape",u),u},checks:[]});return ei(e,l)}function i5(e,t){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=Wa(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const d in t){if(!(d in r.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete u[d]}return Fi(this,"shape",u),u},checks:[]});return ei(e,l)}function s5(e,t){if(!pl(t))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 t)if(Object.getOwnPropertyDescriptor(l,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Wa(e._zod.def,{get shape(){const l={...e._zod.def.shape,...t};return Fi(this,"shape",l),l}});return ei(e,o)}function o5(e,t){if(!pl(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Wa(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Fi(this,"shape",i),i}});return ei(e,r)}function l5(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=Wa(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Fi(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ei(e,r)}function c5(e,t,r){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Wa(t._zod.def,{get shape(){const d=t._zod.def.shape,m={...d};if(r)for(const p in r){if(!(p in d))throw new Error(`Unrecognized key: "${p}"`);r[p]&&(m[p]=e?new e({type:"optional",innerType:d[p]}):d[p])}else for(const p in d)m[p]=e?new e({type:"optional",innerType:d[p]}):d[p];return Fi(this,"shape",m),m},checks:[]});return ei(t,u)}function u5(e,t,r){const i=Wa(t._zod.def,{get shape(){const o=t._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 Fi(this,"shape",l),l}});return ei(t,i)}function $s(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function ru(e){return typeof e=="string"?e:e?.message}function Mi(e,t,r){const i=e.message?e.message:ru(e.inst?._zod.def?.error?.(e))??ru(t?.error?.(e))??ru(r.customError?.(e))??ru(r.localeError?.(e))??"Invalid input",{inst:o,continue:l,input:u,...d}=e;return d.path??(d.path=[]),d.message=i,t?.reportInput&&(d.input=u),d}function hg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function gl(...e){const[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}const hC=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ym,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},mg=ge("$ZodError",hC),sd=ge("$ZodError",hC,{Parent:Error});function f5(e,t=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(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:r}}function h5(e,t=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(t(u));else{let m=r,p=0;for(;p(t,r,i,o)=>{const l=i?{...i,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},l);if(u instanceof Promise)throw new Bs;if(u.issues.length){const d=new(o?.Err??e)(u.issues.map(m=>Mi(m,l,Ai())));throw uC(d,o?.callee),d}return u.value},m5=od(sd),ld=e=>async(t,r,i,o)=>{const l=i?{...i,async:!0}:{async:!0};let u=t._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(m=>Mi(m,l,Ai())));throw uC(d,o?.callee),d}return u.value},p5=ld(sd),cd=e=>(t,r,i)=>{const o=i?{...i,async:!1}:{async:!1},l=t._zod.run({value:r,issues:[]},o);if(l instanceof Promise)throw new Bs;return l.issues.length?{success:!1,error:new(e??mg)(l.issues.map(u=>Mi(u,o,Ai())))}:{success:!0,data:l.value}},g5=cd(sd),ud=e=>async(t,r,i)=>{const o=i?{...i,async:!0}:{async:!0};let l=t._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=>Mi(u,o,Ai())))}:{success:!0,data:l.value}},v5=ud(sd),y5=e=>(t,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return od(e)(t,r,o)},b5=e=>(t,r,i)=>od(e)(t,r,i),x5=e=>async(t,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return ld(e)(t,r,o)},w5=e=>async(t,r,i)=>ld(e)(t,r,i),S5=e=>(t,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return cd(e)(t,r,o)},_5=e=>(t,r,i)=>cd(e)(t,r,i),C5=e=>async(t,r,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return ud(e)(t,r,o)},E5=e=>async(t,r,i)=>ud(e)(t,r,i),R5=/^[cC][0-9a-z]{6,}$/,j5=/^[0-9a-z]+$/,T5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,O5=/^[0-9a-vA-V]{20}$/,A5=/^[A-Za-z0-9]{27}$/,M5=/^[a-zA-Z0-9_-]{21}$/,N5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,D5=/^([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})$/,Px=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)$/,k5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,z5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function L5(){return new RegExp(z5,"u")}const $5=/^(?:(?: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])$/,I5=/^(([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}|:))$/,P5=/^((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])$/,F5=/^(([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])$/,V5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mC=/^[A-Za-z0-9_-]*$/,U5=/^https?$/,H5=/^\+[1-9]\d{6,14}$/,pC="(?:(?:\\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])))",B5=new RegExp(`^${pC}$`);function gC(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function q5(e){return new RegExp(`^${gC(e)}$`)}function G5(e){const t=gC({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${r.join("|")})`;return new RegExp(`^${pC}T(?:${i})$`)}const Z5=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},K5=/^(?:true|false)$/i,Y5=/^[^A-Z]*$/,Q5=/^[^a-z]*$/,Nr=ge("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),X5=ge("$ZodCheckMaxLength",(e,t)=>{var r;Nr.init(e,t),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!dg(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=i.value;if(o.length<=t.maximum)return;const u=hg(o);i.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),J5=ge("$ZodCheckMinLength",(e,t)=>{var r;Nr.init(e,t),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!dg(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=t.minimum)return;const u=hg(o);i.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),W5=ge("$ZodCheckLengthEquals",(e,t)=>{var r;Nr.init(e,t),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!dg(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=i=>{const o=i.value,l=o.length;if(l===t.length)return;const u=hg(o),d=l>t.length;i.issues.push({origin:u,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),dd=ge("$ZodCheckStringFormat",(e,t)=>{var r,i;Nr.init(e,t),e._zod.onattach.push(o=>{const l=o._zod.bag;l.format=t.format,t.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),e6=ge("$ZodCheckRegex",(e,t)=>{dd.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),t6=ge("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Y5),dd.init(e,t)}),n6=ge("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Q5),dd.init(e,t)}),r6=ge("$ZodCheckIncludes",(e,t)=>{Nr.init(e,t);const r=id(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.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(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),a6=ge("$ZodCheckStartsWith",(e,t)=>{Nr.init(e,t);const r=new RegExp(`^${id(t.prefix)}.*`);t.pattern??(t.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(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),i6=ge("$ZodCheckEndsWith",(e,t)=>{Nr.init(e,t);const r=new RegExp(`.*${id(t.suffix)}$`);t.pattern??(t.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(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),s6=ge("$ZodCheckOverwrite",(e,t)=>{Nr.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class o6{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.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 t=Function,r=this?.args,o=[...(this?.content??[""]).map(l=>` ${l}`)];return new t(...r,o.join(` -`))}}const o6={major:4,minor:4,patch:3},Vt=ge("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=o6;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,m)=>{let p=$s(u),y;for(const v of d){if(v._zod.def.when){if(u5(u)||!v._zod.def.when(u))continue}else if(p)continue;const b=u.issues.length,x=v._zod.check(u);if(x instanceof Promise&&m?.async===!1)throw new Bs;if(y||x instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await x,u.issues.length!==b&&(p||(p=$s(u,b)))});else{if(u.issues.length===b)continue;p||(p=$s(u,b))}}return y?y.then(()=>u):u},l=(u,d,m)=>{if($s(u))return u.aborted=!0,u;const p=o(d,i,m);if(p instanceof Promise){if(m.async===!1)throw new Bs;return p.then(y=>e._zod.parse(y,m))}return e._zod.parse(p,m)};e._zod.run=(u,d)=>{if(d.skipChecks)return e._zod.parse(u,d);if(d.direction==="backward"){const p=e._zod.parse({value:u.value,issues:[]},{...d,skipChecks:!0});return p instanceof Promise?p.then(y=>l(y,u,d)):l(p,u,d)}const m=e._zod.parse(u,d);if(m instanceof Promise){if(d.async===!1)throw new Bs;return m.then(p=>o(p,i,d))}return o(m,i,d)}}pt(e,"~standard",()=>({validate:o=>{try{const l=p5(e,o);return l.success?{value:l.data}:{issues:l.error?.issues}}catch{return g5(e,o).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),pg=ge("$ZodString",(e,t)=>{Vt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??G5(e._zod.bag),e._zod.parse=(r,i)=>{if(t.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}}),St=ge("$ZodStringFormat",(e,t)=>{dd.init(e,t),pg.init(e,t)}),l6=ge("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=N5),St.init(e,t)}),c6=ge("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Px(i))}else t.pattern??(t.pattern=Px());St.init(e,t)}),u6=ge("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=D5),St.init(e,t)}),d6=ge("$ZodURL",(e,t)=>{St.init(e,t),e._zod.check=r=>{try{const i=r.value.trim();if(!t.normalize&&t.protocol?.source===V5.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}const o=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),f6=ge("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=z5()),St.init(e,t)}),h6=ge("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=A5),St.init(e,t)}),m6=ge("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=E5),St.init(e,t)}),p6=ge("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=R5),St.init(e,t)}),g6=ge("$ZodULID",(e,t)=>{t.pattern??(t.pattern=j5),St.init(e,t)}),v6=ge("$ZodXID",(e,t)=>{t.pattern??(t.pattern=T5),St.init(e,t)}),y6=ge("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=O5),St.init(e,t)}),b6=ge("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=q5(t)),St.init(e,t)}),x6=ge("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=H5),St.init(e,t)}),w6=ge("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=B5(t)),St.init(e,t)}),S6=ge("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=M5),St.init(e,t)}),_6=ge("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=L5),St.init(e,t),e._zod.bag.format="ipv4"}),C6=ge("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=$5),St.init(e,t),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:!t.abort})}}}),E6=ge("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=I5),St.init(e,t)}),R6=ge("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=P5),St.init(e,t),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:!t.abort})}}});function vC(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const j6=ge("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=F5),St.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{vC(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function T6(e){if(!mC.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return vC(r)}const O6=ge("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=mC),St.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{T6(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),A6=ge("$ZodE164",(e,t)=>{t.pattern??(t.pattern=U5),St.init(e,t)});function M6(e,t=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||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const N6=ge("$ZodJWT",(e,t)=>{St.init(e,t),e._zod.check=r=>{M6(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),D6=ge("$ZodBoolean",(e,t)=>{Vt.init(e,t),e._zod.pattern=Z5,e._zod.parse=(r,i)=>{if(t.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}}),k6=ge("$ZodUnknown",(e,t)=>{Vt.init(e,t),e._zod.parse=r=>r}),z6=ge("$ZodNever",(e,t)=>{Vt.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Fx(e,t,r){e.issues.length&&t.issues.push(...fC(r,e.issues)),t.value[r]=e.value}const L6=ge("$ZodArray",(e,t)=>{Vt.init(e,t),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;uFx(p,r,u))):Fx(m,r,u)}return l.length?Promise.all(l).then(()=>r):r}});function ju(e,t,r,i,o,l){const u=r in i;if(e.issues.length){if(o&&l&&!u)return;t.issues.push(...fC(r,e.issues))}if(!u&&!o){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?u&&(t.value[r]=void 0):t.value[r]=e.value}function yC(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const r=n5(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function bC(e,t,r,i,o,l){const u=[],d=o.keySet,m=o.catchall._zod,p=m.def.type,y=m.optin==="optional",v=m.optout==="optional";for(const b in t){if(b==="__proto__"||d.has(b))continue;if(p==="never"){u.push(b);continue}const x=m.run({value:t[b],issues:[]},i);x instanceof Promise?e.push(x.then(w=>ju(w,r,b,t,y,v))):ju(x,r,b,t,y,v)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:l}),e.length?Promise.all(e).then(()=>r):r}const $6=ge("$ZodObject",(e,t)=>{if(Vt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const m={...d};return Object.defineProperty(t,"shape",{value:m}),m}})}const i=ug(()=>yC(t));pt(e._zod,"propValues",()=>{const d=t.shape,m={};for(const p in d){const y=d[p]._zod;if(y.values){m[p]??(m[p]=new Set);for(const v of y.values)m[p].add(v)}}return m});const o=Ru,l=t.catchall;let u;e._zod.parse=(d,m)=>{u??(u=i.value);const p=d.value;if(!o(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,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:p[b],issues:[]},m);E instanceof Promise?y.push(E.then(R=>ju(R,d,b,p,w,_))):ju(E,d,b,p,w,_)}return l?bC(y,p,d,m,i.value,e):y.length?Promise.all(y).then(()=>d):d}}),I6=ge("$ZodObjectJIT",(e,t)=>{$6.init(e,t);const r=e._zod.parse,i=ug(()=>yC(t)),o=b=>{const x=new s6(["shape","payload","ctx"]),w=i.value,_=O=>{const M=Ix(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],k=Ix(O),B=b[O],V=B?._zod?.optin==="optional",P=B?._zod?.optout==="optional";x.write(`const ${M} = ${_(O)};`),V&&P?x.write(` +`))}}const l6={major:4,minor:4,patch:3},Vt=ge("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=l6;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,m)=>{let p=$s(u),y;for(const v of d){if(v._zod.def.when){if(d5(u)||!v._zod.def.when(u))continue}else if(p)continue;const b=u.issues.length,x=v._zod.check(u);if(x instanceof Promise&&m?.async===!1)throw new Bs;if(y||x instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await x,u.issues.length!==b&&(p||(p=$s(u,b)))});else{if(u.issues.length===b)continue;p||(p=$s(u,b))}}return y?y.then(()=>u):u},l=(u,d,m)=>{if($s(u))return u.aborted=!0,u;const p=o(d,i,m);if(p instanceof Promise){if(m.async===!1)throw new Bs;return p.then(y=>e._zod.parse(y,m))}return e._zod.parse(p,m)};e._zod.run=(u,d)=>{if(d.skipChecks)return e._zod.parse(u,d);if(d.direction==="backward"){const p=e._zod.parse({value:u.value,issues:[]},{...d,skipChecks:!0});return p instanceof Promise?p.then(y=>l(y,u,d)):l(p,u,d)}const m=e._zod.parse(u,d);if(m instanceof Promise){if(d.async===!1)throw new Bs;return m.then(p=>o(p,i,d))}return o(m,i,d)}}pt(e,"~standard",()=>({validate:o=>{try{const l=g5(e,o);return l.success?{value:l.data}:{issues:l.error?.issues}}catch{return v5(e,o).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),pg=ge("$ZodString",(e,t)=>{Vt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Z5(e._zod.bag),e._zod.parse=(r,i)=>{if(t.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}}),St=ge("$ZodStringFormat",(e,t)=>{dd.init(e,t),pg.init(e,t)}),c6=ge("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=D5),St.init(e,t)}),u6=ge("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Px(i))}else t.pattern??(t.pattern=Px());St.init(e,t)}),d6=ge("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=k5),St.init(e,t)}),f6=ge("$ZodURL",(e,t)=>{St.init(e,t),e._zod.check=r=>{try{const i=r.value.trim();if(!t.normalize&&t.protocol?.source===U5.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}const o=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),h6=ge("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=L5()),St.init(e,t)}),m6=ge("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=M5),St.init(e,t)}),p6=ge("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=R5),St.init(e,t)}),g6=ge("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=j5),St.init(e,t)}),v6=ge("$ZodULID",(e,t)=>{t.pattern??(t.pattern=T5),St.init(e,t)}),y6=ge("$ZodXID",(e,t)=>{t.pattern??(t.pattern=O5),St.init(e,t)}),b6=ge("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=A5),St.init(e,t)}),x6=ge("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=G5(t)),St.init(e,t)}),w6=ge("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=B5),St.init(e,t)}),S6=ge("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=q5(t)),St.init(e,t)}),_6=ge("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=N5),St.init(e,t)}),C6=ge("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=$5),St.init(e,t),e._zod.bag.format="ipv4"}),E6=ge("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=I5),St.init(e,t),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:!t.abort})}}}),R6=ge("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=P5),St.init(e,t)}),j6=ge("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=F5),St.init(e,t),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:!t.abort})}}});function vC(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const T6=ge("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=V5),St.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{vC(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function O6(e){if(!mC.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return vC(r)}const A6=ge("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=mC),St.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{O6(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),M6=ge("$ZodE164",(e,t)=>{t.pattern??(t.pattern=H5),St.init(e,t)});function N6(e,t=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||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const D6=ge("$ZodJWT",(e,t)=>{St.init(e,t),e._zod.check=r=>{N6(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),k6=ge("$ZodBoolean",(e,t)=>{Vt.init(e,t),e._zod.pattern=K5,e._zod.parse=(r,i)=>{if(t.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}}),z6=ge("$ZodUnknown",(e,t)=>{Vt.init(e,t),e._zod.parse=r=>r}),L6=ge("$ZodNever",(e,t)=>{Vt.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Fx(e,t,r){e.issues.length&&t.issues.push(...fC(r,e.issues)),t.value[r]=e.value}const $6=ge("$ZodArray",(e,t)=>{Vt.init(e,t),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;uFx(p,r,u))):Fx(m,r,u)}return l.length?Promise.all(l).then(()=>r):r}});function ju(e,t,r,i,o,l){const u=r in i;if(e.issues.length){if(o&&l&&!u)return;t.issues.push(...fC(r,e.issues))}if(!u&&!o){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?u&&(t.value[r]=void 0):t.value[r]=e.value}function yC(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const r=r5(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function bC(e,t,r,i,o,l){const u=[],d=o.keySet,m=o.catchall._zod,p=m.def.type,y=m.optin==="optional",v=m.optout==="optional";for(const b in t){if(b==="__proto__"||d.has(b))continue;if(p==="never"){u.push(b);continue}const x=m.run({value:t[b],issues:[]},i);x instanceof Promise?e.push(x.then(w=>ju(w,r,b,t,y,v))):ju(x,r,b,t,y,v)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:l}),e.length?Promise.all(e).then(()=>r):r}const I6=ge("$ZodObject",(e,t)=>{if(Vt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const m={...d};return Object.defineProperty(t,"shape",{value:m}),m}})}const i=ug(()=>yC(t));pt(e._zod,"propValues",()=>{const d=t.shape,m={};for(const p in d){const y=d[p]._zod;if(y.values){m[p]??(m[p]=new Set);for(const v of y.values)m[p].add(v)}}return m});const o=Ru,l=t.catchall;let u;e._zod.parse=(d,m)=>{u??(u=i.value);const p=d.value;if(!o(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,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:p[b],issues:[]},m);E instanceof Promise?y.push(E.then(R=>ju(R,d,b,p,w,_))):ju(E,d,b,p,w,_)}return l?bC(y,p,d,m,i.value,e):y.length?Promise.all(y).then(()=>d):d}}),P6=ge("$ZodObjectJIT",(e,t)=>{I6.init(e,t);const r=e._zod.parse,i=ug(()=>yC(t)),o=b=>{const x=new o6(["shape","payload","ctx"]),w=i.value,_=O=>{const M=Ix(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],k=Ix(O),B=b[O],V=B?._zod?.optin==="optional",P=B?._zod?.optout==="optional";x.write(`const ${M} = ${_(O)};`),V&&P?x.write(` if (${M}.issues.length) { if (${k} 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=Ru,d=!cg.jitless,p=d&&e5.value,y=t.catchall;let v;e._zod.parse=(b,x)=>{v??(v=i.value);const w=b.value;return u(w)?d&&p&&x?.async===!1&&x.jitless!==!0?(l||(l=o(t.shape)),b=l(b,x),y?bC([],w,b,x,v,e):b):r(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),b)}});function Vx(e,t,r,i){for(const l of e)if(l.issues.length===0)return t.value=l.value,t;const o=e.filter(l=>!$s(l));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(l=>l.issues.map(u=>Mi(u,i,Ai())))}),t)}const P6=ge("$ZodUnion",(e,t)=>{Vt.init(e,t),pt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),pt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),pt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),pt(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>fg(o.source)).join("|")})$`)}});const r=t.options.length===1?t.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 t.options){const m=d._zod.run({value:i.value,issues:[]},o);if(m instanceof Promise)u.push(m),l=!0;else{if(m.issues.length===0)return m;u.push(m)}}return l?Promise.all(u).then(d=>Vx(d,i,e,o)):Vx(u,i,e,o)}}),F6=ge("$ZodIntersection",(e,t)=>{Vt.init(e,t),e._zod.parse=(r,i)=>{const o=r.value,l=t.left._zod.run({value:o,issues:[]},i),u=t.right._zod.run({value:o,issues:[]},i);return l instanceof Promise||u instanceof Promise?Promise.all([l,u]).then(([m,p])=>Ux(r,m,p)):Ux(r,l,u)}});function Qm(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(pl(e)&&pl(t)){const r=Object.keys(t),i=Object.keys(e).filter(l=>r.indexOf(l)!==-1),o={...e,...t};for(const l of i){const u=Qm(e[l],t[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(t)){if(e.length!==t.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}),$s(e))return e;const u=Qm(t.value,r.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const V6=ge("$ZodEnum",(e,t)=>{Vt.init(e,t);const r=cC(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(o=>t5.has(typeof o)).map(o=>typeof o=="string"?id(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}}),U6=ge("$ZodTransform",(e,t)=>{Vt.init(e,t),e._zod.optin="optional",e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new lC(e.constructor.name);const o=t.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 Bs;return r.value=o,r.fallback=!0,r}});function Hx(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const xC=ge("$ZodOptional",(e,t)=>{Vt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",pt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),pt(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${fg(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){const o=r.value,l=t.innerType._zod.run(r,i);return l instanceof Promise?l.then(u=>Hx(u,o)):Hx(l,o)}return r.value===void 0?r:t.innerType._zod.run(r,i)}}),H6=ge("$ZodExactOptional",(e,t)=>{xC.init(e,t),pt(e._zod,"values",()=>t.innerType._zod.values),pt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,i)=>t.innerType._zod.run(r,i)}),B6=ge("$ZodNullable",(e,t)=>{Vt.init(e,t),pt(e._zod,"optin",()=>t.innerType._zod.optin),pt(e._zod,"optout",()=>t.innerType._zod.optout),pt(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${fg(r.source)}|null)$`):void 0}),pt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),q6=ge("$ZodDefault",(e,t)=>{Vt.init(e,t),e._zod.optin="optional",pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(l=>Bx(l,t)):Bx(o,t)}});function Bx(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const G6=ge("$ZodPrefault",(e,t)=>{Vt.init(e,t),e._zod.optin="optional",pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),Z6=ge("$ZodNonOptional",(e,t)=>{Vt.init(e,t),pt(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(l=>qx(l,e)):qx(o,e)}});function qx(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const K6=ge("$ZodCatch",(e,t)=>{Vt.init(e,t),e._zod.optin="optional",pt(e._zod,"optout",()=>t.innerType._zod.optout),pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(l=>(r.value=l.value,l.issues.length&&(r.value=t.catchValue({...r,error:{issues:l.issues.map(u=>Mi(u,i,Ai()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(l=>Mi(l,i,Ai()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),Y6=ge("$ZodPipe",(e,t)=>{Vt.init(e,t),pt(e._zod,"values",()=>t.in._zod.values),pt(e._zod,"optin",()=>t.in._zod.optin),pt(e._zod,"optout",()=>t.out._zod.optout),pt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){const l=t.out._zod.run(r,i);return l instanceof Promise?l.then(u=>au(u,t.in,i)):au(l,t.in,i)}const o=t.in._zod.run(r,i);return o instanceof Promise?o.then(l=>au(l,t.out,i)):au(o,t.out,i)}});function au(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}const Q6=ge("$ZodReadonly",(e,t)=>{Vt.init(e,t),pt(e._zod,"propValues",()=>t.innerType._zod.propValues),pt(e._zod,"values",()=>t.innerType._zod.values),pt(e._zod,"optin",()=>t.innerType?._zod?.optin),pt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(Gx):Gx(o)}});function Gx(e){return e.value=Object.freeze(e.value),e}const X6=ge("$ZodCustom",(e,t)=>{Nr.init(e,t),Vt.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,o=t.fn(i);if(o instanceof Promise)return o.then(l=>Zx(l,r,i,e));Zx(o,r,i,e)}});function Zx(e,t,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),t.issues.push(gl(o))}}var Kx;class J6{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const i=r[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const i={...this.get(r)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function W6(){return new J6}(Kx=globalThis).__zod_globalRegistry??(Kx.__zod_globalRegistry=W6());const tl=globalThis.__zod_globalRegistry;function eL(e,t){return new e({type:"string",...Ie(t)})}function tL(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ie(t)})}function Yx(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ie(t)})}function nL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ie(t)})}function rL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ie(t)})}function aL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ie(t)})}function iL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ie(t)})}function sL(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ie(t)})}function oL(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ie(t)})}function lL(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ie(t)})}function cL(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ie(t)})}function uL(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ie(t)})}function dL(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ie(t)})}function fL(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ie(t)})}function hL(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ie(t)})}function mL(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ie(t)})}function pL(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ie(t)})}function gL(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ie(t)})}function vL(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ie(t)})}function yL(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ie(t)})}function bL(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ie(t)})}function xL(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ie(t)})}function wL(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ie(t)})}function SL(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ie(t)})}function _L(e,t){return new e({type:"string",format:"date",check:"string_format",...Ie(t)})}function CL(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ie(t)})}function EL(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ie(t)})}function RL(e,t){return new e({type:"boolean",...Ie(t)})}function jL(e){return new e({type:"unknown"})}function TL(e,t){return new e({type:"never",...Ie(t)})}function wC(e,t){return new Q5({check:"max_length",...Ie(t),maximum:e})}function Tu(e,t){return new X5({check:"min_length",...Ie(t),minimum:e})}function SC(e,t){return new J5({check:"length_equals",...Ie(t),length:e})}function OL(e,t){return new W5({check:"string_format",format:"regex",...Ie(t),pattern:e})}function AL(e){return new e6({check:"string_format",format:"lowercase",...Ie(e)})}function ML(e){return new t6({check:"string_format",format:"uppercase",...Ie(e)})}function NL(e,t){return new n6({check:"string_format",format:"includes",...Ie(t),includes:e})}function DL(e,t){return new r6({check:"string_format",format:"starts_with",...Ie(t),prefix:e})}function kL(e,t){return new a6({check:"string_format",format:"ends_with",...Ie(t),suffix:e})}function eo(e){return new i6({check:"overwrite",tx:e})}function zL(e){return eo(t=>t.normalize(e))}function LL(){return eo(e=>e.trim())}function $L(){return eo(e=>e.toLowerCase())}function IL(){return eo(e=>e.toUpperCase())}function PL(){return eo(e=>W4(e))}function FL(e,t,r){return new e({type:"array",element:t,...Ie(r)})}function VL(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Ie(r)})}function UL(e,t){const r=HL(i=>(i.addIssue=o=>{if(typeof o=="string")i.issues.push(gl(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(gl(l))}},e(i.value,i)),t);return r}function HL(e,t){const r=new Nr({check:"custom",...Ie(t)});return r._zod.check=e,r}function _C(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??tl,target:t,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 cn(e,t,r={path:[],schemaPath:[]}){var i;const o=e._zod.def,l=t.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};t.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(t,u.schema,y);else{const b=u.schema,x=t.processors[o.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);x(e,t,b,y)}const v=e._zod.parent;v&&(u.ref||(u.ref=v),cn(v,t,y),t.seen.get(v).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(u.schema,m),t.io==="input"&&gn(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&"_prefault"in u.schema&&((i=u.schema).default??(i.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function CC(e,t){const r=e.seen.get(t);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 m=i.get(d);if(m&&m!==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 p=`#/${d}/`,y=u[1].schema.id??`__schema${e.counter++}`;return{defId:y,ref:p+y}},l=u=>{if(u[1].schema.$ref)return;const d=u[1],{ref:m,defId:p}=o(u);d.def={...d.schema},p&&(d.defId=p);const y=d.schema;for(const v in y)delete y[v];y.$ref=m};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=Ru,d=!cg.jitless,p=d&&t5.value,y=t.catchall;let v;e._zod.parse=(b,x)=>{v??(v=i.value);const w=b.value;return u(w)?d&&p&&x?.async===!1&&x.jitless!==!0?(l||(l=o(t.shape)),b=l(b,x),y?bC([],w,b,x,v,e):b):r(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),b)}});function Vx(e,t,r,i){for(const l of e)if(l.issues.length===0)return t.value=l.value,t;const o=e.filter(l=>!$s(l));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(l=>l.issues.map(u=>Mi(u,i,Ai())))}),t)}const F6=ge("$ZodUnion",(e,t)=>{Vt.init(e,t),pt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),pt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),pt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),pt(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>fg(o.source)).join("|")})$`)}});const r=t.options.length===1?t.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 t.options){const m=d._zod.run({value:i.value,issues:[]},o);if(m instanceof Promise)u.push(m),l=!0;else{if(m.issues.length===0)return m;u.push(m)}}return l?Promise.all(u).then(d=>Vx(d,i,e,o)):Vx(u,i,e,o)}}),V6=ge("$ZodIntersection",(e,t)=>{Vt.init(e,t),e._zod.parse=(r,i)=>{const o=r.value,l=t.left._zod.run({value:o,issues:[]},i),u=t.right._zod.run({value:o,issues:[]},i);return l instanceof Promise||u instanceof Promise?Promise.all([l,u]).then(([m,p])=>Ux(r,m,p)):Ux(r,l,u)}});function Qm(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(pl(e)&&pl(t)){const r=Object.keys(t),i=Object.keys(e).filter(l=>r.indexOf(l)!==-1),o={...e,...t};for(const l of i){const u=Qm(e[l],t[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(t)){if(e.length!==t.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}),$s(e))return e;const u=Qm(t.value,r.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const U6=ge("$ZodEnum",(e,t)=>{Vt.init(e,t);const r=cC(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(o=>n5.has(typeof o)).map(o=>typeof o=="string"?id(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}}),H6=ge("$ZodTransform",(e,t)=>{Vt.init(e,t),e._zod.optin="optional",e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new lC(e.constructor.name);const o=t.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 Bs;return r.value=o,r.fallback=!0,r}});function Hx(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const xC=ge("$ZodOptional",(e,t)=>{Vt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",pt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),pt(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${fg(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){const o=r.value,l=t.innerType._zod.run(r,i);return l instanceof Promise?l.then(u=>Hx(u,o)):Hx(l,o)}return r.value===void 0?r:t.innerType._zod.run(r,i)}}),B6=ge("$ZodExactOptional",(e,t)=>{xC.init(e,t),pt(e._zod,"values",()=>t.innerType._zod.values),pt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,i)=>t.innerType._zod.run(r,i)}),q6=ge("$ZodNullable",(e,t)=>{Vt.init(e,t),pt(e._zod,"optin",()=>t.innerType._zod.optin),pt(e._zod,"optout",()=>t.innerType._zod.optout),pt(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${fg(r.source)}|null)$`):void 0}),pt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),G6=ge("$ZodDefault",(e,t)=>{Vt.init(e,t),e._zod.optin="optional",pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(l=>Bx(l,t)):Bx(o,t)}});function Bx(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Z6=ge("$ZodPrefault",(e,t)=>{Vt.init(e,t),e._zod.optin="optional",pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),K6=ge("$ZodNonOptional",(e,t)=>{Vt.init(e,t),pt(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(l=>qx(l,e)):qx(o,e)}});function qx(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Y6=ge("$ZodCatch",(e,t)=>{Vt.init(e,t),e._zod.optin="optional",pt(e._zod,"optout",()=>t.innerType._zod.optout),pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(l=>(r.value=l.value,l.issues.length&&(r.value=t.catchValue({...r,error:{issues:l.issues.map(u=>Mi(u,i,Ai()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(l=>Mi(l,i,Ai()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),Q6=ge("$ZodPipe",(e,t)=>{Vt.init(e,t),pt(e._zod,"values",()=>t.in._zod.values),pt(e._zod,"optin",()=>t.in._zod.optin),pt(e._zod,"optout",()=>t.out._zod.optout),pt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){const l=t.out._zod.run(r,i);return l instanceof Promise?l.then(u=>au(u,t.in,i)):au(l,t.in,i)}const o=t.in._zod.run(r,i);return o instanceof Promise?o.then(l=>au(l,t.out,i)):au(o,t.out,i)}});function au(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}const X6=ge("$ZodReadonly",(e,t)=>{Vt.init(e,t),pt(e._zod,"propValues",()=>t.innerType._zod.propValues),pt(e._zod,"values",()=>t.innerType._zod.values),pt(e._zod,"optin",()=>t.innerType?._zod?.optin),pt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(Gx):Gx(o)}});function Gx(e){return e.value=Object.freeze(e.value),e}const J6=ge("$ZodCustom",(e,t)=>{Nr.init(e,t),Vt.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,o=t.fn(i);if(o instanceof Promise)return o.then(l=>Zx(l,r,i,e));Zx(o,r,i,e)}});function Zx(e,t,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),t.issues.push(gl(o))}}var Kx;class W6{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const i=r[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const i={...this.get(r)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function eL(){return new W6}(Kx=globalThis).__zod_globalRegistry??(Kx.__zod_globalRegistry=eL());const tl=globalThis.__zod_globalRegistry;function tL(e,t){return new e({type:"string",...Ie(t)})}function nL(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ie(t)})}function Yx(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ie(t)})}function rL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ie(t)})}function aL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ie(t)})}function iL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ie(t)})}function sL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ie(t)})}function oL(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ie(t)})}function lL(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ie(t)})}function cL(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ie(t)})}function uL(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ie(t)})}function dL(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ie(t)})}function fL(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ie(t)})}function hL(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ie(t)})}function mL(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ie(t)})}function pL(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ie(t)})}function gL(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ie(t)})}function vL(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ie(t)})}function yL(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ie(t)})}function bL(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ie(t)})}function xL(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ie(t)})}function wL(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ie(t)})}function SL(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ie(t)})}function _L(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ie(t)})}function CL(e,t){return new e({type:"string",format:"date",check:"string_format",...Ie(t)})}function EL(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ie(t)})}function RL(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ie(t)})}function jL(e,t){return new e({type:"boolean",...Ie(t)})}function TL(e){return new e({type:"unknown"})}function OL(e,t){return new e({type:"never",...Ie(t)})}function wC(e,t){return new X5({check:"max_length",...Ie(t),maximum:e})}function Tu(e,t){return new J5({check:"min_length",...Ie(t),minimum:e})}function SC(e,t){return new W5({check:"length_equals",...Ie(t),length:e})}function AL(e,t){return new e6({check:"string_format",format:"regex",...Ie(t),pattern:e})}function ML(e){return new t6({check:"string_format",format:"lowercase",...Ie(e)})}function NL(e){return new n6({check:"string_format",format:"uppercase",...Ie(e)})}function DL(e,t){return new r6({check:"string_format",format:"includes",...Ie(t),includes:e})}function kL(e,t){return new a6({check:"string_format",format:"starts_with",...Ie(t),prefix:e})}function zL(e,t){return new i6({check:"string_format",format:"ends_with",...Ie(t),suffix:e})}function eo(e){return new s6({check:"overwrite",tx:e})}function LL(e){return eo(t=>t.normalize(e))}function $L(){return eo(e=>e.trim())}function IL(){return eo(e=>e.toLowerCase())}function PL(){return eo(e=>e.toUpperCase())}function FL(){return eo(e=>e5(e))}function VL(e,t,r){return new e({type:"array",element:t,...Ie(r)})}function UL(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Ie(r)})}function HL(e,t){const r=BL(i=>(i.addIssue=o=>{if(typeof o=="string")i.issues.push(gl(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(gl(l))}},e(i.value,i)),t);return r}function BL(e,t){const r=new Nr({check:"custom",...Ie(t)});return r._zod.check=e,r}function _C(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??tl,target:t,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 cn(e,t,r={path:[],schemaPath:[]}){var i;const o=e._zod.def,l=t.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};t.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(t,u.schema,y);else{const b=u.schema,x=t.processors[o.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);x(e,t,b,y)}const v=e._zod.parent;v&&(u.ref||(u.ref=v),cn(v,t,y),t.seen.get(v).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(u.schema,m),t.io==="input"&&gn(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&"_prefault"in u.schema&&((i=u.schema).default??(i.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function CC(e,t){const r=e.seen.get(t);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 m=i.get(d);if(m&&m!==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 p=`#/${d}/`,y=u[1].schema.id??`__schema${e.counter++}`;return{defId:y,ref:p+y}},l=u=>{if(u[1].schema.$ref)return;const d=u[1],{ref:m,defId:p}=o(u);d.def={...d.schema},p&&(d.defId=p);const y=d.schema;for(const v in y)delete y[v];y.$ref=m};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(t===u[0]){l(u);continue}if(e.external){const p=e.external.registry.get(u[0])?.id;if(t!==u[0]&&p){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 EC(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=d=>{const m=e.seen.get(d);if(m.ref===null)return;const p=m.def??m.schema,y={...p},v=m.ref;if(m.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")?(p.allOf=p.allOf??[],p.allOf.push(w)):Object.assign(p,w),Object.assign(p,y),d._zod.parent===v)for(const E in p)E==="$ref"||E==="allOf"||E in y||delete p[E];if(w.$ref&&x.def)for(const E in p)E==="$ref"||E==="allOf"||E in x.def&&JSON.stringify(p[E])===JSON.stringify(x.def[E])&&delete p[E]}const b=d._zod.parent;if(b&&b!==v){i(b);const x=e.seen.get(b);if(x?.schema.$ref&&(p.$ref=x.schema.$ref,x.def))for(const w in p)w==="$ref"||w==="allOf"||w in x.def&&JSON.stringify(p[w])===JSON.stringify(x.def[w])&&delete p[w]}e.override({zodSchema:d,jsonSchema:p,path:m.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(t)?.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(t)?.id;l!==void 0&&o.id===l&&delete o.id;const u=e.external?.defs??{};for(const d of e.seen.entries()){const m=d[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,u[m.defId]=m.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:{...t["~standard"],jsonSchema:{input:Ou(t,"input",e.processors),output:Ou(t,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function gn(e,t){const r=t??{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 BL=(e,t={})=>r=>{const i=_C({...r,processors:t});return cn(e,i),CC(i,e),EC(i,e)},Ou=(e,t,r={})=>i=>{const{libraryOptions:o,target:l}=i??{},u=_C({...o??{},target:l,io:t,processors:r});return cn(e,u),CC(u,e),EC(u,e)},qL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},GL=(e,t,r,i)=>{const o=r;o.type="string";const{minimum:l,maximum:u,format:d,patterns:m,contentEncoding:p}=e._zod.bag;if(typeof l=="number"&&(o.minLength=l),typeof u=="number"&&(o.maxLength=u),d&&(o.format=qL[d]??d,o.format===""&&delete o.format,d==="time"&&delete o.format),p&&(o.contentEncoding=p),m&&m.size>0){const y=[...m];y.length===1?o.pattern=y[0].source:y.length>1&&(o.allOf=[...y.map(v=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},ZL=(e,t,r,i)=>{r.type="boolean"},KL=(e,t,r,i)=>{r.not={}},YL=(e,t,r,i)=>{},QL=(e,t,r,i)=>{const o=e._zod.def,l=cC(o.entries);l.every(u=>typeof u=="number")&&(r.type="number"),l.every(u=>typeof u=="string")&&(r.type="string"),r.enum=l},XL=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},JL=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},WL=(e,t,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=cn(l.element,t,{...i,path:[...i.path,"items"]})},e8=(e,t,r,i)=>{const o=r,l=e._zod.def;o.type="object",o.properties={};const u=l.shape;for(const p in u)o.properties[p]=cn(u[p],t,{...i,path:[...i.path,"properties",p]});const d=new Set(Object.keys(u)),m=new Set([...d].filter(p=>{const y=l.shape[p]._zod;return t.io==="input"?y.optin===void 0:y.optout===void 0}));m.size>0&&(o.required=Array.from(m)),l.catchall?._zod.def.type==="never"?o.additionalProperties=!1:l.catchall?l.catchall&&(o.additionalProperties=cn(l.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},t8=(e,t,r,i)=>{const o=e._zod.def,l=o.inclusive===!1,u=o.options.map((d,m)=>cn(d,t,{...i,path:[...i.path,l?"oneOf":"anyOf",m]}));l?r.oneOf=u:r.anyOf=u},n8=(e,t,r,i)=>{const o=e._zod.def,l=cn(o.left,t,{...i,path:[...i.path,"allOf",0]}),u=cn(o.right,t,{...i,path:[...i.path,"allOf",1]}),d=p=>"allOf"in p&&Object.keys(p).length===1,m=[...d(l)?l.allOf:[l],...d(u)?u.allOf:[u]];r.allOf=m},r8=(e,t,r,i)=>{const o=e._zod.def,l=cn(o.innerType,t,i),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=o.innerType,r.nullable=!0):r.anyOf=[l,{type:"null"}]},a8=(e,t,r,i)=>{const o=e._zod.def;cn(o.innerType,t,i);const l=t.seen.get(e);l.ref=o.innerType},i8=(e,t,r,i)=>{const o=e._zod.def;cn(o.innerType,t,i);const l=t.seen.get(e);l.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},s8=(e,t,r,i)=>{const o=e._zod.def;cn(o.innerType,t,i);const l=t.seen.get(e);l.ref=o.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},o8=(e,t,r,i)=>{const o=e._zod.def;cn(o.innerType,t,i);const l=t.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},l8=(e,t,r,i)=>{const o=e._zod.def,l=o.in._zod.traits.has("$ZodTransform"),u=t.io==="input"?l?o.out:o.in:o.out;cn(u,t,i);const d=t.seen.get(e);d.ref=u},c8=(e,t,r,i)=>{const o=e._zod.def;cn(o.innerType,t,i);const l=t.seen.get(e);l.ref=o.innerType,r.readOnly=!0},RC=(e,t,r,i)=>{const o=e._zod.def;cn(o.innerType,t,i);const l=t.seen.get(e);l.ref=o.innerType};function Xm(){return Xm=Object.assign?Object.assign.bind():function(e){for(var t=1;t0){var m=o.errors[0][0];r[d]={message:m.message,type:m.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(Xm({},b,{path:[].concat(o.path,b.path)}))})}),t){var p=r[d].types,y=p&&p[o.code];r[d]=og(d,t,r,l,y?[].concat(y,o.message):o.message)}e.shift()};e.length;)i();return r}function gg(e,t,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(Qx(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](i,t)).then(function(u){return l.shouldUseNativeValidation&&Km({},l),{errors:{},values:r.raw?Object.assign({},i):u}})},function(u){if((function(d){return Array.isArray(d?.issues)})(u))return{values:{},errors:kx(u8(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(Qx(function(){return Promise.resolve((r.mode==="sync"?h5:m5)(e,i,t)).then(function(u){return l.shouldUseNativeValidation&&Km({},l),{errors:{},values:r.raw?Object.assign({},i):u}})},function(u){if((function(d){return d instanceof mg})(u))return{values:{},errors:kx(d8(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 f8=ge("ZodISODateTime",(e,t)=>{b6.init(e,t),Et.init(e,t)});function h8(e){return SL(f8,e)}const m8=ge("ZodISODate",(e,t)=>{x6.init(e,t),Et.init(e,t)});function p8(e){return _L(m8,e)}const g8=ge("ZodISOTime",(e,t)=>{w6.init(e,t),Et.init(e,t)});function v8(e){return CL(g8,e)}const y8=ge("ZodISODuration",(e,t)=>{S6.init(e,t),Et.init(e,t)});function b8(e){return EL(y8,e)}const x8=(e,t)=>{mg.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>f5(e,r)},flatten:{value:r=>d5(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ym,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ym,2)}},isEmpty:{get(){return e.issues.length===0}}})},nr=ge("ZodError",x8,{Parent:Error}),w8=od(nr),S8=ld(nr),_8=cd(nr),C8=ud(nr),E8=v5(nr),R8=y5(nr),j8=b5(nr),T8=x5(nr),O8=w5(nr),A8=S5(nr),M8=_5(nr),N8=C5(nr),Xx=new WeakMap;function fd(e,t,r){const i=Object.getPrototypeOf(e);let o=Xx.get(i);if(o||(o=new Set,Xx.set(i,o)),!o.has(t)){o.add(t);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 Ut=ge("ZodType",(e,t)=>(Vt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ou(e,"input"),output:Ou(e,"output")}}),e.toJSONSchema=BL(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,i)=>w8(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>_8(e,r,i),e.parseAsync=async(r,i)=>S8(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>C8(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>E8(e,r,i),e.decode=(r,i)=>R8(e,r,i),e.encodeAsync=async(r,i)=>j8(e,r,i),e.decodeAsync=async(r,i)=>T8(e,r,i),e.safeEncode=(r,i)=>O8(e,r,i),e.safeDecode=(r,i)=>A8(e,r,i),e.safeEncodeAsync=async(r,i)=>M8(e,r,i),e.safeDecodeAsync=async(r,i)=>N8(e,r,i),fd(e,"ZodType",{check(...r){const i=this.def;return this.clone(Wa(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 ei(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(E$(r,i))},superRefine(r,i){return this.check(R$(r,i))},overwrite(r){return this.check(eo(r))},optional(){return tw(this)},exactOptional(){return f$(this)},nullable(){return nw(this)},nullish(){return tw(nw(this))},nonoptional(r){return y$(this,r)},array(){return n$(this)},or(r){return i$([this,r])},and(r){return o$(this,r)},transform(r){return rw(this,u$(r))},default(r){return p$(this,r)},prefault(r){return v$(this,r)},catch(r){return x$(this,r)},pipe(r){return rw(this,r)},readonly(){return _$(this)},describe(r){const i=this.clone();return tl.add(i,{description:r}),i},meta(...r){if(r.length===0)return tl.get(this);const i=this.clone();return tl.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 tl.get(e)?.description},configurable:!0}),e)),jC=ge("_ZodString",(e,t)=>{pg.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(i,o,l)=>GL(e,i,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,fd(e,"_ZodString",{regex(...i){return this.check(OL(...i))},includes(...i){return this.check(NL(...i))},startsWith(...i){return this.check(DL(...i))},endsWith(...i){return this.check(kL(...i))},min(...i){return this.check(Tu(...i))},max(...i){return this.check(wC(...i))},length(...i){return this.check(SC(...i))},nonempty(...i){return this.check(Tu(1,...i))},lowercase(i){return this.check(AL(i))},uppercase(i){return this.check(ML(i))},trim(){return this.check(LL())},normalize(...i){return this.check(zL(...i))},toLowerCase(){return this.check($L())},toUpperCase(){return this.check(IL())},slugify(){return this.check(PL())}})}),D8=ge("ZodString",(e,t)=>{pg.init(e,t),jC.init(e,t),e.email=r=>e.check(tL(k8,r)),e.url=r=>e.check(sL(z8,r)),e.jwt=r=>e.check(wL(Q8,r)),e.emoji=r=>e.check(oL(L8,r)),e.guid=r=>e.check(Yx(Jx,r)),e.uuid=r=>e.check(nL(iu,r)),e.uuidv4=r=>e.check(rL(iu,r)),e.uuidv6=r=>e.check(aL(iu,r)),e.uuidv7=r=>e.check(iL(iu,r)),e.nanoid=r=>e.check(lL($8,r)),e.guid=r=>e.check(Yx(Jx,r)),e.cuid=r=>e.check(cL(I8,r)),e.cuid2=r=>e.check(uL(P8,r)),e.ulid=r=>e.check(dL(F8,r)),e.base64=r=>e.check(yL(Z8,r)),e.base64url=r=>e.check(bL(K8,r)),e.xid=r=>e.check(fL(V8,r)),e.ksuid=r=>e.check(hL(U8,r)),e.ipv4=r=>e.check(mL(H8,r)),e.ipv6=r=>e.check(pL(B8,r)),e.cidrv4=r=>e.check(gL(q8,r)),e.cidrv6=r=>e.check(vL(G8,r)),e.e164=r=>e.check(xL(Y8,r)),e.datetime=r=>e.check(h8(r)),e.date=r=>e.check(p8(r)),e.time=r=>e.check(v8(r)),e.duration=r=>e.check(b8(r))});function fu(e){return eL(D8,e)}const Et=ge("ZodStringFormat",(e,t)=>{St.init(e,t),jC.init(e,t)}),k8=ge("ZodEmail",(e,t)=>{u6.init(e,t),Et.init(e,t)}),Jx=ge("ZodGUID",(e,t)=>{l6.init(e,t),Et.init(e,t)}),iu=ge("ZodUUID",(e,t)=>{c6.init(e,t),Et.init(e,t)}),z8=ge("ZodURL",(e,t)=>{d6.init(e,t),Et.init(e,t)}),L8=ge("ZodEmoji",(e,t)=>{f6.init(e,t),Et.init(e,t)}),$8=ge("ZodNanoID",(e,t)=>{h6.init(e,t),Et.init(e,t)}),I8=ge("ZodCUID",(e,t)=>{m6.init(e,t),Et.init(e,t)}),P8=ge("ZodCUID2",(e,t)=>{p6.init(e,t),Et.init(e,t)}),F8=ge("ZodULID",(e,t)=>{g6.init(e,t),Et.init(e,t)}),V8=ge("ZodXID",(e,t)=>{v6.init(e,t),Et.init(e,t)}),U8=ge("ZodKSUID",(e,t)=>{y6.init(e,t),Et.init(e,t)}),H8=ge("ZodIPv4",(e,t)=>{_6.init(e,t),Et.init(e,t)}),B8=ge("ZodIPv6",(e,t)=>{C6.init(e,t),Et.init(e,t)}),q8=ge("ZodCIDRv4",(e,t)=>{E6.init(e,t),Et.init(e,t)}),G8=ge("ZodCIDRv6",(e,t)=>{R6.init(e,t),Et.init(e,t)}),Z8=ge("ZodBase64",(e,t)=>{j6.init(e,t),Et.init(e,t)}),K8=ge("ZodBase64URL",(e,t)=>{O6.init(e,t),Et.init(e,t)}),Y8=ge("ZodE164",(e,t)=>{A6.init(e,t),Et.init(e,t)}),Q8=ge("ZodJWT",(e,t)=>{N6.init(e,t),Et.init(e,t)}),X8=ge("ZodBoolean",(e,t)=>{D6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>ZL(e,r,i)});function Wx(e){return RL(X8,e)}const J8=ge("ZodUnknown",(e,t)=>{k6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>YL()});function ew(){return jL(J8)}const W8=ge("ZodNever",(e,t)=>{z6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>KL(e,r,i)});function e$(e){return TL(W8,e)}const t$=ge("ZodArray",(e,t)=>{L6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>WL(e,r,i,o),e.element=t.element,fd(e,"ZodArray",{min(r,i){return this.check(Tu(r,i))},nonempty(r){return this.check(Tu(1,r))},max(r,i){return this.check(wC(r,i))},length(r,i){return this.check(SC(r,i))},unwrap(){return this.element}})});function n$(e,t){return FL(t$,e,t)}const r$=ge("ZodObject",(e,t)=>{I6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>e8(e,r,i,o),pt(e,"shape",()=>t.shape),fd(e,"ZodObject",{keyof(){return l$(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:ew()})},loose(){return this.clone({...this._zod.def,catchall:ew()})},strict(){return this.clone({...this._zod.def,catchall:e$()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return i5(this,r)},safeExtend(r){return s5(this,r)},merge(r){return o5(this,r)},pick(r){return r5(this,r)},omit(r){return a5(this,r)},partial(...r){return l5(TC,this,r[0])},required(...r){return c5(OC,this,r[0])}})});function vg(e,t){const r={type:"object",shape:e??{},...Ie(t)};return new r$(r)}const a$=ge("ZodUnion",(e,t)=>{P6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>t8(e,r,i,o),e.options=t.options});function i$(e,t){return new a$({type:"union",options:e,...Ie(t)})}const s$=ge("ZodIntersection",(e,t)=>{F6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>n8(e,r,i,o)});function o$(e,t){return new s$({type:"intersection",left:e,right:t})}const Jm=ge("ZodEnum",(e,t)=>{V6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(i,o,l)=>QL(e,i,o),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const l={};for(const u of i)if(r.has(u))l[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new Jm({...t,checks:[],...Ie(o),entries:l})},e.exclude=(i,o)=>{const l={...t.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 Jm({...t,checks:[],...Ie(o),entries:l})}});function l$(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Jm({type:"enum",entries:r,...Ie(t)})}const c$=ge("ZodTransform",(e,t)=>{U6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>JL(e,r),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new lC(e.constructor.name);r.addIssue=l=>{if(typeof l=="string")r.issues.push(gl(l,r.value,t));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(gl(u))}};const o=t.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 u$(e){return new c$({type:"transform",transform:e})}const TC=ge("ZodOptional",(e,t)=>{xC.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>RC(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function tw(e){return new TC({type:"optional",innerType:e})}const d$=ge("ZodExactOptional",(e,t)=>{H6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>RC(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function f$(e){return new d$({type:"optional",innerType:e})}const h$=ge("ZodNullable",(e,t)=>{B6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>r8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function nw(e){return new h$({type:"nullable",innerType:e})}const m$=ge("ZodDefault",(e,t)=>{q6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>i8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function p$(e,t){return new m$({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():dC(t)}})}const g$=ge("ZodPrefault",(e,t)=>{G6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>s8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function v$(e,t){return new g$({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():dC(t)}})}const OC=ge("ZodNonOptional",(e,t)=>{Z6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>a8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function y$(e,t){return new OC({type:"nonoptional",innerType:e,...Ie(t)})}const b$=ge("ZodCatch",(e,t)=>{K6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>o8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function x$(e,t){return new b$({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const w$=ge("ZodPipe",(e,t)=>{Y6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>l8(e,r,i,o),e.in=t.in,e.out=t.out});function rw(e,t){return new w$({type:"pipe",in:e,out:t})}const S$=ge("ZodReadonly",(e,t)=>{Q6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>c8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function _$(e){return new S$({type:"readonly",innerType:e})}const C$=ge("ZodCustom",(e,t)=>{X6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>XL(e,r)});function E$(e,t={}){return VL(C$,e,t)}function R$(e,t){return UL(e,t)}const j$=/\.(md|markdown)$/i,T$=/\.(png|jpe?g|gif|svg|webp|ico|bmp|avif)$/i,AC=/\.html?$/i,MC=/\.pdf$/i,O$=/\.(csv|tsv)$/i,A$=/\.(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 yg(e){if(e<1024)return e+" B";const t=["KB","MB","GB","TB"];let r=-1;do e/=1024,r++;while(e>=1024&&ri.path.toLowerCase()===r||i.path.toLowerCase()===r+".md")||t.find(i=>{const o=i.name.toLowerCase();return o===r||o===r+".md"})}async function Ni(e){try{if(navigator.clipboard)return await navigator.clipboard.writeText(e),!0}catch{}return!1}const DC="bdrive.lastProject";function N$(){try{return localStorage.getItem(DC)||""}catch{return""}}function D$(e){try{localStorage.setItem(DC,e)}catch{}}function hd(e){return e.user_name?`${e.user_name} <${e.user}>`:e.user||e.author||"unknown"}function k$({className:e,...t}){return f.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:f.jsx("table",{"data-slot":"table",className:We("w-full caption-bottom text-sm",e),...t})})}function z$({className:e,...t}){return f.jsx("thead",{"data-slot":"table-header",className:We("[&_tr]:border-b",e),...t})}function L$({className:e,...t}){return f.jsx("tbody",{"data-slot":"table-body",className:We("[&_tr:last-child]:border-0",e),...t})}function aw({className:e,...t}){return f.jsx("tr",{"data-slot":"table-row",className:We("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function iw({className:e,...t}){return f.jsx("th",{"data-slot":"table-head",className:We("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),...t})}function $$({className:e,...t}){return f.jsx("td",{"data-slot":"table-cell",className:We("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function I$({header:e}){const t=e.column.getIsSorted();return e.column.getCanSort()?f.jsx(iw,{"data-sort":t||void 0,"aria-sort":t==="asc"?"ascending":t==="desc"?"descending":"none",children:f.jsxs("button",{type:"button",className:"th-sort",onClick:e.column.getToggleSortingHandler(),children:[Bm(e.column.columnDef.header,e.getContext()),t==="asc"?" ↑":t==="desc"?" ↓":""]})}):f.jsx(iw,{children:Bm(e.column.columnDef.header,e.getContext())})}function kC({table:e,className:t}){return f.jsx("div",{className:"admin-list admin-card-table"+(t?" "+t:""),children:f.jsxs(k$,{className:"admin-table",children:[f.jsx(z$,{children:e.getHeaderGroups().map(r=>f.jsx(aw,{children:r.headers.map(i=>f.jsx(I$,{header:i},i.id))},r.id))}),f.jsx(L$,{children:e.getRowModel().rows.map(r=>f.jsx(aw,{className:"admin-item",children:r.getVisibleCells().map(i=>f.jsx($$,{children:Bm(i.column.columnDef.cell,i.getContext())},i.id))},r.id))})]})})}function zC(e){return e?"expires "+new Date(e).toLocaleDateString():"no expiry"}function P$(e){if(e.opens===void 0)return null;if(e.opens===0)return"not opened yet";const t=`${e.opens} open${e.opens===1?"":"s"}`;return e.last_opened?`${t} · last opened ${new Date(e.last_opened).toLocaleDateString()}`:t}function LC(e,t){const r=[];t&&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=P$(e);return i&&r.push(i),r.join(" · ")}const $C="Opens count how many times a file has been read through a public link. Repeat opens from the same browser and network within 10 minutes count once — two people on one network using the same browser still count as one.";function IC({shares:e,onChanged:t,showProject:r=!1,canRevoke:i=!0,empty:o="No public shares.",loading:l=!1}){const[u,d]=S.useState([]),m=S.useMemo(()=>L_(),[]),p=S.useMemo(()=>[m.accessor("path",{header:"Path",cell:v=>f.jsx("a",{className:"ai-main mono",title:v.getValue(),...Qs(Oi(v.getValue(),v.row.original.project)),children:v.getValue()})}),m.accessor(v=>LC(v,r),{id:"detail",header:r?"Project":"Shared",cell:v=>f.jsx("span",{className:"ai-tag",children:v.getValue()})}),m.display({id:"actions",header:"",cell:v=>f.jsxs("span",{className:"share-acts",children:[f.jsx("button",{className:"ai-btn","aria-label":`Copy the public link to ${v.row.original.path}`,title:"Copy link",onClick:()=>Ni(v.row.original.url).then(b=>qe(b?"Copied.":"Select and copy the link.")),children:f.jsx(nt,{name:"copy"})}),i&&f.jsx("button",{className:"ai-del","aria-label":`Revoke the share of ${v.row.original.path}`,onClick:()=>PC(v.row.original,t),children:"Revoke"})]})})],[m,t,r,i]),y=K_({data:e,columns:p,state:{sorting:u},onSortingChange:d,getCoreRowModel:G_(),getSortedRowModel:Z_()});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(kC,{table:y,className:"shares-table"})}async function PC(e,t){if(await za("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),qe("Share revoked."),t()}catch(r){qe(r.message,!0)}}const F$=vg({name:fu().trim().min(1,"Give the organization a name.").max(60,"Keep it under 60 characters.")});function V$({org:e,projects:t,myEmail:r}){const i=ki(),o=e.role==="owner",l=()=>i.invalidateQueries({queryKey:["orgs"]}),u=()=>i.invalidateQueries({queryKey:["invites",e.id]}),d=()=>i.invalidateQueries({queryKey:["orgShares",e.id]}),m=lg({resolver:gg(F$),values:{name:e.name}}),{data:p}=Ft({queryKey:["invites",e.id],queryFn:()=>qt(`/api/orgs/${e.id}/invites`),enabled:o,select:x=>x.invites||[]}),{data:y,isLoading:v}=Ft({queryKey:["orgShares",e.id],queryFn:()=>qt(`/api/orgs/${e.id}/shares`),enabled:o,select:x=>x.shares||[]}),b=t.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:m.handleSubmit(async({name:x})=>{try{await Wn("PATCH","/api/orgs/"+e.id,{name:x}),qe("Renamed."),l()}catch(w){qe(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":!!m.formState.errors.name,"aria-describedby":m.formState.errors.name?"org-rename-err":void 0,...m.register("name")}),f.jsx(xt,{variant:"subtle",id:"org-rename-btn",type:"submit",disabled:!m.formState.isDirty,children:"Rename org"}),m.formState.errors.name&&f.jsx("span",{id:"org-rename-err",role:"alert",className:"field-err",children:m.formState.errors.name.message})]}),f.jsx("h3",{children:"Members"}),f.jsx(U$,{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(xt,{variant:"primary",onClick:async()=>{try{const x=await ea(`/api/orgs/${e.id}/invites`),w=await Ni(x.url);qe(w?"Invite link copied to clipboard.":"Invite created — copy it from the list below."),u()}catch(x){qe(x.message,!0)}},children:"New invite"})]}),f.jsxs("div",{className:"admin-list",children:[p&&p.length===0&&f.jsx("div",{className:"admin-empty",children:"No active invite links."}),(p||[]).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:()=>Ni(x.url).then(w=>qe(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 za("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}`),qe("Revoked."),u()}catch(w){qe(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(IC,{shares:y||[],loading:v,onChanged:d,showProject:!0})]})]})}function U$({org:e,owner:t,myEmail:r,onChanged:i}){const[o,l]=S.useState([{id:"email",desc:!1}]),u=S.useMemo(()=>L_(),[]),d=S.useMemo(()=>[u.accessor("email",{id:"email",header:"Member",cell:p=>{const y=!!r&&p.getValue().toLowerCase()===r.toLowerCase();return f.jsx("span",{className:"ai-main",title:p.getValue(),children:p.getValue()+(y?" (you)":"")})}}),u.accessor("role",{id:"role",header:"Role",cell:p=>{const y=p.row.original,v=!!r&&y.email.toLowerCase()===r.toLowerCase();return!t||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}),qe("Role updated.")}catch(x){qe(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 za("Remove member",`Remove ${y.email} from ${e.name}?`,"Remove",!0))try{await Wn("DELETE",`/api/orgs/${e.id}/members/${encodeURIComponent(y.email)}`),qe("Removed."),i()}catch(b){qe(b.message,!0)}},children:"Remove"})]})}})],[u,e.id,e.name,t,r]),m=K_({data:e.members,columns:d,state:{sorting:o},onSortingChange:l,getCoreRowModel:G_(),getSortedRowModel:Z_()});return f.jsx(kC,{table:m})}const H$=vg({require_verification:Wx(),require_approval:Wx()});function B$(){const e=ki(),{data:t,error:r}=Ft({queryKey:["admin","policy"],queryFn:()=>qt("/api/admin/policy")}),{data:i}=A_(!0),o=lg({resolver:gg(H$),values:t?{require_verification:t.require_verification&&t.mailer,require_approval:t.require_approval}:{require_verification:!1,require_approval:!1}});if(S.useEffect(()=>{r&&qe(r.message,!0)},[r]),!t)return null;const l=async(u,d,m)=>{try{await ea(`/api/admin/pending/${u}/${d}`),qe((d==="approve"?"Approved ":"Denied ")+m),e.invalidateQueries({queryKey:["admin","pending"]})}catch(p){qe(p.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 ea("/api/admin/policy",u),qe("Signup policy saved."),e.invalidateQueries({queryKey:["admin","policy"]})}catch(d){qe(d.message,!0)}}),children:[f.jsxs("div",{className:"admin-list",children:[f.jsx(sw,{label:"Require email verification",desc:t.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:!t.mailer,inputProps:o.register("require_verification")}),f.jsx(sw,{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(xt,{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:t.allowed_domains&&t.allowed_domains.length?t.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:t.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:t.admins&&t.admins.length?t.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(xt,{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 sw({label:e,desc:t,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:t})]}),f.jsx("input",{type:"checkbox",disabled:r,...i})]})}function q$({...e}){return f.jsx(m1,{"data-slot":"select",...e})}function G$({...e}){return f.jsx(y1,{"data-slot":"select-value",...e})}function Z$({className:e,size:t="default",children:r,...i}){return f.jsxs(g1,{"data-slot":"select-trigger","data-size":t,className:We("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(b1,{asChild:!0,children:f.jsx(Kp,{className:"size-4 opacity-50"})})]})}function K$({className:e,children:t,position:r="item-aligned",align:i="center",...o}){return f.jsx(w1,{children:f.jsxs(S1,{"data-slot":"select-content",className:We("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(Q$,{}),f.jsx(j1,{className:We("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),f.jsx(X$,{})]})})}function Y$({className:e,children:t,...r}){return f.jsxs(M1,{"data-slot":"select-item",className:We("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(k1,{children:f.jsx(g_,{className:"size-4"})})}),f.jsx(N1,{children:t})]})}function Q$({className:e,...t}){return f.jsx(z1,{"data-slot":"select-scroll-up-button",className:We("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(vk,{className:"size-4"})})}function X$({className:e,...t}){return f.jsx(L1,{"data-slot":"select-scroll-down-button",className:We("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(Kp,{className:"size-4"})})}const ow=["#5b8def","#f5a623","#4cc38a","#e0679b","#8b7bf0","#3ec8c8","#e6934a"];function vl(e){let t=0;for(const r of e)t=t*31+r.charCodeAt(0)>>>0;return ow[t%ow.length]}function rm({projects:e,currentId:t,menu:r,onNew:i}){const o=e.find(l=>l.id===t);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(q$,{value:t||"",onValueChange:l=>{l&&l!==t&&(Yt("/"+l),hr())},children:[f.jsxs(Z$,{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:vl(o.name)},children:f.jsx(Vs,{name:o.icon})}),o?f.jsx("span",{"data-slot":"select-value",children:o.name}):f.jsx(G$,{placeholder:"Select a project"})]}),f.jsx(K$,{className:"proj-menu",position:"popper",sideOffset:4,children:e.map(l=>f.jsxs(Y$,{value:l.id,children:[f.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:vl(l.name)},children:f.jsx(Vs,{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,m])=>f.jsx("li",{children:f.jsxs("div",{id:"nav-"+l,className:"row"+(r.active===l?" active":""),role:"button",tabIndex:0,onClick:m,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),m())},children:[f.jsx(nt,{name:d}),f.jsx("span",{className:"label",children:u})]})},l))})]})}function FC({...e}){return f.jsx(YM,{"data-slot":"dropdown-menu",...e})}function VC({...e}){return f.jsx(QM,{"data-slot":"dropdown-menu-trigger",...e})}function UC({className:e,sideOffset:t=4,...r}){return f.jsx(XM,{children:f.jsx(JM,{"data-slot":"dropdown-menu-content",sideOffset:t,className:We("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 Is({className:e,inset:t,variant:r="default",...i}){return f.jsx(eN,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:We("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 am({className:e,inset:t,...r}){return f.jsx(WM,{"data-slot":"dropdown-menu-label","data-inset":t,className:We("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}const J$="https://github.com/runbear-io/beardrive";function W$(){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 eI({me:e,org:t,admin:r,orgActive:i,billing:o}){const l=e.name||e.email,[u,d]=S.useState(!1),m=t?Qs(t.manage_url):null,p=o?Qs(o.url):null;return f.jsxs("footer",{id:"accountbar",children:[f.jsxs("a",{className:"gh-star",href:J$,target:"_blank",rel:"noreferrer",children:[f.jsx(W$,{}),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(FC,{modal:!1,open:u,onOpenChange:d,children:[f.jsx(VC,{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:vl(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(nt,{name:"chev"})]})}),f.jsxs(UC,{id:"account-menu",side:"top",align:"start",sideOffset:6,className:"acct-menu",children:[t&&f.jsxs(f.Fragment,{children:[f.jsx(am,{className:"menu-sec",children:"Organization"}),f.jsx(Is,{asChild:!0,children:f.jsxs("a",{id:"menu-org-settings","aria-current":i?"page":void 0,...m,onClick:y=>{m?.onClick?.(y),d(!1)},children:[f.jsx(nt,{name:"gear"}),f.jsxs("span",{children:[f.jsx("b",{children:t.name})," Settings"]}),!t.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(Is,{asChild:!0,children:f.jsxs("a",{id:"menu-billing",...p,onClick:y=>{p?.onClick?.(y),d(!1)},children:[f.jsx(nt,{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(am,{className:"menu-sec",children:"Hub"}),f.jsxs(Is,{id:"menu-hub-admin",onSelect:r.onClick,children:[f.jsx(nt,{name:"shield"}),f.jsxs("span",{children:["Signup & access",r.pending?` · ${r.pending}`:""]})]})]}),f.jsx(am,{className:"menu-sec",children:"Account"}),f.jsx(Is,{asChild:!0,children:f.jsxs("a",{id:"signout",href:"/auth/logout",children:[f.jsx(nt,{name:"power"}),f.jsx("span",{children:"Log out"})]})})]})]})]})}function Pa({className:e,...t}){return f.jsx("div",{"data-slot":"card",className:We("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Fa({className:e,...t}){return f.jsx("div",{"data-slot":"card-header",className:We("@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),...t})}function Va({className:e,...t}){return f.jsx("div",{"data-slot":"card-title",className:We("leading-none font-semibold",e),...t})}function qs({className:e,...t}){return f.jsx("div",{"data-slot":"card-description",className:We("text-muted-foreground text-sm",e),...t})}function Ua({className:e,...t}){return f.jsx("div",{"data-slot":"card-content",className:We("px-6",e),...t})}function ta({className:e,orientation:t="horizontal",decorative:r=!0,...i}){return f.jsx(MN,{"data-slot":"separator",decorative:r,orientation:t,className:We("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 tI({url:e}){const t=Ft({queryKey:["billing"],queryFn:()=>qt(e)});if(t.isLoading)return f.jsx("div",{className:"empty",children:"Loading…"});if(t.error||!t.data)return f.jsxs("div",{className:"empty",children:[f.jsx("h3",{children:"Billing is unavailable"}),f.jsx("p",{children:t.error?.message||"Try again shortly."})]});const r=t.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(Pa,{children:[f.jsxs(Fa,{children:[f.jsxs(Va,{children:[r.plan.name," plan",r.plan.status?` (${r.plan.status})`:""]}),f.jsxs(qs,{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(ta,{}),f.jsx(Ua,{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(Pa,{children:[f.jsxs(Fa,{children:[f.jsx(Va,{children:i.name}),f.jsx(qs,{children:i.blurb})]}),f.jsx(ta,{}),f.jsxs(Ua,{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(xt,{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(Pa,{children:[f.jsxs(Fa,{children:[f.jsx(Va,{children:"Manage subscription"}),f.jsx(qs,{children:"Change seats, update the card, download invoices, or cancel."})]}),f.jsx(ta,{}),f.jsx(Ua,{children:f.jsx("form",{method:"post",action:r.portal_url,children:f.jsx(xt,{type:"submit",variant:"subtle",children:"Open the billing portal"})})})]})]})}function hu({className:e,type:t,...r}){return f.jsx("input",{type:t,"data-slot":"input",className:We("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 im({className:e,...t}){return f.jsx(nN,{"data-slot":"label",className:We("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),...t})}function nI({className:e,...t}){return f.jsx("textarea",{"data-slot":"textarea",className:We("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),...t})}const lw={read:1,write:2,admin:3};function _i(e,t){return(lw[e||""]||0)>=(lw[t]||0)}const Wm=280,rI=vg({name:fu().trim().min(1,"Give the project a name.").max(120,"Keep the name under 120 characters."),description:fu().max(Wm,`Keep the description under ${Wm} characters.`),icon:fu()});function aI({project:e,org:t,onDeleted:r}){const i=M_(),o=_i(e.perm,"admin"),l=lg({resolver:gg(rI),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"),m=l.handleSubmit(async p=>{const y=l.formState.dirtyFields,v={};if(y.name&&(v.name=p.name.trim()),y.description&&(v.description=p.description),y.icon&&(v.icon=p.icon),Object.keys(v).length!==0)try{await Wn("PATCH","/api/projects/"+e.id,v),qe("Saved."),l.reset({...p,name:p.name.trim()}),await i()}catch(b){qe(b.message,!0)}});return f.jsxs("div",{className:"project-settings",children:[f.jsxs("h2",{children:[e.name,!_i(e.perm,"write")&&f.jsx("span",{className:"ps-chip",children:"Read-only"})]}),f.jsxs(Pa,{children:[f.jsxs(Fa,{children:[f.jsx(Va,{children:"General"}),f.jsx(qs,{children:"Name, description and icon for this project."})]}),f.jsx(ta,{}),f.jsx(Ua,{children:f.jsxs("form",{className:"ps-form",onSubmit:m,children:[f.jsxs("div",{className:"ps-field",children:[f.jsx(im,{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:vl(e.name)},children:f.jsx(Vs,{name:u})}),f.jsxs(FC,{children:[f.jsx(VC,{asChild:!0,children:f.jsx(xt,{id:"ps-icon-btn",type:"button",variant:"subtle",disabled:!o,children:"Change"})}),f.jsxs(UC,{align:"start",className:"ps-icon-grid",children:[f.jsx(Is,{className:"ps-icon-cell"+(u===""?" active":""),title:"Default","aria-label":"Default icon",onSelect:()=>l.setValue("icon","",{shouldDirty:!0}),children:f.jsx(Vs,{})}),Object.keys(Lm).map(p=>f.jsx(Is,{className:"ps-icon-cell"+(u===p?" active":""),title:p,"aria-label":p,onSelect:()=>l.setValue("icon",p,{shouldDirty:!0}),children:f.jsx(Vs,{name:p})},p))]})]})]})]}),f.jsxs("div",{className:"ps-field",children:[f.jsx(im,{htmlFor:"ps-name",children:"Name"}),f.jsx(hu,{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(im,{htmlFor:"ps-desc",children:["Description ",f.jsx("span",{className:"ps-opt",children:"(optional)"})]}),f.jsx(nI,{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," / ",Wm]})]})]}),o&&f.jsxs(f.Fragment,{children:[f.jsx(ta,{}),f.jsx("div",{className:"ps-actions",children:f.jsx(xt,{id:"ps-save",type:"submit",variant:"primary",disabled:!l.formState.isDirty||l.formState.isSubmitting,children:"Save changes"})})]})]})})]}),f.jsx(iI,{project:e}),f.jsx(oI,{project:e,org:t}),f.jsxs(Pa,{children:[f.jsx(Fa,{children:f.jsx(Va,{children:"About"})}),f.jsx(ta,{}),f.jsxs(Ua,{children:[f.jsxs("dl",{className:"ps-facts",children:[f.jsx("dt",{children:"Project id"}),f.jsx("dd",{children:f.jsx("code",{children:e.id})}),t&&f.jsxs(f.Fragment,{children:[f.jsx("dt",{children:"Workspace"}),f.jsx("dd",{children:t.name})]}),e.created&&f.jsxs(f.Fragment,{children:[f.jsx("dt",{children:"Created"}),f.jsx("dd",{children:new Date(e.created).toLocaleDateString()})]})]}),f.jsxs("p",{className:"ps-note ps-export",children:[f.jsx("strong",{children:"Take your files elsewhere."})," Run ",f.jsx("code",{children:"bdrive export"})," in the synced folder to write the whole project — every device's journal and every content blob, so full history and authorship — into a single archive. ",f.jsx("code",{children:"bdrive import"})," restores it into any other BearDrive hub, self-hosted or cloud. Export warns first if this device still has changes it hasn't pushed."," ",f.jsx("a",{href:"https://docs.beardrive.ai/reference/migration/",target:"_blank",rel:"noreferrer",children:"How migration works →"})]})]})]}),o&&f.jsxs(Pa,{className:"ps-danger",children:[f.jsx(Fa,{children:f.jsx(Va,{children:"Danger zone"})}),f.jsx(ta,{}),f.jsxs(Ua,{children:[f.jsx("p",{children:"Deleting removes the project from this hub. Its files stay in storage. This can't be undone."}),f.jsx(xt,{variant:"danger",onClick:async()=>{if(await T_(`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),qe(`Deleted “${e.name}”.`),await r()}catch(y){qe(y.message,!0)}},children:"Delete project"})]})]})]})}function iI({project:e}){const t=ki(),{data:r,error:i,isLoading:o}=O_(e.id);return i?null:f.jsxs(Pa,{children:[f.jsxs(Fa,{children:[f.jsx(Va,{children:"Public links"}),f.jsxs(qs,{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:[" ",$C]})]})]}),f.jsx(ta,{}),f.jsx(Ua,{children:f.jsx(IC,{shares:r||[],loading:o,canRevoke:_i(e.perm,"write"),onChanged:()=>t.invalidateQueries({queryKey:["shares",e.id]}),empty:"No public links."})})]})}const ep=[{value:"admin",label:"Admin"},{value:"write",label:"Write"},{value:"read",label:"Read"},{value:"none",label:"No access"}],sI=Object.fromEntries(ep.map(e=>[e.value,e.label]));function oI({project:e,org:t}){const r=ki(),{data:i,error:o}=k3(e.id),l=_i(e.perm,"admin"),u=()=>{r.invalidateQueries({queryKey:["permissions",e.id]}),r.invalidateQueries({queryKey:["projects"]})},d=async(x,w)=>{try{await x(),qe(w)}catch(_){qe(_.message,!0)}u()};if(o||!i)return null;const m=i,p=`/api/p/${e.id}/permissions`,y=new Set((t?.members||[]).filter(x=>x.role==="owner").map(x=>x.email.toLowerCase())),v=[...m.grants.filter(x=>!y.has(x.email.toLowerCase())),...[...y].sort().map(x=>({email:x,level:"admin",owner:!0}))],b=async()=>{const x=await T_("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",`${p}/${encodeURIComponent(x.trim())}`,{level:"read"}),"Added.")};return f.jsxs(Pa,{className:"ps-people",children:[f.jsxs(Fa,{children:[f.jsx(Va,{children:"People"}),f.jsx(qs,{children:"Who can see and change this project."})]}),f.jsx(ta,{}),f.jsxs(Ua,{children:[f.jsxs("p",{className:"ps-row",children:[f.jsxs("span",{children:["Everyone in ",t?.name||"this workspace"," can"]}),f.jsx("select",{"aria-label":"Default access for workspace members",disabled:!l,value:m.default,onChange:async x=>{const w=x.target.value;if(w==="none"&&!await za("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",p,{default:w}),"Default access updated.")},children:ep.filter(x=>x.value!=="admin").map(x=>f.jsx("option",{value:x.value,children:x.label},x.value))})]}),m.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(xt,{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,m.creator&&x.email.toLowerCase()===m.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",`${p}/${encodeURIComponent(x.email)}`,{level:_.target.value}),`${x.email} is now ${sI[_.target.value]||_.target.value}.`),children:ep.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",`${p}/${encodeURIComponent(x.email)}`),"Reverted to the default access."),children:"Remove"})]})]},x.email)})})]})]})}const HC="https://raw.githubusercontent.com/runbear-io/beardrive/main/INSTALL_FOR_AGENTS.md";function BC({project:e,existing:t}){const r=window.location.origin,i=t?'. 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 "+HC+` +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const d=u[1];if(t===u[0]){l(u);continue}if(e.external){const p=e.external.registry.get(u[0])?.id;if(t!==u[0]&&p){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 EC(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=d=>{const m=e.seen.get(d);if(m.ref===null)return;const p=m.def??m.schema,y={...p},v=m.ref;if(m.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")?(p.allOf=p.allOf??[],p.allOf.push(w)):Object.assign(p,w),Object.assign(p,y),d._zod.parent===v)for(const E in p)E==="$ref"||E==="allOf"||E in y||delete p[E];if(w.$ref&&x.def)for(const E in p)E==="$ref"||E==="allOf"||E in x.def&&JSON.stringify(p[E])===JSON.stringify(x.def[E])&&delete p[E]}const b=d._zod.parent;if(b&&b!==v){i(b);const x=e.seen.get(b);if(x?.schema.$ref&&(p.$ref=x.schema.$ref,x.def))for(const w in p)w==="$ref"||w==="allOf"||w in x.def&&JSON.stringify(p[w])===JSON.stringify(x.def[w])&&delete p[w]}e.override({zodSchema:d,jsonSchema:p,path:m.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(t)?.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(t)?.id;l!==void 0&&o.id===l&&delete o.id;const u=e.external?.defs??{};for(const d of e.seen.entries()){const m=d[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,u[m.defId]=m.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:{...t["~standard"],jsonSchema:{input:Ou(t,"input",e.processors),output:Ou(t,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function gn(e,t){const r=t??{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 qL=(e,t={})=>r=>{const i=_C({...r,processors:t});return cn(e,i),CC(i,e),EC(i,e)},Ou=(e,t,r={})=>i=>{const{libraryOptions:o,target:l}=i??{},u=_C({...o??{},target:l,io:t,processors:r});return cn(e,u),CC(u,e),EC(u,e)},GL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ZL=(e,t,r,i)=>{const o=r;o.type="string";const{minimum:l,maximum:u,format:d,patterns:m,contentEncoding:p}=e._zod.bag;if(typeof l=="number"&&(o.minLength=l),typeof u=="number"&&(o.maxLength=u),d&&(o.format=GL[d]??d,o.format===""&&delete o.format,d==="time"&&delete o.format),p&&(o.contentEncoding=p),m&&m.size>0){const y=[...m];y.length===1?o.pattern=y[0].source:y.length>1&&(o.allOf=[...y.map(v=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},KL=(e,t,r,i)=>{r.type="boolean"},YL=(e,t,r,i)=>{r.not={}},QL=(e,t,r,i)=>{},XL=(e,t,r,i)=>{const o=e._zod.def,l=cC(o.entries);l.every(u=>typeof u=="number")&&(r.type="number"),l.every(u=>typeof u=="string")&&(r.type="string"),r.enum=l},JL=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},WL=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},e8=(e,t,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=cn(l.element,t,{...i,path:[...i.path,"items"]})},t8=(e,t,r,i)=>{const o=r,l=e._zod.def;o.type="object",o.properties={};const u=l.shape;for(const p in u)o.properties[p]=cn(u[p],t,{...i,path:[...i.path,"properties",p]});const d=new Set(Object.keys(u)),m=new Set([...d].filter(p=>{const y=l.shape[p]._zod;return t.io==="input"?y.optin===void 0:y.optout===void 0}));m.size>0&&(o.required=Array.from(m)),l.catchall?._zod.def.type==="never"?o.additionalProperties=!1:l.catchall?l.catchall&&(o.additionalProperties=cn(l.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},n8=(e,t,r,i)=>{const o=e._zod.def,l=o.inclusive===!1,u=o.options.map((d,m)=>cn(d,t,{...i,path:[...i.path,l?"oneOf":"anyOf",m]}));l?r.oneOf=u:r.anyOf=u},r8=(e,t,r,i)=>{const o=e._zod.def,l=cn(o.left,t,{...i,path:[...i.path,"allOf",0]}),u=cn(o.right,t,{...i,path:[...i.path,"allOf",1]}),d=p=>"allOf"in p&&Object.keys(p).length===1,m=[...d(l)?l.allOf:[l],...d(u)?u.allOf:[u]];r.allOf=m},a8=(e,t,r,i)=>{const o=e._zod.def,l=cn(o.innerType,t,i),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=o.innerType,r.nullable=!0):r.anyOf=[l,{type:"null"}]},i8=(e,t,r,i)=>{const o=e._zod.def;cn(o.innerType,t,i);const l=t.seen.get(e);l.ref=o.innerType},s8=(e,t,r,i)=>{const o=e._zod.def;cn(o.innerType,t,i);const l=t.seen.get(e);l.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},o8=(e,t,r,i)=>{const o=e._zod.def;cn(o.innerType,t,i);const l=t.seen.get(e);l.ref=o.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},l8=(e,t,r,i)=>{const o=e._zod.def;cn(o.innerType,t,i);const l=t.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},c8=(e,t,r,i)=>{const o=e._zod.def,l=o.in._zod.traits.has("$ZodTransform"),u=t.io==="input"?l?o.out:o.in:o.out;cn(u,t,i);const d=t.seen.get(e);d.ref=u},u8=(e,t,r,i)=>{const o=e._zod.def;cn(o.innerType,t,i);const l=t.seen.get(e);l.ref=o.innerType,r.readOnly=!0},RC=(e,t,r,i)=>{const o=e._zod.def;cn(o.innerType,t,i);const l=t.seen.get(e);l.ref=o.innerType};function Xm(){return Xm=Object.assign?Object.assign.bind():function(e){for(var t=1;t0){var m=o.errors[0][0];r[d]={message:m.message,type:m.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(Xm({},b,{path:[].concat(o.path,b.path)}))})}),t){var p=r[d].types,y=p&&p[o.code];r[d]=og(d,t,r,l,y?[].concat(y,o.message):o.message)}e.shift()};e.length;)i();return r}function gg(e,t,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(Qx(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](i,t)).then(function(u){return l.shouldUseNativeValidation&&Km({},l),{errors:{},values:r.raw?Object.assign({},i):u}})},function(u){if((function(d){return Array.isArray(d?.issues)})(u))return{values:{},errors:kx(d8(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(Qx(function(){return Promise.resolve((r.mode==="sync"?m5:p5)(e,i,t)).then(function(u){return l.shouldUseNativeValidation&&Km({},l),{errors:{},values:r.raw?Object.assign({},i):u}})},function(u){if((function(d){return d instanceof mg})(u))return{values:{},errors:kx(f8(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 h8=ge("ZodISODateTime",(e,t)=>{x6.init(e,t),Et.init(e,t)});function m8(e){return _L(h8,e)}const p8=ge("ZodISODate",(e,t)=>{w6.init(e,t),Et.init(e,t)});function g8(e){return CL(p8,e)}const v8=ge("ZodISOTime",(e,t)=>{S6.init(e,t),Et.init(e,t)});function y8(e){return EL(v8,e)}const b8=ge("ZodISODuration",(e,t)=>{_6.init(e,t),Et.init(e,t)});function x8(e){return RL(b8,e)}const w8=(e,t)=>{mg.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>h5(e,r)},flatten:{value:r=>f5(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ym,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ym,2)}},isEmpty:{get(){return e.issues.length===0}}})},nr=ge("ZodError",w8,{Parent:Error}),S8=od(nr),_8=ld(nr),C8=cd(nr),E8=ud(nr),R8=y5(nr),j8=b5(nr),T8=x5(nr),O8=w5(nr),A8=S5(nr),M8=_5(nr),N8=C5(nr),D8=E5(nr),Xx=new WeakMap;function fd(e,t,r){const i=Object.getPrototypeOf(e);let o=Xx.get(i);if(o||(o=new Set,Xx.set(i,o)),!o.has(t)){o.add(t);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 Ut=ge("ZodType",(e,t)=>(Vt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ou(e,"input"),output:Ou(e,"output")}}),e.toJSONSchema=qL(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,i)=>S8(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>C8(e,r,i),e.parseAsync=async(r,i)=>_8(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>E8(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>R8(e,r,i),e.decode=(r,i)=>j8(e,r,i),e.encodeAsync=async(r,i)=>T8(e,r,i),e.decodeAsync=async(r,i)=>O8(e,r,i),e.safeEncode=(r,i)=>A8(e,r,i),e.safeDecode=(r,i)=>M8(e,r,i),e.safeEncodeAsync=async(r,i)=>N8(e,r,i),e.safeDecodeAsync=async(r,i)=>D8(e,r,i),fd(e,"ZodType",{check(...r){const i=this.def;return this.clone(Wa(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 ei(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(R$(r,i))},superRefine(r,i){return this.check(j$(r,i))},overwrite(r){return this.check(eo(r))},optional(){return tw(this)},exactOptional(){return h$(this)},nullable(){return nw(this)},nullish(){return tw(nw(this))},nonoptional(r){return b$(this,r)},array(){return r$(this)},or(r){return s$([this,r])},and(r){return l$(this,r)},transform(r){return rw(this,d$(r))},default(r){return g$(this,r)},prefault(r){return y$(this,r)},catch(r){return w$(this,r)},pipe(r){return rw(this,r)},readonly(){return C$(this)},describe(r){const i=this.clone();return tl.add(i,{description:r}),i},meta(...r){if(r.length===0)return tl.get(this);const i=this.clone();return tl.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 tl.get(e)?.description},configurable:!0}),e)),jC=ge("_ZodString",(e,t)=>{pg.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(i,o,l)=>ZL(e,i,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,fd(e,"_ZodString",{regex(...i){return this.check(AL(...i))},includes(...i){return this.check(DL(...i))},startsWith(...i){return this.check(kL(...i))},endsWith(...i){return this.check(zL(...i))},min(...i){return this.check(Tu(...i))},max(...i){return this.check(wC(...i))},length(...i){return this.check(SC(...i))},nonempty(...i){return this.check(Tu(1,...i))},lowercase(i){return this.check(ML(i))},uppercase(i){return this.check(NL(i))},trim(){return this.check($L())},normalize(...i){return this.check(LL(...i))},toLowerCase(){return this.check(IL())},toUpperCase(){return this.check(PL())},slugify(){return this.check(FL())}})}),k8=ge("ZodString",(e,t)=>{pg.init(e,t),jC.init(e,t),e.email=r=>e.check(nL(z8,r)),e.url=r=>e.check(oL(L8,r)),e.jwt=r=>e.check(SL(X8,r)),e.emoji=r=>e.check(lL($8,r)),e.guid=r=>e.check(Yx(Jx,r)),e.uuid=r=>e.check(rL(iu,r)),e.uuidv4=r=>e.check(aL(iu,r)),e.uuidv6=r=>e.check(iL(iu,r)),e.uuidv7=r=>e.check(sL(iu,r)),e.nanoid=r=>e.check(cL(I8,r)),e.guid=r=>e.check(Yx(Jx,r)),e.cuid=r=>e.check(uL(P8,r)),e.cuid2=r=>e.check(dL(F8,r)),e.ulid=r=>e.check(fL(V8,r)),e.base64=r=>e.check(bL(K8,r)),e.base64url=r=>e.check(xL(Y8,r)),e.xid=r=>e.check(hL(U8,r)),e.ksuid=r=>e.check(mL(H8,r)),e.ipv4=r=>e.check(pL(B8,r)),e.ipv6=r=>e.check(gL(q8,r)),e.cidrv4=r=>e.check(vL(G8,r)),e.cidrv6=r=>e.check(yL(Z8,r)),e.e164=r=>e.check(wL(Q8,r)),e.datetime=r=>e.check(m8(r)),e.date=r=>e.check(g8(r)),e.time=r=>e.check(y8(r)),e.duration=r=>e.check(x8(r))});function fu(e){return tL(k8,e)}const Et=ge("ZodStringFormat",(e,t)=>{St.init(e,t),jC.init(e,t)}),z8=ge("ZodEmail",(e,t)=>{d6.init(e,t),Et.init(e,t)}),Jx=ge("ZodGUID",(e,t)=>{c6.init(e,t),Et.init(e,t)}),iu=ge("ZodUUID",(e,t)=>{u6.init(e,t),Et.init(e,t)}),L8=ge("ZodURL",(e,t)=>{f6.init(e,t),Et.init(e,t)}),$8=ge("ZodEmoji",(e,t)=>{h6.init(e,t),Et.init(e,t)}),I8=ge("ZodNanoID",(e,t)=>{m6.init(e,t),Et.init(e,t)}),P8=ge("ZodCUID",(e,t)=>{p6.init(e,t),Et.init(e,t)}),F8=ge("ZodCUID2",(e,t)=>{g6.init(e,t),Et.init(e,t)}),V8=ge("ZodULID",(e,t)=>{v6.init(e,t),Et.init(e,t)}),U8=ge("ZodXID",(e,t)=>{y6.init(e,t),Et.init(e,t)}),H8=ge("ZodKSUID",(e,t)=>{b6.init(e,t),Et.init(e,t)}),B8=ge("ZodIPv4",(e,t)=>{C6.init(e,t),Et.init(e,t)}),q8=ge("ZodIPv6",(e,t)=>{E6.init(e,t),Et.init(e,t)}),G8=ge("ZodCIDRv4",(e,t)=>{R6.init(e,t),Et.init(e,t)}),Z8=ge("ZodCIDRv6",(e,t)=>{j6.init(e,t),Et.init(e,t)}),K8=ge("ZodBase64",(e,t)=>{T6.init(e,t),Et.init(e,t)}),Y8=ge("ZodBase64URL",(e,t)=>{A6.init(e,t),Et.init(e,t)}),Q8=ge("ZodE164",(e,t)=>{M6.init(e,t),Et.init(e,t)}),X8=ge("ZodJWT",(e,t)=>{D6.init(e,t),Et.init(e,t)}),J8=ge("ZodBoolean",(e,t)=>{k6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>KL(e,r,i)});function Wx(e){return jL(J8,e)}const W8=ge("ZodUnknown",(e,t)=>{z6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>QL()});function ew(){return TL(W8)}const e$=ge("ZodNever",(e,t)=>{L6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>YL(e,r,i)});function t$(e){return OL(e$,e)}const n$=ge("ZodArray",(e,t)=>{$6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>e8(e,r,i,o),e.element=t.element,fd(e,"ZodArray",{min(r,i){return this.check(Tu(r,i))},nonempty(r){return this.check(Tu(1,r))},max(r,i){return this.check(wC(r,i))},length(r,i){return this.check(SC(r,i))},unwrap(){return this.element}})});function r$(e,t){return VL(n$,e,t)}const a$=ge("ZodObject",(e,t)=>{P6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>t8(e,r,i,o),pt(e,"shape",()=>t.shape),fd(e,"ZodObject",{keyof(){return c$(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:ew()})},loose(){return this.clone({...this._zod.def,catchall:ew()})},strict(){return this.clone({...this._zod.def,catchall:t$()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return s5(this,r)},safeExtend(r){return o5(this,r)},merge(r){return l5(this,r)},pick(r){return a5(this,r)},omit(r){return i5(this,r)},partial(...r){return c5(TC,this,r[0])},required(...r){return u5(OC,this,r[0])}})});function vg(e,t){const r={type:"object",shape:e??{},...Ie(t)};return new a$(r)}const i$=ge("ZodUnion",(e,t)=>{F6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>n8(e,r,i,o),e.options=t.options});function s$(e,t){return new i$({type:"union",options:e,...Ie(t)})}const o$=ge("ZodIntersection",(e,t)=>{V6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>r8(e,r,i,o)});function l$(e,t){return new o$({type:"intersection",left:e,right:t})}const Jm=ge("ZodEnum",(e,t)=>{U6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(i,o,l)=>XL(e,i,o),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const l={};for(const u of i)if(r.has(u))l[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new Jm({...t,checks:[],...Ie(o),entries:l})},e.exclude=(i,o)=>{const l={...t.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 Jm({...t,checks:[],...Ie(o),entries:l})}});function c$(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Jm({type:"enum",entries:r,...Ie(t)})}const u$=ge("ZodTransform",(e,t)=>{H6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>WL(e,r),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new lC(e.constructor.name);r.addIssue=l=>{if(typeof l=="string")r.issues.push(gl(l,r.value,t));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(gl(u))}};const o=t.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 d$(e){return new u$({type:"transform",transform:e})}const TC=ge("ZodOptional",(e,t)=>{xC.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>RC(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function tw(e){return new TC({type:"optional",innerType:e})}const f$=ge("ZodExactOptional",(e,t)=>{B6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>RC(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function h$(e){return new f$({type:"optional",innerType:e})}const m$=ge("ZodNullable",(e,t)=>{q6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>a8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function nw(e){return new m$({type:"nullable",innerType:e})}const p$=ge("ZodDefault",(e,t)=>{G6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>s8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function g$(e,t){return new p$({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():dC(t)}})}const v$=ge("ZodPrefault",(e,t)=>{Z6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>o8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function y$(e,t){return new v$({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():dC(t)}})}const OC=ge("ZodNonOptional",(e,t)=>{K6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>i8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function b$(e,t){return new OC({type:"nonoptional",innerType:e,...Ie(t)})}const x$=ge("ZodCatch",(e,t)=>{Y6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>l8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function w$(e,t){return new x$({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const S$=ge("ZodPipe",(e,t)=>{Q6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>c8(e,r,i,o),e.in=t.in,e.out=t.out});function rw(e,t){return new S$({type:"pipe",in:e,out:t})}const _$=ge("ZodReadonly",(e,t)=>{X6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>u8(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function C$(e){return new _$({type:"readonly",innerType:e})}const E$=ge("ZodCustom",(e,t)=>{J6.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,o)=>JL(e,r)});function R$(e,t={}){return UL(E$,e,t)}function j$(e,t){return HL(e,t)}const T$=/\.(md|markdown)$/i,O$=/\.(png|jpe?g|gif|svg|webp|ico|bmp|avif)$/i,AC=/\.html?$/i,MC=/\.pdf$/i,A$=/\.(csv|tsv)$/i,M$=/\.(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 yg(e){if(e<1024)return e+" B";const t=["KB","MB","GB","TB"];let r=-1;do e/=1024,r++;while(e>=1024&&ri.path.toLowerCase()===r||i.path.toLowerCase()===r+".md")||t.find(i=>{const o=i.name.toLowerCase();return o===r||o===r+".md"})}async function Ni(e){try{if(navigator.clipboard)return await navigator.clipboard.writeText(e),!0}catch{}return!1}const DC="bdrive.lastProject";function D$(){try{return localStorage.getItem(DC)||""}catch{return""}}function k$(e){try{localStorage.setItem(DC,e)}catch{}}const kC="bdrive.fmPanel",z$="(min-width: 1400px)";function L$(){try{const e=localStorage.getItem(kC);if(e!==null)return e==="1"}catch{}return window.matchMedia(z$).matches}function $$(e){try{localStorage.setItem(kC,e?"1":"0")}catch{}}function hd(e){return e.user_name?`${e.user_name} <${e.user}>`:e.user||e.author||"unknown"}function I$({className:e,...t}){return f.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:f.jsx("table",{"data-slot":"table",className:We("w-full caption-bottom text-sm",e),...t})})}function P$({className:e,...t}){return f.jsx("thead",{"data-slot":"table-header",className:We("[&_tr]:border-b",e),...t})}function F$({className:e,...t}){return f.jsx("tbody",{"data-slot":"table-body",className:We("[&_tr:last-child]:border-0",e),...t})}function aw({className:e,...t}){return f.jsx("tr",{"data-slot":"table-row",className:We("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function iw({className:e,...t}){return f.jsx("th",{"data-slot":"table-head",className:We("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),...t})}function V$({className:e,...t}){return f.jsx("td",{"data-slot":"table-cell",className:We("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function U$({header:e}){const t=e.column.getIsSorted();return e.column.getCanSort()?f.jsx(iw,{"data-sort":t||void 0,"aria-sort":t==="asc"?"ascending":t==="desc"?"descending":"none",children:f.jsxs("button",{type:"button",className:"th-sort",onClick:e.column.getToggleSortingHandler(),children:[Bm(e.column.columnDef.header,e.getContext()),t==="asc"?" ↑":t==="desc"?" ↓":""]})}):f.jsx(iw,{children:Bm(e.column.columnDef.header,e.getContext())})}function zC({table:e,className:t}){return f.jsx("div",{className:"admin-list admin-card-table"+(t?" "+t:""),children:f.jsxs(I$,{className:"admin-table",children:[f.jsx(P$,{children:e.getHeaderGroups().map(r=>f.jsx(aw,{children:r.headers.map(i=>f.jsx(U$,{header:i},i.id))},r.id))}),f.jsx(F$,{children:e.getRowModel().rows.map(r=>f.jsx(aw,{className:"admin-item",children:r.getVisibleCells().map(i=>f.jsx(V$,{children:Bm(i.column.columnDef.cell,i.getContext())},i.id))},r.id))})]})})}function LC(e){return e?"expires "+new Date(e).toLocaleDateString():"no expiry"}function H$(e){if(e.opens===void 0)return null;if(e.opens===0)return"not opened yet";const t=`${e.opens} open${e.opens===1?"":"s"}`;return e.last_opened?`${t} · last opened ${new Date(e.last_opened).toLocaleDateString()}`:t}function $C(e,t){const r=[];t&&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(LC(e.expires));const i=H$(e);return i&&r.push(i),r.join(" · ")}const IC="Opens count how many times a file has been read through a public link. Repeat opens from the same browser and network within 10 minutes count once — two people on one network using the same browser still count as one.";function PC({shares:e,onChanged:t,showProject:r=!1,canRevoke:i=!0,empty:o="No public shares.",loading:l=!1}){const[u,d]=S.useState([]),m=S.useMemo(()=>L_(),[]),p=S.useMemo(()=>[m.accessor("path",{header:"Path",cell:v=>f.jsx("a",{className:"ai-main mono",title:v.getValue(),...Qs(Oi(v.getValue(),v.row.original.project)),children:v.getValue()})}),m.accessor(v=>$C(v,r),{id:"detail",header:r?"Project":"Shared",cell:v=>f.jsx("span",{className:"ai-tag",children:v.getValue()})}),m.display({id:"actions",header:"",cell:v=>f.jsxs("span",{className:"share-acts",children:[f.jsx("button",{className:"ai-btn","aria-label":`Copy the public link to ${v.row.original.path}`,title:"Copy link",onClick:()=>Ni(v.row.original.url).then(b=>qe(b?"Copied.":"Select and copy the link.")),children:f.jsx(nt,{name:"copy"})}),i&&f.jsx("button",{className:"ai-del","aria-label":`Revoke the share of ${v.row.original.path}`,onClick:()=>FC(v.row.original,t),children:"Revoke"})]})})],[m,t,r,i]),y=K_({data:e,columns:p,state:{sorting:u},onSortingChange:d,getCoreRowModel:G_(),getSortedRowModel:Z_()});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(zC,{table:y,className:"shares-table"})}async function FC(e,t){if(await za("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),qe("Share revoked."),t()}catch(r){qe(r.message,!0)}}const B$=vg({name:fu().trim().min(1,"Give the organization a name.").max(60,"Keep it under 60 characters.")});function q$({org:e,projects:t,myEmail:r}){const i=ki(),o=e.role==="owner",l=()=>i.invalidateQueries({queryKey:["orgs"]}),u=()=>i.invalidateQueries({queryKey:["invites",e.id]}),d=()=>i.invalidateQueries({queryKey:["orgShares",e.id]}),m=lg({resolver:gg(B$),values:{name:e.name}}),{data:p}=Ft({queryKey:["invites",e.id],queryFn:()=>qt(`/api/orgs/${e.id}/invites`),enabled:o,select:x=>x.invites||[]}),{data:y,isLoading:v}=Ft({queryKey:["orgShares",e.id],queryFn:()=>qt(`/api/orgs/${e.id}/shares`),enabled:o,select:x=>x.shares||[]}),b=t.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:m.handleSubmit(async({name:x})=>{try{await Wn("PATCH","/api/orgs/"+e.id,{name:x}),qe("Renamed."),l()}catch(w){qe(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":!!m.formState.errors.name,"aria-describedby":m.formState.errors.name?"org-rename-err":void 0,...m.register("name")}),f.jsx(xt,{variant:"subtle",id:"org-rename-btn",type:"submit",disabled:!m.formState.isDirty,children:"Rename org"}),m.formState.errors.name&&f.jsx("span",{id:"org-rename-err",role:"alert",className:"field-err",children:m.formState.errors.name.message})]}),f.jsx("h3",{children:"Members"}),f.jsx(G$,{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(xt,{variant:"primary",onClick:async()=>{try{const x=await ea(`/api/orgs/${e.id}/invites`),w=await Ni(x.url);qe(w?"Invite link copied to clipboard.":"Invite created — copy it from the list below."),u()}catch(x){qe(x.message,!0)}},children:"New invite"})]}),f.jsxs("div",{className:"admin-list",children:[p&&p.length===0&&f.jsx("div",{className:"admin-empty",children:"No active invite links."}),(p||[]).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:()=>Ni(x.url).then(w=>qe(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 za("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}`),qe("Revoked."),u()}catch(w){qe(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(PC,{shares:y||[],loading:v,onChanged:d,showProject:!0})]})]})}function G$({org:e,owner:t,myEmail:r,onChanged:i}){const[o,l]=S.useState([{id:"email",desc:!1}]),u=S.useMemo(()=>L_(),[]),d=S.useMemo(()=>[u.accessor("email",{id:"email",header:"Member",cell:p=>{const y=!!r&&p.getValue().toLowerCase()===r.toLowerCase();return f.jsx("span",{className:"ai-main",title:p.getValue(),children:p.getValue()+(y?" (you)":"")})}}),u.accessor("role",{id:"role",header:"Role",cell:p=>{const y=p.row.original,v=!!r&&y.email.toLowerCase()===r.toLowerCase();return!t||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}),qe("Role updated.")}catch(x){qe(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 za("Remove member",`Remove ${y.email} from ${e.name}?`,"Remove",!0))try{await Wn("DELETE",`/api/orgs/${e.id}/members/${encodeURIComponent(y.email)}`),qe("Removed."),i()}catch(b){qe(b.message,!0)}},children:"Remove"})]})}})],[u,e.id,e.name,t,r]),m=K_({data:e.members,columns:d,state:{sorting:o},onSortingChange:l,getCoreRowModel:G_(),getSortedRowModel:Z_()});return f.jsx(zC,{table:m})}const Z$=vg({require_verification:Wx(),require_approval:Wx()});function K$(){const e=ki(),{data:t,error:r}=Ft({queryKey:["admin","policy"],queryFn:()=>qt("/api/admin/policy")}),{data:i}=A_(!0),o=lg({resolver:gg(Z$),values:t?{require_verification:t.require_verification&&t.mailer,require_approval:t.require_approval}:{require_verification:!1,require_approval:!1}});if(S.useEffect(()=>{r&&qe(r.message,!0)},[r]),!t)return null;const l=async(u,d,m)=>{try{await ea(`/api/admin/pending/${u}/${d}`),qe((d==="approve"?"Approved ":"Denied ")+m),e.invalidateQueries({queryKey:["admin","pending"]})}catch(p){qe(p.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 ea("/api/admin/policy",u),qe("Signup policy saved."),e.invalidateQueries({queryKey:["admin","policy"]})}catch(d){qe(d.message,!0)}}),children:[f.jsxs("div",{className:"admin-list",children:[f.jsx(sw,{label:"Require email verification",desc:t.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:!t.mailer,inputProps:o.register("require_verification")}),f.jsx(sw,{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(xt,{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:t.allowed_domains&&t.allowed_domains.length?t.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:t.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:t.admins&&t.admins.length?t.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(xt,{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 sw({label:e,desc:t,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:t})]}),f.jsx("input",{type:"checkbox",disabled:r,...i})]})}function Y$({...e}){return f.jsx(m1,{"data-slot":"select",...e})}function Q$({...e}){return f.jsx(y1,{"data-slot":"select-value",...e})}function X$({className:e,size:t="default",children:r,...i}){return f.jsxs(g1,{"data-slot":"select-trigger","data-size":t,className:We("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(b1,{asChild:!0,children:f.jsx(Kp,{className:"size-4 opacity-50"})})]})}function J$({className:e,children:t,position:r="item-aligned",align:i="center",...o}){return f.jsx(w1,{children:f.jsxs(S1,{"data-slot":"select-content",className:We("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(eI,{}),f.jsx(j1,{className:We("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),f.jsx(tI,{})]})})}function W$({className:e,children:t,...r}){return f.jsxs(M1,{"data-slot":"select-item",className:We("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(k1,{children:f.jsx(g_,{className:"size-4"})})}),f.jsx(N1,{children:t})]})}function eI({className:e,...t}){return f.jsx(z1,{"data-slot":"select-scroll-up-button",className:We("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(yk,{className:"size-4"})})}function tI({className:e,...t}){return f.jsx(L1,{"data-slot":"select-scroll-down-button",className:We("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(Kp,{className:"size-4"})})}const ow=["#5b8def","#f5a623","#4cc38a","#e0679b","#8b7bf0","#3ec8c8","#e6934a"];function vl(e){let t=0;for(const r of e)t=t*31+r.charCodeAt(0)>>>0;return ow[t%ow.length]}function rm({projects:e,currentId:t,menu:r,onNew:i}){const o=e.find(l=>l.id===t);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(Y$,{value:t||"",onValueChange:l=>{l&&l!==t&&(Yt("/"+l),hr())},children:[f.jsxs(X$,{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:vl(o.name)},children:f.jsx(Vs,{name:o.icon})}),o?f.jsx("span",{"data-slot":"select-value",children:o.name}):f.jsx(Q$,{placeholder:"Select a project"})]}),f.jsx(J$,{className:"proj-menu",position:"popper",sideOffset:4,children:e.map(l=>f.jsxs(W$,{value:l.id,children:[f.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:vl(l.name)},children:f.jsx(Vs,{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,m])=>f.jsx("li",{children:f.jsxs("div",{id:"nav-"+l,className:"row"+(r.active===l?" active":""),role:"button",tabIndex:0,onClick:m,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),m())},children:[f.jsx(nt,{name:d}),f.jsx("span",{className:"label",children:u})]})},l))})]})}function VC({...e}){return f.jsx(QM,{"data-slot":"dropdown-menu",...e})}function UC({...e}){return f.jsx(XM,{"data-slot":"dropdown-menu-trigger",...e})}function HC({className:e,sideOffset:t=4,...r}){return f.jsx(JM,{children:f.jsx(WM,{"data-slot":"dropdown-menu-content",sideOffset:t,className:We("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 Is({className:e,inset:t,variant:r="default",...i}){return f.jsx(tN,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:We("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 am({className:e,inset:t,...r}){return f.jsx(eN,{"data-slot":"dropdown-menu-label","data-inset":t,className:We("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}const nI="https://github.com/runbear-io/beardrive";function rI(){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 aI({me:e,org:t,admin:r,orgActive:i,billing:o}){const l=e.name||e.email,[u,d]=S.useState(!1),m=t?Qs(t.manage_url):null,p=o?Qs(o.url):null;return f.jsxs("footer",{id:"accountbar",children:[f.jsxs("a",{className:"gh-star",href:nI,target:"_blank",rel:"noreferrer",children:[f.jsx(rI,{}),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(VC,{modal:!1,open:u,onOpenChange:d,children:[f.jsx(UC,{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:vl(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(nt,{name:"chev"})]})}),f.jsxs(HC,{id:"account-menu",side:"top",align:"start",sideOffset:6,className:"acct-menu",children:[t&&f.jsxs(f.Fragment,{children:[f.jsx(am,{className:"menu-sec",children:"Organization"}),f.jsx(Is,{asChild:!0,children:f.jsxs("a",{id:"menu-org-settings","aria-current":i?"page":void 0,...m,onClick:y=>{m?.onClick?.(y),d(!1)},children:[f.jsx(nt,{name:"gear"}),f.jsxs("span",{children:[f.jsx("b",{children:t.name})," Settings"]}),!t.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(Is,{asChild:!0,children:f.jsxs("a",{id:"menu-billing",...p,onClick:y=>{p?.onClick?.(y),d(!1)},children:[f.jsx(nt,{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(am,{className:"menu-sec",children:"Hub"}),f.jsxs(Is,{id:"menu-hub-admin",onSelect:r.onClick,children:[f.jsx(nt,{name:"shield"}),f.jsxs("span",{children:["Signup & access",r.pending?` · ${r.pending}`:""]})]})]}),f.jsx(am,{className:"menu-sec",children:"Account"}),f.jsx(Is,{asChild:!0,children:f.jsxs("a",{id:"signout",href:"/auth/logout",children:[f.jsx(nt,{name:"power"}),f.jsx("span",{children:"Log out"})]})})]})]})]})}function Pa({className:e,...t}){return f.jsx("div",{"data-slot":"card",className:We("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Fa({className:e,...t}){return f.jsx("div",{"data-slot":"card-header",className:We("@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),...t})}function Va({className:e,...t}){return f.jsx("div",{"data-slot":"card-title",className:We("leading-none font-semibold",e),...t})}function qs({className:e,...t}){return f.jsx("div",{"data-slot":"card-description",className:We("text-muted-foreground text-sm",e),...t})}function Ua({className:e,...t}){return f.jsx("div",{"data-slot":"card-content",className:We("px-6",e),...t})}function ta({className:e,orientation:t="horizontal",decorative:r=!0,...i}){return f.jsx(NN,{"data-slot":"separator",decorative:r,orientation:t,className:We("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 iI({url:e}){const t=Ft({queryKey:["billing"],queryFn:()=>qt(e)});if(t.isLoading)return f.jsx("div",{className:"empty",children:"Loading…"});if(t.error||!t.data)return f.jsxs("div",{className:"empty",children:[f.jsx("h3",{children:"Billing is unavailable"}),f.jsx("p",{children:t.error?.message||"Try again shortly."})]});const r=t.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(Pa,{children:[f.jsxs(Fa,{children:[f.jsxs(Va,{children:[r.plan.name," plan",r.plan.status?` (${r.plan.status})`:""]}),f.jsxs(qs,{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(ta,{}),f.jsx(Ua,{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(Pa,{children:[f.jsxs(Fa,{children:[f.jsx(Va,{children:i.name}),f.jsx(qs,{children:i.blurb})]}),f.jsx(ta,{}),f.jsxs(Ua,{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(xt,{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(Pa,{children:[f.jsxs(Fa,{children:[f.jsx(Va,{children:"Manage subscription"}),f.jsx(qs,{children:"Change seats, update the card, download invoices, or cancel."})]}),f.jsx(ta,{}),f.jsx(Ua,{children:f.jsx("form",{method:"post",action:r.portal_url,children:f.jsx(xt,{type:"submit",variant:"subtle",children:"Open the billing portal"})})})]})]})}function hu({className:e,type:t,...r}){return f.jsx("input",{type:t,"data-slot":"input",className:We("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 im({className:e,...t}){return f.jsx(rN,{"data-slot":"label",className:We("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),...t})}function sI({className:e,...t}){return f.jsx("textarea",{"data-slot":"textarea",className:We("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),...t})}const lw={read:1,write:2,admin:3};function _i(e,t){return(lw[e||""]||0)>=(lw[t]||0)}const Wm=280,oI=vg({name:fu().trim().min(1,"Give the project a name.").max(120,"Keep the name under 120 characters."),description:fu().max(Wm,`Keep the description under ${Wm} characters.`),icon:fu()});function lI({project:e,org:t,onDeleted:r}){const i=M_(),o=_i(e.perm,"admin"),l=lg({resolver:gg(oI),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"),m=l.handleSubmit(async p=>{const y=l.formState.dirtyFields,v={};if(y.name&&(v.name=p.name.trim()),y.description&&(v.description=p.description),y.icon&&(v.icon=p.icon),Object.keys(v).length!==0)try{await Wn("PATCH","/api/projects/"+e.id,v),qe("Saved."),l.reset({...p,name:p.name.trim()}),await i()}catch(b){qe(b.message,!0)}});return f.jsxs("div",{className:"project-settings",children:[f.jsxs("h2",{children:[e.name,!_i(e.perm,"write")&&f.jsx("span",{className:"ps-chip",children:"Read-only"})]}),f.jsxs(Pa,{children:[f.jsxs(Fa,{children:[f.jsx(Va,{children:"General"}),f.jsx(qs,{children:"Name, description and icon for this project."})]}),f.jsx(ta,{}),f.jsx(Ua,{children:f.jsxs("form",{className:"ps-form",onSubmit:m,children:[f.jsxs("div",{className:"ps-field",children:[f.jsx(im,{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:vl(e.name)},children:f.jsx(Vs,{name:u})}),f.jsxs(VC,{children:[f.jsx(UC,{asChild:!0,children:f.jsx(xt,{id:"ps-icon-btn",type:"button",variant:"subtle",disabled:!o,children:"Change"})}),f.jsxs(HC,{align:"start",className:"ps-icon-grid",children:[f.jsx(Is,{className:"ps-icon-cell"+(u===""?" active":""),title:"Default","aria-label":"Default icon",onSelect:()=>l.setValue("icon","",{shouldDirty:!0}),children:f.jsx(Vs,{})}),Object.keys(Lm).map(p=>f.jsx(Is,{className:"ps-icon-cell"+(u===p?" active":""),title:p,"aria-label":p,onSelect:()=>l.setValue("icon",p,{shouldDirty:!0}),children:f.jsx(Vs,{name:p})},p))]})]})]})]}),f.jsxs("div",{className:"ps-field",children:[f.jsx(im,{htmlFor:"ps-name",children:"Name"}),f.jsx(hu,{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(im,{htmlFor:"ps-desc",children:["Description ",f.jsx("span",{className:"ps-opt",children:"(optional)"})]}),f.jsx(sI,{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," / ",Wm]})]})]}),o&&f.jsxs(f.Fragment,{children:[f.jsx(ta,{}),f.jsx("div",{className:"ps-actions",children:f.jsx(xt,{id:"ps-save",type:"submit",variant:"primary",disabled:!l.formState.isDirty||l.formState.isSubmitting,children:"Save changes"})})]})]})})]}),f.jsx(cI,{project:e}),f.jsx(dI,{project:e,org:t}),f.jsxs(Pa,{children:[f.jsx(Fa,{children:f.jsx(Va,{children:"About"})}),f.jsx(ta,{}),f.jsxs(Ua,{children:[f.jsxs("dl",{className:"ps-facts",children:[f.jsx("dt",{children:"Project id"}),f.jsx("dd",{children:f.jsx("code",{children:e.id})}),t&&f.jsxs(f.Fragment,{children:[f.jsx("dt",{children:"Workspace"}),f.jsx("dd",{children:t.name})]}),e.created&&f.jsxs(f.Fragment,{children:[f.jsx("dt",{children:"Created"}),f.jsx("dd",{children:new Date(e.created).toLocaleDateString()})]})]}),f.jsxs("p",{className:"ps-note ps-export",children:[f.jsx("strong",{children:"Take your files elsewhere."})," Run ",f.jsx("code",{children:"bdrive export"})," in the synced folder to write the whole project — every device's journal and every content blob, so full history and authorship — into a single archive. ",f.jsx("code",{children:"bdrive import"})," restores it into any other BearDrive hub, self-hosted or cloud. Export warns first if this device still has changes it hasn't pushed."," ",f.jsx("a",{href:"https://docs.beardrive.ai/reference/migration/",target:"_blank",rel:"noreferrer",children:"How migration works →"})]})]})]}),o&&f.jsxs(Pa,{className:"ps-danger",children:[f.jsx(Fa,{children:f.jsx(Va,{children:"Danger zone"})}),f.jsx(ta,{}),f.jsxs(Ua,{children:[f.jsx("p",{children:"Deleting removes the project from this hub. Its files stay in storage. This can't be undone."}),f.jsx(xt,{variant:"danger",onClick:async()=>{if(await T_(`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),qe(`Deleted “${e.name}”.`),await r()}catch(y){qe(y.message,!0)}},children:"Delete project"})]})]})]})}function cI({project:e}){const t=ki(),{data:r,error:i,isLoading:o}=O_(e.id);return i?null:f.jsxs(Pa,{children:[f.jsxs(Fa,{children:[f.jsx(Va,{children:"Public links"}),f.jsxs(qs,{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:[" ",IC]})]})]}),f.jsx(ta,{}),f.jsx(Ua,{children:f.jsx(PC,{shares:r||[],loading:o,canRevoke:_i(e.perm,"write"),onChanged:()=>t.invalidateQueries({queryKey:["shares",e.id]}),empty:"No public links."})})]})}const ep=[{value:"admin",label:"Admin"},{value:"write",label:"Write"},{value:"read",label:"Read"},{value:"none",label:"No access"}],uI=Object.fromEntries(ep.map(e=>[e.value,e.label]));function dI({project:e,org:t}){const r=ki(),{data:i,error:o}=z3(e.id),l=_i(e.perm,"admin"),u=()=>{r.invalidateQueries({queryKey:["permissions",e.id]}),r.invalidateQueries({queryKey:["projects"]})},d=async(x,w)=>{try{await x(),qe(w)}catch(_){qe(_.message,!0)}u()};if(o||!i)return null;const m=i,p=`/api/p/${e.id}/permissions`,y=new Set((t?.members||[]).filter(x=>x.role==="owner").map(x=>x.email.toLowerCase())),v=[...m.grants.filter(x=>!y.has(x.email.toLowerCase())),...[...y].sort().map(x=>({email:x,level:"admin",owner:!0}))],b=async()=>{const x=await T_("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",`${p}/${encodeURIComponent(x.trim())}`,{level:"read"}),"Added.")};return f.jsxs(Pa,{className:"ps-people",children:[f.jsxs(Fa,{children:[f.jsx(Va,{children:"People"}),f.jsx(qs,{children:"Who can see and change this project."})]}),f.jsx(ta,{}),f.jsxs(Ua,{children:[f.jsxs("p",{className:"ps-row",children:[f.jsxs("span",{children:["Everyone in ",t?.name||"this workspace"," can"]}),f.jsx("select",{"aria-label":"Default access for workspace members",disabled:!l,value:m.default,onChange:async x=>{const w=x.target.value;if(w==="none"&&!await za("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",p,{default:w}),"Default access updated.")},children:ep.filter(x=>x.value!=="admin").map(x=>f.jsx("option",{value:x.value,children:x.label},x.value))})]}),m.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(xt,{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,m.creator&&x.email.toLowerCase()===m.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",`${p}/${encodeURIComponent(x.email)}`,{level:_.target.value}),`${x.email} is now ${uI[_.target.value]||_.target.value}.`),children:ep.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",`${p}/${encodeURIComponent(x.email)}`),"Reverted to the default access."),children:"Remove"})]})]},x.email)})})]})]})}const BC="https://raw.githubusercontent.com/runbear-io/beardrive/main/INSTALL_FOR_AGENTS.md";function qC({project:e,existing:t}){const r=window.location.origin,i=t?'. 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 "+BC+` 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:vl(e.name)},children:f.jsx(Vs,{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:t?"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:"}),t&&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(tp,{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. Install the CLI, point it at this hub, then bdrive init registers the sync hooks and starts syncing."}),f.jsx(tp,{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 tp({code:e}){const[t,r]=S.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 Ni(e)?"Copied":"Copy failed"),setTimeout(()=>r("Copy"),1400)},children:t})]})}function lI({onNew:e,canCreate:t}){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."}),t&&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(xt,{variant:"primary",id:"ob-new",onClick:e,children:"New project"})]}),f.jsxs("div",{className:"ob-card ob-agent",children:[f.jsx("h3",{children:t?"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(tp,{code:"Follow "+HC+` -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 qC="__existing__";function cI({templates:e,onCreate:t,onClose:r}){const i=[...e.map(x=>({value:x.name,title:x.title,blurb:x.blurb,rule:!1})),{value:qC,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),[m,p]=S.useState(""),[y,v]=S.useState(!1),b=async()=>{if(!y){if(!o.trim()){p("Give it a name.");return}v(!0);try{await t(o.trim(),u)}finally{v(!1)}}};return f.jsx(Wu,{open:!0,onOpenChange:x=>!x&&r(),children:f.jsxs(ed,{className:"modal",showCloseButton:!1,children:[f.jsx(El,{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":!!m,"aria-describedby":m?"modal-input-err":void 0,onChange:x=>{l(x.currentTarget.value),m&&p("")},onKeyDown:x=>x.key==="Enter"&&b()}),m&&f.jsx("span",{id:"modal-input-err",role:"alert",className:"field-err",children:m}),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(xt,{variant:"subtle",onClick:r,children:"Cancel"}),f.jsx(xt,{variant:"primary",onClick:b,disabled:y,children:"Create"})]})]})})}function sm(e,t,r){if(!e)return null;if(!r)return e[t]||null;const i={human:0,agent:0,share:0};for(const[o,l]of Object.entries(e))o.startsWith(t+"/")&&(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 na(e){return(e.human||0)+(e.agent||0)+(e.share||0)}function nl(e){const t=na(e);if(!t)return"";const r=t+(t===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(", ")+")"}const Ci="Includes your own views. Repeat opens by the same reader inside 10 minutes count once.";function uI(e){const t=na(e);return t?t<3?1:t<10?2:t<30?3:4:0}function dI(e){const t=na(e);return t?{agent:(e.agent||0)/t,human:(e.human||0)/t,share:(e.share||0)/t}:{agent:0,human:0,share:0}}function fI(e,t){return e?Object.keys(e).filter(r=>!t.has(r)).sort():[]}const hI=7;function mI(e){if(!e.length)return null;let t=e[0],r=e[0];for(const i of e)ir&&(r=i);return{min:t,max:r}}const pI=(e,t)=>t-el.reads-o.reads).slice(0,vI)){const o=i.path.split("/").pop();let l=i.cx+i.r+4,u="start";l+o.length*yI>t.right&&(l=i.cx-i.r-4,u="end");const d=p=>r.every(y=>Math.abs(y.y-p)>=om);let m=i.cy;for(;m<=t.bottom&&!d(m);)m+=om;if(m>t.bottom)for(m=i.cy;m>=t.top&&!d(m);)m-=om;r.push({path:i.path,name:o,x:l,y:Math.min(t.bottom,Math.max(t.top,m)),anchor:u})}return r}const rl=3,ks=30,GC=(e,t)=>e>=rl&&t>=ks;function xI(e,t=Date.now()){if(!e)return null;const r=new Date(e).getTime();return Number.isFinite(r)?Math.max(0,(t-r)/864e5):null}function wI(e){const t=new Intl.RelativeTimeFormat("en",{numeric:"always"});return e<30?t.format(-Math.round(e),"day"):e<365?t.format(-Math.round(e/30),"month"):t.format(-Math.round(e/365),"year")}function ZC(e,t){const r=xI(t);return!e||r===null||!GC(na(e),r)?"":`stale · last changed ${wI(r)}`}function SI(e,t=!0){const r=Ft({queryKey:["tree",e],queryFn:()=>qt(e+"tree"),enabled:t,refetchInterval:15e3}),i=S.useMemo(()=>{const o=[],l=new Map,u=d=>{for(const m of d.children||[])m.dir?(l.set(m.path,m),u(m)):o.push(m)};return r.data&&u(r.data),{flatFiles:o,dirIndex:l}},[r.data]);return{tree:r.data,...i,loaded:!!r.data}}function _I(e,t){return Ft({queryKey:["heat",e],queryFn:()=>qt(e+"heat?days=30"),enabled:t,staleTime:6e4,refetchInterval:6e4}).data?.entries??null}function CI(e,t,r){return Ft({queryKey:["history",e,"prefix",t,20],queryFn:()=>qt(e+"history?prefix="+encodeURIComponent(t)+"&n=20"),enabled:r,staleTime:15e3}).data?.entries??null}function EI(e,t,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 m=+l;if(Number.isInteger(m)&&m>=0&&mi[y]!==p))&&(i=d,o=t(...d),r?.onChange&&!(l&&r.skipInitialOnChange)&&r.onChange(o),l=!1),o}return u.updateDeps=d=>{i=d},u}function cw(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const RI=(e,t)=>Math.abs(e-t)<1.01,jI=(e,t,r)=>{let i;return function(...o){e.clearTimeout(i),i=e.setTimeout(()=>t.apply(this,o),r)}};let Xo;const lm=()=>{if(Xo!==void 0)return Xo;if(typeof navigator>"u")return Xo=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Xo=!0;const e=navigator.maxTouchPoints;return Xo=navigator.platform==="MacIntel"&&e!==void 0&&e>0},uw=e=>{const{offsetWidth:t,offsetHeight:r}=e;return{width:t,height:r}},TI=e=>e,OI=e=>{const t=Math.max(e.startIndex-e.overscan,0),i=Math.min(e.endIndex+e.overscan,e.count-1)-t+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:m}=u;t({width:Math.round(d),height:Math.round(m)})};if(o(uw(r)),!i.ResizeObserver)return()=>{};const l=new i.ResizeObserver(u=>{const d=()=>{const m=u[0];if(m?.borderBoxSize){const p=m.borderBoxSize[0];if(p){o({width:p.inlineSize,height:p.blockSize});return}}o(uw(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return l.observe(r,{box:"border-box"}),()=>{l.unobserve(r)}},Au={passive:!0},MI=typeof window>"u"?!0:"onscrollend"in window,NI=(e,t,r)=>{const i=e.scrollElement;if(!i)return;const o=e.targetWindow;if(!o)return;const l=e.options.useScrollendEvent&&MI;let u=0;const d=l?null:jI(o,()=>t(u,!1),e.options.isScrollingResetDelay),m=v=>()=>{u=r(i),d?.(),t(u,v)},p=m(!0),y=m(!1);return i.addEventListener("scroll",p,Au),l&&i.addEventListener("scrollend",y,Au),()=>{i.removeEventListener("scroll",p),l&&i.removeEventListener("scrollend",y)}},DI=(e,t)=>NI(e,t,r=>{const{horizontal:i,isRtl:o}=e.options;return i?r.scrollLeft*(o&&-1||1):r.scrollTop}),kI=(e,t,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(t?.borderBoxSize){const i=t.borderBoxSize[0];if(i)return Math.round(i[r.options.horizontal?"inlineSize":"blockSize"])}if(!t){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"]},zI=(e,{adjustments:t=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+t,behavior:r})},LI=zI;class $I{constructor(t){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,m=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[p,y]of this.elementsCache)if(y===d){this.elementsCache.delete(p);break}return}this.shouldMeasureDuringScroll(m)&&this.resizeItem(m,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:TI,rangeExtractor:OI,onChange:()=>{},measureElement:kI,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,m=null,p=!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)){p=!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)&&(m=M)}}this.options=l,p&&(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||m)&&(this.pendingScrollAnchor=[y?d[0]:null,y?d[1]:0,m,v])},this.notify=r=>{var i,o;(o=(i=this.options).onChange)==null||o.call(i,this,r)},this.maybeNotify=Ns(()=>(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,!(!lm()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};l.addEventListener("touchstart",u,Au),l.addEventListener("touchend",d,Au),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,m]=o;l!==null&&!d&&(lm()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?m!==0&&(this._iosDeferredAdjustment+=m):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=Ns(()=>[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,m,p)=>(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:m,gap:p}),{key:!1}),this.getMeasurements=Ns(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:r,paddingStart:i,scrollMargin:o,getItemKey:l,enabled:u,lanes:d,laneAssignmentMode:m,gap:p},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&&k.set(T.subarray(0,b*2)),T=k,this._flatMeasurements=T}let O;if(b===0)O=i+o;else{const k=b-1;O=T[k*2]+T[k*2+1]+p}for(let k=b;k1){M=O;const ne=w[M],ce=ne!==void 0?x[ne]:void 0;k=ce?ce.end+p:i+o}else if(E===d){let ne=0,ce=_[0],me=w[0];for(let fe=1;fethis.options.debug}),this.calculateRange=Ns(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(r,i,o,l)=>r.length===0||i===0?(this.range=null,null):(this.range=PI(r,i,o,l,l===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ns(()=>{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,m;const p=this._flatMeasurements;if(this.options.lanes===1&&p!==null)m=this.options.getItemKey(r),d=p[r*2],u=p[r*2+1];else{const b=this.measurementsCache[r];if(!b)return;m=b.key,d=b.start,u=b.size}const y=this.itemSizeCache.get(m)??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:m,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=KC(0,i.length-1,l?d=>o[d*2]:d=>cw(i[d]).start,r);return cw(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,m=this.now();this.scrollState={index:r,align:d,behavior:o,startedAt:m,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(t)}applyScrollAdjustment(t,r){t!==0&&(lm()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=t:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,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&&RI(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,m=Math.abs(o-this.getScrollOffset()),p=this.scrollState.behavior==="smooth"&&m>d;this.scrollState.lastTargetOffset=o,p||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:p?"smooth":"auto"})}this.scheduleScrollReconcile()}}const KC=(e,t,r,i)=>{for(;e<=t;){const o=(e+t)/2|0,l=r(o);if(li)t=o-1;else return o}return e>0?e-1:0};function II(e,t,r){let i=0;for(;i<=t;){const o=(i+t)/2|0,l=e[o*2];if(lr)t=o-1;else return o}return i>0?i-1:0}function PI(e,t,r,i,o){const l=e.length-1;if(e.length<=i)return{startIndex:0,endIndex:l};if(i===1&&o!==null){const p=II(o,l,r);let y=p;const v=r+t;for(;ye[p].start,r),m=d;if(i===1)for(;m1){const p=Array(i).fill(0);for(;mv=0&&y.some(v=>v>=r);){const v=e[d];y[v.lane]=v.start,d--}d=Math.max(0,d-d%i),m=Math.min(l,m+(i-1-m%i))}return{startIndex:d,endIndex:m}}const cm=typeof document<"u"?S.useLayoutEffect:S.useEffect;function FI({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:r="transform",...i}){const o=S.useReducer(p=>p+1,0)[1],l=S.useRef({enabled:t,mode:r,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});l.current.enabled=t,l.current.mode=r;const u=p=>{const y=l.current;if(!y.enabled||!y.container)return;const v=p.getTotalSize();if(v!==y.lastSize){y.lastSize=v;const R=p.options.horizontal?"width":"height";y.container.style[R]=`${v}px`}const b=!!p.options.horizontal,x=y.mode==="transform",w=b?"left":"top",_=p.options.scrollMargin,E=p.getVirtualItems();for(const R of E){const T=R.start-_,O=p.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:(p,y)=>{var v;const b=l.current;let x=!0;if(b.enabled){u(p);const w=p.range,_=b.prevRange;x=!_||_.isScrolling!==p.isScrolling||_.startIndex!==w?.startIndex||_.endIndex!==w?.endIndex,x&&(b.prevRange=w?{startIndex:w.startIndex,endIndex:w.endIndex,isScrolling:p.isScrolling}:null)}x&&(e&&y?zi.flushSync(o):o()),(v=i.onChange)==null||v.call(i,p,y)}},[m]=S.useState(()=>{const p=new $I(d);return Object.assign(p,{containerRef:y=>{const v=l.current;if(v.container=y,v.lastSize=null,y&&v.enabled){const b=p.getTotalSize();v.lastSize=b;const x=p.options.horizontal?"width":"height";y.style[x]=`${b}px`}}})});return m.setOptions(d),cm(()=>m._didMount(),[]),cm(()=>m._willUpdate()),cm(()=>{u(m)}),m}function VI(e){return FI({observeElementRect:AI,observeElementOffset:DI,scrollToFn:LI,...e})}function UI(e,t){const r=[],i=(o,l)=>{for(const u of o)r.push({node:u,depth:l}),u.dir&&t.has(u.path)&&i(u.children||[],l+1)};return i(e?.children||[],0),r}function HI(e){const{root:t,expanded:r,onToggle:i,currentPath:o,listingShowing:l,onOpen:u}=e,d=S.useRef(null),m=S.useMemo(()=>UI(t,r),[t,r]),p=VI({count:m.length,getScrollElement:()=>d.current,estimateSize:()=>window.matchMedia("(max-width: 768px)").matches?44:28,overscan:12,getItemKey:y=>m[y].node.path});return S.useEffect(()=>{if(!o)return;const y=m.findIndex(v=>v.node.path===o);y>=0&&p.scrollToIndex(y,{align:"auto"})},[o,m]),f.jsx("nav",{id:"tree","aria-label":"Files",ref:d,children:f.jsx("div",{style:{height:p.getTotalSize(),position:"relative"},children:p.getVirtualItems().map(y=>{const{node:v,depth:b}=m[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||hr()};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(nt,{name:"chevd"})}),f.jsx("span",{className:"ticon",children:f.jsx(nt,{name:v.dir?"folder":"doc"})}),f.jsx("span",{className:"label",children:v.name})]},y.key)})})})}function BI(e){const t=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:()=>t(u),children:o})]},u)})})}const GI=/\.bdrive-conflict-([A-Za-z0-9_-]{0,32})-(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/;function YC(e){const t=GI.exec(e);if(!t)return null;const[,r,i,o,l,u,d,m]=t,p=new Date(Date.UTC(+i,+o-1,+l,+u,+d,+m));return p.getUTCFullYear()!==+i||p.getUTCMonth()!==+o-1||p.getUTCDate()!==+l||p.getUTCHours()!==+u||p.getUTCMinutes()!==+d||p.getUTCSeconds()!==+m?null:{original:e.slice(0,t.index),device:r,when:p}}function dw(e){if(e==="")return[];const t=e.split(` -`);return t[t.length-1]===""&&t.pop(),t}const ZI=4e6;function KI(e,t){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*m>ZI){for(let v=0;v=0;w--)for(let _=m-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]?p(b++):y(x++);for(;bi.op==="+").length,del:r.filter(i=>i.op==="-").length}}const QC=1<<20,QI=8192;function XI(e){if(e.byteLength>QC)return{kind:"too-large",size:e.byteLength};if(e.subarray(0,QI).includes(0))return{kind:"binary"};try{return{kind:"text",text:new TextDecoder("utf-8",{fatal:!0}).decode(e)}}catch{return{kind:"binary"}}}function np(e,t,r,i){let o=e+"blob?sha="+encodeURIComponent(t);return r&&(o+="&name="+encodeURIComponent(r)),i&&(o+="&download=1"),o}async function JI(e){const t=await _2(e),r=Number(t.headers.get("Content-Length"));return r>QC?{kind:"too-large",size:r}:XI(new Uint8Array(await t.arrayBuffer()))}function XC(e,t,r,i){return Ft({queryKey:t,queryFn:()=>JI(e),enabled:r,...i?{staleTime:1/0,gcTime:1/0}:{},retry:!1})}function fw(e,t,r){return XC(t?np(e,t):"",["blob",e,t],!!t,!0)}function WI(e){return e.slice(e.lastIndexOf("/")+1)}function eP({apiBase:e,path:t,prev:r,cur:i}){const o=WI(t);return f.jsxs("span",{className:"dv-dl",children:[f.jsx("a",{href:np(e,r,o,!0),children:"download previous"}),f.jsx("a",{href:np(e,i,o,!0),children:"download this version"})]})}function tP({apiBase:e,path:t,prev:r,cur:i}){const o=fw(e,r),l=fw(e,i),u=o.data?.kind==="text"&&l.data?.kind==="text",d=S.useMemo(()=>o.data?.kind==="text"&&l.data?.kind==="text"?YI(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(eP,{apiBase:e,path:t,prev:r,cur:i})]})}const{lines:m,add:p,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:["+",p]})," ",f.jsxs("span",{className:"dv-del",children:["−",y]})]}),p===0&&y===0&&f.jsx("span",{className:"dv-same",children:"No line changes"})]}),f.jsx("div",{className:"dv-body",children:m.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 nP={add:"added",edit:"edited",delete:"deleted"};function JC({text:e}){return f.jsx(f.Fragment,{children:e.split(/(https?:\/\/\S+)/).map((t,r)=>/^https?:\/\//.test(t)?f.jsx("a",{href:t,target:"_blank",rel:"noopener",children:t},r):t)})}function bg({entry:e,apiBase:t,onOpen:r,diff:i,restore:o,remove:l,restoreSha:u,recreates:d,inRun:m,read:p}){const[y,v]=S.useState(!1),[b,x]=S.useState(!1),w=e.kind==="put"?"edit":e.kind,_=hd(e),E=[e.device.name||e.device.id,e.device.os].filter(Boolean).join(" · "),R=w!=="delete",T=!!i&&w!=="delete"&&!!e.blob,O=!!m&&w==="add",M=!!o&&!!u&&!O,k=!!l&&O,B=!!o?.busy&&o.busy===e.path+u,V=!!l?.busy&&l.busy===e.path,P=R&&!!e.blob,pe=e.path.split("/").pop()||e.path,ne=new Date(e.time).toLocaleString(),ce=t+"blob?sha="+e.blob+"&name="+encodeURIComponent(pe)+"&download=1",me=()=>x(!b),fe=Z=>{Z.target.tagName!=="A"&&R&&r(e.path,e.blob)};return f.jsxs("div",{className:"hentry "+w+(R?" clickable":""),tabIndex:R?0:void 0,role:R?"button":void 0,onClick:fe,onKeyDown:Z=>{R&&(Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),r(e.path,e.blob))},children:[f.jsxs("div",{className:"hline",children:[f.jsx("span",{className:"hkind",children:nP[w]||w}),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:ne})]}),f.jsxs("div",{className:"hmeta",children:[f.jsx("span",{className:"hwho",children:_}),f.jsx("span",{className:"hdev",children:E}),f.jsx("span",{className:"hsize",children:e.size?yg(e.size):""}),M&&f.jsxs("button",{type:"button",className:"hrestore-btn",disabled:B,title:"Put this version of "+e.path+" back as a new change",onClick:Z=>{Z.stopPropagation(),o.onRestore(e.path,u,!!d)},onKeyDown:Z=>Z.stopPropagation(),children:[f.jsx(nt,{name:"hist"}),B?"restoring…":"restore"]}),k&&f.jsxs("button",{type:"button",className:"hremove-btn",disabled:V,title:"Remove "+e.path+" — this run created it",onClick:Z=>{Z.stopPropagation(),l.onRemove(e.path)},onKeyDown:Z=>Z.stopPropagation(),children:[f.jsx(nt,{name:"trash"}),V?"removing…":"undo — remove file"]})]}),e.note&&!m&&f.jsx("div",{className:"hnote"+(y?" open":""),tabIndex:0,role:"button",title:y?"Collapse note":"Show full note","aria-expanded":y,onClick:Z=>{Z.stopPropagation(),Z.target.tagName!=="A"&&v(!y)},onKeyDown:Z=>{(Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),Z.stopPropagation(),v(!y))},children:f.jsx(JC,{text:e.note})}),(T||P)&&f.jsxs("div",{className:"hactions",children:[T&&(i.prev?f.jsxs("button",{type:"button",className:"hdiff-btn"+(b?" open":""),"aria-expanded":b,onClick:Z=>{Z.stopPropagation(),me()},onKeyDown:Z=>Z.stopPropagation(),children:[f.jsx(nt,{name:b?"chevd":"chev"}),b?"hide changes":"show changes"]}):f.jsx("div",{className:"hdiff-none",children:"First version — nothing to compare against"})),P&&f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"hver-btn","aria-label":`Open ${pe} as of ${ne}`,onClick:Z=>{Z.stopPropagation(),r(e.path,e.blob)},onKeyDown:Z=>Z.stopPropagation(),children:[f.jsx(nt,{name:"clock"}),"Open this version"]}),f.jsxs("a",{className:"hver-btn",download:!0,href:ce,"aria-label":`Download ${pe} as of ${ne}`,onClick:Z=>Z.stopPropagation(),onKeyDown:Z=>{Z.stopPropagation(),Z.key===" "&&(Z.preventDefault(),Z.currentTarget.click())},children:[f.jsx(nt,{name:"download"}),"Download"]})]})]}),T&&i.prev&&b&&f.jsx("div",{onClick:Z=>Z.stopPropagation(),children:f.jsx(tP,{apiBase:i.apiBase,path:e.path,prev:i.prev,cur:e.blob})})]})}function rP(e){const{node:t,heatMap:r,onOpen:i}=e,o=(t.children||[]).slice().sort((y,v)=>Number(v.dir||!1)-Number(y.dir||!1)||y.name.localeCompare(v.name)),l=o.filter(y=>y.dir).length,u=o.length-l,d=[];l&&d.push(l+(l===1?" folder":" folders")),u&&d.push(u+(u===1?" file":" files"));const m=sm(r,t.path,!0);m&&d.push(nl(m)+" in 30 days");const p=!!m||o.some(y=>sm(r,y.path,!!y.dir));return f.jsxs("div",{className:"dirlist",children:[f.jsxs("h1",{className:"dl-title",children:[f.jsx("span",{className:"dl-title-icon",children:f.jsx(nt,{name:"folder"})}),f.jsx("span",{children:t.name})]}),f.jsx("p",{className:"dl-sub",children:d.join(" · ")||"Empty folder"}),p&&f.jsx("p",{className:"dl-heatnote",children:Ci}),o.length===0?f.jsx("div",{className:"dl-empty",children:"Nothing in this folder yet."}):f.jsx("div",{className:"dl-items",children:o.map(y=>{let v="";if(y.dir){const _=(y.children||[]).length;v=_+(_===1?" item":" items")}else v=[y.size?yg(y.size):"",y.time?new Date(y.time).toLocaleDateString():""].filter(Boolean).join(" · ");const b=sm(r,y.path,!!y.dir);b&&(v=nl(b)+(v?" · "+v:""));const x=y.dir?null:YC(y.path),w=y.dir?"":ZC(b,y.time);return f.jsxs("div",{className:"dl-row",tabIndex:0,role:"button",title:y.path,onClick:()=>i(y.path),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),i(y.path))},children:[f.jsx("span",{className:"ticon",children:f.jsx(nt,{name:y.dir?"folder":"doc"})}),f.jsx("span",{className:"dl-name",children:y.name}),x&&f.jsx("span",{className:"dl-conflict","aria-label":"Conflict copy: a concurrent edit from "+(x.device||"another device")+" that beardrive preserved instead of dropping.",title:"A concurrent edit from "+(x.device||"another device")+" that beardrive preserved instead of dropping.",children:"conflict copy"}),w&&f.jsx("span",{className:"stalemark",role:"img","aria-label":"Warning: "+w,title:"Read often, but "+w,children:"⚠"}),b&&f.jsx("span",{className:"heatdot lvl"+uI(b),role:"img","aria-label":nl(b)+" in 30 days. "+Ci,title:nl(b)+" in 30 days. "+Ci}),f.jsx("span",{className:"dl-meta",children:v})]},y.path)})}),e.hub&&f.jsx(aP,{apiBase:e.apiBase,prefix:t.path+"/",onOpen:i,onFullHistory:()=>e.onFullHistory(t.path+"/"),onRendered:e.onRendered})]})}function aP(e){const t=CI(e.apiBase,e.prefix,!0),{onRendered:r}=e;return S.useEffect(()=>{t&&t.length&&r&&r()},[t,r]),!t||t.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:t.map((i,o)=>f.jsx(bg,{entry:i,apiBase:e.apiBase,onOpen:e.onOpen},o))}),f.jsx("button",{className:"ai-btn dl-more",onClick:e.onFullHistory,children:"Full history"})]})}const WC=5e3;function iP(e,t,r=WC){const i=[];let o=[],l="",u=!1,d=0;const m=()=>{o.push(l),l="",i.length{r(await Ni(e)?"Copied":"Copy failed"),setTimeout(()=>r("Copy"),1400)},children:t})]})}function fI({onNew:e,canCreate:t}){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."}),t&&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(xt,{variant:"primary",id:"ob-new",onClick:e,children:"New project"})]}),f.jsxs("div",{className:"ob-card ob-agent",children:[f.jsx("h3",{children:t?"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(tp,{code:"Follow "+BC+` +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 GC="__existing__";function hI({templates:e,onCreate:t,onClose:r}){const i=[...e.map(x=>({value:x.name,title:x.title,blurb:x.blurb,rule:!1})),{value:GC,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),[m,p]=S.useState(""),[y,v]=S.useState(!1),b=async()=>{if(!y){if(!o.trim()){p("Give it a name.");return}v(!0);try{await t(o.trim(),u)}finally{v(!1)}}};return f.jsx(Wu,{open:!0,onOpenChange:x=>!x&&r(),children:f.jsxs(ed,{className:"modal",showCloseButton:!1,children:[f.jsx(El,{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":!!m,"aria-describedby":m?"modal-input-err":void 0,onChange:x=>{l(x.currentTarget.value),m&&p("")},onKeyDown:x=>x.key==="Enter"&&b()}),m&&f.jsx("span",{id:"modal-input-err",role:"alert",className:"field-err",children:m}),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(xt,{variant:"subtle",onClick:r,children:"Cancel"}),f.jsx(xt,{variant:"primary",onClick:b,disabled:y,children:"Create"})]})]})})}function sm(e,t,r){if(!e)return null;if(!r)return e[t]||null;const i={human:0,agent:0,share:0};for(const[o,l]of Object.entries(e))o.startsWith(t+"/")&&(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 na(e){return(e.human||0)+(e.agent||0)+(e.share||0)}function nl(e){const t=na(e);if(!t)return"";const r=t+(t===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(", ")+")"}const Ci="Includes your own views. Repeat opens by the same reader inside 10 minutes count once.";function mI(e){const t=na(e);return t?t<3?1:t<10?2:t<30?3:4:0}function pI(e){const t=na(e);return t?{agent:(e.agent||0)/t,human:(e.human||0)/t,share:(e.share||0)/t}:{agent:0,human:0,share:0}}function gI(e,t){return e?Object.keys(e).filter(r=>!t.has(r)).sort():[]}const vI=7;function yI(e){if(!e.length)return null;let t=e[0],r=e[0];for(const i of e)ir&&(r=i);return{min:t,max:r}}const bI=(e,t)=>t-el.reads-o.reads).slice(0,wI)){const o=i.path.split("/").pop();let l=i.cx+i.r+4,u="start";l+o.length*SI>t.right&&(l=i.cx-i.r-4,u="end");const d=p=>r.every(y=>Math.abs(y.y-p)>=om);let m=i.cy;for(;m<=t.bottom&&!d(m);)m+=om;if(m>t.bottom)for(m=i.cy;m>=t.top&&!d(m);)m-=om;r.push({path:i.path,name:o,x:l,y:Math.min(t.bottom,Math.max(t.top,m)),anchor:u})}return r}const rl=3,ks=30,ZC=(e,t)=>e>=rl&&t>=ks;function CI(e,t=Date.now()){if(!e)return null;const r=new Date(e).getTime();return Number.isFinite(r)?Math.max(0,(t-r)/864e5):null}function EI(e){const t=new Intl.RelativeTimeFormat("en",{numeric:"always"});return e<30?t.format(-Math.round(e),"day"):e<365?t.format(-Math.round(e/30),"month"):t.format(-Math.round(e/365),"year")}function KC(e,t){const r=CI(t);return!e||r===null||!ZC(na(e),r)?"":`stale · last changed ${EI(r)}`}function RI(e,t=!0){const r=Ft({queryKey:["tree",e],queryFn:()=>qt(e+"tree"),enabled:t,refetchInterval:15e3}),i=S.useMemo(()=>{const o=[],l=new Map,u=d=>{for(const m of d.children||[])m.dir?(l.set(m.path,m),u(m)):o.push(m)};return r.data&&u(r.data),{flatFiles:o,dirIndex:l}},[r.data]);return{tree:r.data,...i,loaded:!!r.data}}function jI(e,t){return Ft({queryKey:["heat",e],queryFn:()=>qt(e+"heat?days=30"),enabled:t,staleTime:6e4,refetchInterval:6e4}).data?.entries??null}function TI(e,t,r){return Ft({queryKey:["history",e,"prefix",t,20],queryFn:()=>qt(e+"history?prefix="+encodeURIComponent(t)+"&n=20"),enabled:r,staleTime:15e3}).data?.entries??null}function OI(e,t,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 m=+l;if(Number.isInteger(m)&&m>=0&&mi[y]!==p))&&(i=d,o=t(...d),r?.onChange&&!(l&&r.skipInitialOnChange)&&r.onChange(o),l=!1),o}return u.updateDeps=d=>{i=d},u}function cw(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const AI=(e,t)=>Math.abs(e-t)<1.01,MI=(e,t,r)=>{let i;return function(...o){e.clearTimeout(i),i=e.setTimeout(()=>t.apply(this,o),r)}};let Xo;const lm=()=>{if(Xo!==void 0)return Xo;if(typeof navigator>"u")return Xo=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Xo=!0;const e=navigator.maxTouchPoints;return Xo=navigator.platform==="MacIntel"&&e!==void 0&&e>0},uw=e=>{const{offsetWidth:t,offsetHeight:r}=e;return{width:t,height:r}},NI=e=>e,DI=e=>{const t=Math.max(e.startIndex-e.overscan,0),i=Math.min(e.endIndex+e.overscan,e.count-1)-t+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:m}=u;t({width:Math.round(d),height:Math.round(m)})};if(o(uw(r)),!i.ResizeObserver)return()=>{};const l=new i.ResizeObserver(u=>{const d=()=>{const m=u[0];if(m?.borderBoxSize){const p=m.borderBoxSize[0];if(p){o({width:p.inlineSize,height:p.blockSize});return}}o(uw(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return l.observe(r,{box:"border-box"}),()=>{l.unobserve(r)}},Au={passive:!0},zI=typeof window>"u"?!0:"onscrollend"in window,LI=(e,t,r)=>{const i=e.scrollElement;if(!i)return;const o=e.targetWindow;if(!o)return;const l=e.options.useScrollendEvent&&zI;let u=0;const d=l?null:MI(o,()=>t(u,!1),e.options.isScrollingResetDelay),m=v=>()=>{u=r(i),d?.(),t(u,v)},p=m(!0),y=m(!1);return i.addEventListener("scroll",p,Au),l&&i.addEventListener("scrollend",y,Au),()=>{i.removeEventListener("scroll",p),l&&i.removeEventListener("scrollend",y)}},$I=(e,t)=>LI(e,t,r=>{const{horizontal:i,isRtl:o}=e.options;return i?r.scrollLeft*(o&&-1||1):r.scrollTop}),II=(e,t,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(t?.borderBoxSize){const i=t.borderBoxSize[0];if(i)return Math.round(i[r.options.horizontal?"inlineSize":"blockSize"])}if(!t){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"]},PI=(e,{adjustments:t=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+t,behavior:r})},FI=PI;class VI{constructor(t){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,m=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[p,y]of this.elementsCache)if(y===d){this.elementsCache.delete(p);break}return}this.shouldMeasureDuringScroll(m)&&this.resizeItem(m,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:NI,rangeExtractor:DI,onChange:()=>{},measureElement:II,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,m=null,p=!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)){p=!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)&&(m=M)}}this.options=l,p&&(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||m)&&(this.pendingScrollAnchor=[y?d[0]:null,y?d[1]:0,m,v])},this.notify=r=>{var i,o;(o=(i=this.options).onChange)==null||o.call(i,this,r)},this.maybeNotify=Ns(()=>(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,!(!lm()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};l.addEventListener("touchstart",u,Au),l.addEventListener("touchend",d,Au),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,m]=o;l!==null&&!d&&(lm()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?m!==0&&(this._iosDeferredAdjustment+=m):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=Ns(()=>[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,m,p)=>(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:m,gap:p}),{key:!1}),this.getMeasurements=Ns(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:r,paddingStart:i,scrollMargin:o,getItemKey:l,enabled:u,lanes:d,laneAssignmentMode:m,gap:p},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&&k.set(T.subarray(0,b*2)),T=k,this._flatMeasurements=T}let O;if(b===0)O=i+o;else{const k=b-1;O=T[k*2]+T[k*2+1]+p}for(let k=b;k1){M=O;const ne=w[M],ce=ne!==void 0?x[ne]:void 0;k=ce?ce.end+p:i+o}else if(E===d){let ne=0,ce=_[0],me=w[0];for(let fe=1;fethis.options.debug}),this.calculateRange=Ns(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(r,i,o,l)=>r.length===0||i===0?(this.range=null,null):(this.range=HI(r,i,o,l,l===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ns(()=>{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,m;const p=this._flatMeasurements;if(this.options.lanes===1&&p!==null)m=this.options.getItemKey(r),d=p[r*2],u=p[r*2+1];else{const b=this.measurementsCache[r];if(!b)return;m=b.key,d=b.start,u=b.size}const y=this.itemSizeCache.get(m)??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:m,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=YC(0,i.length-1,l?d=>o[d*2]:d=>cw(i[d]).start,r);return cw(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,m=this.now();this.scrollState={index:r,align:d,behavior:o,startedAt:m,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(t)}applyScrollAdjustment(t,r){t!==0&&(lm()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=t:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,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&&AI(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,m=Math.abs(o-this.getScrollOffset()),p=this.scrollState.behavior==="smooth"&&m>d;this.scrollState.lastTargetOffset=o,p||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:p?"smooth":"auto"})}this.scheduleScrollReconcile()}}const YC=(e,t,r,i)=>{for(;e<=t;){const o=(e+t)/2|0,l=r(o);if(li)t=o-1;else return o}return e>0?e-1:0};function UI(e,t,r){let i=0;for(;i<=t;){const o=(i+t)/2|0,l=e[o*2];if(lr)t=o-1;else return o}return i>0?i-1:0}function HI(e,t,r,i,o){const l=e.length-1;if(e.length<=i)return{startIndex:0,endIndex:l};if(i===1&&o!==null){const p=UI(o,l,r);let y=p;const v=r+t;for(;ye[p].start,r),m=d;if(i===1)for(;m1){const p=Array(i).fill(0);for(;mv=0&&y.some(v=>v>=r);){const v=e[d];y[v.lane]=v.start,d--}d=Math.max(0,d-d%i),m=Math.min(l,m+(i-1-m%i))}return{startIndex:d,endIndex:m}}const cm=typeof document<"u"?S.useLayoutEffect:S.useEffect;function BI({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:r="transform",...i}){const o=S.useReducer(p=>p+1,0)[1],l=S.useRef({enabled:t,mode:r,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});l.current.enabled=t,l.current.mode=r;const u=p=>{const y=l.current;if(!y.enabled||!y.container)return;const v=p.getTotalSize();if(v!==y.lastSize){y.lastSize=v;const R=p.options.horizontal?"width":"height";y.container.style[R]=`${v}px`}const b=!!p.options.horizontal,x=y.mode==="transform",w=b?"left":"top",_=p.options.scrollMargin,E=p.getVirtualItems();for(const R of E){const T=R.start-_,O=p.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:(p,y)=>{var v;const b=l.current;let x=!0;if(b.enabled){u(p);const w=p.range,_=b.prevRange;x=!_||_.isScrolling!==p.isScrolling||_.startIndex!==w?.startIndex||_.endIndex!==w?.endIndex,x&&(b.prevRange=w?{startIndex:w.startIndex,endIndex:w.endIndex,isScrolling:p.isScrolling}:null)}x&&(e&&y?zi.flushSync(o):o()),(v=i.onChange)==null||v.call(i,p,y)}},[m]=S.useState(()=>{const p=new VI(d);return Object.assign(p,{containerRef:y=>{const v=l.current;if(v.container=y,v.lastSize=null,y&&v.enabled){const b=p.getTotalSize();v.lastSize=b;const x=p.options.horizontal?"width":"height";y.style[x]=`${b}px`}}})});return m.setOptions(d),cm(()=>m._didMount(),[]),cm(()=>m._willUpdate()),cm(()=>{u(m)}),m}function qI(e){return BI({observeElementRect:kI,observeElementOffset:$I,scrollToFn:FI,...e})}function GI(e,t){const r=[],i=(o,l)=>{for(const u of o)r.push({node:u,depth:l}),u.dir&&t.has(u.path)&&i(u.children||[],l+1)};return i(e?.children||[],0),r}function ZI(e){const{root:t,expanded:r,onToggle:i,currentPath:o,listingShowing:l,onOpen:u}=e,d=S.useRef(null),m=S.useMemo(()=>GI(t,r),[t,r]),p=qI({count:m.length,getScrollElement:()=>d.current,estimateSize:()=>window.matchMedia("(max-width: 768px)").matches?44:28,overscan:12,getItemKey:y=>m[y].node.path});return S.useEffect(()=>{if(!o)return;const y=m.findIndex(v=>v.node.path===o);y>=0&&p.scrollToIndex(y,{align:"auto"})},[o,m]),f.jsx("nav",{id:"tree","aria-label":"Files",ref:d,children:f.jsx("div",{style:{height:p.getTotalSize(),position:"relative"},children:p.getVirtualItems().map(y=>{const{node:v,depth:b}=m[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||hr()};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(nt,{name:"chevd"})}),f.jsx("span",{className:"ticon",children:f.jsx(nt,{name:v.dir?"folder":"doc"})}),f.jsx("span",{className:"label",children:v.name})]},y.key)})})})}function KI(e){const t=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:()=>t(u),children:o})]},u)})})}const QI=/\.bdrive-conflict-([A-Za-z0-9_-]{0,32})-(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/;function QC(e){const t=QI.exec(e);if(!t)return null;const[,r,i,o,l,u,d,m]=t,p=new Date(Date.UTC(+i,+o-1,+l,+u,+d,+m));return p.getUTCFullYear()!==+i||p.getUTCMonth()!==+o-1||p.getUTCDate()!==+l||p.getUTCHours()!==+u||p.getUTCMinutes()!==+d||p.getUTCSeconds()!==+m?null:{original:e.slice(0,t.index),device:r,when:p}}function dw(e){if(e==="")return[];const t=e.split(` +`);return t[t.length-1]===""&&t.pop(),t}const XI=4e6;function JI(e,t){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*m>XI){for(let v=0;v=0;w--)for(let _=m-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]?p(b++):y(x++);for(;bi.op==="+").length,del:r.filter(i=>i.op==="-").length}}const XC=1<<20,eP=8192;function tP(e){if(e.byteLength>XC)return{kind:"too-large",size:e.byteLength};if(e.subarray(0,eP).includes(0))return{kind:"binary"};try{return{kind:"text",text:new TextDecoder("utf-8",{fatal:!0}).decode(e)}}catch{return{kind:"binary"}}}function np(e,t,r,i){let o=e+"blob?sha="+encodeURIComponent(t);return r&&(o+="&name="+encodeURIComponent(r)),i&&(o+="&download=1"),o}async function nP(e){const t=await C2(e),r=Number(t.headers.get("Content-Length"));return r>XC?{kind:"too-large",size:r}:tP(new Uint8Array(await t.arrayBuffer()))}function JC(e,t,r,i){return Ft({queryKey:t,queryFn:()=>nP(e),enabled:r,...i?{staleTime:1/0,gcTime:1/0}:{},retry:!1})}function fw(e,t,r){return JC(t?np(e,t):"",["blob",e,t],!!t,!0)}function rP(e){return e.slice(e.lastIndexOf("/")+1)}function aP({apiBase:e,path:t,prev:r,cur:i}){const o=rP(t);return f.jsxs("span",{className:"dv-dl",children:[f.jsx("a",{href:np(e,r,o,!0),children:"download previous"}),f.jsx("a",{href:np(e,i,o,!0),children:"download this version"})]})}function iP({apiBase:e,path:t,prev:r,cur:i}){const o=fw(e,r),l=fw(e,i),u=o.data?.kind==="text"&&l.data?.kind==="text",d=S.useMemo(()=>o.data?.kind==="text"&&l.data?.kind==="text"?WI(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(aP,{apiBase:e,path:t,prev:r,cur:i})]})}const{lines:m,add:p,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:["+",p]})," ",f.jsxs("span",{className:"dv-del",children:["−",y]})]}),p===0&&y===0&&f.jsx("span",{className:"dv-same",children:"No line changes"})]}),f.jsx("div",{className:"dv-body",children:m.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 sP={add:"added",edit:"edited",delete:"deleted"};function WC({text:e}){return f.jsx(f.Fragment,{children:e.split(/(https?:\/\/\S+)/).map((t,r)=>/^https?:\/\//.test(t)?f.jsx("a",{href:t,target:"_blank",rel:"noopener",children:t},r):t)})}function bg({entry:e,apiBase:t,onOpen:r,diff:i,restore:o,remove:l,restoreSha:u,recreates:d,inRun:m,read:p}){const[y,v]=S.useState(!1),[b,x]=S.useState(!1),w=e.kind==="put"?"edit":e.kind,_=hd(e),E=[e.device.name||e.device.id,e.device.os].filter(Boolean).join(" · "),R=w!=="delete",T=!!i&&w!=="delete"&&!!e.blob,O=!!m&&w==="add",M=!!o&&!!u&&!O,k=!!l&&O,B=!!o?.busy&&o.busy===e.path+u,V=!!l?.busy&&l.busy===e.path,P=R&&!!e.blob,pe=e.path.split("/").pop()||e.path,ne=new Date(e.time).toLocaleString(),ce=t+"blob?sha="+e.blob+"&name="+encodeURIComponent(pe)+"&download=1",me=()=>x(!b),fe=Z=>{Z.target.tagName!=="A"&&R&&r(e.path,e.blob)};return f.jsxs("div",{className:"hentry "+w+(R?" clickable":""),tabIndex:R?0:void 0,role:R?"button":void 0,onClick:fe,onKeyDown:Z=>{R&&(Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),r(e.path,e.blob))},children:[f.jsxs("div",{className:"hline",children:[f.jsx("span",{className:"hkind",children:sP[w]||w}),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:ne})]}),f.jsxs("div",{className:"hmeta",children:[f.jsx("span",{className:"hwho",children:_}),f.jsx("span",{className:"hdev",children:E}),f.jsx("span",{className:"hsize",children:e.size?yg(e.size):""}),M&&f.jsxs("button",{type:"button",className:"hrestore-btn",disabled:B,title:"Put this version of "+e.path+" back as a new change",onClick:Z=>{Z.stopPropagation(),o.onRestore(e.path,u,!!d)},onKeyDown:Z=>Z.stopPropagation(),children:[f.jsx(nt,{name:"hist"}),B?"restoring…":"restore"]}),k&&f.jsxs("button",{type:"button",className:"hremove-btn",disabled:V,title:"Remove "+e.path+" — this run created it",onClick:Z=>{Z.stopPropagation(),l.onRemove(e.path)},onKeyDown:Z=>Z.stopPropagation(),children:[f.jsx(nt,{name:"trash"}),V?"removing…":"undo — remove file"]})]}),e.note&&!m&&f.jsx("div",{className:"hnote"+(y?" open":""),tabIndex:0,role:"button",title:y?"Collapse note":"Show full note","aria-expanded":y,onClick:Z=>{Z.stopPropagation(),Z.target.tagName!=="A"&&v(!y)},onKeyDown:Z=>{(Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),Z.stopPropagation(),v(!y))},children:f.jsx(WC,{text:e.note})}),(T||P)&&f.jsxs("div",{className:"hactions",children:[T&&(i.prev?f.jsxs("button",{type:"button",className:"hdiff-btn"+(b?" open":""),"aria-expanded":b,onClick:Z=>{Z.stopPropagation(),me()},onKeyDown:Z=>Z.stopPropagation(),children:[f.jsx(nt,{name:b?"chevd":"chev"}),b?"hide changes":"show changes"]}):f.jsx("div",{className:"hdiff-none",children:"First version — nothing to compare against"})),P&&f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"hver-btn","aria-label":`Open ${pe} as of ${ne}`,onClick:Z=>{Z.stopPropagation(),r(e.path,e.blob)},onKeyDown:Z=>Z.stopPropagation(),children:[f.jsx(nt,{name:"clock"}),"Open this version"]}),f.jsxs("a",{className:"hver-btn",download:!0,href:ce,"aria-label":`Download ${pe} as of ${ne}`,onClick:Z=>Z.stopPropagation(),onKeyDown:Z=>{Z.stopPropagation(),Z.key===" "&&(Z.preventDefault(),Z.currentTarget.click())},children:[f.jsx(nt,{name:"download"}),"Download"]})]})]}),T&&i.prev&&b&&f.jsx("div",{onClick:Z=>Z.stopPropagation(),children:f.jsx(iP,{apiBase:i.apiBase,path:e.path,prev:i.prev,cur:e.blob})})]})}function oP(e){const{node:t,heatMap:r,onOpen:i}=e,o=(t.children||[]).slice().sort((y,v)=>Number(v.dir||!1)-Number(y.dir||!1)||y.name.localeCompare(v.name)),l=o.filter(y=>y.dir).length,u=o.length-l,d=[];l&&d.push(l+(l===1?" folder":" folders")),u&&d.push(u+(u===1?" file":" files"));const m=sm(r,t.path,!0);m&&d.push(nl(m)+" in 30 days");const p=!!m||o.some(y=>sm(r,y.path,!!y.dir));return f.jsxs("div",{className:"dirlist",children:[f.jsxs("h1",{className:"dl-title",children:[f.jsx("span",{className:"dl-title-icon",children:f.jsx(nt,{name:"folder"})}),f.jsx("span",{children:t.name})]}),f.jsx("p",{className:"dl-sub",children:d.join(" · ")||"Empty folder"}),p&&f.jsx("p",{className:"dl-heatnote",children:Ci}),o.length===0?f.jsx("div",{className:"dl-empty",children:"Nothing in this folder yet."}):f.jsx("div",{className:"dl-items",children:o.map(y=>{let v="";if(y.dir){const _=(y.children||[]).length;v=_+(_===1?" item":" items")}else v=[y.size?yg(y.size):"",y.time?new Date(y.time).toLocaleDateString():""].filter(Boolean).join(" · ");const b=sm(r,y.path,!!y.dir);b&&(v=nl(b)+(v?" · "+v:""));const x=y.dir?null:QC(y.path),w=y.dir?"":KC(b,y.time);return f.jsxs("div",{className:"dl-row",tabIndex:0,role:"button",title:y.path,onClick:()=>i(y.path),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),i(y.path))},children:[f.jsx("span",{className:"ticon",children:f.jsx(nt,{name:y.dir?"folder":"doc"})}),f.jsx("span",{className:"dl-name",children:y.name}),x&&f.jsx("span",{className:"dl-conflict","aria-label":"Conflict copy: a concurrent edit from "+(x.device||"another device")+" that beardrive preserved instead of dropping.",title:"A concurrent edit from "+(x.device||"another device")+" that beardrive preserved instead of dropping.",children:"conflict copy"}),w&&f.jsx("span",{className:"stalemark",role:"img","aria-label":"Warning: "+w,title:"Read often, but "+w,children:"⚠"}),b&&f.jsx("span",{className:"heatdot lvl"+mI(b),role:"img","aria-label":nl(b)+" in 30 days. "+Ci,title:nl(b)+" in 30 days. "+Ci}),f.jsx("span",{className:"dl-meta",children:v})]},y.path)})}),e.hub&&f.jsx(lP,{apiBase:e.apiBase,prefix:t.path+"/",onOpen:i,onFullHistory:()=>e.onFullHistory(t.path+"/"),onRendered:e.onRendered})]})}function lP(e){const t=TI(e.apiBase,e.prefix,!0),{onRendered:r}=e;return S.useEffect(()=>{t&&t.length&&r&&r()},[t,r]),!t||t.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:t.map((i,o)=>f.jsx(bg,{entry:i,apiBase:e.apiBase,onOpen:e.onOpen},o))}),f.jsx("button",{className:"ai-btn dl-more",onClick:e.onFullHistory,children:"Full history"})]})}const eE=5e3;function cP(e,t,r=eE){const i=[];let o=[],l="",u=!1,d=0;const m=()=>{o.push(l),l="",i.length1?t.slice(0,-1).join(", ")+" and "+t[t.length-1]:t[0]||"something credential-shaped"}function lP(e=[]){return`BearDrive found ${eE(e)} 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 cP(e=[]){return`This file contains ${eE(e)}.`}function uP(e){const{apiBase:t,path:r,version:i,onMeta:o}=e,l=i?t+"blob?sha="+i+"&name="+encodeURIComponent(r):t+"file?path="+encodeURIComponent(r);return S.useEffect(()=>()=>o(""),[r,o]),j$.test(r)?f.jsx(hP,{...e}):AC.test(r)?f.jsx("iframe",{className:"htmlview",sandbox:"allow-scripts",src:l,title:r,onLoad:e.onRendered}):MC.test(r)?f.jsx("iframe",{className:"pdfview",src:l,title:r,onLoad:e.onRendered}):T$.test(r)?f.jsx(vP,{src:l,alt:r,version:i,onRendered:e.onRendered}):O$.test(r)?f.jsx(hw,{...e,fileURL:l,delim:/\.tsv$/i.test(r)?" ":","}):A$.test(r)?f.jsx(hw,{...e,fileURL:l}):f.jsx(dP,{...e,fileURL:l})}function dP(e){const{apiBase:t,path:r,version:i,fileURL:o,onRendered:l}=e,{data:u,error:d}=XC(o,["text",o],!0,!!i);return S.useEffect(()=>{u&&l?.()},[u,l]),d?f.jsx(md,{version:i,err:d}):u?u.kind==="text"?f.jsx("pre",{className:"plain",children:u.text},r):f.jsx(fP,{apiBase:t,path:r,version:i,fileURL:o,children:u.kind==="too-large"?`Too large to preview (${yg(u.size)}).`:"No preview for this file type."}):null}function fP(e){const{apiBase:t,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":t+"download?path="+encodeURIComponent(r),children:"Download"})]})}function hP(e){const{apiBase:t,path:r,version:i,heatMap:o,flatFiles:l,projectId:u,onOpenFile:d,onMeta:m,onRendered:p}=e,{data:y,error:v}=Ft({queryKey:["render",t,r,i||""],queryFn:()=>qt(t+"render?path="+encodeURIComponent(r)+(i?"&sha="+i:"")),retry:i?!1:void 0}),b=S.useMemo(()=>y?gP(y.html,r,t,l,u):"",[y,r,t,l,u]),[x,w]=S.useState(null);return S.useEffect(()=>{if(w(null),!_j(b))return;let _=!1;return Cj(b).then(E=>{_||w(E)}),()=>{_=!0}},[b]),S.useEffect(()=>{if(!y)return;const _=[],E=i?null:o&&o[y.path],R=ZC(E||null,y.time);(y.user_name||y.user||y.author)&&_.push(hd(y)+(y.device?" on "+y.device:"")),y.time&&_.push(new Date(y.time).toLocaleString());const T=E&&na(E)?nl(E)+" / 30d":"",O=R?f.jsxs("span",{className:"meta-stale",title:R,children:[f.jsx("span",{"aria-hidden":"true",children:"⚠ "}),R]}):null;m(T?f.jsxs(f.Fragment,{children:[O,O?" · ":"",_.length?_.join(" · ")+" · ":"",f.jsxs("span",{title:Ci,children:[T,f.jsxs("span",{className:"sr-only",children:[" — ",Ci]})]})]}):O?f.jsxs(f.Fragment,{children:[O,_.length?" · "+_.join(" · "):""]}):_.join(" · ")),p?.()},[y,i,o,m,p]),v?f.jsx(md,{version:i,err:v}):y?f.jsxs(f.Fragment,{children:[f.jsx(mP,{findings:y.findings}),f.jsx("div",{dangerouslySetInnerHTML:{__html:x??b},onClick:_=>pP(_,r,d)})]}):null}function mP({findings:e}){return e?.length?f.jsxs("div",{className:"sbadge",role:"status",children:[f.jsx("span",{className:"sb-icon",children:f.jsx(nt,{name:"shield"})}),f.jsxs("div",{className:"sb-text",children:[f.jsx("b",{children:cP(e)}),f.jsx("span",{children:"Checked when this page loaded. Sharing the file asks you to confirm first."})]})]}):null}function pP(e,t,r){const i=e.target.closest("a");if(!i||!e.currentTarget.contains(i)||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0)return;const o=i.getAttribute("href")||"",l=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"",u=i.getAttribute("data-wiki");u!==null?(e.preventDefault(),r(u)):/^([a-z]+:|\/|#)/i.test(o)||(e.preventDefault(),r(NC(l,decodeURIComponent(o))))}function gP(e,t,r,i,o){const l=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"",u=m=>r+"file?path="+encodeURIComponent(m),d=new DOMParser().parseFromString(e,"text/html");for(const m of d.querySelectorAll("img")){const p=m.getAttribute("src")||"";/^\s*data:image\/svg/i.test(p)?m.removeAttribute("src"):/^([a-z]+:|\/)/i.test(p)||m.setAttribute("src",u(NC(l,p)))}for(const m of d.querySelectorAll("a")){const p=m.getAttribute("href")||"";if(p.startsWith("wiki:")){const y=M$(decodeURIComponent(p.slice(5)),i);y?(m.setAttribute("href",Oi(y.path,o)),m.setAttribute("data-wiki",y.path)):(m.removeAttribute("href"),m.classList.add("wiki-missing"),m.setAttribute("title","No file matches this wikilink"));continue}/^\s*data:/i.test(p)?m.removeAttribute("href"):/^https?:/i.test(p)&&(m.setAttribute("target","_blank"),m.setAttribute("rel","noopener"))}return d.body.innerHTML}function vP(e){const[t,r]=S.useState(!1);return t?f.jsx(md,{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 md({version:e,err:t}){return f.jsx("div",{className:"empty",children:e?"That version isn't available.":"Could not load file: "+t.message})}function hw(e){const{path:t,version:r,fileURL:i,delim:o,onRendered:l}=e,{data:u,error:d}=Ft({queryKey:["text",i],queryFn:async()=>{const p=await fetch(i);if(!p.ok)throw new Error(await p.text());return p.text()},retry:r?!1:void 0});S.useEffect(()=>{u!=null&&l?.()},[u,l]);const m=S.useMemo(()=>o&&u!=null?iP(u,o,WC):null,[u,o]);return d?f.jsx(md,{version:r,err:d}):u==null?null:m?f.jsx(yP,{csv:m},t):f.jsx("pre",{className:"plain",children:u},t)}function yP({csv:e}){const[t,...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:t[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"]})]})}const bP=[{value:"",label:"Never"},{value:"24h",label:"In 24 hours"},{value:"168h",label:"In 7 days"},{value:"720h",label:"In 30 days"}];function xP({url:e,copied:t,onClose:r}){const i=e.split("/s/")[1],[o,l]=S.useState(""),[u,d]=S.useState(),[m,p]=S.useState(!1),y=S.useRef(null);async function v(b){const x=o;l(b),p(!0);try{const w=await Wn("PATCH","/api/shares/"+i,{expires_in:b});d(w.expires)}catch(w){qe(w.message,!0),l(x)}finally{p(!1)}}return f.jsx(Wu,{open:!0,onOpenChange:b=>!b&&r(),children:f.jsxs(ed,{className:"modal",showCloseButton:!1,onOpenAutoFocus:b=>{b.preventDefault(),y.current?.focus()},children:[f.jsx(El,{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:m,onChange:b=>v(b.target.value),children:bP.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(xt,{ref:y,variant:"primary",onClick:()=>Ni(e).then(b=>qe(b?"Copied.":"Select and copy the link above.")),children:t?"Copied ✓":"Copy link"}),f.jsx(xt,{variant:"subtle",onClick:()=>window.open(e,"_blank"),children:"Open"}),f.jsx(xt,{variant:"subtle",onClick:r,children:"Done"})]})]})})}function wP({shares:e,canRevoke:t,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(nt,{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:[" ",$C]})]}),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:LC(i,!1)}),f.jsxs("span",{className:"sb-actions",children:[f.jsx(xt,{variant:"subtle",onClick:()=>Ni(i.url).then(o=>qe(o?"Copied.":"Select and copy the link.")),children:"Copy link"}),f.jsx(xt,{variant:"subtle",onClick:()=>window.open(i.url,"_blank"),children:"Open"}),t&&f.jsx("button",{className:"ai-del","aria-label":`Revoke the share of ${i.path}`,onClick:()=>PC(i,r),children:"Revoke"})]})]},i.token))]})}var mw=1,SP=.9,_P=.8,CP=.17,um=.1,dm=.999,EP=.9999,RP=.99,jP=/[\\\/_+.#"@\[\(\{&]/,TP=/[\\\/_+.#"@\[\(\{&]/g,OP=/[\s-]/,tE=/[\s-]/g;function rp(e,t,r,i,o,l,u){if(l===t.length)return o===e.length?mw:RP;var d=`${o},${l}`;if(u[d]!==void 0)return u[d];for(var m=i.charAt(l),p=r.indexOf(m,o),y=0,v,b,x,w;p>=0;)v=rp(e,t,r,i,p+1,l+1,u),v>y&&(p===o?v*=mw:jP.test(e.charAt(p-1))?(v*=_P,x=e.slice(o,p-1).match(TP),x&&o>0&&(v*=Math.pow(dm,x.length))):OP.test(e.charAt(p-1))?(v*=SP,w=e.slice(o,p-1).match(tE),w&&o>0&&(v*=Math.pow(dm,w.length))):(v*=CP,o>0&&(v*=Math.pow(dm,p-o))),e.charAt(p)!==t.charAt(l)&&(v*=EP)),(vv&&(v=b*um)),v>y&&(y=v),p=r.indexOf(m,p+1);return u[d]=y,y}function pw(e){return e.toLowerCase().replace(tE," ")}function AP(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,rp(e,t,pw(e),pw(t),0,0,{})}var Jo='[cmdk-group=""]',fm='[cmdk-group-items=""]',MP='[cmdk-group-heading=""]',nE='[cmdk-item=""]',gw=`${nE}:not([aria-disabled="true"])`,ap="cmdk-item-select",zs="data-value",NP=(e,t,r)=>AP(e,t,r),rE=S.createContext(void 0),Ol=()=>S.useContext(rE),aE=S.createContext(void 0),xg=()=>S.useContext(aE),iE=S.createContext(void 0),sE=S.forwardRef((e,t)=>{let r=Ls(()=>{var N,H;return{search:"",value:(H=(N=e.value)!=null?N:e.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=Ls(()=>new Set),o=Ls(()=>new Map),l=Ls(()=>new Map),u=Ls(()=>new Set),d=oE(e),{label:m,children:p,value:y,onValueChange:v,filter:b,shouldFilter:x,loop:w,disablePointerSelection:_=!1,vimBindings:E=!0,...R}=e,T=fn(),O=fn(),M=fn(),k=S.useRef(null),B=HP();Di(()=>{if(y!==void 0){let N=y.trim();r.current.value=N,V.emit()}},[y]),Di(()=>{B(6,fe)},[]);let V=S.useMemo(()=>({subscribe:N=>(u.current.add(N),()=>u.current.delete(N)),snapshot:()=>r.current,setState:(N,H,X)=>{var Y,he,re,be;if(!Object.is(r.current[N],H)){if(r.current[N]=H,N==="search")me(),ne(),B(1,ce);else if(N==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let xe=document.getElementById(M);xe?xe.focus():(Y=document.getElementById(T))==null||Y.focus()}if(B(7,()=>{var xe;r.current.selectedItemId=(xe=Z())==null?void 0:xe.id,V.emit()}),X||B(5,fe),((he=d.current)==null?void 0:he.value)!==void 0){let xe=H??"";(be=(re=d.current).onValueChange)==null||be.call(re,xe);return}}V.emit()}},emit:()=>{u.current.forEach(N=>N())}}),[]),P=S.useMemo(()=>({value:(N,H,X)=>{var Y;H!==((Y=l.current.get(N))==null?void 0:Y.value)&&(l.current.set(N,{value:H,keywords:X}),r.current.filtered.items.set(N,pe(H,X)),B(2,()=>{ne(),V.emit()}))},item:(N,H)=>(i.current.add(N),H&&(o.current.has(H)?o.current.get(H).add(N):o.current.set(H,new Set([N]))),B(3,()=>{me(),ne(),r.current.value||ce(),V.emit()}),()=>{l.current.delete(N),i.current.delete(N),r.current.filtered.items.delete(N);let X=Z();B(4,()=>{me(),X?.getAttribute("id")===N&&ce(),V.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:m||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:T,inputId:M,labelId:O,listInnerRef:k}),[]);function pe(N,H){var X,Y;let he=(Y=(X=d.current)==null?void 0:X.filter)!=null?Y:NP;return N?he(N,r.current.search,H):0}function ne(){if(!r.current.search||d.current.shouldFilter===!1)return;let N=r.current.filtered.items,H=[];r.current.filtered.groups.forEach(Y=>{let he=o.current.get(Y),re=0;he.forEach(be=>{let xe=N.get(be);re=Math.max(xe,re)}),H.push([Y,re])});let X=k.current;Se().sort((Y,he)=>{var re,be;let xe=Y.getAttribute("id"),Me=he.getAttribute("id");return((re=N.get(Me))!=null?re:0)-((be=N.get(xe))!=null?be:0)}).forEach(Y=>{let he=Y.closest(fm);he?he.appendChild(Y.parentElement===he?Y:Y.closest(`${fm} > *`)):X.appendChild(Y.parentElement===X?Y:Y.closest(`${fm} > *`))}),H.sort((Y,he)=>he[1]-Y[1]).forEach(Y=>{var he;let re=(he=k.current)==null?void 0:he.querySelector(`${Jo}[${zs}="${encodeURIComponent(Y[0])}"]`);re?.parentElement.appendChild(re)})}function ce(){let N=Se().find(X=>X.getAttribute("aria-disabled")!=="true"),H=N?.getAttribute(zs);V.setState("value",H||void 0)}function me(){var N,H,X,Y;if(!r.current.search||d.current.shouldFilter===!1){r.current.filtered.count=i.current.size;return}r.current.filtered.groups=new Set;let he=0;for(let re of i.current){let be=(H=(N=l.current.get(re))==null?void 0:N.value)!=null?H:"",xe=(Y=(X=l.current.get(re))==null?void 0:X.keywords)!=null?Y:[],Me=pe(be,xe);r.current.filtered.items.set(re,Me),Me>0&&he++}for(let[re,be]of o.current)for(let xe of be)if(r.current.filtered.items.get(xe)>0){r.current.filtered.groups.add(re);break}r.current.filtered.count=he}function fe(){var N,H,X;let Y=Z();Y&&(((N=Y.parentElement)==null?void 0:N.firstChild)===Y&&((X=(H=Y.closest(Jo))==null?void 0:H.querySelector(MP))==null||X.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function Z(){var N;return(N=k.current)==null?void 0:N.querySelector(`${nE}[aria-selected="true"]`)}function Se(){var N;return Array.from(((N=k.current)==null?void 0:N.querySelectorAll(gw))||[])}function L(N){let H=Se()[N];H&&V.setState("value",H.getAttribute(zs))}function K(N){var H;let X=Z(),Y=Se(),he=Y.findIndex(be=>be===X),re=Y[he+N];(H=d.current)!=null&&H.loop&&(re=he+N<0?Y[Y.length-1]:he+N===Y.length?Y[0]:Y[he+N]),re&&V.setState("value",re.getAttribute(zs))}function ie(N){let H=Z(),X=H?.closest(Jo),Y;for(;X&&!Y;)X=N>0?VP(X,Jo):UP(X,Jo),Y=X?.querySelector(gw);Y?V.setState("value",Y.getAttribute(zs)):K(N)}let J=()=>L(Se().length-1),te=N=>{N.preventDefault(),N.metaKey?J():N.altKey?ie(1):K(1)},D=N=>{N.preventDefault(),N.metaKey?L(0):N.altKey?ie(-1):K(-1)};return S.createElement(Pe.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:N=>{var H;(H=R.onKeyDown)==null||H.call(R,N);let X=N.nativeEvent.isComposing||N.keyCode===229;if(!(N.defaultPrevented||X))switch(N.key){case"n":case"j":{E&&N.ctrlKey&&te(N);break}case"ArrowDown":{te(N);break}case"p":case"k":{E&&N.ctrlKey&&D(N);break}case"ArrowUp":{D(N);break}case"Home":{N.preventDefault(),L(0);break}case"End":{N.preventDefault(),J();break}case"Enter":{N.preventDefault();let Y=Z();if(Y){let he=new Event(ap);Y.dispatchEvent(he)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:qP},m),gd(e,N=>S.createElement(aE.Provider,{value:V},S.createElement(rE.Provider,{value:P},N))))}),DP=S.forwardRef((e,t)=>{var r,i;let o=fn(),l=S.useRef(null),u=S.useContext(iE),d=Ol(),m=oE(e),p=(i=(r=m.current)==null?void 0:r.forceMount)!=null?i:u?.forceMount;Di(()=>{if(!p)return d.item(o,u?.id)},[p]);let y=lE(o,l,[e.value,e.children,l],e.keywords),v=xg(),b=Za(B=>B.value&&B.value===y.current),x=Za(B=>p||d.filter()===!1?!0:B.search?B.filtered.items.get(o)>0:!0);S.useEffect(()=>{let B=l.current;if(!(!B||e.disabled))return B.addEventListener(ap,w),()=>B.removeEventListener(ap,w)},[x,e.onSelect,e.disabled]);function w(){var B,V;_(),(V=(B=m.current).onSelect)==null||V.call(B,y.current)}function _(){v.setState("value",y.current,!0)}if(!x)return null;let{disabled:E,value:R,onSelect:T,forceMount:O,keywords:M,...k}=e;return S.createElement(Pe.div,{ref:Gs(l,t),...k,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)}),kP=S.forwardRef((e,t)=>{let{heading:r,children:i,forceMount:o,...l}=e,u=fn(),d=S.useRef(null),m=S.useRef(null),p=fn(),y=Ol(),v=Za(x=>o||y.filter()===!1?!0:x.search?x.filtered.groups.has(u):!0);Di(()=>y.group(u),[]),lE(u,d,[e.value,e.heading,m]);let b=S.useMemo(()=>({id:u,forceMount:o}),[o]);return S.createElement(Pe.div,{ref:Gs(d,t),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},r&&S.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:p},r),gd(e,x=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?p:void 0},S.createElement(iE.Provider,{value:b},x))))}),zP=S.forwardRef((e,t)=>{let{alwaysRender:r,...i}=e,o=S.useRef(null),l=Za(u=>!u.search);return!r&&!l?null:S.createElement(Pe.div,{ref:Gs(o,t),...i,"cmdk-separator":"",role:"separator"})}),LP=S.forwardRef((e,t)=>{let{onValueChange:r,...i}=e,o=e.value!=null,l=xg(),u=Za(p=>p.search),d=Za(p=>p.selectedItemId),m=Ol();return S.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),S.createElement(Pe.input,{ref:t,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":d,id:m.inputId,type:"text",value:o?e.value:u,onChange:p=>{o||l.setState("search",p.target.value),r?.(p.target.value)}})}),$P=S.forwardRef((e,t)=>{let{children:r,label:i="Suggestions",...o}=e,l=S.useRef(null),u=S.useRef(null),d=Za(p=>p.selectedItemId),m=Ol();return S.useEffect(()=>{if(u.current&&l.current){let p=u.current,y=l.current,v,b=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let x=p.offsetHeight;y.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return b.observe(p),()=>{cancelAnimationFrame(v),b.unobserve(p)}}},[]),S.createElement(Pe.div,{ref:Gs(l,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":i,id:m.listId},gd(e,p=>S.createElement("div",{ref:Gs(u,m.listInnerRef),"cmdk-list-sizer":""},p)))}),IP=S.forwardRef((e,t)=>{let{open:r,onOpenChange:i,overlayClassName:o,contentClassName:l,container:u,...d}=e;return S.createElement(vp,{open:r,onOpenChange:i},S.createElement(bp,{container:u},S.createElement(xp,{"cmdk-overlay":"",className:o}),S.createElement(wp,{"aria-label":e.label,"cmdk-dialog":"",className:l},S.createElement(sE,{ref:t,...d}))))}),PP=S.forwardRef((e,t)=>Za(r=>r.filtered.count===0)?S.createElement(Pe.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),FP=S.forwardRef((e,t)=>{let{progress:r,children:i,label:o="Loading...",...l}=e;return S.createElement(Pe.div,{ref:t,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},gd(e,u=>S.createElement("div",{"aria-hidden":!0},u)))}),pd=Object.assign(sE,{List:$P,Item:DP,Input:LP,Group:kP,Separator:zP,Dialog:IP,Empty:PP,Loading:FP});function VP(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function UP(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function oE(e){let t=S.useRef(e);return Di(()=>{t.current=e}),t}var Di=typeof window>"u"?S.useEffect:S.useLayoutEffect;function Ls(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function Za(e){let t=xg(),r=()=>e(t.snapshot());return S.useSyncExternalStore(t.subscribe,r,r)}function lE(e,t,r,i=[]){let o=S.useRef(),l=Ol();return Di(()=>{var u;let d=(()=>{var p;for(let y of r){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(p=y.current.textContent)==null?void 0:p.trim():o.current}})(),m=i.map(p=>p.trim());l.value(e,d,m),(u=t.current)==null||u.setAttribute(zs,d),o.current=d}),o}var HP=()=>{let[e,t]=S.useState(),r=Ls(()=>new Map);return Di(()=>{r.current.forEach(i=>i()),r.current=new Map},[e]),(i,o)=>{r.current.set(i,o),t({})}};function BP(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function gd({asChild:e,children:t},r){return e&&S.isValidElement(t)?S.cloneElement(BP(t),{ref:t.ref},r(t.props.children)):r(t)}var qP={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function GP({className:e,...t}){return f.jsx(pd,{"data-slot":"command",className:We("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function ZP({className:e,...t}){return f.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[f.jsx(w_,{className:"size-4 shrink-0 opacity-50"}),f.jsx(pd.Input,{"data-slot":"command-input",className:We("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),...t})]})}function KP({className:e,...t}){return f.jsx(pd.List,{"data-slot":"command-list",className:We("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function YP({className:e,...t}){return f.jsx(pd.Item,{"data-slot":"command-item",className:We("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),...t})}function vw(e,t){if(!e)return{score:0,hits:[]};const r=e.toLowerCase(),i=t.toLowerCase();let o=0,l=0,u=0;const d=[];for(let m=0;m3&&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?vw(o,t):null}function XP({text:e,hits:t}){const r=[];let i=0;return t.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 JP({open:e,onClose:t,candidates:r}){const[i,o]=S.useState(""),l=S.useMemo(()=>{if(!e)return[];const d=[];for(const m of r()){const p=QP(i,m.label);p&&d.push({...m,score:p.score,hits:p.hits})}return d.sort((m,p)=>p.score-m.score),d.slice(0,40)},[e,i,r]);S.useEffect(()=>{e&&o("")},[e]);const u=d=>{t(),d.run()};return f.jsx(Wu,{open:e,onOpenChange:d=>!d&&t(),children:f.jsxs(ed,{id:"palette",className:"palette",showCloseButton:!1,"aria-describedby":void 0,children:[f.jsx(El,{className:"sr-only",children:"Search and quick actions"}),f.jsxs(GP,{shouldFilter:!1,loop:!0,children:[f.jsxs("div",{id:"palette-inputwrap",children:[f.jsx(nt,{name:"search"}),f.jsx(ZP,{placeholder:"Search file names, projects, actions…",autoComplete:"off",spellCheck:!1,value:i,onValueChange:o})]}),f.jsx(KP,{children:l.length===0?f.jsx("div",{className:"pempty",children:"No matches — search covers file names, projects, and actions"}):l.map(d=>f.jsxs(YP,{value:d.kind+":"+d.label,onSelect:()=>u(d),children:[f.jsx("span",{className:"picon",children:f.jsx(nt,{name:d.icon})}),f.jsx(XP,{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"})]})]})})}function WP(e,t){return Ft({queryKey:["heatDevices",e],queryFn:()=>qt(e+"heat?by=device&days=30"),enabled:t,retry:!1,staleTime:6e4}).data?.devices??null}const eF=["all","human","agent","share"],tF={all:"All reads",human:"Human reads",agent:"Agent reads",share:"Shared reads"},nF={agent:{agent:1,human:0,share:0},human:{agent:0,human:1,share:0},share:{agent:0,human:0,share:1}};function yw(e){const[t,r]=S.useState("all"),{flatFiles:i,heatMap:o,devices:l,scope:u}=e,d=w=>!u||w===u||w.startsWith(u+"/"),m=u?i.filter(w=>d(w.path)):i;if(!e.loading&&!m.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",...Qs(e.installHref),children:"Set up a device →"})]})]});const p=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=m.map(w=>{const _=o&&o[w.path]||{},E=w.time?Math.max(0,(y-new Date(w.time).getTime())/864e5):0,R=t==="all"?na(_):_[t]||0;return{path:w.path,reads:R,agent:_.agent||0,human:_.human||0,share:_.share||0,total:na(_),days:E,danger:GC(R,E)}}),b=fI(o,new Set(i.map(w=>w.path))).filter(d).map(w=>{const _=o[w];return{path:w,reads:t==="all"?na(_):_[t]||0,agent:_.agent||0,human:_.human||0,share:_.share||0,total:na(_),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:[ip(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. ${Ci}`:"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. "+Ci}),f.jsx("div",{className:"in-lens",children:eF.map(w=>f.jsx("button",{className:"in-lens-btn"+(w===t?" active":""),onClick:()=>r(w),children:tF[w]},w))}),f.jsx("h3",{className:"dl-h3",children:"Map — cell size = reads, color = freshness (scale below)"}),f.jsx(aF,{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(sF,{pts:v,onOpenFile:e.onOpenFile}),x,f.jsx("h3",{className:"dl-h3",children:"Hot path — top files by reads"}),f.jsx(oF,{pts:[...v,...b],lens:t,onOpenFile:e.onOpenFile,onOpenHistory:e.onOpenHistory}),p&&p.length>0&&f.jsxs(f.Fragment,{children:[f.jsx("h3",{className:"dl-h3",children:"Agent coverage — which agents read which areas"}),f.jsx(lF,{devices:p})]})]})}const rF="rgb(150,156,164)";function cE(e){const t=[[76,195,138],[232,196,84],[224,93,93]],r=Math.min(1,Math.max(0,e/300))*(t.length-1),i=Math.min(t.length-2,Math.floor(r)),o=r-i,l=t[i].map((u,d)=>Math.round(u+(t[i+1][d]-u)*o));return`rgb(${l[0]},${l[1]},${l[2]})`}function bw(e,t,r,i,o){const l=e.reduce((p,y)=>p+y.value,0);if(!l||i<=0||o<=0)return[];const u=e.slice().sort((p,y)=>y.value-p.value).map(p=>({it:p,a:p.value/l*i*o})),d=(p,y)=>{const b=p.reduce((w,_)=>w+_.a,0)/y;let x=0;for(const w of p){const _=w.a/b;x=Math.max(x,_/b,b/_)}return x},m=[];for(;u.length;){const p=i>=o,y=p?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;p?m.push({item:w.it,x:t,y:r+x,w:b,h:_}):m.push({item:w.it,x:t+x,y:r,w:_,h:b}),x+=_}p?(t+=b,i-=b):(r+=b,o-=b)}return m}const hm=15;function xw(e,t,r){const i=Math.floor((r-8)/6),o=`${e} · ${t}`;return o.length<=i?{label:o,fit:i}:{label:e.length>i?e.slice(0,Math.max(1,i-1))+"…":e,fit:i}}const ip=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function aF({pts:e,onOpenFile:t,onOpenFolder:r,isFolder:i}){const u=mI(e.map(y=>y.days)),d=!!u&&pI(u.min,u.max),m=new Map;for(const y of e){const v=y.path.includes("/")?y.path.split("/")[0]:"/";let b=m.get(v);b||m.set(v,b={name:v,files:[],value:0,reads:0}),b.files.push(y),b.value+=y.reads+1,b.reads+=y.reads}const p=[];for(const y of bw([...m.values()],0,0,720,480)){const v=y.item,b=v.name==="/"?"":v.name,x=v.name==="/"?"(root)":v.name;if(p.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+"/"} — ${ip(v.reads,"read")}/30d · ${ip(v.files.length,"file")}`})},"g"+v.name)),y.w>46&&y.h>hm+10){const{label:_}=xw(x,v.reads,y.w);p.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=bw(v.files.map(_=>({..._,name:_.path.split("/").pop(),value:_.reads+1})),y.x+2,y.y+hm,Math.max(0,y.w-4),Math.max(0,y.h-hm-2));for(const _ of w)if(p.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?rF:cE(_.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}=xw((_.item.danger?"⚠ ":"")+_.item.name,_.item.reads,_.w);R>=5&&p.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 t(b);const x=v.getAttribute("data-dir");x&&i(x)&&r(x)},children:p}),f.jsx(iF,{range:u,flat:d})]})}function iF({range:e,flat:t}){if(!e)return null;const r=gI(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"+(t?" in-sw-flat":""),style:{background:`linear-gradient(to right, ${[0,60,150,300].map(cE).join(", ")})`}}),"300d+",f.jsx("span",{className:"in-tm-range",children:t?`all files here: ${r} old — colour off, not enough range to rank`:`observed: ${r} old`})]})}function sF({pts:e,onOpenFile:t}){const o={l:44,r:16,t:20,b:34},l=Math.max(ks*2,...e.map(w=>w.days)),u=Math.max(rl*2,...e.map(w=>w.reads)),d=w=>Math.log10(w+1)/Math.log10(l+1),m=w=>Math.log10(w+1)/Math.log10(u+1),p=w=>3+4*w,y=p(1),v=w=>o.l+y+d(w)*(720-o.l-o.r-2*y),b=w=>360-o.b-y-m(w)*(360-o.t-o.b-2*y),x=bI(e.filter(w=>w.danger).map(w=>({path:w.path,reads:w.reads,cx:v(w.days),cy:b(w.reads),r:p(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(ks),y:o.t,width:720-o.r-v(ks),height:b(rl)-o.t,className:"in-danger-zone"}),f.jsx("line",{x1:v(ks),y1:o.t,x2:v(ks),y2:360-o.b,className:"in-threshold"}),f.jsx("line",{x1:o.l,y1:b(rl),x2:720-o.r,y2:b(rl),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(p(_).toFixed(1)),className:"in-pt"+(w.danger?" danger":w.reads?"":" cold"),onClick:()=>t(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 oF({pts:e,lens:t,onOpenFile:r,onOpenHistory:i}){const o=e.filter(d=>d.reads>0).sort((d,m)=>m.reads-d.reads||m.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 m=nF[t]??dI(d),p=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:(p*m.agent).toFixed(1)+"%"}}),f.jsx("span",{className:"in-hp-human",style:{width:(p*m.human).toFixed(1)+"%"}}),f.jsx("span",{className:"in-hp-share",style:{width:(p*m.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 lF({devices:e}){const t=new Map;for(const b of e)for(const[x,w]of Object.entries(b.folders||{}))t.set(x,(t.get(x)||0)+w);const r=[...t.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,m=720,p=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 ${m} ${p}`,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 uE(e){return new Set(e.entries.map(t=>t.path)).size}function cF(e){const t=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(t(l));if(d){d.entries.push(l),d.idx.push(u);return}r.set(t(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(t(l)):void 0;if(!d||uE(d)<2){i.push({i:u});return}o.has(d)||(o.add(d),i.push({run:d,i:u}))}),i}function uF(e){const{filters:t,authors:r,onChange:i}=e,o=(y,v)=>i({...t,[y]:v||void 0}),[l,u]=S.useState(t?.q??""),d=S.useRef(!1);S.useEffect(()=>{d.current||u(t?.q??"")},[t?.q]),S.useEffect(()=>{if(!d.current)return;const y=setTimeout(()=>{d.current=!1,l!==(t?.q??"")&&o("q",l)},250);return()=>clearTimeout(y)},[l]);const m=t?.user&&!r.includes(t.user)?[t.user,...r]:r,p=Xp(t);return f.jsxs("div",{className:"hfilters",children:[f.jsxs("label",{className:"hf-search",children:[f.jsx(nt,{name:"search"}),f.jsx(hu,{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:t?.user??"","aria-label":"Filter by author",onChange:y=>o("user",y.target.value),children:[f.jsx("option",{value:"",children:"Anyone"}),m.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(hu,{type:"date",className:"hf-date",value:t?.since??"","aria-label":"From date (UTC)",onChange:y=>o("since",y.target.value)}),f.jsx("span",{className:"hf-dash",children:"–"}),f.jsx(hu,{type:"date",className:"hf-date",value:t?.until??"","aria-label":"To date (UTC)",onChange:y=>o("until",y.target.value)})]}),p&&f.jsx("button",{type:"button",className:"hf-clear",onClick:()=>i({}),children:"Clear"})]})}function dF(e){const t=new Set;for(const r of e)r.user&&t.add(r.user);return[...t].sort()}function fF(e){const{apiBase:t,target:r,isFolder:i,onMeta:o,onRendered:l,restore:u,remove:d,undoRun:m,filters:p}=e,y=S.useMemo(()=>new Set(e.flatFiles.map(ne=>ne.path)),[e.flatFiles]),v=r?i(r)?{prefix:r+"/"}:{path:r}:{prefix:""},b=("path"in v&&v.path!==void 0?"path="+encodeURIComponent(v.path):"prefix="+encodeURIComponent(v.prefix??""))+D_(p).replace("?","&"),{data:x,error:w,isPending:_,fetchNextPage:E,hasNextPage:R,isFetchingNextPage:T}=b2({queryKey:["history",t,b],queryFn:({pageParam:ne})=>qt(t+"history?"+b+"&n=100"+(ne?"&cursor="+encodeURIComponent(ne):"")),initialPageParam:"",getNextPageParam:ne=>ne.next_cursor,staleTime:15e3}),O=S.useRef(new Set);S.useEffect(()=>{w&&o("History unavailable: "+w.message)},[w,o]),S.useEffect(()=>{x&&l?.()},[x,l]);const M=x?x.pages.flatMap(ne=>ne.entries||[]):[];for(const ne of dF(M))O.current.add(ne);const k=e.onFilters&&f.jsx(uF,{filters:p,authors:[...O.current].sort(),onChange:e.onFilters});if(!x)return f.jsxs("div",{className:"history",children:[k,_&&!w&&f.jsx("div",{className:"empty",children:"Loading…"})]});const B=ne=>{for(let ce=ne+1;ce{const ce=M[ne].kind==="delete"?B(ne):M[ne].blob;return ce&&ce===V.get(M[ne].path)?void 0:ce},pe=ne=>V.get(M[ne].path)==="";return f.jsxs("div",{className:"history",children:[k,M.length===0&&(Xp(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."})),cF(M).map((ne,ce)=>ne.run?f.jsx(hF,{run:ne.run,known:y,onOpen:e.onOpen,apiBase:t,prevBlob:B,restoreSha:P,recreates:pe,restore:u,remove:d,undoRun:m},"g"+ce):f.jsx(bg,{entry:M[ne.i],apiBase:t,onOpen:e.onOpen,diff:{apiBase:t,prev:B(ne.i)},restore:u,restoreSha:P(ne.i),recreates:pe(ne.i)},"r"+ne.i)),R&&f.jsx("button",{type:"button",className:"btn hmore",onClick:()=>E(),disabled:T,children:T?"Loading…":"Load more"})]})}function hF({run:e,known:t,onOpen:r,apiBase:i,prevBlob:o,restoreSha:l,recreates:u,restore:d,remove:m,undoRun:p}){const[y,v]=S.useState(!0),b=e.entries[0],x=hd(b),w=[b.device.name||b.device.id,b.device.os].filter(Boolean).join(" · "),_=b.session,E=b.device?.id,{data:R}=Ft({queryKey:["session-reads",i,_,E],queryFn:()=>qt(i+"heat?session="+encodeURIComponent(_)+"&device="+encodeURIComponent(E)),enabled:!!_&&!!E,staleTime:3e4}),T=new Set(R?.paths??[]),O=new Set(e.entries.map(pe=>pe.path)),M=[...T].filter(pe=>!O.has(pe)).sort(),k=e.entries.map(pe=>new Date(pe.time).getTime()),B=mF(Math.min(...k),Math.max(...k)),V=uE(e),P=!!p?.busy&&p.busy===(e.session||e.note);return f.jsxs("div",{className:"hrun"+(y?" open":""),children:[f.jsxs("div",{className:"hrun-head",children:[f.jsx("button",{type:"button",className:"hrun-toggle","aria-expanded":y,title:y?"Collapse this run":"Expand this run",onClick:()=>v(!y),children:f.jsx(nt,{name:y?"chevd":"chev"})}),f.jsx("span",{className:"hrun-note",children:f.jsx(JC,{text:e.note})}),f.jsxs("span",{className:"hrun-meta",children:[T.size>0?`read ${T.size} · changed ${V}`:`${V} file${V===1?"":"s"}`," ·"," ",x,w?" · "+w:""]}),f.jsx("span",{className:"hrun-time",children:B}),p&&f.jsxs("button",{type:"button",className:"hrun-undo",disabled:P,title:"Put every file this run touched back the way it was",onClick:()=>p.onUndoRun(e),children:[f.jsx(nt,{name:"hist"}),P?"undoing…":"undo this run"]})]}),y&&f.jsxs("div",{className:"hrun-body",children:[e.entries.map((pe,ne)=>f.jsx(bg,{entry:pe,apiBase:i,onOpen:r,diff:{apiBase:i,prev:o(e.idx[ne])},restore:d,remove:m,restoreSha:l(e.idx[ne]),recreates:u(e.idx[ne]),inRun:!0,read:T.has(pe.path)},ne)),M.length>0&&f.jsxs("div",{className:"hrun-reads",children:[f.jsx("div",{className:"hrun-reads-head",children:"Read, not changed"}),M.map(pe=>f.jsxs("button",{type:"button",className:"hrun-read",onClick:()=>r(pe),children:[f.jsx("span",{className:"hkind",children:"read"}),f.jsx("span",{className:"hpath",children:pe}),!t.has(pe)&&f.jsx("span",{className:"in-hp-gone",children:"· no longer in the project"})]},pe))]}),_&&f.jsx("div",{className:"hrun-foot",children:"Reads shown are what this device reported for this session — a narrower set than the project's read totals."})]})]})}function mF(e,t){const r=new Date(e),i=new Date(t),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===t?l+" "+o(i):l+" "+o(r)+" – "+o(i)}function pF(e,t){return e?t(e)?e+"/ (folder)":e:"all changes"}function gF(e){const{apiBase:t,path:r,version:i}=e,o="path="+encodeURIComponent(r),{data:l}=Ft({queryKey:["history",t,o,200],queryFn:()=>qt(t+"history?"+o+"&n=200"),staleTime:15e3}),u=l?.entries?.find(y=>y.blob===i),d=u?hd(u):"",m=u?.time?new Date(u.time).toLocaleString():"",p=t+"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(nt,{name:"clock"})}),f.jsxs("div",{className:"vb-text",children:[f.jsx("b",{children:[m&&"Version from "+m,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:p,children:"Download this version"})]})]})}function vF(e){const{conflict:t,originalHref:r}=e,i=t.device||"another device";return f.jsxs("div",{className:"vbanner",role:"status",children:[f.jsx("span",{className:"vb-icon",children:f.jsx(nt,{name:"alert"})}),f.jsxs("div",{className:"vb-text",children:[f.jsx("b",{children:"Conflict copy — a concurrent edit, preserved"}),f.jsxs("span",{children:[i," edited this file at the same time as someone else on"," ",t.when.toLocaleString(),". Rather than drop either version, beardrive kept that one here."," ",r?f.jsxs(f.Fragment,{children:["The other version lives at ",f.jsx("code",{children:t.original})]}):f.jsx(f.Fragment,{children:"The other version kept the original name."})]})]}),r&&f.jsx("div",{className:"vb-actions",children:f.jsx("button",{className:"ai-btn",onClick:r,children:"Open the other version"})})]})}function dE(e){const{config:t,apiBase:r,route:i,hub:o,project:l}=e,u=Wp(),d=ki(),{tree:m,flatFiles:p,dirIndex:y,loaded:v}=SI(r,!o||!!l),b=_I(r,o&&!!l&&!!t.reads?.enabled),x=o&&!!l&&!i.path&&!i.view,w=i.view==="dashboard"||x,_=WP(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&&p.some(ee=>ee.path===E),k=!!E&&v&&!O&&!M,B=O&&!i.view,{data:V}=Ft({queryKey:["resolve",r,E],queryFn:()=>qt(r+"resolve?path="+encodeURIComponent(E)),enabled:k,retry:!1,staleTime:6e4}),[P,pe]=S.useState(null);S.useEffect(()=>{!k||!V?.to||(pe({from:E,to:V.to}),Yt(Oi(V.to,l?.id),{replace:!0}))},[k,V,E,l?.id]);const[ne,ce]=S.useState(()=>new Set),me=S.useRef(!0);S.useEffect(()=>{if(!m||!me.current)return;me.current=!1;const ee=(m.children||[]).filter(le=>le.dir);ee.length===1&&ce(le=>new Set(le).add(ee[0].path))},[m]),S.useEffect(()=>{!T||!v||ce(ee=>{const le=new Set(ee);for(const Re of BI(T))le.add(Re);return y.has(T)&&le.add(T),le})},[T,v,y]);const fe=S.useCallback(ee=>{ce(le=>{const Re=new Set(le);return Re.has(ee)?Re.delete(ee):Re.add(ee),Re})},[]),Z=S.useRef(null),Se=S.useRef(new Map),L=S.useRef({key:"",want:0,attempts:0});S.useEffect(()=>{L.current={key:u,want:F3()==="POP"?Se.current.get(u)??0:0,attempts:0}},[u]);const K=S.useCallback(()=>{const ee=Z.current,le=L.current;!ee||le.key!==u||le.attempts>=3||(le.attempts++,ee.scrollTo({top:le.want,behavior:"instant"}))},[u]),ie=S.useCallback(()=>{Z.current&&Se.current.set(u,Z.current.scrollTop)},[u]),J=S.useCallback((ee,le)=>{Yt(Oi(ee,l?.id,le)),hr()},[l?.id]),te=S.useCallback(ee=>Yt(An("history",l?.id,ee)),[l?.id]),[D,N]=S.useState(""),[H,X]=S.useState(null),[Y,he]=S.useState(!1),[re,be]=S.useState(!1);S.useEffect(()=>KD(()=>be(!0)),[]);const xe=S.useRef(null),Me=e.panel??null,Fe=!Me&&o&&!!l&&M&&_i(l.perm,"write"),{data:He}=O_(l?.id,o&&!!l),ct=S.useCallback(()=>{d.invalidateQueries({queryKey:["shares",l?.id]})},[d,l?.id]),Je=M?(He||[]).filter(ee=>ee.path===E):[],hn=!Me&&o&&!!l,mn=!Me&&M,Xt=!Me&&(M||o&&!!l&&O),yr=R?r+"blob?sha="+R+"&name="+encodeURIComponent(E)+"&download=1":r+"download?path="+encodeURIComponent(E),At=S.useCallback(async()=>{const ee=le=>fetch(r+"shares",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(le?{path:E,confirm:!0}:{path:E})});try{let le=await ee(!1);if(le.status===409){const{findings:it}=await le.json();if(!await za("This file may contain credentials",lP(it),"Share anyway",!0))return;le=await ee(!0)}if(!le.ok)throw new Error(await le.text());const Re=await le.json();Lw("share_created");const ze=await Ni(Re.url);X({url:Re.url,copied:ze}),ct()}catch(le){qe("Share failed: "+le.message,!0)}},[r,E,ct]),[rr,br]=S.useState(""),Rt=o&&!!l&&_i(l?.perm,"write"),Vn=S.useCallback(async(ee,le,Re)=>{if(await za("Restore this version of "+ee+"?","It syncs to every device as a new change. "+(Re?"The file comes back on every device. Removing it again isn't available from History yet.":"You can restore any other version afterwards."),"Restore")){br(ee+le);try{await ea(r+"restore",{path:ee,sha:le}),d.invalidateQueries({queryKey:["history",r]}),d.invalidateQueries({queryKey:["tree",r]}),d.invalidateQueries({queryKey:["render",r,ee]}),d.invalidateQueries({queryKey:["text"]}),qe("Restored "+ee+" — it syncs to every device like any other change.")}catch(ze){qe("Restore failed: "+ze.message,!0)}finally{br("")}}},[r,d]),[zt,Dr]=S.useState(""),ar=S.useCallback(async ee=>{if(await za("Remove "+ee+"?","It disappears from every synced device. History keeps it — you can restore it from the DELETED row afterwards.","Remove file",!0)){Dr(ee);try{await ea(r+"remove",{path:ee}),d.invalidateQueries({queryKey:["history",r]}),d.invalidateQueries({queryKey:["tree",r]}),d.invalidateQueries({queryKey:["render",r,ee]}),d.invalidateQueries({queryKey:["text"]}),qe("Removed "+ee+" — it syncs to every device like any other change.")}catch(le){qe("Remove failed: "+le.message,!0)}finally{Dr("")}}},[r,d]),[oa,ir]=S.useState(""),la=S.useCallback(async ee=>{const le=ee.session||ee.note,Re=ee.session?{session:ee.session,device:ee.entries[0]?.device?.id}:{note:ee.note,device:ee.entries[0]?.device?.id};ir(le);try{const ze=await ea(r+"undo-run",{...Re,preview:!0}),it=new Set(ze.changed_after);if(!ze.undone.length){qe("Nothing to undo — every file this run touched already holds its pre-run content.");return}if(!await za("Undo this run?",f.jsxs(f.Fragment,{children:[f.jsxs("div",{children:[ee.note||le," — ",ze.undone.length," file",ze.undone.length===1?"":"s"]}),f.jsx("div",{className:"undo-list",children:ze.undone.map(st=>f.jsxs("div",{className:"undo-row",children:[f.jsx("span",{className:"undo-path",children:st.path}),it.has(st.path)&&f.jsx("span",{className:"undo-after",children:"changed after this run"}),f.jsx("span",{className:"undo-what",children:st.action==="remove"?"remove (the run created it)":"restore to pre-run version"})]},st.path))}),it.size>0&&f.jsxs("div",{className:"undo-warn",children:[it.size," file",it.size===1?" was":"s were"," changed by someone else after this run. Undoing overwrites ",it.size===1?"that change":"those changes"," too."]}),ze.skipped.length>0&&f.jsxs("div",{children:[ze.skipped.length," already hold",ze.skipped.length===1?"s":""," its pre-run content and will be left alone."]}),ze.refused.length>0&&f.jsxs("div",{children:[ze.refused.length," path",ze.refused.length===1?"":"s"," can't be written by the hub and will be left alone: ",ze.refused.join(", "),"."]})]}),"Undo run",!0))return;const Ae=await ea(r+"undo-run",Re);d.invalidateQueries({queryKey:["history",r]}),d.invalidateQueries({queryKey:["tree",r]}),d.invalidateQueries({queryKey:["render",r]}),d.invalidateQueries({queryKey:["text"]});const ut=Ae.skipped.length?`, skipped ${Ae.skipped.length} (already current)`:"";qe(`Undid ${Ae.undone.length} file${Ae.undone.length===1?"":"s"}${ut}.`)}catch(ze){qe("Undo failed: "+ze.message,!0)}finally{ir("")}},[r,d]),Jt=S.useCallback(()=>{if(!E)return te("");te(O?E+"/":E)},[E,O,te]);S.useEffect(()=>{const ee=le=>{(le.metaKey||le.ctrlKey)&&le.key.toLowerCase()==="k"&&(le.preventDefault(),be(Re=>!Re))};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[]);const A=S.useCallback(()=>{const ee=[],le=(Re,ze,it,_t)=>ee.push({icon:Re,label:ze,kind:it,run:_t});if(o&&l){const Re=l.id,ze=it=>()=>{e.onClosePanel?.(),Yt(it)};le("folder",l.name+" — project root","project",ze("/"+Re)),le("dashboard","Dashboard","action",ze(An("dashboard",Re))),le("terminal","Installation","action",ze(An("install",Re))),le("gear","Settings","action",ze(An("settings",Re)))}if(o&&l&&E&&(M&&le("share","Share: "+E,"action",At),le("hist","History: "+E,"action",Jt),M&&le("download","Download: "+E,"action",()=>xe.current?.click())),o&&l&&le("hist","History: whole project","action",()=>te("")),o)for(const Re of e.projects||[])(!l||Re.id!==l.id)&&le("folder","Switch to project: "+Re.name,"project",()=>Yt("/"+Re.id));t.auth?.enabled&&le("power","Sign out","action",()=>window.location.href="/auth/logout");for(const Re of y.keys())le("folder",Re,"folder",()=>J(Re));for(const Re of p)le("doc",Re.path,"file",()=>J(Re.path));return ee},[o,l,E,M,t.auth?.enabled,y,p,e.projects,e.onClosePanel,At,Jt,te,J]);S.useEffect(()=>{if(!Y)return;const ee=()=>he(!1);return document.addEventListener("click",ee),()=>document.removeEventListener("click",ee)},[Y]);const I=S.useCallback(ee=>y.has(ee),[y]);let F="app",de,oe;if(Me)oe=Me.body;else if(i.view==="dashboard")oe=f.jsx(yw,{flatFiles:p,heatMap:b,devices:_,scope:i.viewTarget||"",loading:!v,installHref:l?An("install",l.id):void 0,onOpenFile:J,onOpenFolder:J,onOpenHistory:te,isFolder:I});else if(i.view==="history")oe=f.jsx(fF,{apiBase:r,target:i.viewTarget||"",isFolder:I,flatFiles:p,onOpen:J,onMeta:N,onRendered:K,restore:Rt?{onRestore:Vn,busy:rr}:void 0,remove:Rt?{onRemove:ar,busy:zt}:void 0,undoRun:Rt?{onUndoRun:la,busy:oa}:void 0,filters:i.filters,onFilters:ee=>Yt(An("history",l?.id,i.viewTarget||"",ee))});else if(E)if(!v)oe=f.jsx("div",{className:"empty",children:"Loading…"});else if(k)oe=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"})]});else if(O)oe=f.jsx(rP,{node:y.get(E),heatMap:b,hub:o&&!!l,apiBase:r,onOpen:J,onFullHistory:te,onRendered:K});else{F=AC.test(E)||MC.test(E)?"wide":"read",de="markdown";const ee=YC(E);oe=f.jsxs(f.Fragment,{children:[R&&f.jsx(gF,{apiBase:r,path:E,version:R,onViewCurrent:()=>J(E)}),ee&&f.jsx(vF,{conflict:ee,originalHref:p.some(le=>le.path===ee.original)?()=>J(ee.original):void 0}),f.jsx(uP,{apiBase:r,path:E,version:R,heatMap:b,flatFiles:p,projectId:l?.id,onOpenFile:J,onMeta:N,onRendered:K})]})}else x?oe=f.jsxs(f.Fragment,{children:[f.jsx(BC,{project:l,existing:i.connect==="existing"}),f.jsx("div",{className:"home-insights",children:f.jsx(yw,{flatFiles:p,heatMap:b,devices:_,loading:!v,onOpenFile:J,onOpenFolder:J,onOpenHistory:te,isFolder:I})})]}):oe=f.jsx("div",{className:"empty",children:"Select a file to read it."});P&&P.to===E&&(oe=f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"vbanner",role:"status",children:[f.jsx("span",{className:"vb-icon",children:f.jsx(nt,{name:"link"})}),f.jsxs("div",{className:"vb-text",children:[f.jsxs("b",{children:["Moved from ",P.from]}),f.jsx("span",{children:"The URL has been updated."})]})]}),oe]}));const ye=Me?Me.crumb:E?f.jsx(qI,{path:E,onOpenFolder:J}):i.view==="dashboard"?"Dashboard — "+(i.viewTarget||l?.name||""):i.view==="history"?"History — "+pF(i.viewTarget||"",I):x?l.name:null,we=f.jsx(Hs,{crumb:ye,meta:D,actions:f.jsxs(f.Fragment,{children:[Fe&&f.jsx(xt,{id:"share-btn",variant:"toolbar",className:"icon-only",title:"Share","aria-label":"Share",onClick:At,children:f.jsx(nt,{name:"share"})}),hn&&!E&&!i.view&&f.jsxs(xt,{id:"history-btn",variant:"toolbar",onClick:Jt,children:[f.jsx(nt,{name:"hist"})," ",f.jsx("span",{className:"lbl",children:"History"})]}),mn&&f.jsx("a",{id:"download",hidden:!0,download:!0,href:yr,ref:xe,children:"Download"}),Xt&&f.jsx(xt,{id:"more-btn",variant:"toolbar",className:"icon-only",title:"More actions","aria-label":"More actions",onClick:ee=>{ee.stopPropagation(),he(!Y)},children:f.jsx(nt,{name:"dots"})}),Y&&f.jsxs("div",{id:"more-menu",role:"menu",children:[hn&&f.jsx("button",{className:"more-item",onClick:Jt,children:"History"}),mn&&f.jsx("button",{className:"more-item",onClick:()=>xe.current?.click(),children:"Download"}),o&&!!l&&f.jsx("button",{className:"more-item",onClick:()=>{e.onClosePanel?.(),Yt(An("dashboard",l?.id,E))},children:"Dashboard"})]})]})});return f.jsxs(f.Fragment,{children:[f.jsx(Us,{vault:e.sidebar.vault,projectsNav:e.sidebar.projectsNav,orgBar:e.sidebar.orgBar,tree:f.jsx(HI,{root:m,expanded:ne,onToggle:fe,currentPath:T,listingShowing:B,onOpen:J}),topbar:we,contentRef:Z,onContentScroll:ie,children:f.jsxs(al,{width:F,className:de,children:[!Me&&M&&f.jsx(wP,{shares:Je,canRevoke:!!l&&_i(l.perm,"write"),onChanged:ct}),oe]})}),H&&f.jsx(xP,{url:H.url,copied:H.copied,onClose:()=>{X(null),ct()}}),f.jsx(JP,{open:re,onClose:()=>be(!1),candidates:A})]})}function yF({config:e}){const t=Wp(),r=M_(),[i,o]=S.useState(null),[l,u]=S.useState(null);S.useEffect(()=>u(null),[t]);const d=S.useMemo(()=>{const Z=t.split("?")[0].match(/^\/join\/([0-9a-f]+)\/?$/);return Z?Z[1]:null},[t]),{data:m}=N3(!d),{data:p}=D3(!d),y=!!e.auth.admin,{data:v}=A_(y),b=S.useMemo(()=>k_(t,"hub"),[t]),[x,w]=S.useState(!1),_=e.upload.enabled,E=async(Z,Se)=>{const L=Se===qC;try{const K=await ea("/api/projects",{name:Z,template:L?"":Se});w(!1),await r(),Yt("/"+K.project.id+(L?"?connect=existing":"")),qe(`Created “${K.project.name}”.`)}catch(K){qe("Could not create the project: "+K.message,!0)}},R=x?f.jsx(cI,{templates:e.templates??[],onCreate:E,onClose:()=>w(!1)}):null,T=S.useMemo(()=>m&&(m.find(Z=>Z.id===b.project)||i&&m.find(Z=>Z.org===i)||m.find(Z=>Z.id===N$())||m[0])||null,[m,b.project,i]);if(S.useEffect(()=>{document.title=T?T.name+" — BearDrive":e.brand||"BearDrive",T&&D$(T.id)},[T,e]),d)return f.jsx(bF,{token:d,onDone:async Z=>{o(Z),await r(),Yt("/",{replace:!0})}});const O=e.brand||"BearDrive",M=T&&p?.find(Z=>Z.id===T.org)||null,k=f.jsx(Ju,{name:O,onHome:()=>Yt("/"),search:!!T,beta:O==="BearDrive"}),B=e.me?f.jsx(eI,{me:e.me,org:M,orgActive:!!b.org,billing:e.billing,admin:y?{pending:v?.length||0,onClick:()=>{u({kind:"hub"}),hr()}}:void 0}):void 0;if(!m||!p)return f.jsx(Us,{vault:k,topbar:f.jsx(Hs,{}),children:f.jsx(al,{children:f.jsx("div",{className:"empty",children:"Loading…"})})});if(!T)return f.jsxs(Us,{vault:k,projectsNav:f.jsx(rm,{projects:m,onNew:()=>w(!0)}),orgBar:B,topbar:f.jsx(Hs,{}),children:[f.jsx(al,{children:f.jsx(lI,{onNew:()=>w(!0),canCreate:_})}),R]});const V=l?.kind==="hub"?{crumb:"Signup & access",body:f.jsx(B$,{})}:null,P=b.org?p.find(Z=>Z.id===b.org):null,ne=b.org&&!P?{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",{...Qs("/"+T.id),children:["Back to ",T.name]})})]})}:P?{crumb:"Organization",body:f.jsx(V$,{org:P,projects:m,myEmail:e.me?.email||""})}:null;if(!!b.project&&!m.some(Z=>Z.id===b.project)){const Z=P3(m,b.project);return Z?f.jsx(Ds,{to:b.view?An(b.view,Z,b.viewTarget,b.filters):Oi(b.path,Z,b.version)}):f.jsxs(Us,{vault:k,projectsNav:f.jsx(rm,{projects:m,onNew:()=>w(!0)}),orgBar:B,topbar:f.jsx(Hs,{}),children:[f.jsx(al,{children:f.jsxs("div",{className:"empty",children:[f.jsx("h3",{children:"Project not found"}),f.jsxs("p",{children:["There's no project called “",td(b.project),"” in your account. It may have been renamed or deleted, or the link may be wrong."]}),f.jsx("p",{children:f.jsxs("a",{...Qs("/"+T.id),children:["Back to ",T.name]})})]})}),R]})}const me=b.billing?{crumb:"Billing",body:e.billing?f.jsx(tI,{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,fe=b.view==="settings"?{crumb:"Project settings",body:f.jsx(aI,{project:T,org:M,onDeleted:async()=>{await r(),Yt("/")}})}:b.view==="install"?{crumb:"Installation",body:f.jsx(BC,{project:T,existing:b.connect==="existing"})}:null;return!b.org&&!b.billing&&b.project!==T.id?f.jsx(Ds,{to:"/"+T.id}):b.legacyView&&b.view?f.jsx(Ds,{to:An(b.view,T.id,b.viewTarget,b.filters)}):b.queryTarget&&b.view?f.jsx(Ds,{to:An(b.view,T.id,b.viewTarget,b.filters)}):b.trailingSlash&&b.path?f.jsx(Ds,{to:Oi(b.path,T.id,b.version)}):f.jsxs(f.Fragment,{children:[f.jsx(dE,{config:e,apiBase:"/api/p/"+T.id+"/",route:b,hub:!0,project:T,projects:m,sidebar:{vault:k,projectsNav:f.jsx(rm,{projects:m,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),Yt(An("dashboard",T.id)),hr()},onInstall:()=>{u(null),Yt(An("install",T.id)),hr()},onHistory:()=>{u(null),Yt(An("history",T.id)),hr()},onSettings:()=>{u(null),Yt(An("settings",T.id)),hr()}}}),orgBar:B},panel:V||ne||me||fe,onClosePanel:()=>u(null)},T.id),R]})}function bF({token:e,onDone:t}){return S.useEffect(()=>{let r=!1;return ea("/api/invites/"+e).then(i=>{r||(qe(`Welcome — you joined the “${i.org.name}” team. Opening its projects…`),t(i.org.id))}).catch(i=>{r||String(i.message).includes("signing in")||(qe("Could not accept the invite: "+i.message,!0),t(null))}),()=>{r=!0}},[e]),f.jsx(Us,{vault:f.jsx(Ju,{name:"BearDrive",beta:!0}),topbar:f.jsx(Hs,{}),children:f.jsx(al,{children:f.jsx("div",{className:"empty",children:"Joining…"})})})}function xF({config:e}){const t=Wp(),r=e.volume||"BearDrive";S.useEffect(()=>{document.title=e.brand||r},[e,r]);const i=S.useMemo(()=>k_(t,"volume"),[t]);return i.trailingSlash&&i.path?f.jsx(Ds,{to:Oi(i.path)}):f.jsx(dE,{config:e,apiBase:"/api/",route:i,hub:!1,sidebar:{vault:f.jsx(Ju,{name:r,showSignout:e.auth.enabled,search:!0})}})}function wF(){const{data:e}=C2();return f.jsxs(BD,{delayDuration:150,children:[e?e.mode==="hub"?f.jsx(yF,{config:e}):f.jsx(xF,{config:e}):f.jsx(Us,{vault:f.jsx(Ju,{name:"…",showSignout:!1}),topbar:f.jsx(Hs,{}),children:f.jsx("div",{className:"empty",children:"Loading…"})}),f.jsx(C3,{}),f.jsx(O3,{})]})}class SF extends S.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,r){console.error("BearDrive: unhandled render error",t,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 _F=new o2({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});kj.createRoot(document.getElementById("root")).render(f.jsx(S.StrictMode,{children:f.jsx(SF,{children:f.jsx(l2,{client:_F,children:f.jsx(wF,{})})})})); +`)continue;l+=y}}return u||((l!==""||o.length)&&m(),!i.length)||i[0].length<2?null:{rows:i,truncated:d}}const uP={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 dP(e){return`${uP[e.rule]??e.rule} (line ${e.line})`}function tE(e){const t=e.map(dP);return t.length>1?t.slice(0,-1).join(", ")+" and "+t[t.length-1]:t[0]||"something credential-shaped"}function fP(e=[]){return`BearDrive found ${tE(e)} 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 hP(e=[]){return`This file contains ${tE(e)}.`}function mP(e){const{apiBase:t,path:r,version:i,onMeta:o}=e,l=i?t+"blob?sha="+i+"&name="+encodeURIComponent(r):t+"file?path="+encodeURIComponent(r);return S.useEffect(()=>()=>o(""),[r,o]),T$.test(r)?f.jsx(vP,{...e}):AC.test(r)?f.jsx("iframe",{className:"htmlview",sandbox:"allow-scripts",src:l,title:r,onLoad:e.onRendered}):MC.test(r)?f.jsx("iframe",{className:"pdfview",src:l,title:r,onLoad:e.onRendered}):O$.test(r)?f.jsx(SP,{src:l,alt:r,version:i,onRendered:e.onRendered}):A$.test(r)?f.jsx(hw,{...e,fileURL:l,delim:/\.tsv$/i.test(r)?" ":","}):M$.test(r)?f.jsx(hw,{...e,fileURL:l}):f.jsx(pP,{...e,fileURL:l})}function pP(e){const{apiBase:t,path:r,version:i,fileURL:o,onRendered:l}=e,{data:u,error:d}=JC(o,["text",o],!0,!!i);return S.useEffect(()=>{u&&l?.()},[u,l]),d?f.jsx(md,{version:i,err:d}):u?u.kind==="text"?f.jsx("pre",{className:"plain",children:u.text},r):f.jsx(gP,{apiBase:t,path:r,version:i,fileURL:o,children:u.kind==="too-large"?`Too large to preview (${yg(u.size)}).`:"No preview for this file type."}):null}function gP(e){const{apiBase:t,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":t+"download?path="+encodeURIComponent(r),children:"Download"})]})}function vP(e){const{apiBase:t,path:r,version:i,heatMap:o,flatFiles:l,projectId:u,onOpenFile:d,onMeta:m,onRendered:p}=e,{data:y,error:v}=Ft({queryKey:["render",t,r,i||""],queryFn:()=>qt(t+"render?path="+encodeURIComponent(r)+(i?"&sha="+i:"")),retry:i?!1:void 0}),b=S.useMemo(()=>y?wP(y.html,r,t,l,u):"",[y,r,t,l,u]),[x,w]=S.useState(null);return S.useEffect(()=>{if(w(null),!Cj(b))return;let _=!1;return Ej(b).then(E=>{_||w(E)}),()=>{_=!0}},[b]),S.useEffect(()=>{if(!y)return;const _=[],E=i?null:o&&o[y.path],R=KC(E||null,y.time);(y.user_name||y.user||y.author)&&_.push(hd(y)+(y.device?" on "+y.device:"")),y.time&&_.push(new Date(y.time).toLocaleString());const T=E&&na(E)?nl(E)+" / 30d":"",O=R?f.jsxs("span",{className:"meta-stale",title:R,children:[f.jsx("span",{"aria-hidden":"true",children:"⚠ "}),R]}):null;m(T?f.jsxs(f.Fragment,{children:[O,O?" · ":"",_.length?_.join(" · ")+" · ":"",f.jsxs("span",{title:Ci,children:[T,f.jsxs("span",{className:"sr-only",children:[" — ",Ci]})]})]}):O?f.jsxs(f.Fragment,{children:[O,_.length?" · "+_.join(" · "):""]}):_.join(" · ")),p?.()},[y,i,o,m,p]),v?f.jsx(md,{version:i,err:v}):y?f.jsxs(f.Fragment,{children:[f.jsx(bP,{findings:y.findings}),y.frontmatter?.length?f.jsx(yP,{pairs:y.frontmatter}):null,f.jsx("div",{dangerouslySetInnerHTML:{__html:x??b},onClick:_=>xP(_,r,d)})]}):null}function yP({pairs:e}){const[t,r]=S.useState(L$);return f.jsxs("details",{className:"fmpanel",open:t,children:[f.jsx("summary",{onClick:i=>{i.preventDefault(),r(!t),$$(!t)},children:"Properties"}),f.jsx("dl",{children:e.map(i=>f.jsxs("div",{children:[f.jsx("dt",{children:i.key}),f.jsx("dd",{children:i.code?f.jsx("code",{children:i.value}):i.value})]},i.key))})]})}function bP({findings:e}){return e?.length?f.jsxs("div",{className:"sbadge",role:"status",children:[f.jsx("span",{className:"sb-icon",children:f.jsx(nt,{name:"shield"})}),f.jsxs("div",{className:"sb-text",children:[f.jsx("b",{children:hP(e)}),f.jsx("span",{children:"Checked when this page loaded. Sharing the file asks you to confirm first."})]})]}):null}function xP(e,t,r){const i=e.target.closest("a");if(!i||!e.currentTarget.contains(i)||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0)return;const o=i.getAttribute("href")||"",l=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"",u=i.getAttribute("data-wiki");u!==null?(e.preventDefault(),r(u)):/^([a-z]+:|\/|#)/i.test(o)||(e.preventDefault(),r(NC(l,decodeURIComponent(o))))}function wP(e,t,r,i,o){const l=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"",u=m=>r+"file?path="+encodeURIComponent(m),d=new DOMParser().parseFromString(e,"text/html");for(const m of d.querySelectorAll("img")){const p=m.getAttribute("src")||"";/^\s*data:image\/svg/i.test(p)?m.removeAttribute("src"):/^([a-z]+:|\/)/i.test(p)||m.setAttribute("src",u(NC(l,p)))}for(const m of d.querySelectorAll("a")){const p=m.getAttribute("href")||"";if(p.startsWith("wiki:")){const y=N$(decodeURIComponent(p.slice(5)),i);y?(m.setAttribute("href",Oi(y.path,o)),m.setAttribute("data-wiki",y.path)):(m.removeAttribute("href"),m.classList.add("wiki-missing"),m.setAttribute("title","No file matches this wikilink"));continue}/^\s*data:/i.test(p)?m.removeAttribute("href"):/^https?:/i.test(p)&&(m.setAttribute("target","_blank"),m.setAttribute("rel","noopener"))}return d.body.innerHTML}function SP(e){const[t,r]=S.useState(!1);return t?f.jsx(md,{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 md({version:e,err:t}){return f.jsx("div",{className:"empty",children:e?"That version isn't available.":"Could not load file: "+t.message})}function hw(e){const{path:t,version:r,fileURL:i,delim:o,onRendered:l}=e,{data:u,error:d}=Ft({queryKey:["text",i],queryFn:async()=>{const p=await fetch(i);if(!p.ok)throw new Error(await p.text());return p.text()},retry:r?!1:void 0});S.useEffect(()=>{u!=null&&l?.()},[u,l]);const m=S.useMemo(()=>o&&u!=null?cP(u,o,eE):null,[u,o]);return d?f.jsx(md,{version:r,err:d}):u==null?null:m?f.jsx(_P,{csv:m},t):f.jsx("pre",{className:"plain",children:u},t)}function _P({csv:e}){const[t,...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:t[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"]})]})}const CP=[{value:"",label:"Never"},{value:"24h",label:"In 24 hours"},{value:"168h",label:"In 7 days"},{value:"720h",label:"In 30 days"}];function EP({url:e,copied:t,onClose:r}){const i=e.split("/s/")[1],[o,l]=S.useState(""),[u,d]=S.useState(),[m,p]=S.useState(!1),y=S.useRef(null);async function v(b){const x=o;l(b),p(!0);try{const w=await Wn("PATCH","/api/shares/"+i,{expires_in:b});d(w.expires)}catch(w){qe(w.message,!0),l(x)}finally{p(!1)}}return f.jsx(Wu,{open:!0,onOpenChange:b=>!b&&r(),children:f.jsxs(ed,{className:"modal",showCloseButton:!1,onOpenAutoFocus:b=>{b.preventDefault(),y.current?.focus()},children:[f.jsx(El,{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:m,onChange:b=>v(b.target.value),children:CP.map(b=>f.jsx("option",{value:b.value,children:b.label},b.value))}),f.jsx("span",{className:"modal-expiry-note",children:LC(u)})]}),f.jsxs("div",{className:"modal-actions",children:[f.jsx(xt,{ref:y,variant:"primary",onClick:()=>Ni(e).then(b=>qe(b?"Copied.":"Select and copy the link above.")),children:t?"Copied ✓":"Copy link"}),f.jsx(xt,{variant:"subtle",onClick:()=>window.open(e,"_blank"),children:"Open"}),f.jsx(xt,{variant:"subtle",onClick:r,children:"Done"})]})]})})}function RP({shares:e,canRevoke:t,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(nt,{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:[" ",IC]})]}),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:$C(i,!1)}),f.jsxs("span",{className:"sb-actions",children:[f.jsx(xt,{variant:"subtle",onClick:()=>Ni(i.url).then(o=>qe(o?"Copied.":"Select and copy the link.")),children:"Copy link"}),f.jsx(xt,{variant:"subtle",onClick:()=>window.open(i.url,"_blank"),children:"Open"}),t&&f.jsx("button",{className:"ai-del","aria-label":`Revoke the share of ${i.path}`,onClick:()=>FC(i,r),children:"Revoke"})]})]},i.token))]})}var mw=1,jP=.9,TP=.8,OP=.17,um=.1,dm=.999,AP=.9999,MP=.99,NP=/[\\\/_+.#"@\[\(\{&]/,DP=/[\\\/_+.#"@\[\(\{&]/g,kP=/[\s-]/,nE=/[\s-]/g;function rp(e,t,r,i,o,l,u){if(l===t.length)return o===e.length?mw:MP;var d=`${o},${l}`;if(u[d]!==void 0)return u[d];for(var m=i.charAt(l),p=r.indexOf(m,o),y=0,v,b,x,w;p>=0;)v=rp(e,t,r,i,p+1,l+1,u),v>y&&(p===o?v*=mw:NP.test(e.charAt(p-1))?(v*=TP,x=e.slice(o,p-1).match(DP),x&&o>0&&(v*=Math.pow(dm,x.length))):kP.test(e.charAt(p-1))?(v*=jP,w=e.slice(o,p-1).match(nE),w&&o>0&&(v*=Math.pow(dm,w.length))):(v*=OP,o>0&&(v*=Math.pow(dm,p-o))),e.charAt(p)!==t.charAt(l)&&(v*=AP)),(vv&&(v=b*um)),v>y&&(y=v),p=r.indexOf(m,p+1);return u[d]=y,y}function pw(e){return e.toLowerCase().replace(nE," ")}function zP(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,rp(e,t,pw(e),pw(t),0,0,{})}var Jo='[cmdk-group=""]',fm='[cmdk-group-items=""]',LP='[cmdk-group-heading=""]',rE='[cmdk-item=""]',gw=`${rE}:not([aria-disabled="true"])`,ap="cmdk-item-select",zs="data-value",$P=(e,t,r)=>zP(e,t,r),aE=S.createContext(void 0),Ol=()=>S.useContext(aE),iE=S.createContext(void 0),xg=()=>S.useContext(iE),sE=S.createContext(void 0),oE=S.forwardRef((e,t)=>{let r=Ls(()=>{var N,H;return{search:"",value:(H=(N=e.value)!=null?N:e.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=Ls(()=>new Set),o=Ls(()=>new Map),l=Ls(()=>new Map),u=Ls(()=>new Set),d=lE(e),{label:m,children:p,value:y,onValueChange:v,filter:b,shouldFilter:x,loop:w,disablePointerSelection:_=!1,vimBindings:E=!0,...R}=e,T=fn(),O=fn(),M=fn(),k=S.useRef(null),B=KP();Di(()=>{if(y!==void 0){let N=y.trim();r.current.value=N,V.emit()}},[y]),Di(()=>{B(6,fe)},[]);let V=S.useMemo(()=>({subscribe:N=>(u.current.add(N),()=>u.current.delete(N)),snapshot:()=>r.current,setState:(N,H,X)=>{var Y,he,re,be;if(!Object.is(r.current[N],H)){if(r.current[N]=H,N==="search")me(),ne(),B(1,ce);else if(N==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let xe=document.getElementById(M);xe?xe.focus():(Y=document.getElementById(T))==null||Y.focus()}if(B(7,()=>{var xe;r.current.selectedItemId=(xe=Z())==null?void 0:xe.id,V.emit()}),X||B(5,fe),((he=d.current)==null?void 0:he.value)!==void 0){let xe=H??"";(be=(re=d.current).onValueChange)==null||be.call(re,xe);return}}V.emit()}},emit:()=>{u.current.forEach(N=>N())}}),[]),P=S.useMemo(()=>({value:(N,H,X)=>{var Y;H!==((Y=l.current.get(N))==null?void 0:Y.value)&&(l.current.set(N,{value:H,keywords:X}),r.current.filtered.items.set(N,pe(H,X)),B(2,()=>{ne(),V.emit()}))},item:(N,H)=>(i.current.add(N),H&&(o.current.has(H)?o.current.get(H).add(N):o.current.set(H,new Set([N]))),B(3,()=>{me(),ne(),r.current.value||ce(),V.emit()}),()=>{l.current.delete(N),i.current.delete(N),r.current.filtered.items.delete(N);let X=Z();B(4,()=>{me(),X?.getAttribute("id")===N&&ce(),V.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:m||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:T,inputId:M,labelId:O,listInnerRef:k}),[]);function pe(N,H){var X,Y;let he=(Y=(X=d.current)==null?void 0:X.filter)!=null?Y:$P;return N?he(N,r.current.search,H):0}function ne(){if(!r.current.search||d.current.shouldFilter===!1)return;let N=r.current.filtered.items,H=[];r.current.filtered.groups.forEach(Y=>{let he=o.current.get(Y),re=0;he.forEach(be=>{let xe=N.get(be);re=Math.max(xe,re)}),H.push([Y,re])});let X=k.current;Se().sort((Y,he)=>{var re,be;let xe=Y.getAttribute("id"),Me=he.getAttribute("id");return((re=N.get(Me))!=null?re:0)-((be=N.get(xe))!=null?be:0)}).forEach(Y=>{let he=Y.closest(fm);he?he.appendChild(Y.parentElement===he?Y:Y.closest(`${fm} > *`)):X.appendChild(Y.parentElement===X?Y:Y.closest(`${fm} > *`))}),H.sort((Y,he)=>he[1]-Y[1]).forEach(Y=>{var he;let re=(he=k.current)==null?void 0:he.querySelector(`${Jo}[${zs}="${encodeURIComponent(Y[0])}"]`);re?.parentElement.appendChild(re)})}function ce(){let N=Se().find(X=>X.getAttribute("aria-disabled")!=="true"),H=N?.getAttribute(zs);V.setState("value",H||void 0)}function me(){var N,H,X,Y;if(!r.current.search||d.current.shouldFilter===!1){r.current.filtered.count=i.current.size;return}r.current.filtered.groups=new Set;let he=0;for(let re of i.current){let be=(H=(N=l.current.get(re))==null?void 0:N.value)!=null?H:"",xe=(Y=(X=l.current.get(re))==null?void 0:X.keywords)!=null?Y:[],Me=pe(be,xe);r.current.filtered.items.set(re,Me),Me>0&&he++}for(let[re,be]of o.current)for(let xe of be)if(r.current.filtered.items.get(xe)>0){r.current.filtered.groups.add(re);break}r.current.filtered.count=he}function fe(){var N,H,X;let Y=Z();Y&&(((N=Y.parentElement)==null?void 0:N.firstChild)===Y&&((X=(H=Y.closest(Jo))==null?void 0:H.querySelector(LP))==null||X.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function Z(){var N;return(N=k.current)==null?void 0:N.querySelector(`${rE}[aria-selected="true"]`)}function Se(){var N;return Array.from(((N=k.current)==null?void 0:N.querySelectorAll(gw))||[])}function L(N){let H=Se()[N];H&&V.setState("value",H.getAttribute(zs))}function K(N){var H;let X=Z(),Y=Se(),he=Y.findIndex(be=>be===X),re=Y[he+N];(H=d.current)!=null&&H.loop&&(re=he+N<0?Y[Y.length-1]:he+N===Y.length?Y[0]:Y[he+N]),re&&V.setState("value",re.getAttribute(zs))}function ie(N){let H=Z(),X=H?.closest(Jo),Y;for(;X&&!Y;)X=N>0?GP(X,Jo):ZP(X,Jo),Y=X?.querySelector(gw);Y?V.setState("value",Y.getAttribute(zs)):K(N)}let J=()=>L(Se().length-1),te=N=>{N.preventDefault(),N.metaKey?J():N.altKey?ie(1):K(1)},D=N=>{N.preventDefault(),N.metaKey?L(0):N.altKey?ie(-1):K(-1)};return S.createElement(Pe.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:N=>{var H;(H=R.onKeyDown)==null||H.call(R,N);let X=N.nativeEvent.isComposing||N.keyCode===229;if(!(N.defaultPrevented||X))switch(N.key){case"n":case"j":{E&&N.ctrlKey&&te(N);break}case"ArrowDown":{te(N);break}case"p":case"k":{E&&N.ctrlKey&&D(N);break}case"ArrowUp":{D(N);break}case"Home":{N.preventDefault(),L(0);break}case"End":{N.preventDefault(),J();break}case"Enter":{N.preventDefault();let Y=Z();if(Y){let he=new Event(ap);Y.dispatchEvent(he)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:QP},m),gd(e,N=>S.createElement(iE.Provider,{value:V},S.createElement(aE.Provider,{value:P},N))))}),IP=S.forwardRef((e,t)=>{var r,i;let o=fn(),l=S.useRef(null),u=S.useContext(sE),d=Ol(),m=lE(e),p=(i=(r=m.current)==null?void 0:r.forceMount)!=null?i:u?.forceMount;Di(()=>{if(!p)return d.item(o,u?.id)},[p]);let y=cE(o,l,[e.value,e.children,l],e.keywords),v=xg(),b=Za(B=>B.value&&B.value===y.current),x=Za(B=>p||d.filter()===!1?!0:B.search?B.filtered.items.get(o)>0:!0);S.useEffect(()=>{let B=l.current;if(!(!B||e.disabled))return B.addEventListener(ap,w),()=>B.removeEventListener(ap,w)},[x,e.onSelect,e.disabled]);function w(){var B,V;_(),(V=(B=m.current).onSelect)==null||V.call(B,y.current)}function _(){v.setState("value",y.current,!0)}if(!x)return null;let{disabled:E,value:R,onSelect:T,forceMount:O,keywords:M,...k}=e;return S.createElement(Pe.div,{ref:Gs(l,t),...k,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)}),PP=S.forwardRef((e,t)=>{let{heading:r,children:i,forceMount:o,...l}=e,u=fn(),d=S.useRef(null),m=S.useRef(null),p=fn(),y=Ol(),v=Za(x=>o||y.filter()===!1?!0:x.search?x.filtered.groups.has(u):!0);Di(()=>y.group(u),[]),cE(u,d,[e.value,e.heading,m]);let b=S.useMemo(()=>({id:u,forceMount:o}),[o]);return S.createElement(Pe.div,{ref:Gs(d,t),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},r&&S.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:p},r),gd(e,x=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?p:void 0},S.createElement(sE.Provider,{value:b},x))))}),FP=S.forwardRef((e,t)=>{let{alwaysRender:r,...i}=e,o=S.useRef(null),l=Za(u=>!u.search);return!r&&!l?null:S.createElement(Pe.div,{ref:Gs(o,t),...i,"cmdk-separator":"",role:"separator"})}),VP=S.forwardRef((e,t)=>{let{onValueChange:r,...i}=e,o=e.value!=null,l=xg(),u=Za(p=>p.search),d=Za(p=>p.selectedItemId),m=Ol();return S.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),S.createElement(Pe.input,{ref:t,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":d,id:m.inputId,type:"text",value:o?e.value:u,onChange:p=>{o||l.setState("search",p.target.value),r?.(p.target.value)}})}),UP=S.forwardRef((e,t)=>{let{children:r,label:i="Suggestions",...o}=e,l=S.useRef(null),u=S.useRef(null),d=Za(p=>p.selectedItemId),m=Ol();return S.useEffect(()=>{if(u.current&&l.current){let p=u.current,y=l.current,v,b=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let x=p.offsetHeight;y.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return b.observe(p),()=>{cancelAnimationFrame(v),b.unobserve(p)}}},[]),S.createElement(Pe.div,{ref:Gs(l,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":i,id:m.listId},gd(e,p=>S.createElement("div",{ref:Gs(u,m.listInnerRef),"cmdk-list-sizer":""},p)))}),HP=S.forwardRef((e,t)=>{let{open:r,onOpenChange:i,overlayClassName:o,contentClassName:l,container:u,...d}=e;return S.createElement(vp,{open:r,onOpenChange:i},S.createElement(bp,{container:u},S.createElement(xp,{"cmdk-overlay":"",className:o}),S.createElement(wp,{"aria-label":e.label,"cmdk-dialog":"",className:l},S.createElement(oE,{ref:t,...d}))))}),BP=S.forwardRef((e,t)=>Za(r=>r.filtered.count===0)?S.createElement(Pe.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),qP=S.forwardRef((e,t)=>{let{progress:r,children:i,label:o="Loading...",...l}=e;return S.createElement(Pe.div,{ref:t,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},gd(e,u=>S.createElement("div",{"aria-hidden":!0},u)))}),pd=Object.assign(oE,{List:UP,Item:IP,Input:VP,Group:PP,Separator:FP,Dialog:HP,Empty:BP,Loading:qP});function GP(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function ZP(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function lE(e){let t=S.useRef(e);return Di(()=>{t.current=e}),t}var Di=typeof window>"u"?S.useEffect:S.useLayoutEffect;function Ls(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function Za(e){let t=xg(),r=()=>e(t.snapshot());return S.useSyncExternalStore(t.subscribe,r,r)}function cE(e,t,r,i=[]){let o=S.useRef(),l=Ol();return Di(()=>{var u;let d=(()=>{var p;for(let y of r){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(p=y.current.textContent)==null?void 0:p.trim():o.current}})(),m=i.map(p=>p.trim());l.value(e,d,m),(u=t.current)==null||u.setAttribute(zs,d),o.current=d}),o}var KP=()=>{let[e,t]=S.useState(),r=Ls(()=>new Map);return Di(()=>{r.current.forEach(i=>i()),r.current=new Map},[e]),(i,o)=>{r.current.set(i,o),t({})}};function YP(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function gd({asChild:e,children:t},r){return e&&S.isValidElement(t)?S.cloneElement(YP(t),{ref:t.ref},r(t.props.children)):r(t)}var QP={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function XP({className:e,...t}){return f.jsx(pd,{"data-slot":"command",className:We("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function JP({className:e,...t}){return f.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[f.jsx(w_,{className:"size-4 shrink-0 opacity-50"}),f.jsx(pd.Input,{"data-slot":"command-input",className:We("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),...t})]})}function WP({className:e,...t}){return f.jsx(pd.List,{"data-slot":"command-list",className:We("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function eF({className:e,...t}){return f.jsx(pd.Item,{"data-slot":"command-item",className:We("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),...t})}function vw(e,t){if(!e)return{score:0,hits:[]};const r=e.toLowerCase(),i=t.toLowerCase();let o=0,l=0,u=0;const d=[];for(let m=0;m3&&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?vw(o,t):null}function nF({text:e,hits:t}){const r=[];let i=0;return t.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 rF({open:e,onClose:t,candidates:r}){const[i,o]=S.useState(""),l=S.useMemo(()=>{if(!e)return[];const d=[];for(const m of r()){const p=tF(i,m.label);p&&d.push({...m,score:p.score,hits:p.hits})}return d.sort((m,p)=>p.score-m.score),d.slice(0,40)},[e,i,r]);S.useEffect(()=>{e&&o("")},[e]);const u=d=>{t(),d.run()};return f.jsx(Wu,{open:e,onOpenChange:d=>!d&&t(),children:f.jsxs(ed,{id:"palette",className:"palette",showCloseButton:!1,"aria-describedby":void 0,children:[f.jsx(El,{className:"sr-only",children:"Search and quick actions"}),f.jsxs(XP,{shouldFilter:!1,loop:!0,children:[f.jsxs("div",{id:"palette-inputwrap",children:[f.jsx(nt,{name:"search"}),f.jsx(JP,{placeholder:"Search file names, projects, actions…",autoComplete:"off",spellCheck:!1,value:i,onValueChange:o})]}),f.jsx(WP,{children:l.length===0?f.jsx("div",{className:"pempty",children:"No matches — search covers file names, projects, and actions"}):l.map(d=>f.jsxs(eF,{value:d.kind+":"+d.label,onSelect:()=>u(d),children:[f.jsx("span",{className:"picon",children:f.jsx(nt,{name:d.icon})}),f.jsx(nF,{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"})]})]})})}function aF(e,t){return Ft({queryKey:["heatDevices",e],queryFn:()=>qt(e+"heat?by=device&days=30"),enabled:t,retry:!1,staleTime:6e4}).data?.devices??null}const iF=["all","human","agent","share"],sF={all:"All reads",human:"Human reads",agent:"Agent reads",share:"Shared reads"},oF={agent:{agent:1,human:0,share:0},human:{agent:0,human:1,share:0},share:{agent:0,human:0,share:1}};function yw(e){const[t,r]=S.useState("all"),{flatFiles:i,heatMap:o,devices:l,scope:u}=e,d=w=>!u||w===u||w.startsWith(u+"/"),m=u?i.filter(w=>d(w.path)):i;if(!e.loading&&!m.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",...Qs(e.installHref),children:"Set up a device →"})]})]});const p=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=m.map(w=>{const _=o&&o[w.path]||{},E=w.time?Math.max(0,(y-new Date(w.time).getTime())/864e5):0,R=t==="all"?na(_):_[t]||0;return{path:w.path,reads:R,agent:_.agent||0,human:_.human||0,share:_.share||0,total:na(_),days:E,danger:ZC(R,E)}}),b=gI(o,new Set(i.map(w=>w.path))).filter(d).map(w=>{const _=o[w];return{path:w,reads:t==="all"?na(_):_[t]||0,agent:_.agent||0,human:_.human||0,share:_.share||0,total:na(_),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:[ip(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. ${Ci}`:"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. "+Ci}),f.jsx("div",{className:"in-lens",children:iF.map(w=>f.jsx("button",{className:"in-lens-btn"+(w===t?" active":""),onClick:()=>r(w),children:sF[w]},w))}),f.jsx("h3",{className:"dl-h3",children:"Map — cell size = reads, color = freshness (scale below)"}),f.jsx(cF,{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(dF,{pts:v,onOpenFile:e.onOpenFile}),x,f.jsx("h3",{className:"dl-h3",children:"Hot path — top files by reads"}),f.jsx(fF,{pts:[...v,...b],lens:t,onOpenFile:e.onOpenFile,onOpenHistory:e.onOpenHistory}),p&&p.length>0&&f.jsxs(f.Fragment,{children:[f.jsx("h3",{className:"dl-h3",children:"Agent coverage — which agents read which areas"}),f.jsx(hF,{devices:p})]})]})}const lF="rgb(150,156,164)";function uE(e){const t=[[76,195,138],[232,196,84],[224,93,93]],r=Math.min(1,Math.max(0,e/300))*(t.length-1),i=Math.min(t.length-2,Math.floor(r)),o=r-i,l=t[i].map((u,d)=>Math.round(u+(t[i+1][d]-u)*o));return`rgb(${l[0]},${l[1]},${l[2]})`}function bw(e,t,r,i,o){const l=e.reduce((p,y)=>p+y.value,0);if(!l||i<=0||o<=0)return[];const u=e.slice().sort((p,y)=>y.value-p.value).map(p=>({it:p,a:p.value/l*i*o})),d=(p,y)=>{const b=p.reduce((w,_)=>w+_.a,0)/y;let x=0;for(const w of p){const _=w.a/b;x=Math.max(x,_/b,b/_)}return x},m=[];for(;u.length;){const p=i>=o,y=p?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;p?m.push({item:w.it,x:t,y:r+x,w:b,h:_}):m.push({item:w.it,x:t+x,y:r,w:_,h:b}),x+=_}p?(t+=b,i-=b):(r+=b,o-=b)}return m}const hm=15;function xw(e,t,r){const i=Math.floor((r-8)/6),o=`${e} · ${t}`;return o.length<=i?{label:o,fit:i}:{label:e.length>i?e.slice(0,Math.max(1,i-1))+"…":e,fit:i}}const ip=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function cF({pts:e,onOpenFile:t,onOpenFolder:r,isFolder:i}){const u=yI(e.map(y=>y.days)),d=!!u&&bI(u.min,u.max),m=new Map;for(const y of e){const v=y.path.includes("/")?y.path.split("/")[0]:"/";let b=m.get(v);b||m.set(v,b={name:v,files:[],value:0,reads:0}),b.files.push(y),b.value+=y.reads+1,b.reads+=y.reads}const p=[];for(const y of bw([...m.values()],0,0,720,480)){const v=y.item,b=v.name==="/"?"":v.name,x=v.name==="/"?"(root)":v.name;if(p.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+"/"} — ${ip(v.reads,"read")}/30d · ${ip(v.files.length,"file")}`})},"g"+v.name)),y.w>46&&y.h>hm+10){const{label:_}=xw(x,v.reads,y.w);p.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=bw(v.files.map(_=>({..._,name:_.path.split("/").pop(),value:_.reads+1})),y.x+2,y.y+hm,Math.max(0,y.w-4),Math.max(0,y.h-hm-2));for(const _ of w)if(p.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?lF:uE(_.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}=xw((_.item.danger?"⚠ ":"")+_.item.name,_.item.reads,_.w);R>=5&&p.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 t(b);const x=v.getAttribute("data-dir");x&&i(x)&&r(x)},children:p}),f.jsx(uF,{range:u,flat:d})]})}function uF({range:e,flat:t}){if(!e)return null;const r=xI(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"+(t?" in-sw-flat":""),style:{background:`linear-gradient(to right, ${[0,60,150,300].map(uE).join(", ")})`}}),"300d+",f.jsx("span",{className:"in-tm-range",children:t?`all files here: ${r} old — colour off, not enough range to rank`:`observed: ${r} old`})]})}function dF({pts:e,onOpenFile:t}){const o={l:44,r:16,t:20,b:34},l=Math.max(ks*2,...e.map(w=>w.days)),u=Math.max(rl*2,...e.map(w=>w.reads)),d=w=>Math.log10(w+1)/Math.log10(l+1),m=w=>Math.log10(w+1)/Math.log10(u+1),p=w=>3+4*w,y=p(1),v=w=>o.l+y+d(w)*(720-o.l-o.r-2*y),b=w=>360-o.b-y-m(w)*(360-o.t-o.b-2*y),x=_I(e.filter(w=>w.danger).map(w=>({path:w.path,reads:w.reads,cx:v(w.days),cy:b(w.reads),r:p(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(ks),y:o.t,width:720-o.r-v(ks),height:b(rl)-o.t,className:"in-danger-zone"}),f.jsx("line",{x1:v(ks),y1:o.t,x2:v(ks),y2:360-o.b,className:"in-threshold"}),f.jsx("line",{x1:o.l,y1:b(rl),x2:720-o.r,y2:b(rl),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(p(_).toFixed(1)),className:"in-pt"+(w.danger?" danger":w.reads?"":" cold"),onClick:()=>t(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 fF({pts:e,lens:t,onOpenFile:r,onOpenHistory:i}){const o=e.filter(d=>d.reads>0).sort((d,m)=>m.reads-d.reads||m.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 m=oF[t]??pI(d),p=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:(p*m.agent).toFixed(1)+"%"}}),f.jsx("span",{className:"in-hp-human",style:{width:(p*m.human).toFixed(1)+"%"}}),f.jsx("span",{className:"in-hp-share",style:{width:(p*m.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 hF({devices:e}){const t=new Map;for(const b of e)for(const[x,w]of Object.entries(b.folders||{}))t.set(x,(t.get(x)||0)+w);const r=[...t.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,m=720,p=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 ${m} ${p}`,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 dE(e){return new Set(e.entries.map(t=>t.path)).size}function mF(e){const t=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(t(l));if(d){d.entries.push(l),d.idx.push(u);return}r.set(t(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(t(l)):void 0;if(!d||dE(d)<2){i.push({i:u});return}o.has(d)||(o.add(d),i.push({run:d,i:u}))}),i}function pF(e){const{filters:t,authors:r,onChange:i}=e,o=(y,v)=>i({...t,[y]:v||void 0}),[l,u]=S.useState(t?.q??""),d=S.useRef(!1);S.useEffect(()=>{d.current||u(t?.q??"")},[t?.q]),S.useEffect(()=>{if(!d.current)return;const y=setTimeout(()=>{d.current=!1,l!==(t?.q??"")&&o("q",l)},250);return()=>clearTimeout(y)},[l]);const m=t?.user&&!r.includes(t.user)?[t.user,...r]:r,p=Xp(t);return f.jsxs("div",{className:"hfilters",children:[f.jsxs("label",{className:"hf-search",children:[f.jsx(nt,{name:"search"}),f.jsx(hu,{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:t?.user??"","aria-label":"Filter by author",onChange:y=>o("user",y.target.value),children:[f.jsx("option",{value:"",children:"Anyone"}),m.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(hu,{type:"date",className:"hf-date",value:t?.since??"","aria-label":"From date (UTC)",onChange:y=>o("since",y.target.value)}),f.jsx("span",{className:"hf-dash",children:"–"}),f.jsx(hu,{type:"date",className:"hf-date",value:t?.until??"","aria-label":"To date (UTC)",onChange:y=>o("until",y.target.value)})]}),p&&f.jsx("button",{type:"button",className:"hf-clear",onClick:()=>i({}),children:"Clear"})]})}function gF(e){const t=new Set;for(const r of e)r.user&&t.add(r.user);return[...t].sort()}function vF(e){const{apiBase:t,target:r,isFolder:i,onMeta:o,onRendered:l,restore:u,remove:d,undoRun:m,filters:p}=e,y=S.useMemo(()=>new Set(e.flatFiles.map(ne=>ne.path)),[e.flatFiles]),v=r?i(r)?{prefix:r+"/"}:{path:r}:{prefix:""},b=("path"in v&&v.path!==void 0?"path="+encodeURIComponent(v.path):"prefix="+encodeURIComponent(v.prefix??""))+D_(p).replace("?","&"),{data:x,error:w,isPending:_,fetchNextPage:E,hasNextPage:R,isFetchingNextPage:T}=x2({queryKey:["history",t,b],queryFn:({pageParam:ne})=>qt(t+"history?"+b+"&n=100"+(ne?"&cursor="+encodeURIComponent(ne):"")),initialPageParam:"",getNextPageParam:ne=>ne.next_cursor,staleTime:15e3}),O=S.useRef(new Set);S.useEffect(()=>{w&&o("History unavailable: "+w.message)},[w,o]),S.useEffect(()=>{x&&l?.()},[x,l]);const M=x?x.pages.flatMap(ne=>ne.entries||[]):[];for(const ne of gF(M))O.current.add(ne);const k=e.onFilters&&f.jsx(pF,{filters:p,authors:[...O.current].sort(),onChange:e.onFilters});if(!x)return f.jsxs("div",{className:"history",children:[k,_&&!w&&f.jsx("div",{className:"empty",children:"Loading…"})]});const B=ne=>{for(let ce=ne+1;ce{const ce=M[ne].kind==="delete"?B(ne):M[ne].blob;return ce&&ce===V.get(M[ne].path)?void 0:ce},pe=ne=>V.get(M[ne].path)==="";return f.jsxs("div",{className:"history",children:[k,M.length===0&&(Xp(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."})),mF(M).map((ne,ce)=>ne.run?f.jsx(yF,{run:ne.run,known:y,onOpen:e.onOpen,apiBase:t,prevBlob:B,restoreSha:P,recreates:pe,restore:u,remove:d,undoRun:m},"g"+ce):f.jsx(bg,{entry:M[ne.i],apiBase:t,onOpen:e.onOpen,diff:{apiBase:t,prev:B(ne.i)},restore:u,restoreSha:P(ne.i),recreates:pe(ne.i)},"r"+ne.i)),R&&f.jsx("button",{type:"button",className:"btn hmore",onClick:()=>E(),disabled:T,children:T?"Loading…":"Load more"})]})}function yF({run:e,known:t,onOpen:r,apiBase:i,prevBlob:o,restoreSha:l,recreates:u,restore:d,remove:m,undoRun:p}){const[y,v]=S.useState(!0),b=e.entries[0],x=hd(b),w=[b.device.name||b.device.id,b.device.os].filter(Boolean).join(" · "),_=b.session,E=b.device?.id,{data:R}=Ft({queryKey:["session-reads",i,_,E],queryFn:()=>qt(i+"heat?session="+encodeURIComponent(_)+"&device="+encodeURIComponent(E)),enabled:!!_&&!!E,staleTime:3e4}),T=new Set(R?.paths??[]),O=new Set(e.entries.map(pe=>pe.path)),M=[...T].filter(pe=>!O.has(pe)).sort(),k=e.entries.map(pe=>new Date(pe.time).getTime()),B=bF(Math.min(...k),Math.max(...k)),V=dE(e),P=!!p?.busy&&p.busy===(e.session||e.note);return f.jsxs("div",{className:"hrun"+(y?" open":""),children:[f.jsxs("div",{className:"hrun-head",children:[f.jsx("button",{type:"button",className:"hrun-toggle","aria-expanded":y,title:y?"Collapse this run":"Expand this run",onClick:()=>v(!y),children:f.jsx(nt,{name:y?"chevd":"chev"})}),f.jsx("span",{className:"hrun-note",children:f.jsx(WC,{text:e.note})}),f.jsxs("span",{className:"hrun-meta",children:[T.size>0?`read ${T.size} · changed ${V}`:`${V} file${V===1?"":"s"}`," ·"," ",x,w?" · "+w:""]}),f.jsx("span",{className:"hrun-time",children:B}),p&&f.jsxs("button",{type:"button",className:"hrun-undo",disabled:P,title:"Put every file this run touched back the way it was",onClick:()=>p.onUndoRun(e),children:[f.jsx(nt,{name:"hist"}),P?"undoing…":"undo this run"]})]}),y&&f.jsxs("div",{className:"hrun-body",children:[e.entries.map((pe,ne)=>f.jsx(bg,{entry:pe,apiBase:i,onOpen:r,diff:{apiBase:i,prev:o(e.idx[ne])},restore:d,remove:m,restoreSha:l(e.idx[ne]),recreates:u(e.idx[ne]),inRun:!0,read:T.has(pe.path)},ne)),M.length>0&&f.jsxs("div",{className:"hrun-reads",children:[f.jsx("div",{className:"hrun-reads-head",children:"Read, not changed"}),M.map(pe=>f.jsxs("button",{type:"button",className:"hrun-read",onClick:()=>r(pe),children:[f.jsx("span",{className:"hkind",children:"read"}),f.jsx("span",{className:"hpath",children:pe}),!t.has(pe)&&f.jsx("span",{className:"in-hp-gone",children:"· no longer in the project"})]},pe))]}),_&&f.jsx("div",{className:"hrun-foot",children:"Reads shown are what this device reported for this session — a narrower set than the project's read totals."})]})]})}function bF(e,t){const r=new Date(e),i=new Date(t),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===t?l+" "+o(i):l+" "+o(r)+" – "+o(i)}function xF(e,t){return e?t(e)?e+"/ (folder)":e:"all changes"}function wF(e){const{apiBase:t,path:r,version:i}=e,o="path="+encodeURIComponent(r),{data:l}=Ft({queryKey:["history",t,o,200],queryFn:()=>qt(t+"history?"+o+"&n=200"),staleTime:15e3}),u=l?.entries?.find(y=>y.blob===i),d=u?hd(u):"",m=u?.time?new Date(u.time).toLocaleString():"",p=t+"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(nt,{name:"clock"})}),f.jsxs("div",{className:"vb-text",children:[f.jsx("b",{children:[m&&"Version from "+m,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:p,children:"Download this version"})]})]})}function SF(e){const{conflict:t,originalHref:r}=e,i=t.device||"another device";return f.jsxs("div",{className:"vbanner",role:"status",children:[f.jsx("span",{className:"vb-icon",children:f.jsx(nt,{name:"alert"})}),f.jsxs("div",{className:"vb-text",children:[f.jsx("b",{children:"Conflict copy — a concurrent edit, preserved"}),f.jsxs("span",{children:[i," edited this file at the same time as someone else on"," ",t.when.toLocaleString(),". Rather than drop either version, beardrive kept that one here."," ",r?f.jsxs(f.Fragment,{children:["The other version lives at ",f.jsx("code",{children:t.original})]}):f.jsx(f.Fragment,{children:"The other version kept the original name."})]})]}),r&&f.jsx("div",{className:"vb-actions",children:f.jsx("button",{className:"ai-btn",onClick:r,children:"Open the other version"})})]})}function fE(e){const{config:t,apiBase:r,route:i,hub:o,project:l}=e,u=Wp(),d=ki(),{tree:m,flatFiles:p,dirIndex:y,loaded:v}=RI(r,!o||!!l),b=jI(r,o&&!!l&&!!t.reads?.enabled),x=o&&!!l&&!i.path&&!i.view,w=i.view==="dashboard"||x,_=aF(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&&p.some(ee=>ee.path===E),k=!!E&&v&&!O&&!M,B=O&&!i.view,{data:V}=Ft({queryKey:["resolve",r,E],queryFn:()=>qt(r+"resolve?path="+encodeURIComponent(E)),enabled:k,retry:!1,staleTime:6e4}),[P,pe]=S.useState(null);S.useEffect(()=>{!k||!V?.to||(pe({from:E,to:V.to}),Yt(Oi(V.to,l?.id),{replace:!0}))},[k,V,E,l?.id]);const[ne,ce]=S.useState(()=>new Set),me=S.useRef(!0);S.useEffect(()=>{if(!m||!me.current)return;me.current=!1;const ee=(m.children||[]).filter(le=>le.dir);ee.length===1&&ce(le=>new Set(le).add(ee[0].path))},[m]),S.useEffect(()=>{!T||!v||ce(ee=>{const le=new Set(ee);for(const Re of KI(T))le.add(Re);return y.has(T)&&le.add(T),le})},[T,v,y]);const fe=S.useCallback(ee=>{ce(le=>{const Re=new Set(le);return Re.has(ee)?Re.delete(ee):Re.add(ee),Re})},[]),Z=S.useRef(null),Se=S.useRef(new Map),L=S.useRef({key:"",want:0,attempts:0});S.useEffect(()=>{L.current={key:u,want:V3()==="POP"?Se.current.get(u)??0:0,attempts:0}},[u]);const K=S.useCallback(()=>{const ee=Z.current,le=L.current;!ee||le.key!==u||le.attempts>=3||(le.attempts++,ee.scrollTo({top:le.want,behavior:"instant"}))},[u]),ie=S.useCallback(()=>{Z.current&&Se.current.set(u,Z.current.scrollTop)},[u]),J=S.useCallback((ee,le)=>{Yt(Oi(ee,l?.id,le)),hr()},[l?.id]),te=S.useCallback(ee=>Yt(An("history",l?.id,ee)),[l?.id]),[D,N]=S.useState(""),[H,X]=S.useState(null),[Y,he]=S.useState(!1),[re,be]=S.useState(!1);S.useEffect(()=>YD(()=>be(!0)),[]);const xe=S.useRef(null),Me=e.panel??null,Fe=!Me&&o&&!!l&&M&&_i(l.perm,"write"),{data:He}=O_(l?.id,o&&!!l),ct=S.useCallback(()=>{d.invalidateQueries({queryKey:["shares",l?.id]})},[d,l?.id]),Je=M?(He||[]).filter(ee=>ee.path===E):[],hn=!Me&&o&&!!l,mn=!Me&&M,Xt=!Me&&(M||o&&!!l&&O),yr=R?r+"blob?sha="+R+"&name="+encodeURIComponent(E)+"&download=1":r+"download?path="+encodeURIComponent(E),At=S.useCallback(async()=>{const ee=le=>fetch(r+"shares",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(le?{path:E,confirm:!0}:{path:E})});try{let le=await ee(!1);if(le.status===409){const{findings:it}=await le.json();if(!await za("This file may contain credentials",fP(it),"Share anyway",!0))return;le=await ee(!0)}if(!le.ok)throw new Error(await le.text());const Re=await le.json();Lw("share_created");const ze=await Ni(Re.url);X({url:Re.url,copied:ze}),ct()}catch(le){qe("Share failed: "+le.message,!0)}},[r,E,ct]),[rr,br]=S.useState(""),Rt=o&&!!l&&_i(l?.perm,"write"),Vn=S.useCallback(async(ee,le,Re)=>{if(await za("Restore this version of "+ee+"?","It syncs to every device as a new change. "+(Re?"The file comes back on every device. Removing it again isn't available from History yet.":"You can restore any other version afterwards."),"Restore")){br(ee+le);try{await ea(r+"restore",{path:ee,sha:le}),d.invalidateQueries({queryKey:["history",r]}),d.invalidateQueries({queryKey:["tree",r]}),d.invalidateQueries({queryKey:["render",r,ee]}),d.invalidateQueries({queryKey:["text"]}),qe("Restored "+ee+" — it syncs to every device like any other change.")}catch(ze){qe("Restore failed: "+ze.message,!0)}finally{br("")}}},[r,d]),[zt,Dr]=S.useState(""),ar=S.useCallback(async ee=>{if(await za("Remove "+ee+"?","It disappears from every synced device. History keeps it — you can restore it from the DELETED row afterwards.","Remove file",!0)){Dr(ee);try{await ea(r+"remove",{path:ee}),d.invalidateQueries({queryKey:["history",r]}),d.invalidateQueries({queryKey:["tree",r]}),d.invalidateQueries({queryKey:["render",r,ee]}),d.invalidateQueries({queryKey:["text"]}),qe("Removed "+ee+" — it syncs to every device like any other change.")}catch(le){qe("Remove failed: "+le.message,!0)}finally{Dr("")}}},[r,d]),[oa,ir]=S.useState(""),la=S.useCallback(async ee=>{const le=ee.session||ee.note,Re=ee.session?{session:ee.session,device:ee.entries[0]?.device?.id}:{note:ee.note,device:ee.entries[0]?.device?.id};ir(le);try{const ze=await ea(r+"undo-run",{...Re,preview:!0}),it=new Set(ze.changed_after);if(!ze.undone.length){qe("Nothing to undo — every file this run touched already holds its pre-run content.");return}if(!await za("Undo this run?",f.jsxs(f.Fragment,{children:[f.jsxs("div",{children:[ee.note||le," — ",ze.undone.length," file",ze.undone.length===1?"":"s"]}),f.jsx("div",{className:"undo-list",children:ze.undone.map(st=>f.jsxs("div",{className:"undo-row",children:[f.jsx("span",{className:"undo-path",children:st.path}),it.has(st.path)&&f.jsx("span",{className:"undo-after",children:"changed after this run"}),f.jsx("span",{className:"undo-what",children:st.action==="remove"?"remove (the run created it)":"restore to pre-run version"})]},st.path))}),it.size>0&&f.jsxs("div",{className:"undo-warn",children:[it.size," file",it.size===1?" was":"s were"," changed by someone else after this run. Undoing overwrites ",it.size===1?"that change":"those changes"," too."]}),ze.skipped.length>0&&f.jsxs("div",{children:[ze.skipped.length," already hold",ze.skipped.length===1?"s":""," its pre-run content and will be left alone."]}),ze.refused.length>0&&f.jsxs("div",{children:[ze.refused.length," path",ze.refused.length===1?"":"s"," can't be written by the hub and will be left alone: ",ze.refused.join(", "),"."]})]}),"Undo run",!0))return;const Ae=await ea(r+"undo-run",Re);d.invalidateQueries({queryKey:["history",r]}),d.invalidateQueries({queryKey:["tree",r]}),d.invalidateQueries({queryKey:["render",r]}),d.invalidateQueries({queryKey:["text"]});const ut=Ae.skipped.length?`, skipped ${Ae.skipped.length} (already current)`:"";qe(`Undid ${Ae.undone.length} file${Ae.undone.length===1?"":"s"}${ut}.`)}catch(ze){qe("Undo failed: "+ze.message,!0)}finally{ir("")}},[r,d]),Jt=S.useCallback(()=>{if(!E)return te("");te(O?E+"/":E)},[E,O,te]);S.useEffect(()=>{const ee=le=>{(le.metaKey||le.ctrlKey)&&le.key.toLowerCase()==="k"&&(le.preventDefault(),be(Re=>!Re))};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[]);const A=S.useCallback(()=>{const ee=[],le=(Re,ze,it,_t)=>ee.push({icon:Re,label:ze,kind:it,run:_t});if(o&&l){const Re=l.id,ze=it=>()=>{e.onClosePanel?.(),Yt(it)};le("folder",l.name+" — project root","project",ze("/"+Re)),le("dashboard","Dashboard","action",ze(An("dashboard",Re))),le("terminal","Installation","action",ze(An("install",Re))),le("gear","Settings","action",ze(An("settings",Re)))}if(o&&l&&E&&(M&&le("share","Share: "+E,"action",At),le("hist","History: "+E,"action",Jt),M&&le("download","Download: "+E,"action",()=>xe.current?.click())),o&&l&&le("hist","History: whole project","action",()=>te("")),o)for(const Re of e.projects||[])(!l||Re.id!==l.id)&&le("folder","Switch to project: "+Re.name,"project",()=>Yt("/"+Re.id));t.auth?.enabled&&le("power","Sign out","action",()=>window.location.href="/auth/logout");for(const Re of y.keys())le("folder",Re,"folder",()=>J(Re));for(const Re of p)le("doc",Re.path,"file",()=>J(Re.path));return ee},[o,l,E,M,t.auth?.enabled,y,p,e.projects,e.onClosePanel,At,Jt,te,J]);S.useEffect(()=>{if(!Y)return;const ee=()=>he(!1);return document.addEventListener("click",ee),()=>document.removeEventListener("click",ee)},[Y]);const I=S.useCallback(ee=>y.has(ee),[y]);let F="app",de,oe;if(Me)oe=Me.body;else if(i.view==="dashboard")oe=f.jsx(yw,{flatFiles:p,heatMap:b,devices:_,scope:i.viewTarget||"",loading:!v,installHref:l?An("install",l.id):void 0,onOpenFile:J,onOpenFolder:J,onOpenHistory:te,isFolder:I});else if(i.view==="history")oe=f.jsx(vF,{apiBase:r,target:i.viewTarget||"",isFolder:I,flatFiles:p,onOpen:J,onMeta:N,onRendered:K,restore:Rt?{onRestore:Vn,busy:rr}:void 0,remove:Rt?{onRemove:ar,busy:zt}:void 0,undoRun:Rt?{onUndoRun:la,busy:oa}:void 0,filters:i.filters,onFilters:ee=>Yt(An("history",l?.id,i.viewTarget||"",ee))});else if(E)if(!v)oe=f.jsx("div",{className:"empty",children:"Loading…"});else if(k)oe=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"})]});else if(O)oe=f.jsx(oP,{node:y.get(E),heatMap:b,hub:o&&!!l,apiBase:r,onOpen:J,onFullHistory:te,onRendered:K});else{F=AC.test(E)||MC.test(E)?"wide":"read",de="markdown";const ee=QC(E);oe=f.jsxs(f.Fragment,{children:[R&&f.jsx(wF,{apiBase:r,path:E,version:R,onViewCurrent:()=>J(E)}),ee&&f.jsx(SF,{conflict:ee,originalHref:p.some(le=>le.path===ee.original)?()=>J(ee.original):void 0}),f.jsx(mP,{apiBase:r,path:E,version:R,heatMap:b,flatFiles:p,projectId:l?.id,onOpenFile:J,onMeta:N,onRendered:K})]})}else x?oe=f.jsxs(f.Fragment,{children:[f.jsx(qC,{project:l,existing:i.connect==="existing"}),f.jsx("div",{className:"home-insights",children:f.jsx(yw,{flatFiles:p,heatMap:b,devices:_,loading:!v,onOpenFile:J,onOpenFolder:J,onOpenHistory:te,isFolder:I})})]}):oe=f.jsx("div",{className:"empty",children:"Select a file to read it."});P&&P.to===E&&(oe=f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"vbanner",role:"status",children:[f.jsx("span",{className:"vb-icon",children:f.jsx(nt,{name:"link"})}),f.jsxs("div",{className:"vb-text",children:[f.jsxs("b",{children:["Moved from ",P.from]}),f.jsx("span",{children:"The URL has been updated."})]})]}),oe]}));const ye=Me?Me.crumb:E?f.jsx(YI,{path:E,onOpenFolder:J}):i.view==="dashboard"?"Dashboard — "+(i.viewTarget||l?.name||""):i.view==="history"?"History — "+xF(i.viewTarget||"",I):x?l.name:null,we=f.jsx(Hs,{crumb:ye,meta:D,actions:f.jsxs(f.Fragment,{children:[Fe&&f.jsx(xt,{id:"share-btn",variant:"toolbar",className:"icon-only",title:"Share","aria-label":"Share",onClick:At,children:f.jsx(nt,{name:"share"})}),hn&&!E&&!i.view&&f.jsxs(xt,{id:"history-btn",variant:"toolbar",onClick:Jt,children:[f.jsx(nt,{name:"hist"})," ",f.jsx("span",{className:"lbl",children:"History"})]}),mn&&f.jsx("a",{id:"download",hidden:!0,download:!0,href:yr,ref:xe,children:"Download"}),Xt&&f.jsx(xt,{id:"more-btn",variant:"toolbar",className:"icon-only",title:"More actions","aria-label":"More actions",onClick:ee=>{ee.stopPropagation(),he(!Y)},children:f.jsx(nt,{name:"dots"})}),Y&&f.jsxs("div",{id:"more-menu",role:"menu",children:[hn&&f.jsx("button",{className:"more-item",onClick:Jt,children:"History"}),mn&&f.jsx("button",{className:"more-item",onClick:()=>xe.current?.click(),children:"Download"}),o&&!!l&&f.jsx("button",{className:"more-item",onClick:()=>{e.onClosePanel?.(),Yt(An("dashboard",l?.id,E))},children:"Dashboard"})]})]})});return f.jsxs(f.Fragment,{children:[f.jsx(Us,{vault:e.sidebar.vault,projectsNav:e.sidebar.projectsNav,orgBar:e.sidebar.orgBar,tree:f.jsx(ZI,{root:m,expanded:ne,onToggle:fe,currentPath:T,listingShowing:B,onOpen:J}),topbar:we,contentRef:Z,onContentScroll:ie,children:f.jsxs(al,{width:F,className:de,children:[!Me&&M&&f.jsx(RP,{shares:Je,canRevoke:!!l&&_i(l.perm,"write"),onChanged:ct}),oe]})}),H&&f.jsx(EP,{url:H.url,copied:H.copied,onClose:()=>{X(null),ct()}}),f.jsx(rF,{open:re,onClose:()=>be(!1),candidates:A})]})}function _F({config:e}){const t=Wp(),r=M_(),[i,o]=S.useState(null),[l,u]=S.useState(null);S.useEffect(()=>u(null),[t]);const d=S.useMemo(()=>{const Z=t.split("?")[0].match(/^\/join\/([0-9a-f]+)\/?$/);return Z?Z[1]:null},[t]),{data:m}=D3(!d),{data:p}=k3(!d),y=!!e.auth.admin,{data:v}=A_(y),b=S.useMemo(()=>k_(t,"hub"),[t]),[x,w]=S.useState(!1),_=e.upload.enabled,E=async(Z,Se)=>{const L=Se===GC;try{const K=await ea("/api/projects",{name:Z,template:L?"":Se});w(!1),await r(),Yt("/"+K.project.id+(L?"?connect=existing":"")),qe(`Created “${K.project.name}”.`)}catch(K){qe("Could not create the project: "+K.message,!0)}},R=x?f.jsx(hI,{templates:e.templates??[],onCreate:E,onClose:()=>w(!1)}):null,T=S.useMemo(()=>m&&(m.find(Z=>Z.id===b.project)||i&&m.find(Z=>Z.org===i)||m.find(Z=>Z.id===D$())||m[0])||null,[m,b.project,i]);if(S.useEffect(()=>{document.title=T?T.name+" — BearDrive":e.brand||"BearDrive",T&&k$(T.id)},[T,e]),d)return f.jsx(CF,{token:d,onDone:async Z=>{o(Z),await r(),Yt("/",{replace:!0})}});const O=e.brand||"BearDrive",M=T&&p?.find(Z=>Z.id===T.org)||null,k=f.jsx(Ju,{name:O,onHome:()=>Yt("/"),search:!!T,beta:O==="BearDrive"}),B=e.me?f.jsx(aI,{me:e.me,org:M,orgActive:!!b.org,billing:e.billing,admin:y?{pending:v?.length||0,onClick:()=>{u({kind:"hub"}),hr()}}:void 0}):void 0;if(!m||!p)return f.jsx(Us,{vault:k,topbar:f.jsx(Hs,{}),children:f.jsx(al,{children:f.jsx("div",{className:"empty",children:"Loading…"})})});if(!T)return f.jsxs(Us,{vault:k,projectsNav:f.jsx(rm,{projects:m,onNew:()=>w(!0)}),orgBar:B,topbar:f.jsx(Hs,{}),children:[f.jsx(al,{children:f.jsx(fI,{onNew:()=>w(!0),canCreate:_})}),R]});const V=l?.kind==="hub"?{crumb:"Signup & access",body:f.jsx(K$,{})}:null,P=b.org?p.find(Z=>Z.id===b.org):null,ne=b.org&&!P?{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",{...Qs("/"+T.id),children:["Back to ",T.name]})})]})}:P?{crumb:"Organization",body:f.jsx(q$,{org:P,projects:m,myEmail:e.me?.email||""})}:null;if(!!b.project&&!m.some(Z=>Z.id===b.project)){const Z=F3(m,b.project);return Z?f.jsx(Ds,{to:b.view?An(b.view,Z,b.viewTarget,b.filters):Oi(b.path,Z,b.version)}):f.jsxs(Us,{vault:k,projectsNav:f.jsx(rm,{projects:m,onNew:()=>w(!0)}),orgBar:B,topbar:f.jsx(Hs,{}),children:[f.jsx(al,{children:f.jsxs("div",{className:"empty",children:[f.jsx("h3",{children:"Project not found"}),f.jsxs("p",{children:["There's no project called “",td(b.project),"” in your account. It may have been renamed or deleted, or the link may be wrong."]}),f.jsx("p",{children:f.jsxs("a",{...Qs("/"+T.id),children:["Back to ",T.name]})})]})}),R]})}const me=b.billing?{crumb:"Billing",body:e.billing?f.jsx(iI,{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,fe=b.view==="settings"?{crumb:"Project settings",body:f.jsx(lI,{project:T,org:M,onDeleted:async()=>{await r(),Yt("/")}})}:b.view==="install"?{crumb:"Installation",body:f.jsx(qC,{project:T,existing:b.connect==="existing"})}:null;return!b.org&&!b.billing&&b.project!==T.id?f.jsx(Ds,{to:"/"+T.id}):b.legacyView&&b.view?f.jsx(Ds,{to:An(b.view,T.id,b.viewTarget,b.filters)}):b.queryTarget&&b.view?f.jsx(Ds,{to:An(b.view,T.id,b.viewTarget,b.filters)}):b.trailingSlash&&b.path?f.jsx(Ds,{to:Oi(b.path,T.id,b.version)}):f.jsxs(f.Fragment,{children:[f.jsx(fE,{config:e,apiBase:"/api/p/"+T.id+"/",route:b,hub:!0,project:T,projects:m,sidebar:{vault:k,projectsNav:f.jsx(rm,{projects:m,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),Yt(An("dashboard",T.id)),hr()},onInstall:()=>{u(null),Yt(An("install",T.id)),hr()},onHistory:()=>{u(null),Yt(An("history",T.id)),hr()},onSettings:()=>{u(null),Yt(An("settings",T.id)),hr()}}}),orgBar:B},panel:V||ne||me||fe,onClosePanel:()=>u(null)},T.id),R]})}function CF({token:e,onDone:t}){return S.useEffect(()=>{let r=!1;return ea("/api/invites/"+e).then(i=>{r||(qe(`Welcome — you joined the “${i.org.name}” team. Opening its projects…`),t(i.org.id))}).catch(i=>{r||String(i.message).includes("signing in")||(qe("Could not accept the invite: "+i.message,!0),t(null))}),()=>{r=!0}},[e]),f.jsx(Us,{vault:f.jsx(Ju,{name:"BearDrive",beta:!0}),topbar:f.jsx(Hs,{}),children:f.jsx(al,{children:f.jsx("div",{className:"empty",children:"Joining…"})})})}function EF({config:e}){const t=Wp(),r=e.volume||"BearDrive";S.useEffect(()=>{document.title=e.brand||r},[e,r]);const i=S.useMemo(()=>k_(t,"volume"),[t]);return i.trailingSlash&&i.path?f.jsx(Ds,{to:Oi(i.path)}):f.jsx(fE,{config:e,apiBase:"/api/",route:i,hub:!1,sidebar:{vault:f.jsx(Ju,{name:r,showSignout:e.auth.enabled,search:!0})}})}function RF(){const{data:e}=E2();return f.jsxs(qD,{delayDuration:150,children:[e?e.mode==="hub"?f.jsx(_F,{config:e}):f.jsx(EF,{config:e}):f.jsx(Us,{vault:f.jsx(Ju,{name:"…",showSignout:!1}),topbar:f.jsx(Hs,{}),children:f.jsx("div",{className:"empty",children:"Loading…"})}),f.jsx(E3,{}),f.jsx(A3,{})]})}class jF extends S.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,r){console.error("BearDrive: unhandled render error",t,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 TF=new l2({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});zj.createRoot(document.getElementById("root")).render(f.jsx(S.StrictMode,{children:f.jsx(jF,{children:f.jsx(c2,{client:TF,children:f.jsx(RF,{})})})})); diff --git a/internal/webapp/static/assets/index-DISTZ6FW.css b/internal/webapp/static/assets/index-L-I4D1mx.css similarity index 94% rename from internal/webapp/static/assets/index-DISTZ6FW.css rename to internal/webapp/static/assets/index-L-I4D1mx.css index 21089d6..105fd20 100644 --- a/internal/webapp/static/assets/index-DISTZ6FW.css +++ b/internal/webapp/static/assets/index-L-I4D1mx.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-beta{flex:none;font-size:10px;font-weight:600;line-height:1;letter-spacing:.06em;text-transform:uppercase;color:var(--accent-bright);background:color-mix(in srgb,var(--accent) 13%,transparent);border:1px solid color-mix(in srgb,var(--accent) 30%,transparent);border-radius:999px;padding:3px 6px}.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:150px}.share-acts{display:inline-flex;align-items:center;gap:6px}.share-acts .ai-btn{display:inline-flex;align-items:center;justify-content:center;padding:0 8px}.share-acts .ai-btn .ico{width:15px;height:15px}.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}.meta-stale{color:#e07070}.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)}.ps-export{margin:16px 0 0;max-width:62ch}.ps-export code{font-size:12px;padding:1px 5px;border-radius:4px;background:var(--surface);border:1px solid var(--border);color:var(--text)}.ps-export a{color:var(--accent-bright);text-decoration:none}.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-heatnote{color:var(--text-faint);font-size:12px;opacity:.8;margin:-14px 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}.dl-conflict{flex:none;font-size:10.5px;line-height:1;letter-spacing:.02em;text-transform:uppercase;padding:3px 6px;border-radius:999px;border:1px solid var(--accent-dim);background:var(--glow);color:var(--accent-bright);white-space:nowrap}.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}.stalemark{flex:none;font-size:11px;line-height:1;color:#e07070}.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{flex-shrink:0;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{min-width:0;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-undo{display:inline-flex;align-items:center;gap:4px;flex:none;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}.hrun-undo:hover{color:var(--del);border-color:#f26d6d61;background:var(--hover)}.hrun-undo:disabled{opacity:.5;cursor:default}.hrun-undo .ico{width:12px;height:12px}.undo-list{margin:10px 0;max-height:40vh;overflow-y:auto;border:1px solid var(--border);border-radius:6px}.undo-row{display:flex;align-items:baseline;gap:10px;padding:5px 9px;font-size:12.5px}.undo-row+.undo-row{border-top:1px solid var(--border)}.undo-row .undo-path{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.undo-row .undo-what{margin-left:auto;flex:none;color:var(--text-faint);font-size:11.5px}.undo-row .undo-after{flex:none;color:var(--del);font-size:10px;text-transform:uppercase;letter-spacing:.06em;font-weight:600}.undo-warn{color:var(--del)}.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{flex-shrink:1;max-width:none;white-space:normal;overflow:visible}.hrun-meta{order:1;flex:1 1 100%;white-space:normal;overflow:visible}.hrun-undo{order:2;margin-left:auto;min-height:32px}.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 a.wiki-missing{color:var(--text-faint);border-bottom:none;text-decoration:underline dotted;cursor:help}.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 .4em;font-size:12px;color:var(--text-faint)}.markdown .mermaid-err-detail{margin:0 0 1.3em;font:11.5px/1.5 var(--mono);color:var(--text-faint);white-space:pre;overflow:auto;max-height:12em}.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}.sbadge{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 22px;padding:11px 14px;border:1px solid rgba(242,109,109,.32);border-radius:var(--r-card);background:#f26d6d14}.sbadge .sb-icon{flex:none;display:flex;color:#e07070}.sbadge .sb-text{flex:1 1 220px;min-width:0;display:flex;flex-direction:column;gap:1px;font-size:12.5px;line-height:1.45}.sbadge .sb-text b{color:#e07070;font-weight:600}.sbadge .sb-text span{color:var(--text-dim)}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-beta{flex:none;font-size:10px;font-weight:600;line-height:1;letter-spacing:.06em;text-transform:uppercase;color:var(--accent-bright);background:color-mix(in srgb,var(--accent) 13%,transparent);border:1px solid color-mix(in srgb,var(--accent) 30%,transparent);border-radius:999px;padding:3px 6px}.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:150px}.share-acts{display:inline-flex;align-items:center;gap:6px}.share-acts .ai-btn{display:inline-flex;align-items:center;justify-content:center;padding:0 8px}.share-acts .ai-btn .ico{width:15px;height:15px}.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}.meta-stale{color:#e07070}.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)}.ps-export{margin:16px 0 0;max-width:62ch}.ps-export code{font-size:12px;padding:1px 5px;border-radius:4px;background:var(--surface);border:1px solid var(--border);color:var(--text)}.ps-export a{color:var(--accent-bright);text-decoration:none}.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-heatnote{color:var(--text-faint);font-size:12px;opacity:.8;margin:-14px 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}.dl-conflict{flex:none;font-size:10.5px;line-height:1;letter-spacing:.02em;text-transform:uppercase;padding:3px 6px;border-radius:999px;border:1px solid var(--accent-dim);background:var(--glow);color:var(--accent-bright);white-space:nowrap}.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}.stalemark{flex:none;font-size:11px;line-height:1;color:#e07070}.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{flex-shrink:0;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{min-width:0;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-undo{display:inline-flex;align-items:center;gap:4px;flex:none;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}.hrun-undo:hover{color:var(--del);border-color:#f26d6d61;background:var(--hover)}.hrun-undo:disabled{opacity:.5;cursor:default}.hrun-undo .ico{width:12px;height:12px}.undo-list{margin:10px 0;max-height:40vh;overflow-y:auto;border:1px solid var(--border);border-radius:6px}.undo-row{display:flex;align-items:baseline;gap:10px;padding:5px 9px;font-size:12.5px}.undo-row+.undo-row{border-top:1px solid var(--border)}.undo-row .undo-path{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.undo-row .undo-what{margin-left:auto;flex:none;color:var(--text-faint);font-size:11.5px}.undo-row .undo-after{flex:none;color:var(--del);font-size:10px;text-transform:uppercase;letter-spacing:.06em;font-weight:600}.undo-warn{color:var(--del)}.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{flex-shrink:1;max-width:none;white-space:normal;overflow:visible}.hrun-meta{order:1;flex:1 1 100%;white-space:normal;overflow:visible}.hrun-undo{order:2;margin-left:auto;min-height:32px}.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 a.wiki-missing{color:var(--text-faint);border-bottom:none;text-decoration:underline dotted;cursor:help}.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 .4em;font-size:12px;color:var(--text-faint)}.markdown .mermaid-err-detail{margin:0 0 1.3em;font:11.5px/1.5 var(--mono);color:var(--text-faint);white-space:pre;overflow:auto;max-height:12em}.fmpanel{margin:0 0 1.8em;font-size:12px;background:var(--surface);border:1px solid var(--border);border-radius:8px}.fmpanel>summary{list-style:none;cursor:pointer;padding:7px 12px;color:var(--text-faint);font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;-webkit-user-select:none;user-select:none;display:flex;align-items:center;gap:6px}.fmpanel>summary::-webkit-details-marker{display:none}.fmpanel>summary:before{content:"";width:0;height:0;border:4px solid transparent;border-left-color:currentColor;transition:transform .12s ease}.fmpanel[open]>summary:before{transform:rotate(90deg) translate(-1px)}.fmpanel>summary:hover{color:var(--text-dim)}.fmpanel>summary:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;border-radius:8px}.fmpanel dl{margin:0;padding:0 12px 4px;border-top:1px solid var(--border)}.fmpanel dl>div{display:flex;gap:10px;padding:6px 0;border-bottom:1px solid var(--border)}.fmpanel dl>div:last-child{border-bottom:none}.fmpanel dt{flex:0 0 auto;max-width:40%;color:var(--text-faint);font-size:11.5px;font-weight:600;overflow-wrap:anywhere}.fmpanel dd{margin:0;min-width:0;color:var(--text-dim);overflow-wrap:anywhere}.fmpanel code{white-space:pre-wrap;font:11px/1.5 var(--mono);color:#e4d9c4}@media(min-width:1400px){.page.read:has(.fmpanel){max-width:calc(var(--page-read) + 268px);display:grid;grid-template-columns:minmax(0,var(--page-read)) 240px;column-gap:28px;align-items:start}.page.read:has(.fmpanel)>*{grid-column:1;min-width:0}.page.read:has(.fmpanel)>.fmpanel{grid-column:2;grid-row:1;position:sticky;top:0;margin:0}}.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}.sbadge{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 22px;padding:11px 14px;border:1px solid rgba(242,109,109,.32);border-radius:var(--r-card);background:#f26d6d14}.sbadge .sb-icon{flex:none;display:flex;color:#e07070}.sbadge .sb-text{flex:1 1 220px;min-width:0;display:flex;flex-direction:column;gap:1px;font-size:12.5px;line-height:1.45}.sbadge .sb-text b{color:#e07070;font-weight:600}.sbadge .sb-text span{color:var(--text-dim)}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/index.html b/internal/webapp/static/index.html index 1c338ab..7201e33 100644 --- a/internal/webapp/static/index.html +++ b/internal/webapp/static/index.html @@ -5,10 +5,10 @@ BearDrive - + - +
titleQ3ownersnow