diff --git a/dashboard/src/main.test.tsx b/dashboard/src/main.test.tsx index 1fc2e1a..2c61eeb 100644 --- a/dashboard/src/main.test.tsx +++ b/dashboard/src/main.test.tsx @@ -142,27 +142,33 @@ describe("dashboard routing and API query helpers", () => { }); it("renders the webhook status exported by the backend", () => { - render(); + render(); expect(screen.getByRole("heading", { name: "GitHub webhooks" })).toBeInTheDocument(); expect(screen.getByText("shadow")).toBeInTheDocument(); expect(screen.getByText("observed")).toBeInTheDocument(); expect(screen.getAllByText("7").length).toBeGreaterThan(0); + expect(screen.getByRole("tab", { name: "Hooks (143 total)" })).toBeInTheDocument(); + expect(screen.getByRole("tab", { name: "Deliveries (912 total)" })).toBeInTheDocument(); }); it("navigates webhook hook inventory and delivery details", async () => { const user = userEvent.setup(); const onSectionChange = vi.fn(); const onViewHook = vi.fn(); - const summary = { mode: "shadow", configured: true, receipts: { observed: 7 }, duplicate_deliveries: 2, cross_source_matches: 3 }; + const summary = { mode: "shadow", configured: true, receipts: { observed: 7 }, duplicate_deliveries: 2, cross_source_matches: 3, totals: { hooks: 101, deliveries: 912 } }; const hooks = [{ id: "42", target: "gisce", target_type: "organization" as const, active: true, events: ["issue_comment"], status: "receiving" as const, last_ping_at: "2026-10-02T10:00:00Z", last_event_at: "2026-10-02T10:05:00Z" }]; const deliveries = [{ delivery_id: "delivery-1", created_at: "2026-10-02T10:05:00Z", hook_id: "42", hook: { id: "42", target: "gisce", target_type: "organization" as const }, event_name: "issue_comment", action: "created", repository: "gisce/github-agent-bridge", status: "observed" }]; const common = { summary, summaryLoading: false, sectionLoading: false, loadingMore: false, hasMore: false, deliveryFilters: { hook_id: "", event_name: "", repository: "", result: "" }, error: null, onSectionChange, onLoadMore: vi.fn(), onDeliveryFiltersChange: vi.fn(), onViewHook, onRefresh: vi.fn() }; const { rerender } = render(); + expect(screen.getByRole("tab", { name: "Hooks (101 total)" })).toBeInTheDocument(); + await user.click(screen.getByRole("tab", { name: /Hooks/ })); expect(onSectionChange).toHaveBeenCalledWith("hooks"); rerender(); + expect(screen.getByRole("tab", { name: "Hooks (101 total)" })).toBeInTheDocument(); + expect(screen.getByTestId("lazy-scroll-hooks")).toHaveClass("max-h-[640px]", "overflow-auto"); expect(screen.getByText("organization · #42")).toBeInTheDocument(); expect(screen.getByText("receiving")).toBeInTheDocument(); await user.click(screen.getByRole("button", { name: "gisce" })); @@ -171,6 +177,7 @@ describe("dashboard routing and API query helpers", () => { await user.click(screen.getByRole("tab", { name: /Deliveries/ })); expect(onSectionChange).toHaveBeenCalledWith("deliveries"); rerender(); + expect(screen.getByTestId("lazy-scroll-deliveries")).toHaveClass("max-h-[640px]", "overflow-auto"); expect(screen.getAllByText("issue_comment · created").length).toBeGreaterThan(0); expect(screen.getByText("gisce/github-agent-bridge")).toBeInTheDocument(); expect(screen.getByText("#42")).toBeInTheDocument(); @@ -511,6 +518,7 @@ describe("status badges", () => { ); expect(screen.getByRole("columnheader", { name: "Status" }).parentElement).toHaveClass("sticky", "top-0", "z-10"); + expect(screen.getByTestId("lazy-scroll-jobs")).toHaveClass("max-h-[640px]", "overflow-auto"); expect(screen.getByRole("columnheader", { name: "Job" })).toBeInTheDocument(); expect(screen.queryByRole("columnheader", { name: "Model" })).not.toBeInTheDocument(); expect(screen.queryByText("openai/gpt-5.4-mini · medium")).not.toBeInTheDocument(); diff --git a/dashboard/src/main.tsx b/dashboard/src/main.tsx index ba05aa9..4b17799 100644 --- a/dashboard/src/main.tsx +++ b/dashboard/src/main.tsx @@ -75,8 +75,27 @@ type WebhookSummary = { receipts: Record; duplicate_deliveries: number; cross_source_matches: number; + totals?: { hooks: number; deliveries: number }; + coverage?: { + both: number; + imap_only: number; + webhook_only: number; + imap_eligible: number; + ratio?: number | null; + mean_match_delay_ms?: number | null; + }; +}; + +type WebhookException = { + kind: "imap_only" | "webhook_only" | "unmatchable"; + event_key?: string | null; + reference: string; + created_at: string; + repository?: string | null; }; +type WebhookExceptionsResponse = { exceptions: WebhookException[] }; + type WebhookSection = "overview" | "hooks" | "deliveries"; type WebhookTimeseriesResponse = { @@ -992,6 +1011,11 @@ function App() { queryFn: () => api(webhookTimeseriesPath(webhookWindow.from, webhookWindow.to)), enabled: webhookEnabled && webhookQuery.timeseries, }); + const webhookExceptions = useQuery({ + queryKey: ["webhook-exceptions"], + queryFn: () => api("/api/webhooks/github/exceptions"), + enabled: webhookEnabled && webhookQuery.timeseries, + }); const webhookHooks = useInfiniteQuery({ queryKey: ["webhook-hooks"], queryFn: ({ pageParam }) => api(webhookHooksPath(50, pageParam)), @@ -1257,6 +1281,7 @@ function App() { const webhookSectionError = webhookSection === "overview" ? webhookTimeseries.error : webhookSection === "hooks" ? webhookHooks.error : webhookDeliveries.error; const refreshWebhooks = () => { webhookSummary.refetch(); + if (webhookSection === "overview") webhookExceptions.refetch(); if (webhookSection === "overview") setWebhookWindow(webhookMonitoringWindow()); if (webhookSection === "hooks") webhookHooks.refetch(); if (webhookSection === "deliveries") webhookDeliveries.refetch(); @@ -1346,6 +1371,7 @@ function App() { total + count, 0); const sections = [ { id: "overview" as const, label: "Overview" }, - { id: "hooks" as const, label: "Hooks", count: hooks?.length }, - { id: "deliveries" as const, label: "Deliveries", count: deliveries?.length }, + { id: "hooks" as const, label: "Hooks", count: summary?.totals?.hooks }, + { id: "deliveries" as const, label: "Deliveries", count: summary?.totals?.deliveries }, ]; return (
} title="GitHub webhooks" subtitle="Shadow ingestion health. Deliveries are observed but do not create jobs." action={} /> {error ? : null}
- {sections.map((item) => )} + {sections.map((item) => )}
} /> @@ -1757,13 +1785,24 @@ function WebhookPage({ {summaryLoading ? : Object.keys(summary?.receipts ?? {}).length ?
{Object.entries(summary?.receipts ?? {}).sort(([left], [right]) => left.localeCompare(right)).map(([state, count]) => )}
: }
+ +
+ + + + +
+
+ + {exceptions?.length ?
{exceptions.map((item) => )}
TypeRepositoryReferenceObserved
{item.kind}{item.repository ?? "unknown"}{item.event_key ?? item.reference}{item.created_at}
: } +
: null} {section === "hooks" ? - {sectionLoading ? : hooks?.length ? <>
{hooks.map((hook) => onViewHook(hook.id)}>)}
TargetStateConfigurationLast deliveryLast ping
{hook.target_type} · #{hook.id}
{hook.status}
{hook.events.join(", ") || "No event snapshot"}
{hook.content_type ?? "content type unknown"} · SSL {hook.ssl_verify === null || hook.ssl_verify === undefined ? "unknown" : hook.ssl_verify ? "verified" : "disabled"}
{hook.last_event_name ?? "Never"}{hook.last_action ? ` · ${hook.last_action}` : ""}
{hook.last_repository ?? hook.last_event_at ?? "No delivery observed"}
{hook.last_ping_at ?? "Never"}
: } + {sectionLoading ? : hooks?.length ? {hooks.map((hook) => onViewHook(hook.id)}>)}
TargetStateConfigurationLast deliveryLast ping
{hook.target_type} · #{hook.id}
{hook.status}
{hook.events.join(", ") || "No event snapshot"}
{hook.content_type ?? "content type unknown"} · SSL {hook.ssl_verify === null || hook.ssl_verify === undefined ? "unknown" : hook.ssl_verify ? "verified" : "disabled"}
{hook.last_event_name ?? "Never"}{hook.last_action ? ` · ${hook.last_action}` : ""}
{hook.last_repository ?? hook.last_event_at ?? "No delivery observed"}
{hook.last_ping_at ?? "Never"}
: }
: null} {section === "deliveries" ? - {sectionLoading ? : deliveries?.length ? <> : } + {sectionLoading ? : deliveries?.length ? : } : null}
); @@ -1780,24 +1819,39 @@ function WebhookDeliveryFiltersForm({ filters, onChange }: { filters: WebhookDel } function WebhookDeliveriesTable({ deliveries, onViewHook }: { deliveries: WebhookDelivery[]; onViewHook: (hookId: string) => void }) { - return
{deliveries.map((delivery) => )}
ReceivedHookEventRepositoryResultDelivery
{delivery.created_at}{delivery.hook_id ? : Unknown (legacy)}{delivery.event_name}{delivery.action ? ` · ${delivery.action}` : ""}{delivery.repository ?? "—"}{delivery.status}{delivery.duplicate_count ? {delivery.duplicate_count} retries : null}{delivery.delivery_id}
; + return {deliveries.map((delivery) => )}
ReceivedHookEventRepositoryResultDelivery
{delivery.created_at}{delivery.hook_id ? : Unknown (legacy)}{delivery.event_name}{delivery.action ? ` · ${delivery.action}` : ""}{delivery.repository ?? "—"}{delivery.status}{delivery.duplicate_count ? {delivery.duplicate_count} retries : null}{delivery.delivery_id}
; +} + +function LazyScrollFrame({ noun, hasMore, loading, onLoadMore, children, className }: { noun: string; hasMore: boolean; loading: boolean; onLoadMore?: () => void; children: React.ReactNode; className?: string }) { + return
{children}
; } -function IncrementalLoadControls({ kind, hasMore, loading, onLoadMore }: { kind: "hooks" | "deliveries"; hasMore: boolean; loading: boolean; onLoadMore: () => void }) { +function LazyLoadSentinel({ noun, hasMore, loading, onLoadMore }: { noun: string; hasMore: boolean; loading: boolean; onLoadMore?: () => void }) { const ref = React.useRef(null); + const requested = React.useRef(false); + React.useEffect(() => { + if (!loading) requested.current = false; + }, [loading]); React.useEffect(() => { const node = ref.current; - if (!node || !hasMore || loading) return; - if (!("IntersectionObserver" in window)) return; + if (!node || !hasMore || loading || !onLoadMore) return; + const requestMore = () => { + if (requested.current) return; + requested.current = true; + onLoadMore(); + }; + if (!("IntersectionObserver" in window)) { + requestMore(); + return; + } const observer = new IntersectionObserver((entries) => { - if (entries.some((entry) => entry.isIntersecting)) onLoadMore(); + if (entries.some((entry) => entry.isIntersecting)) requestMore(); }, { rootMargin: "240px 0px" }); observer.observe(node); return () => observer.disconnect(); - }, [hasMore, kind, loading, onLoadMore]); + }, [hasMore, loading, noun, onLoadMore]); if (!hasMore && !loading) return null; - const noun = kind === "hooks" ? "hooks" : "deliveries"; - return
; + return
{loading ? `Loading more ${noun}...` : `Scroll for more ${noun}`}
; } function WebhookHookDetailPage({ data, loading, error, onBack, onRefresh, onViewHook }: { data?: WebhookHookDetailResponse; loading: boolean; error: Error | null; onBack: () => void; onRefresh: () => void; onViewHook: (hookId: string) => void }) { @@ -3230,7 +3284,7 @@ function JobsList({ ))} -
+ @@ -3263,8 +3317,7 @@ function JobsList({ ))}
- -
+ ); } @@ -3367,30 +3420,6 @@ function MobileLoadMoreJobs({ hasMore, loading, onLoadMore }: { hasMore: boolean ); } -function JobsLoadSentinel({ hasMore, loading, onLoadMore }: { hasMore: boolean; loading: boolean; onLoadMore?: () => void }) { - const ref = React.useRef(null); - React.useEffect(() => { - const node = ref.current; - if (!node || !hasMore || loading || !onLoadMore) return; - if (!("IntersectionObserver" in window)) { - onLoadMore(); - return; - } - const observer = new IntersectionObserver((entries) => { - if (entries.some((entry) => entry.isIntersecting)) onLoadMore(); - }, { rootMargin: "240px 0px" }); - observer.observe(node); - return () => observer.disconnect(); - }, [hasMore, loading, onLoadMore]); - - if (!hasMore && !loading) return null; - return ( -
- {loading ? "Loading more jobs..." : "Scroll for more jobs"} -
- ); -} - function JobCard({ job, onViewJob, diff --git a/docs/ingestion.md b/docs/ingestion.md index 2e92ff3..a7e311e 100644 --- a/docs/ingestion.md +++ b/docs/ingestion.md @@ -88,8 +88,12 @@ payload and never creates a queue job. The monitoring API is split so opening the overview does not load hook inventory or delivery history: - `GET /api/webhooks/github/summary` returns mode, receipt counts, retries, and - cross-source matches. The previous `/status` path remains a summary-only - compatibility alias. + cross-source coverage (`both`, `imap_only`, `webhook_only`) with an explicit + IMAP denominator and mean matching delay. The previous `/status` path remains + a summary-only compatibility alias. +- `GET /api/webhooks/github/exceptions` returns a bounded operator queue for + IMAP-only, webhook-only, and unmatchable retained events. It never returns raw + payload or comment bodies. - `GET /api/webhooks/github/timeseries?from=&to=&bucket=day|hour` returns only the requested interval. Daily ranges are capped at 366 days and hourly ranges at 31 days; omitted bounds default to the configured retention diff --git a/src/github_agent_bridge/backend.py b/src/github_agent_bridge/backend.py index 867eacf..f8ec577 100644 --- a/src/github_agent_bridge/backend.py +++ b/src/github_agent_bridge/backend.py @@ -792,8 +792,20 @@ def github_webhook_shadow_summary(_: dict[str, Any] = Depends(current_admin_prof " WHERE w.event_key IS NOT NULL AND EXISTS (" " SELECT 1 FROM ingest_receipts i WHERE i.event_key=w.event_key" " )" + "), coverage AS (" + " SELECT " + " (SELECT COUNT(DISTINCT event_key) FROM ingest_receipts WHERE source='email' AND event_key IS NOT NULL) imap_events," + " (SELECT COUNT(DISTINCT event_key) FROM webhook_shadow_receipts WHERE event_key IS NOT NULL) webhook_events," + " COUNT(DISTINCT i.event_key) both_events," + " AVG(ABS((julianday(w.created_at)-julianday(i.created_at))*86400000.0)) match_delay_ms" + " FROM ingest_receipts i JOIN webhook_shadow_receipts w ON w.event_key=i.event_key" + " WHERE i.source='email'" + "), inventory AS (" + " SELECT (SELECT COUNT(*) FROM webhook_hooks) hooks," + " (SELECT COUNT(*) FROM webhook_shadow_receipts) deliveries" ") SELECT COALESCE(observed,0),COALESCE(unsupported,0)," - "duplicate_deliveries,matches FROM receipt_summary CROSS JOIN cross_source" + "duplicate_deliveries,matches,imap_events,webhook_events,both_events,match_delay_ms,hooks,deliveries " + "FROM receipt_summary CROSS JOIN cross_source CROSS JOIN coverage CROSS JOIN inventory" ).fetchone() counts = { name: count @@ -806,8 +818,44 @@ def github_webhook_shadow_summary(_: dict[str, Any] = Depends(current_admin_prof "receipts": counts, "duplicate_deliveries": row[2], "cross_source_matches": row[3], + "totals": {"hooks": row[8], "deliveries": row[9]}, + "coverage": { + "both": row[6], + "imap_only": max(row[4] - row[6], 0), + "webhook_only": max(row[5] - row[6], 0), + "imap_eligible": row[4], + "ratio": (row[6] / row[4]) if row[4] else None, + "mean_match_delay_ms": round(row[7], 1) if row[7] is not None else None, + }, } + @app.get("/api/webhooks/github/exceptions") + def github_webhook_shadow_exceptions( + limit: int = Query(50, ge=1, le=100), + _: dict[str, Any] = Depends(current_admin_profile), + ) -> dict[str, Any]: + """Return bounded, actionable shadow divergences without loading all receipts.""" + ensure_webhook_schema() + with sqlite3.connect(config.db) as con: + con.row_factory = sqlite3.Row + rows = con.execute( + "WITH candidates AS (" + " SELECT 'imap_only' kind,i.event_key,i.source_key reference,i.created_at,NULL repository " + " FROM ingest_receipts i WHERE i.event_key IS NOT NULL AND i.source='email' AND NOT EXISTS (" + " SELECT 1 FROM webhook_shadow_receipts w WHERE w.event_key=i.event_key" + " ) UNION ALL " + " SELECT 'webhook_only',w.event_key,w.delivery_id,w.created_at,w.repository " + " FROM webhook_shadow_receipts w WHERE w.event_key IS NOT NULL AND NOT EXISTS (" + " SELECT 1 FROM ingest_receipts i WHERE i.event_key=w.event_key" + " ) UNION ALL " + " SELECT 'unmatchable',NULL,w.delivery_id,w.created_at,w.repository " + " FROM webhook_shadow_receipts w WHERE w.event_key IS NULL" + ") SELECT kind,event_key,reference,created_at,repository FROM candidates " + "ORDER BY created_at DESC LIMIT ?", + (limit,), + ).fetchall() + return {"exceptions": [dict(row) for row in rows]} + @app.get("/api/webhooks/github/timeseries") def github_webhook_shadow_timeseries( from_value: str | None = Query(None, alias="from"), diff --git a/src/github_agent_bridge/dashboard_static/assets/index-B1f_MgKy.css b/src/github_agent_bridge/dashboard_static/assets/index-B1f_MgKy.css deleted file mode 100644 index 58c63e1..0000000 --- a/src/github_agent_bridge/dashboard_static/assets/index-B1f_MgKy.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{color-scheme:light;--color-border: 214 20% 88%;--color-background: 210 20% 98%;--color-foreground: 216 28% 14%;--color-muted: 215 16% 47%;--color-panel: 0 0% 100%;--color-primary: 212 92% 42%}@media(prefers-color-scheme:dark){:root{color-scheme:dark;--color-border: 217 24% 25%;--color-background: 222 33% 8%;--color-foreground: 214 30% 92%;--color-muted: 215 18% 68%;--color-panel: 222 31% 13%;--color-primary: 212 92% 58%}}*{box-sizing:border-box}body{margin:0;min-width:320px;overflow-x:clip;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;letter-spacing:0}#root{overflow-x:clip}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.animate-live-pulse{animation:live-pulse 1.25s ease-in-out infinite}.control{height:36px;width:100%;border-radius:6px;border:1px solid hsl(var(--color-border));background:hsl(var(--color-panel));padding:0 10px;color:hsl(var(--color-foreground));font:inherit}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.right-0{right:0}.right-3{right:.75rem}.top-0{top:0}.top-20{top:5rem}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.col-span-2{grid-column:span 2 / span 2}.-mx-3{margin-left:-.75rem;margin-right:-.75rem}.mx-auto{margin-left:auto;margin-right:auto}.my-3{margin-top:.75rem;margin-bottom:.75rem}.-mt-3{margin-top:-.75rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-72{height:18rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-full{height:100%}.max-h-40{max-height:10rem}.max-h-56{max-height:14rem}.max-h-64{max-height:16rem}.max-h-72{max-height:18rem}.max-h-\[460px\]{max-height:460px}.max-h-\[620px\]{max-height:620px}.max-h-\[640px\]{max-height:640px}.min-h-10{min-height:2.5rem}.min-h-12{min-height:3rem}.min-h-5{min-height:1.25rem}.min-h-6{min-height:1.5rem}.min-h-7{min-height:1.75rem}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-44{width:11rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[42\%\]{width:42%}.w-\[min\(calc\(100vw-1\.5rem\)\,28rem\)\]{width:min(calc(100vw - 1.5rem),28rem)}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-5{min-width:1.25rem}.min-w-\[1080px\]{min-width:1080px}.min-w-\[180px\]{min-width:180px}.min-w-\[190px\]{min-width:190px}.min-w-\[920px\]{min-width:920px}.min-w-\[980px\]{min-width:980px}.min-w-full{min-width:100%}.max-w-40{max-width:10rem}.max-w-\[1440px\]{max-width:1440px}.max-w-\[14rem\]{max-width:14rem}.max-w-full{max-width:100%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[auto_minmax\(0\,1fr\)\]{grid-template-columns:auto minmax(0,1fr)}.grid-cols-\[minmax\(0\,1\.35fr\)_90px_120px_90px_minmax\(0\,1fr\)\]{grid-template-columns:minmax(0,1.35fr) 90px 120px 90px minmax(0,1fr)}.grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-y-1{row-gap:.25rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-border>:not([hidden])~:not([hidden]){border-color:hsl(var(--color-border))}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l-2{border-left-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-300{--tw-border-opacity: 1;border-color:rgb(252 211 77 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--color-border))}.border-border\/70{border-color:hsl(var(--color-border) / .7)}.border-emerald-200{--tw-border-opacity: 1;border-color:rgb(167 243 208 / var(--tw-border-opacity, 1))}.border-emerald-300{--tw-border-opacity: 1;border-color:rgb(110 231 183 / var(--tw-border-opacity, 1))}.border-emerald-400{--tw-border-opacity: 1;border-color:rgb(52 211 153 / var(--tw-border-opacity, 1))}.border-primary{border-color:hsl(var(--color-primary))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-slate-800{--tw-border-opacity: 1;border-color:rgb(30 41 59 / var(--tw-border-opacity, 1))}.border-violet-200{--tw-border-opacity: 1;border-color:rgb(221 214 254 / var(--tw-border-opacity, 1))}.border-white\/40{border-color:#fff6}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-800{--tw-bg-opacity: 1;background-color:rgb(146 64 14 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--color-background))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-emerald-50{--tw-bg-opacity: 1;background-color:rgb(236 253 245 / var(--tw-bg-opacity, 1))}.bg-emerald-600{--tw-bg-opacity: 1;background-color:rgb(5 150 105 / var(--tw-bg-opacity, 1))}.bg-emerald-950{--tw-bg-opacity: 1;background-color:rgb(2 44 34 / var(--tw-bg-opacity, 1))}.bg-panel{background-color:hsl(var(--color-panel))}.bg-panel\/95{background-color:hsl(var(--color-panel) / .95)}.bg-primary{background-color:hsl(var(--color-primary))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-50\/60{background-color:#f8fafc99}.bg-slate-50\/70{background-color:#f8fafcb3}.bg-slate-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-950{--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-violet-50{--tw-bg-opacity: 1;background-color:rgb(245 243 255 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/15{background-color:#ffffff26}.bg-white\/70{background-color:#ffffffb3}.bg-white\/80{background-color:#fffc}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-3{padding-bottom:.75rem}.pl-0\.5{padding-left:.125rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-5{padding-left:1.25rem}.pr-1{padding-right:.25rem}.pt-2{padding-top:.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-top{vertical-align:top}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[0\.85em\]{font-size:.85em}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-amber-950{--tw-text-opacity: 1;color:rgb(69 26 3 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-700\/70{color:#1d4ed8b3}.text-emerald-50{--tw-text-opacity: 1;color:rgb(236 253 245 / var(--tw-text-opacity, 1))}.text-emerald-700{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.text-emerald-800{--tw-text-opacity: 1;color:rgb(6 95 70 / var(--tw-text-opacity, 1))}.text-emerald-900{--tw-text-opacity: 1;color:rgb(6 78 59 / var(--tw-text-opacity, 1))}.text-emerald-950{--tw-text-opacity: 1;color:rgb(2 44 34 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--color-foreground))}.text-muted{color:hsl(var(--color-muted))}.text-primary{color:hsl(var(--color-primary))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-950{--tw-text-opacity: 1;color:rgb(69 10 10 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-violet-700{--tw-text-opacity: 1;color:rgb(109 40 217 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.opacity-0{opacity:0}.opacity-60{opacity:.6}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_1px_0_rgba\(15\,23\,42\,0\.03\)\]{--tw-shadow: 0 1px 0 rgba(15,23,42,.03);--tw-shadow-colored: 0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-slate-950\/15{--tw-shadow-color: rgb(2 6 23 / .15);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.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)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}@media(prefers-color-scheme:dark){.bg-white,.bg-white\/70,.bg-white\/80,.hover\:bg-white:hover{background-color:hsl(var(--color-panel))}.bg-slate-50,.bg-slate-50\/60,.bg-slate-50\/70,.bg-slate-100,.hover\:bg-slate-50:hover,.hover\:bg-slate-100:hover{background-color:#1f2637}.bg-blue-50{background-color:#152847}.bg-amber-50,.bg-amber-100,.hover\:bg-amber-100:hover{background-color:#46310b}.bg-red-50,.hover\:bg-red-50:hover{background-color:#441818}.bg-emerald-50,.hover\:bg-emerald-100:hover{background-color:#163b2b}.border-slate-200,.border-slate-300,.border-slate-700,.border-slate-800{border-color:hsl(var(--color-border))}.border-amber-200,.border-amber-300{border-color:#956b23}.border-blue-200,.border-blue-300{border-color:#2757a5}.border-red-200,.border-red-300{border-color:#a72f2f}.border-emerald-300{border-color:#30976a}.text-slate-600,.text-slate-700,.text-slate-800,.text-slate-900,.hover\:text-slate-900:hover{color:hsl(var(--color-foreground))}.text-slate-300,.text-slate-400,.text-slate-500,.hover\:text-slate-500:hover{color:hsl(var(--color-muted))}.text-blue-700{color:#92c2fc}.text-amber-700,.text-amber-800,.text-amber-900,.text-amber-950{color:#fde7af}.text-red-600,.text-red-700,.text-red-950{color:#fbacac}.text-emerald-700,.text-emerald-800,.text-emerald-900,.text-emerald-950{color:#a3f5cd}}.\[overflow-wrap\:anywhere\]{overflow-wrap:anywhere}@keyframes live-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.72)}}@media(prefers-reduced-motion:reduce){.animate-live-pulse{animation:none}}.marker\:hidden *::marker{display:none}.marker\:hidden::marker{display:none}.first\:mt-0:first-child{margin-top:0}.last\:border-0:last-child{border-width:0px}.last\:border-b-0:last-child{border-bottom-width:0px}.focus-within\:border-primary:focus-within{border-color:hsl(var(--color-primary))}.focus-within\:ring-1:focus-within{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-within\:ring-primary:focus-within{--tw-ring-color: hsl(var(--color-primary))}.hover\:bg-amber-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.hover\:bg-amber-900:hover{--tw-bg-opacity: 1;background-color:rgb(120 53 15 / var(--tw-bg-opacity, 1))}.hover\:bg-emerald-100:hover{--tw-bg-opacity: 1;background-color:rgb(209 250 229 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:text-foreground:hover{color:hsl(var(--color-foreground))}.hover\:underline:hover{text-decoration-line:underline}@media(prefers-color-scheme:dark){.hover\:bg-white:hover{background-color:hsl(var(--color-panel))}.hover\:bg-slate-50:hover,.hover\:bg-slate-100:hover{background-color:#1f2637}.hover\:bg-amber-100:hover{background-color:#46310b}.hover\:bg-red-50:hover{background-color:#441818}}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}.disabled\:hover\:bg-white:hover:disabled{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}@media(prefers-color-scheme:dark){.disabled\:hover\:bg-white:hover:disabled{background-color:hsl(var(--color-panel))}}.group[open] .group-open\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media(min-width:640px){.sm\:-mx-4{margin-left:-1rem;margin-right:-1rem}.sm\:-mt-4{margin-top:-1rem}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:w-auto{width:auto}.sm\:flex-none{flex:none}.sm\:shrink-0{flex-shrink:0}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:gap-1\.5{gap:.375rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sm\:p-4{padding:1rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:pl-0{padding-left:0}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media(min-width:768px){.md\:col-span-1{grid-column:span 1 / span 1}.md\:mt-4{margin-top:1rem}.md\:block{display:block}.md\:grid{display:grid}.md\:hidden{display:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-\[minmax\(0\,1\.35fr\)_90px_120px_90px_minmax\(0\,1fr\)\]{grid-template-columns:minmax(0,1.35fr) 90px 120px 90px minmax(0,1fr)}.md\:grid-cols-\[minmax\(0\,1fr\)\]{grid-template-columns:minmax(0,1fr)}.md\:grid-cols-\[minmax\(0\,1fr\)_220px\]{grid-template-columns:minmax(0,1fr) 220px}.md\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.md\:grid-cols-\[minmax\(0\,1fr\)_minmax\(12rem\,16rem\)_auto\]{grid-template-columns:minmax(0,1fr) minmax(12rem,16rem) auto}.md\:items-center{align-items:center}.md\:gap-3{gap:.75rem}.md\:p-4{padding:1rem}.md\:px-4{padding-left:1rem;padding-right:1rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:py-5{padding-top:1.25rem;padding-bottom:1.25rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}}@media(min-width:1024px){.lg\:min-w-\[420px\]{min-width:420px}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,0\.9fr\)_minmax\(0\,1\.1fr\)\]{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)}.lg\:grid-cols-\[minmax\(0\,1fr\)_minmax\(0\,1fr\)\]{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.lg\:grid-cols-\[minmax\(0\,1fr\)_minmax\(280px\,auto\)\]{grid-template-columns:minmax(0,1fr) minmax(280px,auto)}.lg\:flex-row{flex-direction:row}.lg\:items-start{align-items:flex-start}.lg\:justify-between{justify-content:space-between}}@media(min-width:1280px){.xl\:col-span-2{grid-column:span 2 / span 2}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}}.\[\&\>span\]\:truncate>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0} diff --git a/src/github_agent_bridge/dashboard_static/assets/index-B5yiYDzv.js b/src/github_agent_bridge/dashboard_static/assets/index-B5yiYDzv.js new file mode 100644 index 0000000..4cbc096 --- /dev/null +++ b/src/github_agent_bridge/dashboard_static/assets/index-B5yiYDzv.js @@ -0,0 +1,187 @@ +var ea=e=>{throw TypeError(e)};var $r=(e,t,n)=>t.has(e)||ea("Cannot "+n);var g=(e,t,n)=>($r(e,t,"read from private field"),n?n.call(e):t.get(e)),U=(e,t,n)=>t.has(e)?ea("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),D=(e,t,n,r)=>($r(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Y=(e,t,n)=>($r(e,t,"access private method"),n);var yr=(e,t,n,r)=>({set _(s){D(e,t,s,n)},get _(){return g(e,t,r)}});import{f as iu,h as su,g as zi,r as ke,R as T,d as rr,a as Fr,C as ir,X as sr,Y as ar,T as or,L as ko,B as Vt,e as au,c as ou,b as lu}from"./charts-SqBiqy9C.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();var Hr={exports:{}},Rn={};/** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ta;function uu(){if(ta)return Rn;ta=1;var e=iu(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(l,u,c){var d,h={},m=null,p=null;c!==void 0&&(m=""+c),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(p=u.ref);for(d in u)r.call(u,d)&&!a.hasOwnProperty(d)&&(h[d]=u[d]);if(l&&l.defaultProps)for(d in u=l.defaultProps,u)h[d]===void 0&&(h[d]=u[d]);return{$$typeof:t,type:l,key:m,ref:p,props:h,_owner:s.current}}return Rn.Fragment=n,Rn.jsx=o,Rn.jsxs=o,Rn}var na;function cu(){return na||(na=1,Hr.exports=uu()),Hr.exports}var i=cu(),wr={},ra;function du(){if(ra)return wr;ra=1;var e=su();return wr.createRoot=e.createRoot,wr.hydrateRoot=e.hydrateRoot,wr}var hu=du();const pu=zi(hu);var lr=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(){}},Ft,kt,sn,po,mu=(po=class extends lr{constructor(){super();U(this,Ft);U(this,kt);U(this,sn);D(this,sn,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){g(this,kt)||this.setEventListener(g(this,sn))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,kt))==null||t.call(this),D(this,kt,void 0))}setEventListener(t){var n;D(this,sn,t),(n=g(this,kt))==null||n.call(this),D(this,kt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){g(this,Ft)!==t&&(D(this,Ft,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof g(this,Ft)=="boolean"?g(this,Ft):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ft=new WeakMap,kt=new WeakMap,sn=new WeakMap,po),qi=new mu,fu={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Nt,Fi,mo,xu=(mo=class{constructor(){U(this,Nt,fu);U(this,Fi,!1)}setTimeoutProvider(e){D(this,Nt,e)}setTimeout(e,t){return g(this,Nt).setTimeout(e,t)}clearTimeout(e){g(this,Nt).clearTimeout(e)}setInterval(e,t){return g(this,Nt).setInterval(e,t)}clearInterval(e){g(this,Nt).clearInterval(e)}},Nt=new WeakMap,Fi=new WeakMap,mo),Dt=new xu;function gu(e){setTimeout(e,0)}var bu=typeof window>"u"||"Deno"in globalThis;function Le(){}function yu(e,t){return typeof e=="function"?e(t):e}function li(e){return typeof e=="number"&&e>=0&&e!==1/0}function No(e,t){return Math.max(e+(t||0)-Date.now(),0)}function It(e,t){return typeof e=="function"?e(t):e}function Be(e,t){return typeof e=="function"?e(t):e}function ia(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Bi(o,t.options))return!1}else if(!Qn(t.queryKey,o))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function sa(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Kn(t.options.mutationKey)!==Kn(a))return!1}else if(!Qn(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Bi(e,t){return((t==null?void 0:t.queryKeyHashFn)||Kn)(e)}function Kn(e){return JSON.stringify(e,(t,n)=>ci(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Qn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Qn(e[n],t[n])):!1}var wu=Object.prototype.hasOwnProperty;function So(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=aa(e)&&aa(t);if(!r&&!(ci(e)&&ci(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),l=o.length,u=r?new Array(l):{};let c=0;for(let d=0;d{Dt.setTimeout(t,e)})}function di(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?So(e,t):t}function ju(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function ku(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ui=Symbol();function Co(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ui?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function _o(e,t){return typeof e=="function"?e(...t):!!e}function Nu(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Vn=(()=>{let e=()=>bu;return{isServer(){return e()},setIsServer(t){e=t}}})();function hi(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var Su=gu;function Cu(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=Su;const a=l=>{t?e.push(l):s(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;t++;try{u=l()}finally{t--,t||o()}return u},batchCalls:l=>(...u)=>{a(()=>{l(...u)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var je=Cu(),an,St,on,fo,_u=(fo=class extends lr{constructor(){super();U(this,an,!0);U(this,St);U(this,on);D(this,on,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){g(this,St)||this.setEventListener(g(this,on))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,St))==null||t.call(this),D(this,St,void 0))}setEventListener(t){var n;D(this,on,t),(n=g(this,St))==null||n.call(this),D(this,St,t(this.setOnline.bind(this)))}setOnline(t){g(this,an)!==t&&(D(this,an,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return g(this,an)}},an=new WeakMap,St=new WeakMap,on=new WeakMap,fo),Ir=new _u;function Eu(e){return Math.min(1e3*2**e,3e4)}function Eo(e){return(e??"online")==="online"?Ir.isOnline():!0}var pi=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Po(e){let t=!1,n=0,r;const s=hi(),a=()=>s.status!=="pending",o=w=>{var j;if(!a()){const b=new pi(w);m(b),(j=e.onCancel)==null||j.call(e,b)}},l=()=>{t=!0},u=()=>{t=!1},c=()=>qi.isFocused()&&(e.networkMode==="always"||Ir.isOnline())&&e.canRun(),d=()=>Eo(e.networkMode)&&e.canRun(),h=w=>{a()||(r==null||r(),s.resolve(w))},m=w=>{a()||(r==null||r(),s.reject(w))},p=()=>new Promise(w=>{var j;r=b=>{(a()||c())&&w(b)},(j=e.onPause)==null||j.call(e)}).then(()=>{var w;r=void 0,a()||(w=e.onContinue)==null||w.call(e)}),y=()=>{if(a())return;let w;const j=n===0?e.initialPromise:void 0;try{w=j??e.fn()}catch(b){w=Promise.reject(b)}Promise.resolve(w).then(h).catch(b=>{var k;if(a())return;const S=e.retry??(Vn.isServer()?0:3),_=e.retryDelay??Eu,N=typeof _=="function"?_(n,b):_,q=S===!0||typeof S=="number"&&nc()?void 0:p()).then(()=>{t?m(b):y()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:l,continueRetry:u,canStart:d,start:()=>(d()?y():p().then(y),s)}}var zt,xo,Ro=(xo=class{constructor(){U(this,zt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),li(this.gcTime)&&D(this,zt,Dt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Vn.isServer()?1/0:300*1e3))}clearGcTimeout(){g(this,zt)!==void 0&&(Dt.clearTimeout(g(this,zt)),D(this,zt,void 0))}},zt=new WeakMap,xo);function Pu(e){return{onFetch:(t,n)=>{var d,h,m,p,y;const r=t.options,s=(m=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:m.direction,a=((p=t.state.data)==null?void 0:p.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const c=async()=>{let w=!1;const j=_=>{Nu(_,()=>t.signal,()=>w=!0)},b=Co(t.options,t.fetchOptions),S=async(_,N,q)=>{if(w)return Promise.reject(t.signal.reason);if(N==null&&_.pages.length)return Promise.resolve(_);const B=(()=>{const L={client:t.client,queryKey:t.queryKey,pageParam:N,direction:q?"backward":"forward",meta:t.options.meta};return j(L),L})(),M=await b(B),{maxPages:v}=t.options,F=q?ku:ju;return{pages:F(_.pages,M,v),pageParams:F(_.pageParams,N,v)}};if(s&&a.length){const _=s==="backward",N=_?Io:mi,q={pages:a,pageParams:o},k=N(r,q);l=await S(q,k,_)}else{const _=e??a.length;do{const N=u===0?o[0]??r.initialPageParam:mi(r,l);if(u>0&&N==null)break;l=await S(l,N),u++}while(u<_)}return l};t.options.persister?t.fetchFn=()=>{var w,j;return(j=(w=t.options).persister)==null?void 0:j.call(w,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function mi(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Io(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function Ru(e,t){return t?mi(e,t)!=null:!1}function Iu(e,t){return!t||!e.getPreviousPageParam?!1:Io(e,t)!=null}var ln,qt,un,He,Bt,ve,Yn,Ut,qe,To,mt,go,Tu=(go=class extends Ro{constructor(t){super();U(this,qe);U(this,ln);U(this,qt);U(this,un);U(this,He);U(this,Bt);U(this,ve);U(this,Yn);U(this,Ut);D(this,Ut,!1),D(this,Yn,t.defaultOptions),this.setOptions(t.options),this.observers=[],D(this,Bt,t.client),D(this,He,g(this,Bt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,D(this,qt,ua(this.options)),this.state=t.state??g(this,qt),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return g(this,ln)}get promise(){var t;return(t=g(this,ve))==null?void 0:t.promise}setOptions(t){if(this.options={...g(this,Yn),...t},t!=null&&t._type&&D(this,ln,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=ua(this.options);n.data!==void 0&&(this.setState(la(n.data,n.dataUpdatedAt)),D(this,qt,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&g(this,He).remove(this)}setData(t,n){const r=di(this.state.data,t,this.options);return Y(this,qe,mt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Y(this,qe,mt).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=g(this,ve))==null?void 0:r.promise;return(s=g(this,ve))==null||s.cancel(t),n?n.then(Le).catch(Le):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return g(this,qt)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Be(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ui||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>It(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!No(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=g(this,ve))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=g(this,ve))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),g(this,He).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(g(this,ve)&&(g(this,Ut)||Y(this,qe,To).call(this)?g(this,ve).cancel({revert:!0}):g(this,ve).cancelRetry()),this.scheduleGc()),g(this,He).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Y(this,qe,mt).call(this,{type:"invalidate"})}async fetch(t,n){var c,d,h,m,p,y,w,j,b,S,_;if(this.state.fetchStatus!=="idle"&&((c=g(this,ve))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(g(this,ve))return g(this,ve).continueRetry(),g(this,ve).promise}if(t&&this.setOptions(t),!this.options.queryFn){const N=this.observers.find(q=>q.options.queryFn);N&&this.setOptions(N.options)}const r=new AbortController,s=N=>{Object.defineProperty(N,"signal",{enumerable:!0,get:()=>(D(this,Ut,!0),r.signal)})},a=()=>{const N=Co(this.options,n),k=(()=>{const B={client:g(this,Bt),queryKey:this.queryKey,meta:this.meta};return s(B),B})();return D(this,Ut,!1),this.options.persister?this.options.persister(N,k,this):N(k)},l=(()=>{const N={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:g(this,Bt),state:this.state,fetchFn:a};return s(N),N})(),u=g(this,ln)==="infinite"?Pu(this.options.pages):this.options.behavior;u==null||u.onFetch(l,this),D(this,un,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&Y(this,qe,mt).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta}),D(this,ve,Po({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:N=>{N instanceof pi&&N.revert&&this.setState({...g(this,un),fetchStatus:"idle"}),r.abort()},onFail:(N,q)=>{Y(this,qe,mt).call(this,{type:"failed",failureCount:N,error:q})},onPause:()=>{Y(this,qe,mt).call(this,{type:"pause"})},onContinue:()=>{Y(this,qe,mt).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const N=await g(this,ve).start();if(N===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(N),(p=(m=g(this,He).config).onSuccess)==null||p.call(m,N,this),(w=(y=g(this,He).config).onSettled)==null||w.call(y,N,this.state.error,this),N}catch(N){if(N instanceof pi){if(N.silent)return g(this,ve).promise;if(N.revert){if(this.state.data===void 0)throw N;return this.state.data}}throw Y(this,qe,mt).call(this,{type:"error",error:N}),(b=(j=g(this,He).config).onError)==null||b.call(j,N,this),(_=(S=g(this,He).config).onSettled)==null||_.call(S,this.state.data,N,this),N}finally{this.scheduleGc()}}},ln=new WeakMap,qt=new WeakMap,un=new WeakMap,He=new WeakMap,Bt=new WeakMap,ve=new WeakMap,Yn=new WeakMap,Ut=new WeakMap,qe=new WeakSet,To=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},mt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Ao(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...la(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return D(this,un,t.manual?s:void 0),s;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),je.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),g(this,He).notify({query:this,type:"updated",action:t})})},go);function Ao(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Eo(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function la(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ua(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ae,te,Zn,Re,$t,cn,ft,Ct,er,dn,hn,Ht,Kt,_t,pn,re,Fn,fi,xi,gi,bi,yi,wi,vi,Mo,bo,Lo=(bo=class extends lr{constructor(t,n){super();U(this,re);U(this,Ae);U(this,te);U(this,Zn);U(this,Re);U(this,$t);U(this,cn);U(this,ft);U(this,Ct);U(this,er);U(this,dn);U(this,hn);U(this,Ht);U(this,Kt);U(this,_t);U(this,pn,new Set);this.options=n,D(this,Ae,t),D(this,Ct,null),D(this,ft,hi()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(g(this,te).addObserver(this),ca(g(this,te),this.options)?Y(this,re,Fn).call(this):this.updateResult(),Y(this,re,bi).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ji(g(this,te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ji(g(this,te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Y(this,re,yi).call(this),Y(this,re,wi).call(this),g(this,te).removeObserver(this)}setOptions(t){const n=this.options,r=g(this,te);if(this.options=g(this,Ae).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Be(this.options.enabled,g(this,te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Y(this,re,vi).call(this),g(this,te).setOptions(this.options),n._defaulted&&!ui(this.options,n)&&g(this,Ae).getQueryCache().notify({type:"observerOptionsUpdated",query:g(this,te),observer:this});const s=this.hasListeners();s&&da(g(this,te),r,this.options,n)&&Y(this,re,Fn).call(this),this.updateResult(),s&&(g(this,te)!==r||Be(this.options.enabled,g(this,te))!==Be(n.enabled,g(this,te))||It(this.options.staleTime,g(this,te))!==It(n.staleTime,g(this,te)))&&Y(this,re,fi).call(this);const a=Y(this,re,xi).call(this);s&&(g(this,te)!==r||Be(this.options.enabled,g(this,te))!==Be(n.enabled,g(this,te))||a!==g(this,_t))&&Y(this,re,gi).call(this,a)}getOptimisticResult(t){const n=g(this,Ae).getQueryCache().build(g(this,Ae),t),r=this.createResult(n,t);return Lu(this,r)&&(D(this,Re,r),D(this,cn,this.options),D(this,$t,g(this,te).state)),r}getCurrentResult(){return g(this,Re)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&g(this,ft).status==="pending"&&g(this,ft).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){g(this,pn).add(t)}getCurrentQuery(){return g(this,te)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=g(this,Ae).defaultQueryOptions(t),r=g(this,Ae).getQueryCache().build(g(this,Ae),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Y(this,re,Fn).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),g(this,Re)))}createResult(t,n){var v;const r=g(this,te),s=this.options,a=g(this,Re),o=g(this,$t),l=g(this,cn),c=t!==r?t.state:g(this,Zn),{state:d}=t;let h={...d},m=!1,p;if(n._optimisticResults){const F=this.hasListeners(),L=!F&&ca(t,n),P=F&&da(t,r,n,s);(L||P)&&(h={...h,...Ao(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:y,errorUpdatedAt:w,status:j}=h;p=h.data;let b=!1;if(n.placeholderData!==void 0&&p===void 0&&j==="pending"){let F;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(F=a.data,b=!0):F=typeof n.placeholderData=="function"?n.placeholderData((v=g(this,hn))==null?void 0:v.state.data,g(this,hn)):n.placeholderData,F!==void 0&&(j="success",p=di(a==null?void 0:a.data,F,n),m=!0)}if(n.select&&p!==void 0&&!b)if(a&&p===(o==null?void 0:o.data)&&n.select===g(this,er))p=g(this,dn);else try{D(this,er,n.select),p=n.select(p),p=di(a==null?void 0:a.data,p,n),D(this,dn,p),D(this,Ct,null)}catch(F){D(this,Ct,F)}g(this,Ct)&&(y=g(this,Ct),p=g(this,dn),w=Date.now(),j="error");const S=h.fetchStatus==="fetching",_=j==="pending",N=j==="error",q=_&&S,k=p!==void 0,M={status:j,fetchStatus:h.fetchStatus,isPending:_,isSuccess:j==="success",isError:N,isInitialLoading:q,isLoading:q,data:p,dataUpdatedAt:h.dataUpdatedAt,error:y,errorUpdatedAt:w,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:S,isRefetching:S&&!_,isLoadingError:N&&!k,isPaused:h.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:N&&k,isStale:$i(t,n),refetch:this.refetch,promise:g(this,ft),isEnabled:Be(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=M.data!==void 0,L=M.status==="error"&&!F,P=E=>{L?E.reject(M.error):F&&E.resolve(M.data)},G=()=>{const E=D(this,ft,M.promise=hi());P(E)},z=g(this,ft);switch(z.status){case"pending":t.queryHash===r.queryHash&&P(z);break;case"fulfilled":(L||M.data!==z.value)&&G();break;case"rejected":(!L||M.error!==z.reason)&&G();break}}return M}updateResult(){const t=g(this,Re),n=this.createResult(g(this,te),this.options);if(D(this,$t,g(this,te).state),D(this,cn,this.options),g(this,$t).data!==void 0&&D(this,hn,g(this,te)),ui(n,t))return;D(this,Re,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!g(this,pn).size)return!0;const o=new Set(a??g(this,pn));return this.options.throwOnError&&o.add("error"),Object.keys(g(this,Re)).some(l=>{const u=l;return g(this,Re)[u]!==t[u]&&o.has(u)})};Y(this,re,Mo).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Y(this,re,bi).call(this)}},Ae=new WeakMap,te=new WeakMap,Zn=new WeakMap,Re=new WeakMap,$t=new WeakMap,cn=new WeakMap,ft=new WeakMap,Ct=new WeakMap,er=new WeakMap,dn=new WeakMap,hn=new WeakMap,Ht=new WeakMap,Kt=new WeakMap,_t=new WeakMap,pn=new WeakMap,re=new WeakSet,Fn=function(t){Y(this,re,vi).call(this);let n=g(this,te).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Le)),n},fi=function(){Y(this,re,yi).call(this);const t=It(this.options.staleTime,g(this,te));if(Vn.isServer()||g(this,Re).isStale||!li(t))return;const r=No(g(this,Re).dataUpdatedAt,t)+1;D(this,Ht,Dt.setTimeout(()=>{g(this,Re).isStale||this.updateResult()},r))},xi=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(g(this,te)):this.options.refetchInterval)??!1},gi=function(t){Y(this,re,wi).call(this),D(this,_t,t),!(Vn.isServer()||Be(this.options.enabled,g(this,te))===!1||!li(g(this,_t))||g(this,_t)===0)&&D(this,Kt,Dt.setInterval(()=>{(this.options.refetchIntervalInBackground||qi.isFocused())&&Y(this,re,Fn).call(this)},g(this,_t)))},bi=function(){Y(this,re,fi).call(this),Y(this,re,gi).call(this,Y(this,re,xi).call(this))},yi=function(){g(this,Ht)!==void 0&&(Dt.clearTimeout(g(this,Ht)),D(this,Ht,void 0))},wi=function(){g(this,Kt)!==void 0&&(Dt.clearInterval(g(this,Kt)),D(this,Kt,void 0))},vi=function(){const t=g(this,Ae).getQueryCache().build(g(this,Ae),this.options);if(t===g(this,te))return;const n=g(this,te);D(this,te,t),D(this,Zn,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Mo=function(t){je.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(g(this,Re))}),g(this,Ae).getQueryCache().notify({query:g(this,te),type:"observerResultsUpdated"})})},bo);function Au(e,t){return Be(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Be(t.retryOnMount,e)===!1)}function ca(e,t){return Au(e,t)||e.state.data!==void 0&&ji(e,t,t.refetchOnMount)}function ji(e,t,n){if(Be(t.enabled,e)!==!1&&It(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&$i(e,t)}return!1}function da(e,t,n,r){return(e!==t||Be(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&$i(e,n)}function $i(e,t){return Be(t.enabled,e)!==!1&&e.isStaleByTime(It(t.staleTime,e))}function Lu(e,t){return!ui(e.getCurrentResult(),t)}var Mu=class extends Lo{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){var y,w;const{state:n}=e,r=super.createResult(e,t),{isFetching:s,isRefetching:a,isError:o,isRefetchError:l}=r,u=(w=(y=n.fetchMeta)==null?void 0:y.fetchMore)==null?void 0:w.direction,c=o&&u==="forward",d=s&&u==="forward",h=o&&u==="backward",m=s&&u==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Ru(t,n.data),hasPreviousPage:Iu(t,n.data),isFetchNextPageError:c,isFetchingNextPage:d,isFetchPreviousPageError:h,isFetchingPreviousPage:m,isRefetchError:l&&!c&&!h,isRefetching:a&&!d&&!m}}},tr,it,Ce,Qt,st,jt,yo,Ou=(yo=class extends Ro{constructor(t){super();U(this,st);U(this,tr);U(this,it);U(this,Ce);U(this,Qt);D(this,tr,t.client),this.mutationId=t.mutationId,D(this,Ce,t.mutationCache),D(this,it,[]),this.state=t.state||Du(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){g(this,it).includes(t)||(g(this,it).push(t),this.clearGcTimeout(),g(this,Ce).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){D(this,it,g(this,it).filter(n=>n!==t)),this.scheduleGc(),g(this,Ce).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){g(this,it).length||(this.state.status==="pending"?this.scheduleGc():g(this,Ce).remove(this))}continue(){var t;return((t=g(this,Qt))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,u,c,d,h,m,p,y,w,j,b,S,_,N,q,k,B;const n=()=>{Y(this,st,jt).call(this,{type:"continue"})},r={client:g(this,tr),meta:this.options.meta,mutationKey:this.options.mutationKey};D(this,Qt,Po({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,v)=>{Y(this,st,jt).call(this,{type:"failed",failureCount:M,error:v})},onPause:()=>{Y(this,st,jt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>g(this,Ce).canRun(this)}));const s=this.state.status==="pending",a=!g(this,Qt).canStart();try{if(s)n();else{Y(this,st,jt).call(this,{type:"pending",variables:t,isPaused:a}),g(this,Ce).config.onMutate&&await g(this,Ce).config.onMutate(t,this,r);const v=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,r));v!==this.state.context&&Y(this,st,jt).call(this,{type:"pending",context:v,variables:t,isPaused:a})}const M=await g(this,Qt).start();return await((c=(u=g(this,Ce).config).onSuccess)==null?void 0:c.call(u,M,t,this.state.context,this,r)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,M,t,this.state.context,r)),await((p=(m=g(this,Ce).config).onSettled)==null?void 0:p.call(m,M,null,this.state.variables,this.state.context,this,r)),await((w=(y=this.options).onSettled)==null?void 0:w.call(y,M,null,t,this.state.context,r)),Y(this,st,jt).call(this,{type:"success",data:M}),M}catch(M){try{await((b=(j=g(this,Ce).config).onError)==null?void 0:b.call(j,M,t,this.state.context,this,r))}catch(v){Promise.reject(v)}try{await((_=(S=this.options).onError)==null?void 0:_.call(S,M,t,this.state.context,r))}catch(v){Promise.reject(v)}try{await((q=(N=g(this,Ce).config).onSettled)==null?void 0:q.call(N,void 0,M,this.state.variables,this.state.context,this,r))}catch(v){Promise.reject(v)}try{await((B=(k=this.options).onSettled)==null?void 0:B.call(k,void 0,M,t,this.state.context,r))}catch(v){Promise.reject(v)}throw Y(this,st,jt).call(this,{type:"error",error:M}),M}finally{g(this,Ce).runNext(this)}}},tr=new WeakMap,it=new WeakMap,Ce=new WeakMap,Qt=new WeakMap,st=new WeakSet,jt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),je.batch(()=>{g(this,it).forEach(r=>{r.onMutationUpdate(t)}),g(this,Ce).notify({mutation:this,type:"updated",action:t})})},yo);function Du(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xt,Xe,nr,wo,Fu=(wo=class extends lr{constructor(t={}){super();U(this,xt);U(this,Xe);U(this,nr);this.config=t,D(this,xt,new Set),D(this,Xe,new Map),D(this,nr,0)}build(t,n,r){const s=new Ou({client:t,mutationCache:this,mutationId:++yr(this,nr)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){g(this,xt).add(t);const n=vr(t);if(typeof n=="string"){const r=g(this,Xe).get(n);r?r.push(t):g(this,Xe).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(g(this,xt).delete(t)){const n=vr(t);if(typeof n=="string"){const r=g(this,Xe).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&g(this,Xe).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=vr(t);if(typeof n=="string"){const r=g(this,Xe).get(n),s=r==null?void 0:r.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=vr(t);if(typeof n=="string"){const s=(r=g(this,Xe).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){je.batch(()=>{g(this,xt).forEach(t=>{this.notify({type:"removed",mutation:t})}),g(this,xt).clear(),g(this,Xe).clear()})}getAll(){return Array.from(g(this,xt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>sa(n,r))}findAll(t={}){return this.getAll().filter(n=>sa(t,n))}notify(t){je.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return je.batch(()=>Promise.all(t.map(n=>n.continue().catch(Le))))}},xt=new WeakMap,Xe=new WeakMap,nr=new WeakMap,wo);function vr(e){var t;return(t=e.options.scope)==null?void 0:t.id}var at,vo,zu=(vo=class extends lr{constructor(t={}){super();U(this,at);this.config=t,D(this,at,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??Bi(s,n);let o=this.get(a);return o||(o=new Tu({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){g(this,at).has(t.queryHash)||(g(this,at).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=g(this,at).get(t.queryHash);n&&(t.destroy(),n===t&&g(this,at).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){je.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return g(this,at).get(t)}getAll(){return[...g(this,at).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ia(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>ia(t,r)):n}notify(t){je.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){je.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){je.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},at=new WeakMap,vo),xe,Et,Pt,mn,fn,Rt,xn,gn,jo,qu=(jo=class{constructor(e={}){U(this,xe);U(this,Et);U(this,Pt);U(this,mn);U(this,fn);U(this,Rt);U(this,xn);U(this,gn);D(this,xe,e.queryCache||new zu),D(this,Et,e.mutationCache||new Fu),D(this,Pt,e.defaultOptions||{}),D(this,mn,new Map),D(this,fn,new Map),D(this,Rt,0)}mount(){yr(this,Rt)._++,g(this,Rt)===1&&(D(this,xn,qi.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,xe).onFocus())})),D(this,gn,Ir.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,xe).onOnline())})))}unmount(){var e,t;yr(this,Rt)._--,g(this,Rt)===0&&((e=g(this,xn))==null||e.call(this),D(this,xn,void 0),(t=g(this,gn))==null||t.call(this),D(this,gn,void 0))}isFetching(e){return g(this,xe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return g(this,Et).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=g(this,xe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=g(this,xe).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(It(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return g(this,xe).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=g(this,xe).get(r.queryHash),a=s==null?void 0:s.state.data,o=yu(t,a);if(o!==void 0)return g(this,xe).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return je.batch(()=>g(this,xe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=g(this,xe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=g(this,xe);je.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=g(this,xe);return je.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=je.batch(()=>g(this,xe).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Le).catch(Le)}invalidateQueries(e,t={}){return je.batch(()=>(g(this,xe).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=je.batch(()=>g(this,xe).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(Le)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Le)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=g(this,xe).build(this,t);return n.isStaleByTime(It(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Le).catch(Le)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Le).catch(Le)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Ir.isOnline()?g(this,Et).resumePausedMutations():Promise.resolve()}getQueryCache(){return g(this,xe)}getMutationCache(){return g(this,Et)}getDefaultOptions(){return g(this,Pt)}setDefaultOptions(e){D(this,Pt,e)}setQueryDefaults(e,t){g(this,mn).set(Kn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...g(this,mn).values()],n={};return t.forEach(r=>{Qn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){g(this,fn).set(Kn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...g(this,fn).values()],n={};return t.forEach(r=>{Qn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...g(this,Pt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Bi(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===Ui&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...g(this,Pt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){g(this,xe).clear(),g(this,Et).clear()}},xe=new WeakMap,Et=new WeakMap,Pt=new WeakMap,mn=new WeakMap,fn=new WeakMap,Rt=new WeakMap,xn=new WeakMap,gn=new WeakMap,jo),Oo=ke.createContext(void 0),Do=e=>{const t=ke.useContext(Oo);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Bu=({client:e,children:t})=>(ke.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(Oo.Provider,{value:e,children:t})),Fo=ke.createContext(!1),Uu=()=>ke.useContext(Fo);Fo.Provider;function $u(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Hu=ke.createContext($u()),Ku=()=>ke.useContext(Hu),Qu=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?_o(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Vu=e=>{ke.useEffect(()=>{e.clearReset()},[e])},Wu=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||_o(n,[e.error,r])),Gu=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Ju=(e,t)=>e.isLoading&&e.isFetching&&!t,Xu=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ha=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function zo(e,t,n){var m,p,y,w;const r=Uu(),s=Ku(),a=Do(),o=a.defaultQueryOptions(e);(p=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||p.call(m,o);const l=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",Gu(o),Qu(o,s,l),Vu(s);const u=!a.getQueryCache().get(o.queryHash),[c]=ke.useState(()=>new t(a,o)),d=c.getOptimisticResult(o),h=!r&&e.subscribed!==!1;if(ke.useSyncExternalStore(ke.useCallback(j=>{const b=h?c.subscribe(je.batchCalls(j)):Le;return c.updateResult(),b},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),ke.useEffect(()=>{c.setOptions(o)},[o,c]),Xu(o,d))throw ha(o,c,s);if(Wu({result:d,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw d.error;if((w=(y=a.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||w.call(y,o,d),o.experimental_prefetchInRender&&!Vn.isServer()&&Ju(d,r)){const j=u?ha(o,c,s):l==null?void 0:l.promise;j==null||j.catch(Le).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?d:c.trackResult(d)}function ge(e,t){return zo(e,Lo)}function pa(e,t){return zo(e,Mu)}/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yu=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qo=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var Zu={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"};/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ec=ke.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:o,...l},u)=>ke.createElement("svg",{ref:u,...Zu,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:qo("lucide",s),...l},[...o.map(([c,d])=>ke.createElement(c,d)),...Array.isArray(a)?a:[a]]));/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const le=(e,t)=>{const n=ke.forwardRef(({className:r,...s},a)=>ke.createElement(ec,{ref:a,iconNode:t,className:qo(`lucide-${Yu(e)}`,r),...s}));return n.displayName=`${e}`,n};/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bn=le("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bo=le("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Uo=le("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hi=le("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yn=le("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wn=le("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wn=le("CircleUserRound",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $o=le("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ma=le("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gt=le("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ho=le("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tc=le("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nc=le("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tr=le("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vn=le("Link",[["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"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rc=le("Pencil",[["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"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ur=le("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gn=le("RotateCcw",[["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"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ic=le("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sc=le("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ko=le("ShieldCheck",[["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"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qo=le("SquareTerminal",[["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"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ac=le("TimerReset",[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M12 14v-4",key:"1evpnu"}],["path",{d:"M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6",key:"1ts96g"}],["path",{d:"M9 17H4v5",key:"8t5av"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ki=le("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zr=le("TriangleAlert",[["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"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oc=le("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jt=le("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function lc(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const uc=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cc=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dc={};function fa(e,t){return(dc.jsx?cc:uc).test(e)}const hc=/[ \t\n\f\r]/g;function pc(e){return typeof e=="object"?e.type==="text"?xa(e.value):!1:xa(e)}function xa(e){return e.replace(hc,"")===""}class cr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}cr.prototype.normal={};cr.prototype.property={};cr.prototype.space=void 0;function Vo(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new cr(n,r,t)}function Ni(e){return e.toLowerCase()}class Oe{constructor(t,n){this.attribute=n,this.property=t}}Oe.prototype.attribute="";Oe.prototype.booleanish=!1;Oe.prototype.boolean=!1;Oe.prototype.commaOrSpaceSeparated=!1;Oe.prototype.commaSeparated=!1;Oe.prototype.defined=!1;Oe.prototype.mustUseProperty=!1;Oe.prototype.number=!1;Oe.prototype.overloadedBoolean=!1;Oe.prototype.property="";Oe.prototype.spaceSeparated=!1;Oe.prototype.space=void 0;let mc=0;const K=Xt(),ye=Xt(),Si=Xt(),R=Xt(),oe=Xt(),Wt=Xt(),ze=Xt();function Xt(){return 2**++mc}const Ci=Object.freeze(Object.defineProperty({__proto__:null,boolean:K,booleanish:ye,commaOrSpaceSeparated:ze,commaSeparated:Wt,number:R,overloadedBoolean:Si,spaceSeparated:oe},Symbol.toStringTag,{value:"Module"})),Kr=Object.keys(Ci);class Ki extends Oe{constructor(t,n,r,s){let a=-1;if(super(t,n),ga(this,"space",s),typeof r=="number")for(;++a4&&n.slice(0,4)==="data"&&yc.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(ba,jc);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!ba.test(a)){let o=a.replace(bc,vc);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=Ki}return new s(r,t)}function vc(e){return"-"+e.toLowerCase()}function jc(e){return e.charAt(1).toUpperCase()}const kc=Vo([Wo,fc,Xo,Yo,Zo],"html"),Qi=Vo([Wo,xc,Xo,Yo,Zo],"svg");function Nc(e){return e.join(" ").trim()}var en={},Qr,ya;function Sc(){if(ya)return Qr;ya=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,u=` +`,c="/",d="*",h="",m="comment",p="declaration";function y(j,b){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];b=b||{};var S=1,_=1;function N(z){var E=z.match(t);E&&(S+=E.length);var O=z.lastIndexOf(u);_=~O?z.length-O:_+z.length}function q(){var z={line:S,column:_};return function(E){return E.position=new k(z),v(),E}}function k(z){this.start=z,this.end={line:S,column:_},this.source=b.source}k.prototype.content=j;function B(z){var E=new Error(b.source+":"+S+":"+_+": "+z);if(E.reason=z,E.filename=b.source,E.line=S,E.column=_,E.source=j,!b.silent)throw E}function M(z){var E=z.exec(j);if(E){var O=E[0];return N(O),j=j.slice(O.length),E}}function v(){M(n)}function F(z){var E;for(z=z||[];E=L();)E!==!1&&z.push(E);return z}function L(){var z=q();if(!(c!=j.charAt(0)||d!=j.charAt(1))){for(var E=2;h!=j.charAt(E)&&(d!=j.charAt(E)||c!=j.charAt(E+1));)++E;if(E+=2,h===j.charAt(E-1))return B("End of comment missing");var O=j.slice(2,E-2);return _+=2,N(O),j=j.slice(E),_+=2,z({type:m,comment:O})}}function P(){var z=q(),E=M(r);if(E){if(L(),!M(s))return B("property missing ':'");var O=M(a),Q=z({type:p,property:w(E[0].replace(e,h)),value:O?w(O[0].replace(e,h)):h});return M(o),Q}}function G(){var z=[];F(z);for(var E;E=P();)E!==!1&&(z.push(E),F(z));return z}return v(),G()}function w(j){return j?j.replace(l,h):h}return Qr=y,Qr}var wa;function Cc(){if(wa)return en;wa=1;var e=en&&en.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(en,"__esModule",{value:!0}),en.default=n;const t=e(Sc());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),l=typeof s=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:c,value:d}=u;l?s(c,d,u):d&&(a=a||{},a[c]=d)}),a}return en}var In={},va;function _c(){if(va)return In;va=1,Object.defineProperty(In,"__esModule",{value:!0}),In.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(c){return!c||n.test(c)||e.test(c)},o=function(c,d){return d.toUpperCase()},l=function(c,d){return"".concat(d,"-")},u=function(c,d){return d===void 0&&(d={}),a(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(s,l):c=c.replace(r,l),c.replace(t,o))};return In.camelCase=u,In}var Tn,ja;function Ec(){if(ja)return Tn;ja=1;var e=Tn&&Tn.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(Cc()),n=_c();function r(s,a){var o={};return!s||typeof s!="string"||(0,t.default)(s,function(l,u){l&&u&&(o[(0,n.camelCase)(l,a)]=u)}),o}return r.default=r,Tn=r,Tn}var Pc=Ec();const Rc=zi(Pc),el=tl("end"),Vi=tl("start");function tl(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Ic(e){const t=Vi(e),n=el(e);if(t&&n)return{start:t,end:n}}function Bn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ka(e.position):"start"in e||"end"in e?ka(e):"line"in e||"column"in e?_i(e):""}function _i(e){return Na(e&&e.line)+":"+Na(e&&e.column)}function ka(e){return _i(e&&e.start)+"-"+_i(e&&e.end)}function Na(e){return e&&typeof e=="number"?e:1}class Ee extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(o=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=Bn(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ee.prototype.file="";Ee.prototype.name="";Ee.prototype.reason="";Ee.prototype.message="";Ee.prototype.stack="";Ee.prototype.column=void 0;Ee.prototype.line=void 0;Ee.prototype.ancestors=void 0;Ee.prototype.cause=void 0;Ee.prototype.fatal=void 0;Ee.prototype.place=void 0;Ee.prototype.ruleId=void 0;Ee.prototype.source=void 0;const Wi={}.hasOwnProperty,Tc=new Map,Ac=/[A-Z]/g,Lc=new Set(["table","tbody","thead","tfoot","tr"]),Mc=new Set(["td","th"]),nl="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Oc(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Hc(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=$c(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Qi:kc,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=rl(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function rl(e,t,n){if(t.type==="element")return Dc(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Fc(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return qc(e,t,n);if(t.type==="mdxjsEsm")return zc(e,t);if(t.type==="root")return Bc(e,t,n);if(t.type==="text")return Uc(e,t)}function Dc(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Qi,e.schema=s),e.ancestors.push(t);const a=sl(e,t.tagName,!1),o=Kc(e,t);let l=Ji(e,t);return Lc.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!pc(u):!0})),il(e,o,a,t),Gi(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Fc(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Jn(e,t.position)}function zc(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Jn(e,t.position)}function qc(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Qi,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:sl(e,t.name,!0),o=Qc(e,t),l=Ji(e,t);return il(e,o,a,t),Gi(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Bc(e,t,n){const r={};return Gi(r,Ji(e,t)),e.create(t,e.Fragment,r,n)}function Uc(e,t){return t.value}function il(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Gi(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $c(e,t,n){return r;function r(s,a,o,l){const c=Array.isArray(o.children)?n:t;return l?c(a,o,l):c(a,o)}}function Hc(e,t){return n;function n(r,s,a,o){const l=Array.isArray(a.children),u=Vi(r);return t(s,a,o,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Kc(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Wi.call(t.properties,s)){const a=Vc(e,s,t.properties[s]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Mc.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Qc(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Jn(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else Jn(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function Ji(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:Tc;for(;++rs?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(ut(e,e.length,0,t),e):t}const _a={}.hasOwnProperty;function td(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function nn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ot=Tt(/[A-Za-z]/),Ue=Tt(/[\dA-Za-z]/),id=Tt(/[#-'*+\--9=?A-Z^-~]/);function Ei(e){return e!==null&&(e<32||e===127)}const Pi=Tt(/\d/),sd=Tt(/[\dA-Fa-f]/),ad=Tt(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function Me(e){return e!==null&&(e<0||e===32)}function ne(e){return e===-2||e===-1||e===32}const od=Tt(new RegExp("\\p{P}|\\p{S}","u")),ld=Tt(/\s/);function Tt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function kn(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),s=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function ce(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(u){return ne(u)?(e.enter(n),l(u)):t(u)}function l(u){return ne(u)&&a++o))return;const B=t.events.length;let M=B,v,F;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(v){F=t.events[M][1].end;break}v=!0}for(b(r),k=B;k_;){const q=n[N];t.containerState=q[1],q[0].exit.call(t,e)}n.length=_}function S(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function pd(e,t,n){return ce(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Pa(e){if(e===null||Me(e)||ld(e))return 1;if(od(e))return 2}function Yi(e,t,n){const r=[];let s=-1;for(;++s1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},m={...e[n][1].start};Ra(h,-u),Ra(m,u),o={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},a={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:u>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ke(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Ke(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",a,t]]),c=Ke(c,Yi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Ke(c,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=Ke(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ut(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&ne(k)?ce(e,S,"linePrefix",a+1)(k):S(k)}function S(k){return k===null||$(k)?e.check(Ia,w,N)(k):(e.enter("codeFlowValue"),_(k))}function _(k){return k===null||$(k)?(e.exit("codeFlowValue"),S(k)):(e.consume(k),_)}function N(k){return e.exit("codeFenced"),t(k)}function q(k,B,M){let v=0;return F;function F(E){return k.enter("lineEnding"),k.consume(E),k.exit("lineEnding"),L}function L(E){return k.enter("codeFencedFence"),ne(E)?ce(k,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):P(E)}function P(E){return E===l?(k.enter("codeFencedFenceSequence"),G(E)):M(E)}function G(E){return E===l?(v++,k.consume(E),G):v>=o?(k.exit("codeFencedFenceSequence"),ne(E)?ce(k,z,"whitespace")(E):z(E)):M(E)}function z(E){return E===null||$(E)?(k.exit("codeFencedFence"),B(E)):M(E)}}}function Sd(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Wr={name:"codeIndented",tokenize:_d},Cd={partial:!0,tokenize:Ed};function _d(e,t,n){const r=this;return s;function s(c){return e.enter("codeIndented"),ce(e,a,"linePrefix",5)(c)}function a(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):$(c)?e.attempt(Cd,o,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||$(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function Ed(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):$(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):ce(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):$(o)?s(o):n(o)}}const Pd={name:"codeText",previous:Id,resolve:Rd,tokenize:Td};function Rd(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&An(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),An(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),An(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function hl(e,t,n,r,s,a,o,l,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return h;function h(b){return b===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(b),e.exit(a),m):b===null||b===32||b===41||Ei(b)?n(b):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),w(b))}function m(b){return b===62?(e.enter(a),e.consume(b),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===62?(e.exit("chunkString"),e.exit(l),m(b)):b===null||b===60||$(b)?n(b):(e.consume(b),b===92?y:p)}function y(b){return b===60||b===62||b===92?(e.consume(b),p):p(b)}function w(b){return!d&&(b===null||b===41||Me(b))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(b)):d999||p===null||p===91||p===93&&!u||p===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(a),e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):$(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||$(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),u||(u=!ne(p)),p===92?m:h)}function m(p){return p===91||p===92||p===93?(e.consume(p),l++,h):h(p)}}function ml(e,t,n,r,s,a){let o;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(s),e.consume(m),e.exit(s),o=m===40?41:m,u):n(m)}function u(m){return m===o?(e.enter(s),e.consume(m),e.exit(s),e.exit(r),t):(e.enter(a),c(m))}function c(m){return m===o?(e.exit(a),u(o)):m===null?n(m):$(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ce(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===o||m===null||$(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?h:d)}function h(m){return m===o||m===92?(e.consume(m),d):d(m)}}function Un(e,t){let n;return r;function r(s){return $(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):ne(s)?ce(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const qd={name:"definition",tokenize:Ud},Bd={partial:!0,tokenize:$d};function Ud(e,t,n){const r=this;let s;return a;function a(p){return e.enter("definition"),o(p)}function o(p){return pl.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return s=nn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):n(p)}function u(p){return Me(p)?Un(e,c)(p):c(p)}function c(p){return hl(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(Bd,h,h)(p)}function h(p){return ne(p)?ce(e,m,"whitespace")(p):m(p)}function m(p){return p===null||$(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function $d(e,t,n){return r;function r(l){return Me(l)?Un(e,s)(l):n(l)}function s(l){return ml(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return ne(l)?ce(e,o,"whitespace")(l):o(l)}function o(l){return l===null||$(l)?t(l):n(l)}}const Hd={name:"hardBreakEscape",tokenize:Kd};function Kd(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return $(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Qd={name:"headingAtx",resolve:Vd,tokenize:Wd};function Vd(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ut(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function Wd(e,t,n){let r=0;return s;function s(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||Me(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||$(d)?(e.exit("atxHeading"),t(d)):ne(d)?ce(e,l,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),l(d))}function c(d){return d===null||d===35||Me(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),c)}}const Gd=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Aa=["pre","script","style","textarea"],Jd={concrete:!0,name:"htmlFlow",resolveTo:Zd,tokenize:eh},Xd={partial:!0,tokenize:nh},Yd={partial:!0,tokenize:th};function Zd(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function eh(e,t,n){const r=this;let s,a,o,l,u;return c;function c(x){return d(x)}function d(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),h}function h(x){return x===33?(e.consume(x),m):x===47?(e.consume(x),a=!0,w):x===63?(e.consume(x),s=3,r.interrupt?t:f):ot(x)?(e.consume(x),o=String.fromCharCode(x),j):n(x)}function m(x){return x===45?(e.consume(x),s=2,p):x===91?(e.consume(x),s=5,l=0,y):ot(x)?(e.consume(x),s=4,r.interrupt?t:f):n(x)}function p(x){return x===45?(e.consume(x),r.interrupt?t:f):n(x)}function y(x){const De="CDATA[";return x===De.charCodeAt(l++)?(e.consume(x),l===De.length?r.interrupt?t:P:y):n(x)}function w(x){return ot(x)?(e.consume(x),o=String.fromCharCode(x),j):n(x)}function j(x){if(x===null||x===47||x===62||Me(x)){const De=x===47,we=o.toLowerCase();return!De&&!a&&Aa.includes(we)?(s=1,r.interrupt?t(x):P(x)):Gd.includes(o.toLowerCase())?(s=6,De?(e.consume(x),b):r.interrupt?t(x):P(x)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):a?S(x):_(x))}return x===45||Ue(x)?(e.consume(x),o+=String.fromCharCode(x),j):n(x)}function b(x){return x===62?(e.consume(x),r.interrupt?t:P):n(x)}function S(x){return ne(x)?(e.consume(x),S):F(x)}function _(x){return x===47?(e.consume(x),F):x===58||x===95||ot(x)?(e.consume(x),N):ne(x)?(e.consume(x),_):F(x)}function N(x){return x===45||x===46||x===58||x===95||Ue(x)?(e.consume(x),N):q(x)}function q(x){return x===61?(e.consume(x),k):ne(x)?(e.consume(x),q):_(x)}function k(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),u=x,B):ne(x)?(e.consume(x),k):M(x)}function B(x){return x===u?(e.consume(x),u=null,v):x===null||$(x)?n(x):(e.consume(x),B)}function M(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||Me(x)?q(x):(e.consume(x),M)}function v(x){return x===47||x===62||ne(x)?_(x):n(x)}function F(x){return x===62?(e.consume(x),L):n(x)}function L(x){return x===null||$(x)?P(x):ne(x)?(e.consume(x),L):n(x)}function P(x){return x===45&&s===2?(e.consume(x),O):x===60&&s===1?(e.consume(x),Q):x===62&&s===4?(e.consume(x),ue):x===63&&s===3?(e.consume(x),f):x===93&&s===5?(e.consume(x),se):$(x)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(Xd,Se,G)(x)):x===null||$(x)?(e.exit("htmlFlowData"),G(x)):(e.consume(x),P)}function G(x){return e.check(Yd,z,Se)(x)}function z(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),E}function E(x){return x===null||$(x)?G(x):(e.enter("htmlFlowData"),P(x))}function O(x){return x===45?(e.consume(x),f):P(x)}function Q(x){return x===47?(e.consume(x),o="",he):P(x)}function he(x){if(x===62){const De=o.toLowerCase();return Aa.includes(De)?(e.consume(x),ue):P(x)}return ot(x)&&o.length<8?(e.consume(x),o+=String.fromCharCode(x),he):P(x)}function se(x){return x===93?(e.consume(x),f):P(x)}function f(x){return x===62?(e.consume(x),ue):x===45&&s===2?(e.consume(x),f):P(x)}function ue(x){return x===null||$(x)?(e.exit("htmlFlowData"),Se(x)):(e.consume(x),ue)}function Se(x){return e.exit("htmlFlow"),t(x)}}function th(e,t,n){const r=this;return s;function s(o){return $(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function nh(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(qr,t,n)}}const rh={name:"htmlText",tokenize:ih};function ih(e,t,n){const r=this;let s,a,o;return l;function l(f){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(f),u}function u(f){return f===33?(e.consume(f),c):f===47?(e.consume(f),q):f===63?(e.consume(f),_):ot(f)?(e.consume(f),M):n(f)}function c(f){return f===45?(e.consume(f),d):f===91?(e.consume(f),a=0,y):ot(f)?(e.consume(f),S):n(f)}function d(f){return f===45?(e.consume(f),p):n(f)}function h(f){return f===null?n(f):f===45?(e.consume(f),m):$(f)?(o=h,Q(f)):(e.consume(f),h)}function m(f){return f===45?(e.consume(f),p):h(f)}function p(f){return f===62?O(f):f===45?m(f):h(f)}function y(f){const ue="CDATA[";return f===ue.charCodeAt(a++)?(e.consume(f),a===ue.length?w:y):n(f)}function w(f){return f===null?n(f):f===93?(e.consume(f),j):$(f)?(o=w,Q(f)):(e.consume(f),w)}function j(f){return f===93?(e.consume(f),b):w(f)}function b(f){return f===62?O(f):f===93?(e.consume(f),b):w(f)}function S(f){return f===null||f===62?O(f):$(f)?(o=S,Q(f)):(e.consume(f),S)}function _(f){return f===null?n(f):f===63?(e.consume(f),N):$(f)?(o=_,Q(f)):(e.consume(f),_)}function N(f){return f===62?O(f):_(f)}function q(f){return ot(f)?(e.consume(f),k):n(f)}function k(f){return f===45||Ue(f)?(e.consume(f),k):B(f)}function B(f){return $(f)?(o=B,Q(f)):ne(f)?(e.consume(f),B):O(f)}function M(f){return f===45||Ue(f)?(e.consume(f),M):f===47||f===62||Me(f)?v(f):n(f)}function v(f){return f===47?(e.consume(f),O):f===58||f===95||ot(f)?(e.consume(f),F):$(f)?(o=v,Q(f)):ne(f)?(e.consume(f),v):O(f)}function F(f){return f===45||f===46||f===58||f===95||Ue(f)?(e.consume(f),F):L(f)}function L(f){return f===61?(e.consume(f),P):$(f)?(o=L,Q(f)):ne(f)?(e.consume(f),L):v(f)}function P(f){return f===null||f===60||f===61||f===62||f===96?n(f):f===34||f===39?(e.consume(f),s=f,G):$(f)?(o=P,Q(f)):ne(f)?(e.consume(f),P):(e.consume(f),z)}function G(f){return f===s?(e.consume(f),s=void 0,E):f===null?n(f):$(f)?(o=G,Q(f)):(e.consume(f),G)}function z(f){return f===null||f===34||f===39||f===60||f===61||f===96?n(f):f===47||f===62||Me(f)?v(f):(e.consume(f),z)}function E(f){return f===47||f===62||Me(f)?v(f):n(f)}function O(f){return f===62?(e.consume(f),e.exit("htmlTextData"),e.exit("htmlText"),t):n(f)}function Q(f){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),he}function he(f){return ne(f)?ce(e,se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):se(f)}function se(f){return e.enter("htmlTextData"),o(f)}}const Zi={name:"labelEnd",resolveAll:lh,resolveTo:uh,tokenize:ch},sh={tokenize:dh},ah={tokenize:hh},oh={tokenize:ph};function lh(e){let t=-1;const n=[];for(;++t=3&&(c===null||$(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===s?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),ne(c)?ce(e,l,"whitespace")(c):l(c))}}const Te={continuation:{tokenize:kh},exit:Sh,name:"list",tokenize:jh},wh={partial:!0,tokenize:Ch},vh={partial:!0,tokenize:Nh};function jh(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return l;function l(p){const y=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Pi(p)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Pr,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return n(p)}function u(p){return Pi(p)&&++o<10?(e.consume(p),u):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(qr,r.interrupt?n:d,e.attempt(wh,m,h))}function d(p){return r.containerState.initialBlankLine=!0,a++,m(p)}function h(p){return ne(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):n(p)}function m(p){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function kh(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(qr,s,a);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ce(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!ne(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vh,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ce(e,e.attempt(Te,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Nh(e,t,n){const r=this;return ce(e,s,"listItemIndent",r.containerState.size+1);function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function Sh(e){e.exit(this.containerState.type)}function Ch(e,t,n){const r=this;return ce(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const o=r.events[r.events.length-1];return!ne(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const La={name:"setextUnderline",resolveTo:_h,tokenize:Eh};function _h(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Eh(e,t,n){const r=this;let s;return a;function a(c){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),s=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===s?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),ne(c)?ce(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||$(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Ph={tokenize:Rh};function Rh(e){const t=this,n=e.attempt(qr,r,e.attempt(this.parser.constructs.flowInitial,s,ce(e,e.attempt(this.parser.constructs.flow,s,e.attempt(Md,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Ih={resolveAll:xl()},Th=fl("string"),Ah=fl("text");function fl(e){return{resolveAll:xl(e==="text"?Lh:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,o,l);return o;function o(d){return c(d)?a(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),a(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const h=s[d];let m=-1;if(h)for(;++m-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[s].slice(0,a))}return o}function Vh(e,t){let n=-1;const r=[];let s;for(;++n0){const Pe=H.tokenStack[H.tokenStack.length-1];(Pe[1]||Oa).call(H,void 0,Pe[0])}for(I.position={start:yt(C.length>0?C[0][1].start:{line:1,column:1,offset:0}),end:yt(C.length>0?C[C.length-2][1].end:{line:1,column:1,offset:0})},ie=-1;++ie0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function op(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lp(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function up(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=kn(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function cp(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dp(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function yl(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function hp(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yl(e,t);const s={src:kn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function pp(e,t){const n={src:kn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function mp(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function fp(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yl(e,t);const s={href:kn(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function xp(e,t){const n={href:kn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function gp(e,t,n){const r=e.all(t),s=n?bp(n):wl(t),a={},o=[];if(typeof t.checked=="boolean"){const d=r[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l1}function yp(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Vi(t.children[1]),u=el(t.children[t.children.length-1]);l&&u&&(o.position={start:l,end:u}),s.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function Np(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(za(t.slice(s),s>0,!1)),a.join("")}function za(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===Da||a===Fa;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===Da||a===Fa;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function _p(e,t){const n={type:"text",value:Cp(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ep(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Pp={blockquote:ip,break:sp,code:ap,delete:op,emphasis:lp,footnoteReference:up,heading:cp,html:dp,imageReference:hp,image:pp,inlineCode:mp,linkReference:fp,link:xp,listItem:gp,list:yp,paragraph:wp,root:vp,strong:jp,table:kp,tableCell:Sp,tableRow:Np,text:_p,thematicBreak:Ep,toml:jr,yaml:jr,definition:jr,footnoteDefinition:jr};function jr(){}const vl=-1,Br=0,$n=1,Ar=2,es=3,ts=4,ns=5,rs=6,jl=7,kl=8,Rp=typeof self=="object"?self:globalThis,qa=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Rp[e](t)},Ip=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,o]=t[s];switch(a){case Br:case vl:return n(o,s);case $n:{const l=n([],s);for(const u of o)l.push(r(u));return l}case Ar:{const l=n({},s);for(const[u,c]of o)l[r(u)]=r(c);return l}case es:return n(new Date(o),s);case ts:{const{source:l,flags:u}=o;return n(new RegExp(l,u),s)}case ns:{const l=n(new Map,s);for(const[u,c]of o)l.set(r(u),r(c));return l}case rs:{const l=n(new Set,s);for(const u of o)l.add(r(u));return l}case jl:{const{name:l,message:u}=o;return n(qa(l,u),s)}case kl:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(qa(a,o),s)};return r},Ba=e=>Ip(new Map,e)(0),tn="",{toString:Tp}={},{keys:Ap}=Object,Ln=e=>{const t=typeof e;if(t!=="object"||!e)return[Br,t];const n=Tp.call(e).slice(8,-1);switch(n){case"Array":return[$n,tn];case"Object":return[Ar,tn];case"Date":return[es,tn];case"RegExp":return[ts,tn];case"Map":return[ns,tn];case"Set":return[rs,tn];case"DataView":return[$n,n]}return n.includes("Array")?[$n,n]:n.includes("Error")?[jl,n]:[Ar,n]},kr=([e,t])=>e===Br&&(t==="function"||t==="symbol"),Lp=(e,t,n,r)=>{const s=(o,l)=>{const u=r.push(o)-1;return n.set(l,u),u},a=o=>{if(n.has(o))return n.get(o);let[l,u]=Ln(o);switch(l){case Br:{let d=o;switch(u){case"bigint":l=kl,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return s([vl],o)}return s([l,d],o)}case $n:{if(u){let m=o;return u==="DataView"?m=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(o)),s([u,[...m]],o)}const d=[],h=s([l,d],o);for(const m of o)d.push(a(m));return h}case Ar:{if(u)switch(u){case"BigInt":return s([u,o.toString()],o);case"Boolean":case"Number":case"String":return s([u,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const d=[],h=s([l,d],o);for(const m of Ap(o))(e||!kr(Ln(o[m])))&&d.push([a(m),a(o[m])]);return h}case es:return s([l,o.toISOString()],o);case ts:{const{source:d,flags:h}=o;return s([l,{source:d,flags:h}],o)}case ns:{const d=[],h=s([l,d],o);for(const[m,p]of o)(e||!(kr(Ln(m))||kr(Ln(p))))&&d.push([a(m),a(p)]);return h}case rs:{const d=[],h=s([l,d],o);for(const m of o)(e||!kr(Ln(m)))&&d.push(a(m));return h}}const{message:c}=o;return s([l,{name:u,message:c}],o)};return a},Ua=(e,{json:t,lossy:n}={})=>{const r=[];return Lp(!(t||n),!!t,new Map,r)(e),r},Lr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ba(Ua(e,t)):structuredClone(e):(e,t)=>Ba(Ua(e,t));function Mp(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Op(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Dp(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Mp,r=e.options.footnoteBackLabel||Op,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u0&&y.push({type:"text",value:" "});let S=typeof n=="string"?n:n(u,p);typeof S=="string"&&(S={type:"text",value:S}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,p),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const j=d[d.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const S=j.children[j.children.length-1];S&&S.type==="text"?S.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...y)}else d.push(...y);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(d,!0)};e.patch(c,b),l.push(b)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Lr(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` +`}]}}const Nl=(function(e){if(e==null)return Bp;if(typeof e=="function")return Ur(e);if(typeof e=="object")return Array.isArray(e)?Fp(e):zp(e);if(typeof e=="string")return qp(e);throw new Error("Expected function, string, or object as test")});function Fp(e){const t=[];let n=-1;for(;++n":""))+")"})}return m;function m(){let p=Sl,y,w,j;if((!t||a(u,c,d[d.length-1]||void 0))&&(p=Qp(n(u,d)),p[0]===$a))return p;if("children"in u&&u.children){const b=u;if(b.children&&p[0]!==Hp)for(w=(r?b.children.length:-1)+o,j=d.concat(b);w>-1&&w0&&n.push({type:"text",value:` +`}),n}function Ha(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ka(e,t){const n=Wp(e,t),r=n.one(e,void 0),s=Dp(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:` +`},s),a}function Zp(e,t){return e&&"run"in e?async function(n,r){const s=Ka(n,{file:r,...t});await e.run(s,r)}:function(n,r){return Ka(n,{file:r,...e||t})}}function Qa(e){if(e)throw e}var Jr,Va;function em(){if(Va)return Jr;Va=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},a=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!h)return!1;var m;for(m in c);return typeof m>"u"||e.call(c,m)},o=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},l=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return Jr=function u(){var c,d,h,m,p,y,w=arguments[0],j=1,b=arguments.length,S=!1;for(typeof w=="boolean"&&(S=w,w=arguments[1]||{},j=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});jo.length;let u;l&&o.push(s);try{u=e.apply(this,o)}catch(c){const d=c;if(l&&n)throw d;return s(d)}l||(u&&u.then&&typeof u.then=="function"?u.then(a,s):u instanceof Error?s(u):a(u))}function s(o,...l){n||(n=!0,t(o,...l))}function a(o){s(null,o)}}const rt={basename:im,dirname:sm,extname:am,join:om,sep:"/"};function im(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');dr(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else o<0&&(a=!0,o=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(r=s):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function sm(e){if(dr(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function am(e){dr(e);let t=e.length,n=-1,r=0,s=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function om(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function um(e,t){let n="",r=0,s=-1,a=0,o=-1,l,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),s=o,a=0;continue}}else if(n.length>0){n="",r=0,s=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function dr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const cm={cwd:dm};function dm(){return"/"}function Ai(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function hm(e){if(typeof e=="string")e=new URL(e);else if(!Ai(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return pm(e)}function pm(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[p,...y]=d;const w=r[m][1];Ti(w)&&Ti(p)&&(p=Xr(!0,w,p)),r[m]=[c,p,...y]}}}}const gm=new is().freeze();function ti(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ni(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ri(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ga(e){if(!Ti(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ja(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Nr(e){return bm(e)?e:new _l(e)}function bm(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ym(e){return typeof e=="string"||wm(e)}function wm(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vm="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Xa=[],Ya={allowDangerousHtml:!0},jm=/^(https?|ircs?|mailto|xmpp)$/i,km=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Nm(e){const t=Sm(e),n=Cm(e);return _m(t.runSync(t.parse(n),n),e)}function Sm(e){const t=e.rehypePlugins||Xa,n=e.remarkPlugins||Xa,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ya}:Ya;return gm().use(rp).use(n).use(Zp,r).use(t)}function Cm(e){const t=e.children||"",n=new _l;return typeof t=="string"&&(n.value=t),n}function _m(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||Em;for(const d of km)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+vm+d.id,void 0);return Cl(e,c),Oc(e,{Fragment:i.Fragment,components:s,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function c(d,h,m){if(d.type==="raw"&&m&&typeof h=="number")return o?m.children.splice(h,1):m.children[h]={type:"text",value:d.value},h;if(d.type==="element"){let p;for(p in Vr)if(Object.hasOwn(Vr,p)&&Object.hasOwn(d.properties,p)){const y=d.properties[p],w=Vr[p];(w===null||w.includes(d.tagName))&&(d.properties[p]=u(String(y||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!p&&r&&typeof h=="number"&&(p=!r(d,h,m)),p&&m&&typeof h=="number")return l&&d.children?m.children.splice(h,1,...d.children):m.children.splice(h,1),h}}}function Em(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||jm.test(e.slice(0,t))?e:""}const ss="-",Pm=e=>{const t=Im(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(ss);return l[0]===""&&l.length!==1&&l.shift(),El(l,t)||Rm(o)},getConflictingClassGroupIds:(o,l)=>{const u=n[o]||[];return l&&r[o]?[...u,...r[o]]:u}}},El=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?El(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(ss);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},Za=/^\[(.+)\]$/,Rm=e=>{if(Za.test(e)){const t=Za.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Im=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Am(Object.entries(e.classGroups),n).forEach(([a,o])=>{Li(o,r,a,t)}),r},Li=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:eo(t,s);a.classGroupId=n;return}if(typeof s=="function"){if(Tm(s)){Li(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([a,o])=>{Li(o,eo(t,a),n,r)})})},eo=(e,t)=>{let n=e;return t.split(ss).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Tm=e=>e.isThemeGetter,Am=(e,t)=>t?e.map(([n,r])=>{const s=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,l])=>[t+o,l])):a);return[n,s]}):e,Lm=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return s(a,o),o},set(a,o){n.has(a)?n.set(a,o):s(a,o)}}},Pl="!",Mm=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],a=t.length,o=l=>{const u=[];let c=0,d=0,h;for(let j=0;jd?h-d:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:w}};return n?l=>n({className:l,parseClassName:o}):o},Om=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Dm=e=>({cache:Lm(e.cacheSize),parseClassName:Mm(e),...Pm(e)}),Fm=/\s+/,zm=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,a=[],o=e.trim().split(Fm);let l="";for(let u=o.length-1;u>=0;u-=1){const c=o[u],{modifiers:d,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}=n(c);let y=!!p,w=r(y?m.substring(0,p):m);if(!w){if(!y){l=c+(l.length>0?" "+l:l);continue}if(w=r(m),!w){l=c+(l.length>0?" "+l:l);continue}y=!1}const j=Om(d).join(":"),b=h?j+Pl:j,S=b+w;if(a.includes(S))continue;a.push(S);const _=s(w,y);for(let N=0;N<_.length;++N){const q=_[N];a.push(b+q)}l=c+(l.length>0?" "+l:l)}return l};function qm(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rh(d),e());return n=Dm(c),r=n.cache.get,s=n.cache.set,a=l,l(u)}function l(u){const c=r(u);if(c)return c;const d=zm(u,n);return s(u,d),d}return function(){return a(qm.apply(null,arguments))}}const de=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Il=/^\[(?:([a-z-]+):)?(.+)\]$/i,Um=/^\d+\/\d+$/,$m=new Set(["px","full","screen"]),Hm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Km=/\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$/,Qm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Vm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Wm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pt=e=>rn(e)||$m.has(e)||Um.test(e),wt=e=>Nn(e,"length",nf),rn=e=>!!e&&!Number.isNaN(Number(e)),ii=e=>Nn(e,"number",rn),Mn=e=>!!e&&Number.isInteger(Number(e)),Gm=e=>e.endsWith("%")&&rn(e.slice(0,-1)),W=e=>Il.test(e),vt=e=>Hm.test(e),Jm=new Set(["length","size","percentage"]),Xm=e=>Nn(e,Jm,Tl),Ym=e=>Nn(e,"position",Tl),Zm=new Set(["image","url"]),ef=e=>Nn(e,Zm,sf),tf=e=>Nn(e,"",rf),On=()=>!0,Nn=(e,t,n)=>{const r=Il.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},nf=e=>Km.test(e)&&!Qm.test(e),Tl=()=>!1,rf=e=>Vm.test(e),sf=e=>Wm.test(e),af=()=>{const e=de("colors"),t=de("spacing"),n=de("blur"),r=de("brightness"),s=de("borderColor"),a=de("borderRadius"),o=de("borderSpacing"),l=de("borderWidth"),u=de("contrast"),c=de("grayscale"),d=de("hueRotate"),h=de("invert"),m=de("gap"),p=de("gradientColorStops"),y=de("gradientColorStopPositions"),w=de("inset"),j=de("margin"),b=de("opacity"),S=de("padding"),_=de("saturate"),N=de("scale"),q=de("sepia"),k=de("skew"),B=de("space"),M=de("translate"),v=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",W,t],P=()=>[W,t],G=()=>["",pt,wt],z=()=>["auto",rn,W],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>["start","end","center","between","around","evenly","stretch"],se=()=>["","0",W],f=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ue=()=>[rn,W];return{cacheSize:500,separator:":",theme:{colors:[On],spacing:[pt,wt],blur:["none","",vt,W],brightness:ue(),borderColor:[e],borderRadius:["none","","full",vt,W],borderSpacing:P(),borderWidth:G(),contrast:ue(),grayscale:se(),hueRotate:ue(),invert:se(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[Gm,wt],inset:L(),margin:L(),opacity:ue(),padding:P(),saturate:ue(),scale:ue(),sepia:se(),skew:ue(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",W]}],container:["container"],columns:[{columns:[vt]}],"break-after":[{"break-after":f()}],"break-before":[{"break-before":f()}],"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"],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:[...E(),W]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:v()}],"overscroll-x":[{"overscroll-x":v()}],"overscroll-y":[{"overscroll-y":v()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Mn,W]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",W]}],grow:[{grow:se()}],shrink:[{shrink:se()}],order:[{order:["first","last","none",Mn,W]}],"grid-cols":[{"grid-cols":[On]}],"col-start-end":[{col:["auto",{span:["full",Mn,W]},W]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[On]}],"row-start-end":[{row:["auto",{span:[Mn,W]},W]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",W]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",W]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...he()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...he(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...he(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[B]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[B]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",W,t]}],"min-w":[{"min-w":[W,t,"min","max","fit"]}],"max-w":[{"max-w":[W,t,"none","full","min","max","fit","prose",{screen:[vt]},vt]}],h:[{h:[W,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[W,t,"auto","min","max","fit"]}],"font-size":[{text:["base",vt,wt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ii]}],"font-family":[{font:[On]}],"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:["tighter","tight","normal","wide","wider","widest",W]}],"line-clamp":[{"line-clamp":["none",rn,ii]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",pt,W]}],"list-image":[{"list-image":["none",W]}],"list-style-type":[{list:["none","disc","decimal",W]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",pt,wt]}],"underline-offset":[{"underline-offset":["auto",pt,W]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...E(),Ym]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Xm]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ef]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:O()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[pt,W]}],"outline-w":[{outline:[pt,wt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[pt,wt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",vt,tf]}],"shadow-color":[{shadow:[On]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",vt,W]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[_]}],sepia:[{sepia:[q]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",W]}],duration:[{duration:ue()}],ease:[{ease:["linear","in","out","in-out",W]}],delay:[{delay:ue()}],animate:[{animate:["none","spin","ping","pulse","bounce",W]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[Mn,W]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",W]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",W]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"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-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-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",W]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[pt,wt,ii]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}},of=Bm(af),Mi={status:"",repo:"",thread:"",action:"",intent:"",actor:""},lf=new qu({defaultOptions:{queries:{retry:1}}}),to=12,uf=12,cf=10080*60*1e3,df=1e3,Al=Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function V(...e){return of(au(e))}async function ee(e,t){const n=new Headers(t==null?void 0:t.headers);n.set("Accept","application/json");const r=await fetch(e,{...t,headers:n});if(!r.ok)throw new Error(`${r.status} ${r.statusText}`);return r.json()}function Qe(e){if(e==null)return"n/a";const t=Math.max(0,Math.floor(e));if(t<60)return`${t}s`;const n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}const hf=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}),pf=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});function hr(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function mf(e){const t=hr(e);return t?hf.format(t):e??""}function Hn(e){const t=hr(e);return t?pf.format(t):e??""}function Ll(e,t){const n=hr(e);if(!n)return e??"";const r=t-n.getTime(),s=Math.abs(r);if(s>cf)return Hn(e);const a=r>=0?"ago":"from now",o=Math.round(s/1e3);if(o<45)return r>=0?"just now":"soon";if(o<90)return`1m ${a}`;const l=Math.round(o/60);if(l<60)return`${l}m ${a}`;if(l<90)return`1h ${a}`;const u=Math.round(l/60);return u<24?`${u}h ${a}`:u<36?`1d ${a}`:`${Math.round(u/24)}d ${a}`}function Ie({value:e,compact:t=!1,relative:n=!1,now:r=Date.now()}){const s=hr(e);return s?i.jsx("time",{dateTime:s.toISOString(),title:`UTC: ${s.toISOString()}`,children:n?Ll(e,r):t?Hn(e):mf(e)}):i.jsx(i.Fragment,{children:e??""})}function Ml(e,t){const n=hr(e);return n?Math.max(0,Math.floor((t-n.getTime())/1e3)):null}function as(e,t){return e.status==="running"?Ml(e.started_at,t)??e.runtime_seconds:e.runtime_seconds}function os(e,t){return e.status==="pending"?Ml(e.created_at,t)??e.queue_wait_seconds:e.queue_wait_seconds}function ff(e){const[t,n]=T.useState(()=>Date.now());return T.useEffect(()=>{if(!e)return;n(Date.now());const r=window.setInterval(()=>n(Date.now()),df);return()=>window.clearInterval(r)},[e]),t}function xf(e){return(e??"").split(/\r?\n/).map(n=>n.trim()).find(Boolean)??""}function Mr(e,t,n=1){const r=xf(t),s=n>1?` (${n})`:"";return r?`${e}${s}: ${r}`:`${e}${s}`}function Or(e){return e==="openclaw_stdout"||e==="openclaw_stderr"}function Ol(e){return e.map(t=>t==null?void 0:t.trim()).filter(Boolean).join(` +`)}function gf(e){const t=[];for(const n of e){const r=t[t.length-1];if(r&&Or(n.event_type)&&r.eventType===n.event_type){r.count+=1,r.meta=n.ts,r.detail=Ol([r.detail,n.detail]),r.summary=Mr(n.summary,r.detail,r.count);continue}t.push({id:String(n.id),badge:n.event_type,meta:n.ts,summary:Or(n.event_type)?Mr(n.summary,n.detail):n.summary,detail:n.detail,eventType:n.event_type,count:1})}return t}function bf(e){const t=[];return e.forEach((n,r)=>{const s=t[t.length-1];if(s&&Or(n.kind)&&s.kind===n.kind){s.count+=1,s.meta=n.timestamp,s.text=Ol([s.text,n.text]),s.summary=Mr(`${n.role} · ${n.kind}`,s.text,s.count);return}t.push({id:`${n.timestamp??"entry"}-${r}`,badge:n.title,meta:n.timestamp,summary:Or(n.kind)?Mr(`${n.role} · ${n.kind}`,n.text):`${n.role} · ${n.kind}`,text:n.text,kind:n.kind,count:1})}),t}function no(e,t,n,r){return e==="openclaw_stdout"?!1:t||n>=r-2}function yf(e){return{pending:{badge:"border-amber-300 bg-amber-50 text-amber-800",dot:"bg-amber-500"},running:{badge:"border-blue-300 bg-blue-50 text-blue-700",dot:"bg-blue-600"},blocked:{badge:"border-red-300 bg-red-50 text-red-700",dot:"bg-red-600"},denied:{badge:"border-red-300 bg-red-50 text-red-700",dot:"bg-red-600"},done:{badge:"border-emerald-300 bg-emerald-50 text-emerald-700",dot:"bg-emerald-600"},waiting_approval:{badge:"border-slate-300 bg-slate-50 text-slate-700",dot:"bg-slate-500"}}[e]??{badge:"border-slate-300 bg-slate-50 text-slate-700",dot:"bg-slate-500"}}function wf(e,t){const n=new URLSearchParams;for(const[r,s]of Object.entries(e))s.trim()&&n.set(r,s.trim());return n.set("limit",String(t)),`/api/jobs?${n.toString()}`}function vf(e,t,n=50){const r=new URLSearchParams;return e.trim()&&r.set("repo",e.trim()),t.trim()&&r.set("status",t.trim()),r.set("limit",String(n)),`/api/knowledge?${r.toString()}`}function jf(e){return{timeseries:e==="overview",hooks:e==="hooks",deliveries:e==="deliveries"}}function kf(e,t,n="day"){return`/api/webhooks/github/timeseries?${new URLSearchParams({from:e,to:t,bucket:n}).toString()}`}function Nf(e=50,t){const n=new URLSearchParams({limit:String(e)});return t&&n.set("cursor",t),`/api/webhooks/github/hooks?${n.toString()}`}function Sf(e=50,t,n){const r=new URLSearchParams({limit:String(e)});t&&r.set("cursor",t);for(const[s,a]of Object.entries(n??{}))a!=null&&a.trim()&&r.set(s,a.trim());return`/api/webhooks/github/deliveries?${r.toString()}`}function Sr(e=new Date){return{from:new Date(e.getTime()-720*60*60*1e3).toISOString(),to:e.toISOString()}}function Cf(e=Al){return`/api/metrics/summary?timezone=${encodeURIComponent(e)}`}function Ze(e){try{const t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"?t.href:"#"}catch{return"#"}}function Rr(){return"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}function _f(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="github-agent-bridge:push")}function Ef(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),r=window.atob(n),s=new Uint8Array(r.length);for(let a=0;an.id===t.id)?e:[...e,t]}function Rf(e,t){const n=ro(t);return e.some(r=>ro(r)===n)?e:[...e,t]}function ro(e){return`${e.timestamp??""}:${e.role}:${e.kind}:${e.title}:${e.text}`}function If(e){return["claimed","dispatch_started","dispatch_finished","done","blocked","denied","waiting_approval"].includes(e)}function zn(e){return["blocked","denied","waiting_approval"].includes(e)}function Oi(e,t){return e.status!=="running"?!1:t!=null&&t.is_admin?!0:!!(t!=null&&t.login&&e.trigger_actor&&t.login.toLowerCase()===e.trigger_actor.toLowerCase())}function Tf(e=window.location.pathname){const t=e.match(/^\/jobs\/(\d+)\/?$/);return t?Number(t[1]):null}function Af(e=window.location.pathname){return/^\/knowledge\/?$/.test(e)}function Lf(e=window.location.pathname){return/^\/mcp\/?$/.test(e)}function Mf(e=window.location.pathname){return/^\/system\/?$/.test(e)}function Of(e=window.location.pathname){const t=e.match(/^\/webhooks\/hooks\/([^/]+)\/?$/);return t?decodeURIComponent(t[1]):null}function si(e=window.location.pathname){return/^\/webhooks(?:\/hooks\/[^/]+)?\/?$/.test(e)}function Dl(e){return e.startsWith("repo:")?e.slice(5):e}function io(e){return Object.values(e).some(t=>t.trim()!=="")}function Df(e){return[{key:"status",label:"Status",value:e.status},{key:"repo",label:"Repo",value:e.repo},{key:"thread",label:"Thread",value:e.thread},{key:"action",label:"Action",value:e.action},{key:"actor",label:"Actor",value:e.actor.trim()?`@${e.actor.trim().replace(/^@/,"")}`:""},{key:"intent",label:"Intent",value:e.intent}].filter(t=>t.value.trim()!=="")}function Ff(){var cs,ds,hs,ps,ms,fs,xs,gs,bs,ys,ws,vs,js,ks,Ns,Ss,Cs,_s,Es,Ps,Rs,Is,Ts,As,Ls,Ms,Os,Ds,Fs,zs,qs,Bs,Us,$s,Hs,Ks,Qs,Vs,Ws,Gs,Js,Xs,Ys;const e=Do(),[t,n]=T.useState(Mi),[r,s]=T.useState(to),a=T.useRef(!1),[o,l]=T.useState(""),[u,c]=T.useState("proposed"),[d,h]=T.useState("overview"),[m,p]=T.useState({hook_id:"",event_name:"",repository:"",result:""}),[y,w]=T.useState(()=>Sr()),[j,b]=T.useState(null),[S,_]=T.useState(""),[N,q]=T.useState(()=>window.location.pathname),[k,B]=T.useState(null),M=Tf(N),v=M!==null,F=Af(N),L=Lf(N),P=Mf(N),G=si(N),z=Of(N),E=!v&&!F&&!L&&!P&&!G,O=M,Q=ge({queryKey:["metrics",Al],queryFn:()=>ee(Cf()),enabled:E||P}),he=ge({queryKey:["dashboard-status"],queryFn:()=>ee("/api/status")}),se=ge({queryKey:["me"],queryFn:()=>ee("/api/me"),refetchInterval:!1}),f=G&&!!((ds=(cs=se.data)==null?void 0:cs.user)!=null&&ds.is_admin&&((hs=he.data)!=null&&hs.webhook_configured)),ue=jf(d),Se=ge({queryKey:["web-push-config"],queryFn:()=>ee("/api/web-push/config"),enabled:!!((ps=se.data)!=null&&ps.user)}),x=ge({queryKey:["about"],queryFn:()=>ee("/api/about")}),De=ge({queryKey:["job-actors"],queryFn:()=>ee("/api/jobs/actors"),enabled:E}),we=ge({queryKey:["jobs",t,r],queryFn:()=>ee(wf(t,r)),enabled:E,placeholderData:A=>A}),me=ge({queryKey:["processes"],queryFn:()=>ee("/api/processes"),enabled:P}),et=ge({queryKey:["systemd"],queryFn:()=>ee("/api/systemd"),enabled:P}),Fe=ge({queryKey:["alerts"],queryFn:()=>ee("/api/alerts"),enabled:P}),Ve=ge({queryKey:["webhook-summary"],queryFn:()=>ee("/api/webhooks/github/summary"),enabled:f}),tt=ge({queryKey:["webhook-timeseries",y.from,y.to,"day"],queryFn:()=>ee(kf(y.from,y.to)),enabled:f&&ue.timeseries}),At=ge({queryKey:["webhook-exceptions"],queryFn:()=>ee("/api/webhooks/github/exceptions"),enabled:f&&ue.timeseries}),ct=pa({queryKey:["webhook-hooks"],queryFn:({pageParam:A})=>ee(Nf(50,A)),initialPageParam:null,getNextPageParam:A=>A.next_cursor??void 0,enabled:f&&ue.hooks&&z===null}),dt=pa({queryKey:["webhook-deliveries",m],queryFn:({pageParam:A})=>ee(Sf(50,A,m)),initialPageParam:null,getNextPageParam:A=>A.next_cursor??void 0,enabled:f&&ue.deliveries&&z===null}),Yt=ge({queryKey:["webhook-hook",z],queryFn:()=>ee(`/api/webhooks/github/hooks/${encodeURIComponent(z??"")}`),enabled:f&&z!==null}),Lt=ge({queryKey:["knowledge",o,u],queryFn:()=>ee(vf(o,u)),enabled:F}),Mt=ge({queryKey:["mcp-tokens"],queryFn:()=>ee("/api/mcp/tokens"),enabled:L&&!!((ms=se.data)!=null&&ms.user)}),pr=ge({queryKey:["mcp-users"],queryFn:()=>ee("/api/mcp/users"),enabled:L&&!!((fs=se.data)!=null&&fs.user)}),Zt=ge({queryKey:["job",O],queryFn:()=>ee(`/api/jobs/${O}`),enabled:O!==null}),_n=ge({queryKey:["job-session",O],queryFn:()=>ee(`/api/jobs/${O}/session`),enabled:O!==null}),En=ge({queryKey:["job-session-events",O],queryFn:()=>ee(`/api/jobs/${O}/session/events`),enabled:O!==null}),mr=ge({queryKey:["job-session-transcript",O],queryFn:()=>ee(`/api/jobs/${O}/session/transcript`),enabled:O!==null}),fr=T.useCallback(async A=>{const ae=await ee(`/api/jobs/${A}/retry`,{method:"POST"});e.setQueryData(["job",A],{job:ae.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]})},[e]),xr=T.useCallback(async A=>{const ae=await ee(`/api/jobs/${A}/dismiss`,{method:"POST"});e.setQueryData(["job",A],{job:ae.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]})},[e]),gr=T.useCallback(async(A,ae)=>{const pe=await ee(`/api/jobs/${A}/cancel`,{method:"POST",body:JSON.stringify({reason:ae||""})});e.setQueryData(["job",A],{job:pe.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]}),e.invalidateQueries({queryKey:["dashboard-status"]})},[e]),br=T.useCallback(async(A,ae)=>{await ee(`/api/knowledge/proposals/${encodeURIComponent(A)}/${ae}`,{method:"POST"}),e.invalidateQueries({queryKey:["knowledge"]}),e.invalidateQueries({queryKey:["dashboard-status"]})},[e]),C=T.useCallback(async A=>{await ee(`/api/knowledge/rules/${encodeURIComponent(A)}`,{method:"DELETE"}),e.invalidateQueries({queryKey:["knowledge"]})},[e]),I=T.useCallback(async(A,ae)=>{await ee(`/api/knowledge/rules/${encodeURIComponent(A)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:ae})}),e.invalidateQueries({queryKey:["knowledge"]})},[e]),H=T.useCallback(async(A,ae)=>{const pe=await ee("/api/mcp/tokens",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:A,user_login:ae||void 0})});return e.invalidateQueries({queryKey:["mcp-tokens"]}),pe},[e]),X=T.useCallback(async(A,ae)=>{await ee(`/api/mcp/tokens/${encodeURIComponent(A)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_login:ae})}),e.invalidateQueries({queryKey:["mcp-tokens"]}),e.invalidateQueries({queryKey:["mcp-users"]})},[e]),ie=T.useCallback(async A=>{await ee(`/api/mcp/tokens/${encodeURIComponent(A)}`,{method:"DELETE"}),e.invalidateQueries({queryKey:["mcp-tokens"]})},[e]),Pe=T.useCallback(async A=>{const ae={refresh:"/api/autoupdate/refresh",apply:"/api/autoupdate/apply",complete:"/api/autoupdate/complete-pending"}[A];b(A),_("");try{await ee(ae,{method:"POST"}),e.invalidateQueries({queryKey:["dashboard-status"]})}catch(pe){e.invalidateQueries({queryKey:["dashboard-status"]}),_(pe instanceof Error?pe.message:String(pe))}finally{b(null)}},[e]),ht=T.useCallback(async()=>{var Zs;const A=(Zs=Se.data)==null?void 0:Zs.public_key;if(!A)throw new Error("web_push_not_configured");if(!Rr())throw new Error("web_push_not_supported");if(await window.Notification.requestPermission()!=="granted")throw new Error("notification_permission_denied");const pe=await navigator.serviceWorker.register("/service-worker.js"),ru=await pe.pushManager.getSubscription()??await pe.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Ef(A)});await ee("/api/web-push/subscriptions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ru.toJSON())}),e.invalidateQueries({queryKey:["web-push-config"]})},[e,(xs=Se.data)==null?void 0:xs.public_key]),We=T.useCallback(async()=>{if(!Rr())return;const ae=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(!ae)return;const pe=ae.endpoint;await ae.unsubscribe(),await ee("/api/web-push/subscriptions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:pe})}),e.invalidateQueries({queryKey:["web-push-config"]})},[e]);T.useEffect(()=>{var A;!((A=Se.data)!=null&&A.status.enabled)||!Rr()||navigator.serviceWorker.register("/service-worker.js").catch(()=>{})},[(gs=Se.data)==null?void 0:gs.status.enabled]),T.useEffect(()=>{if(O===null)return;const A=new EventSource(`/api/jobs/${O}/session/stream`);return A.addEventListener("session_event",ae=>{const pe=Dr(ae);pe&&(e.setQueryData(["job-session-events",O],bt=>({events:Pf((bt==null?void 0:bt.events)??[],pe)})),If(pe.event_type)&&(e.invalidateQueries({queryKey:["job",O]}),e.invalidateQueries({queryKey:["jobs"]})))}),A.addEventListener("transcript_entry",ae=>{const pe=Dr(ae);!pe||pe.job_id!==O||e.setQueryData(["job-session-transcript",O],bt=>({entries:Rf((bt==null?void 0:bt.entries)??[],pe.entry)}))}),A.onerror=()=>{e.invalidateQueries({queryKey:["job",O]}),e.invalidateQueries({queryKey:["job-session-events",O]}),e.invalidateQueries({queryKey:["job-session-transcript",O]})},()=>A.close()},[O,e]),T.useEffect(()=>{const A=()=>{si(window.location.pathname)&&w(Sr()),q(window.location.pathname)};return window.addEventListener("popstate",A),()=>window.removeEventListener("popstate",A)},[]),T.useEffect(()=>{if(!("serviceWorker"in navigator))return;const A=ae=>{if(!_f(ae.data))return;const pe={...ae.data.payload,id:Date.now(),receivedAt:Date.now()};B(pe),pe.job_id&&(e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["job",pe.job_id]}),e.invalidateQueries({queryKey:["metrics"]}))};return navigator.serviceWorker.addEventListener("message",A),()=>navigator.serviceWorker.removeEventListener("message",A)},[e]),T.useEffect(()=>{if(!k)return;const A=window.setTimeout(()=>B(null),12e3);return()=>window.clearTimeout(A)},[k]);const Ot=T.useCallback(A=>{window.history.pushState({},"",Sn(A)),q(window.location.pathname)},[]),$e=T.useCallback(A=>{window.history.pushState({},"",A),si(A)&&w(Sr()),q(window.location.pathname)},[]),be=((bs=Q.data)==null?void 0:bs.metrics.status_counts)??{},Ge=((ys=we.data)==null?void 0:ys.jobs)??[],Je=T.useCallback(A=>{n(A),s(to),a.current=!1},[]);T.useEffect(()=>{we.isFetching||(a.current=!1)},[we.isFetching]);const Gl=T.useCallback(()=>{a.current||(a.current=!0,s(A=>A+uf))},[]),gt=O?((ws=Zt.data)==null?void 0:ws.job)??null:null,Jl=Ge.some(A=>A.status==="running"||A.status==="pending")||(gt==null?void 0:gt.status)==="running"||(gt==null?void 0:gt.status)==="pending"||!!((vs=me.data)!=null&&vs.running_jobs.length),Pn=ff(Jl),Xl=i.jsx(Yf,{selectedJobId:O,selectedJob:gt,loading:Zt.isLoading,error:Zt.error,session:(js=_n.data)==null?void 0:js.session,sessionEvents:(ks=En.data)==null?void 0:ks.events,transcript:(Ns=mr.data)==null?void 0:Ns.entries,now:Pn}),Yl=((Ss=ct.data)==null?void 0:Ss.pages.flatMap(A=>A.hooks))??[],Zl=((Cs=dt.data)==null?void 0:Cs.pages.flatMap(A=>A.deliveries))??[],eu=d==="overview"?tt.isLoading:d==="hooks"?ct.isLoading:dt.isLoading,tu=d==="overview"?tt.error:d==="hooks"?ct.error:dt.error,nu=()=>{Ve.refetch(),d==="overview"&&At.refetch(),d==="overview"&&w(Sr()),d==="hooks"&&ct.refetch(),d==="deliveries"&&dt.refetch()};return i.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[i.jsx("header",{className:"border-b border-slate-800 bg-slate-950 text-white",children:i.jsxs("div",{className:"mx-auto flex w-full max-w-[1440px] items-center justify-between gap-3 px-4 py-4 md:px-6",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h1",{className:"truncate text-xl font-semibold",children:"GitHub Agent Bridge"}),i.jsx(zf,{about:x.data})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[i.jsx(cx,{config:Se.data,loading:Se.isLoading,onEnable:ht,onDisable:We}),i.jsx(ux,{user:(_s=se.data)==null?void 0:_s.user,loading:se.isLoading})]})]})}),i.jsxs("main",{className:"mx-auto grid w-full max-w-[1440px] gap-4 px-3 py-4 sm:px-4 md:px-6 md:py-5",children:[i.jsx(Kf,{isDashboardRoute:E,isSystemRoute:P,isKnowledgeRoute:F,isMcpRoute:L,isWebhooksRoute:G,showWebhooks:!!((Ps=(Es=se.data)==null?void 0:Es.user)!=null&&Ps.is_admin&&((Rs=he.data)!=null&&Rs.webhook_configured)),knowledgeBadgeCount:((As=(Ts=(Is=he.data)==null?void 0:Is.metrics)==null?void 0:Ts.knowledge)==null?void 0:As.proposed)??0,onNavigate:$e}),i.jsx(dx,{notification:k,onDismiss:()=>B(null),onNavigate:$e}),M!==null?i.jsx(Xf,{jobId:M,detail:Xl,selectedJob:gt,user:(Ls=se.data)==null?void 0:Ls.user,onBackToDashboard:()=>$e("/"),onRetry:fr,onDismiss:xr,onCancel:gr,onRefresh:()=>{Zt.refetch(),_n.refetch(),En.refetch(),mr.refetch()}}):F?i.jsx(Zf,{data:Lt.data,loading:Lt.isLoading,error:Lt.error,repo:o,status:u,user:(Ms=se.data)==null?void 0:Ms.user,now:Pn,onRepoChange:l,onStatusChange:c,onApprove:A=>br(A,"approve"),onReject:A=>br(A,"reject"),onUpdateRuleScope:I,onDeleteRule:C,onRefresh:()=>Lt.refetch()}):L?i.jsx(sx,{tokens:(Os=Mt.data)==null?void 0:Os.tokens,loading:Mt.isLoading,error:Mt.error,user:(Ds=se.data)==null?void 0:Ds.user,ownerOptions:((Fs=pr.data)==null?void 0:Fs.users)??[],dashboardUrl:(zs=he.data)==null?void 0:zs.dashboard_url,dashboardUrlSource:(qs=he.data)==null?void 0:qs.dashboard_url_source,now:Pn,onCreate:H,onUpdateOwner:X,onRevoke:ie,onRefresh:()=>Mt.refetch()}):G?z?i.jsx(Gf,{data:Yt.data,loading:Yt.isLoading,error:Yt.error,onBack:()=>{h("hooks"),$e("/webhooks")},onRefresh:()=>Yt.refetch(),onViewHook:A=>$e(`/webhooks/hooks/${encodeURIComponent(A)}`)}):i.jsx(Qf,{summary:Ve.data,timeseries:(Bs=tt.data)==null?void 0:Bs.points,exceptions:(Us=At.data)==null?void 0:Us.exceptions,hooks:Yl,deliveries:Zl,section:d,summaryLoading:Ve.isLoading,sectionLoading:eu,loadingMore:d==="hooks"?ct.isFetchingNextPage:dt.isFetchingNextPage,hasMore:d==="hooks"?ct.hasNextPage:dt.hasNextPage,deliveryFilters:m,error:Ve.error??tu,onSectionChange:h,onLoadMore:()=>d==="hooks"?ct.fetchNextPage():dt.fetchNextPage(),onDeliveryFiltersChange:p,onViewHook:A=>$e(`/webhooks/hooks/${encodeURIComponent(A)}`),onRefresh:nu}):P?i.jsx(Jf,{processes:me.data,processesLoading:me.isLoading,processesError:me.error,systemd:et.data,systemdLoading:et.isLoading,systemdError:et.error,alerts:($s=Fe.data)==null?void 0:$s.alerts,alertsLoading:Fe.isLoading,alertsError:Fe.error,now:Pn,onRefreshProcesses:()=>me.refetch(),onRefreshSystemd:()=>et.refetch(),onRefreshAlerts:()=>Fe.refetch()}):i.jsxs(i.Fragment,{children:[Q.error?i.jsx(Ne,{tone:"error",text:Q.error.message}):null,he.error?i.jsx(Ne,{tone:"error",text:he.error.message}):null,i.jsx(qf,{state:(Hs=he.data)==null?void 0:Hs.autoupdate,isAdmin:!!((Qs=(Ks=se.data)==null?void 0:Ks.user)!=null&&Qs.is_admin),runningAction:j,actionError:S,onRefresh:()=>Pe("refresh"),onApply:()=>Pe("apply"),onCompletePending:()=>Pe("complete")}),i.jsxs("section",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Summary metrics",children:[i.jsx(_e,{title:"Pending",value:be.pending??0,icon:i.jsx($o,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Running",value:be.running??0,icon:i.jsx(bn,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Blocked",value:be.blocked??0,icon:i.jsx(zr,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Done",value:be.done??0,icon:i.jsx(wn,{className:"h-5 w-5"})})]}),i.jsxs("section",{className:"grid gap-3",children:[i.jsx(hx,{count:Ge.length,limit:r,loading:we.isLoading,onRefresh:()=>we.refetch()}),i.jsxs(fe,{title:"Recent jobs",flushHeader:!0,children:[i.jsx(px,{filters:t,actorOptions:((Vs=De.data)==null?void 0:Vs.actors)??[],onChange:Je}),we.error?i.jsx(Ne,{tone:"error",text:we.error.message}):null,i.jsx(fx,{jobs:Ge,loading:we.isLoading,loadingMore:we.isFetching&&!we.isLoading,hasMore:Ge.length>=r,onLoadMore:Gl,onViewJob:Ot,now:Pn,user:(Ws=se.data)==null?void 0:Ws.user,onRetry:fr,onDismiss:xr,onCancel:gr})]}),i.jsx(fe,{title:"Runtime usage",action:i.jsx(lt,{onClick:()=>Q.refetch()}),children:i.jsx(Ex,{usage:(Gs=Q.data)==null?void 0:Gs.metrics.runtime_usage,loading:Q.isLoading,totalJobs:lo(be)})})]}),i.jsxs("section",{className:"grid gap-4 xl:grid-cols-3",children:[i.jsx(fe,{title:"Runtime percentiles",children:i.jsx(oo,{label:"runtime",values:(Js=Q.data)==null?void 0:Js.metrics.runtime_seconds})}),i.jsx(fe,{title:"Jobs per day",children:i.jsx(_x,{values:(Xs=Q.data)==null?void 0:Xs.metrics.by_created_day,loading:Q.isLoading,totalJobs:lo(be)})}),i.jsx(fe,{title:"Queue wait percentiles",children:i.jsx(oo,{label:"queue wait",values:(Ys=Q.data)==null?void 0:Ys.metrics.queue_wait_seconds})})]})]})]})]})}function zf({about:e}){const t=e!=null&&e.version?`v${e.version}`:"version loading";return i.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-slate-300",children:[i.jsx("span",{children:"Operational dashboard"}),i.jsx("span",{className:"font-mono text-xs text-slate-400",children:t}),e!=null&&e.repository_url?i.jsxs("a",{className:"inline-flex items-center gap-1 text-xs font-semibold text-slate-200 hover:underline",href:Ze(e.repository_url),rel:"noreferrer",target:"_blank",children:[i.jsx(Gt,{className:"h-3.5 w-3.5","aria-hidden":!0}),"GitHub"]}):null]})}function qf({state:e,isAdmin:t,runningAction:n=null,actionError:r="",onRefresh:s,onApply:a,onCompletePending:o}){var j,b,S,_,N,q,k,B,M,v,F;if(!e)return null;const l=(b=(j=e==null?void 0:e.target)==null?void 0:j.tag_name)==null?void 0:b.trim();if(!t||!l||(e==null?void 0:e.decision)==="noop")return null;const u=Bf(e.decision),c=((S=e.queue)==null?void 0:S.active_total)??0,d=Uf((_=e.classification)==null?void 0:_.risk),h=$f((N=e.target)==null?void 0:N.body),m=((k=(q=e.classification)==null?void 0:q.migration_files)==null?void 0:k.length)??0,p=((M=(B=e.classification)==null?void 0:B.risky_files)==null?void 0:M.length)??0,y=!!(e.executor_reload_pending&&e.dashboard_applied_at&&o),w=!!(a&&m===0);return i.jsxs("section",{className:"rounded-md border border-amber-300 bg-amber-50 p-3 text-amber-950 shadow-sm","aria-label":"Update available",children:[i.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx(zr,{className:"h-4 w-4 text-amber-700","aria-hidden":!0}),i.jsx("h2",{className:"text-sm font-semibold",children:"Update available"}),i.jsx("span",{className:"rounded-sm border border-amber-300 bg-white px-1.5 py-0.5 font-mono text-[11px] text-amber-800",children:l}),(v=e.target)!=null&&v.url?i.jsxs("a",{className:"inline-flex items-center gap-1 text-xs font-semibold text-amber-800 hover:underline",href:Ze(e.target.url),rel:"noreferrer",target:"_blank",children:[i.jsx(Gt,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Release"]}):null]}),i.jsxs("p",{className:"mt-1 text-sm text-amber-900",children:[u,e.installed_tag?i.jsxs("span",{className:"font-mono",children:[" from ",e.installed_tag]}):null]}),i.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[s?i.jsxs("button",{className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-md border border-amber-300 bg-white px-2.5 text-xs font-semibold text-amber-900 hover:bg-amber-100 disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:n!==null,onClick:s,children:[i.jsx(ur,{className:V("h-3.5 w-3.5",n==="refresh"&&"animate-spin"),"aria-hidden":!0}),n==="refresh"?"Checking...":"Check now"]}):null,w?i.jsxs("button",{className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-md bg-amber-800 px-2.5 text-xs font-semibold text-white hover:bg-amber-900 disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:n!==null,onClick:()=>{window.confirm(`Apply ${l}? This can restart bridge services according to the recorded safe plan.`)&&(a==null||a())},children:[i.jsx(wn,{className:"h-3.5 w-3.5","aria-hidden":!0}),n==="apply"?"Applying...":"Apply update"]}):null,y?i.jsxs("button",{className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-md border border-amber-300 bg-white px-2.5 text-xs font-semibold text-amber-900 hover:bg-amber-100 disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:n!==null,onClick:o,children:[i.jsx(Gn,{className:"h-3.5 w-3.5","aria-hidden":!0}),n==="complete"?"Completing...":"Complete reload"]}):null]})]}),i.jsxs("div",{className:"grid gap-2 text-xs sm:grid-cols-3 lg:min-w-[420px]",children:[i.jsx(ai,{label:"Impact",value:d}),i.jsx(ai,{label:"Active jobs",value:String(c)}),i.jsx(ai,{label:"Admin only",value:"autoupdate"})]})]}),e.blocked_reason||e.executor_reload_pending||m>0||p>0?i.jsxs("div",{className:"mt-3 flex flex-wrap gap-2 text-xs",children:[e.executor_reload_pending?i.jsx("span",{className:"rounded-sm border border-amber-300 bg-white px-2 py-1 font-semibold",children:"executor reload pending"}):null,e.blocked_reason?i.jsx("span",{className:"rounded-sm border border-amber-300 bg-white px-2 py-1 font-mono",children:e.blocked_reason}):null,m>0?i.jsxs("span",{className:"rounded-sm border border-amber-300 bg-white px-2 py-1",children:[m," migration file",m===1?"":"s"]}):null,p>0?i.jsxs("span",{className:"rounded-sm border border-amber-300 bg-white px-2 py-1",children:[p," executor/shared file",p===1?"":"s"]}):null]}):null,h?i.jsxs("div",{className:"mt-3 rounded-md border border-amber-200 bg-white/70 p-2.5",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase text-amber-800",children:"Changelog preview"}),i.jsx(Hf,{markdown:h})]}):null,(F=e.warnings)!=null&&F.length?i.jsx("div",{className:"mt-2 font-mono text-xs text-amber-800",children:e.warnings[0]}):null,r?i.jsxs("div",{className:"mt-2 rounded-sm border border-amber-300 bg-white px-2 py-1 font-mono text-xs text-amber-900",children:["Action failed: ",r]}):null]})}function ai({label:e,value:t}){return i.jsxs("div",{className:"min-w-0 rounded-md border border-amber-200 bg-white/80 px-2 py-1.5",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase text-amber-700",children:e}),i.jsx("div",{className:"mt-0.5 truncate font-mono text-xs text-amber-950",children:t})]})}function Bf(e){return{stage_dashboard_reload:"Dashboard reload can be staged now",stage_defer_executor_reload:"Dashboard reload can be staged; executor reload waits for the queue",stage_full_reload:"Full reload can be staged now",defer_migration:"Migration release is waiting for a quiet queue"}[e??""]??"Update plan recorded"}function Uf(e){return{dashboard_only:"dashboard only",executor_or_queue:"executor or queue",executor_or_shared:"executor or shared",migration_required:"migration",none:"none"}[e??""]??"unknown"}function $f(e){return(e??"").trim()}function Hf({markdown:e}){return i.jsx("div",{className:"mt-1 text-sm leading-relaxed text-amber-950",children:i.jsx(Nm,{allowedElements:["a","blockquote","code","em","h1","h2","h3","h4","li","ol","p","strong","ul"],components:{a:({href:t,children:n})=>i.jsx("a",{className:"font-semibold text-amber-800 underline underline-offset-2",href:Ze(t??""),rel:"noreferrer",target:"_blank",children:n}),blockquote:({children:t})=>i.jsx("blockquote",{className:"mt-2 border-l-2 border-amber-300 pl-2 text-amber-900",children:t}),code:({children:t})=>i.jsx("code",{className:"rounded-sm bg-amber-100 px-1 py-0.5 font-mono text-[0.85em] text-amber-950",children:t}),h1:({children:t})=>i.jsx("h3",{className:"mt-2 text-sm font-semibold text-amber-950 first:mt-0",children:t}),h2:({children:t})=>i.jsx("h3",{className:"mt-2 text-sm font-semibold text-amber-950 first:mt-0",children:t}),h3:({children:t})=>i.jsx("h3",{className:"mt-2 text-sm font-semibold text-amber-950 first:mt-0",children:t}),h4:({children:t})=>i.jsx("h4",{className:"mt-2 text-xs font-semibold uppercase text-amber-800 first:mt-0",children:t}),li:({children:t})=>i.jsx("li",{className:"break-words pl-0.5 [overflow-wrap:anywhere]",children:t}),ol:({children:t})=>i.jsx("ol",{className:"mt-1 list-decimal space-y-1 pl-5 first:mt-0",children:t}),p:({children:t})=>i.jsx("p",{className:"mt-1 break-words [overflow-wrap:anywhere] first:mt-0",children:t}),strong:({children:t})=>i.jsx("strong",{className:"font-semibold",children:t}),em:({children:t})=>i.jsx("em",{className:"italic",children:t}),ul:({children:t})=>i.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-5 first:mt-0",children:t})},children:e})})}function Kf({isDashboardRoute:e,isSystemRoute:t=!1,isKnowledgeRoute:n,isMcpRoute:r=!1,isWebhooksRoute:s=!1,showWebhooks:a=!1,knowledgeBadgeCount:o=0,onNavigate:l}){return i.jsxs("nav",{className:"flex min-w-0 rounded-lg border border-border bg-panel p-1 shadow-sm","aria-label":"Dashboard sections",children:[i.jsxs(Dn,{href:"/",active:e,onNavigate:l,children:[i.jsx(Qo,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"Jobs"})]}),i.jsxs(Dn,{href:"/system",active:t,onNavigate:l,children:[i.jsx(nc,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"System"})]}),a?i.jsxs(Dn,{href:"/webhooks",active:s,onNavigate:l,children:[i.jsx(bn,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"Webhooks"})]}):null,i.jsxs(Dn,{href:"/knowledge",active:n,onNavigate:l,children:[i.jsx(Hi,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"Knowledge"}),o>0?i.jsx("span",{className:V("inline-flex h-5 min-w-5 items-center justify-center rounded-full border px-1 font-mono text-[11px] leading-none",n?"border-white/40 bg-white/15 text-white":"border-amber-200 bg-amber-100 text-amber-800"),"aria-label":`${o} proposed knowledge ${o===1?"item":"items"}`,children:o}):null]}),i.jsxs(Dn,{href:"/mcp",active:r,onNavigate:l,children:[i.jsx(Tr,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"MCP"})]})]})}function qn({text:e}){return i.jsxs("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted",children:[i.jsx(ur,{className:"h-4 w-4 animate-spin","aria-hidden":!0}),e]})}function Qf({summary:e,timeseries:t,exceptions:n,hooks:r,deliveries:s,section:a,summaryLoading:o,sectionLoading:l,loadingMore:u,hasMore:c,deliveryFilters:d,error:h,onSectionChange:m,onLoadMore:p,onDeliveryFiltersChange:y,onViewHook:w,onRefresh:j}){var _,N,q,k,B,M;const b=Object.values((e==null?void 0:e.receipts)??{}).reduce((v,F)=>v+F,0),S=[{id:"overview",label:"Overview"},{id:"hooks",label:"Hooks",count:(_=e==null?void 0:e.totals)==null?void 0:_.hooks},{id:"deliveries",label:"Deliveries",count:(N=e==null?void 0:e.totals)==null?void 0:N.deliveries}];return i.jsxs("section",{className:"grid gap-4",children:[i.jsx(zl,{icon:i.jsx(bn,{className:"h-5 w-5 text-muted","aria-hidden":!0}),title:"GitHub webhooks",subtitle:"Shadow ingestion health. Deliveries are observed but do not create jobs.",action:i.jsx(lt,{onClick:j})}),h?i.jsx(Ne,{tone:"error",text:h.message}):null,i.jsx("div",{className:"flex max-w-full flex-wrap rounded-md border border-border bg-white p-1",role:"tablist","aria-label":"Webhook dashboard section",children:S.map(v=>i.jsxs("button",{type:"button",role:"tab","aria-label":v.count===void 0?v.label:`${v.label} (${v.count} total)`,"aria-selected":a===v.id,className:V("inline-flex h-8 items-center gap-2 rounded px-3 text-sm font-semibold",a===v.id?"bg-primary text-white":"text-muted hover:bg-slate-50 hover:text-foreground"),onClick:()=>m(v.id),children:[v.label,v.count!==void 0?i.jsx("span",{className:"rounded border border-current/30 px-1 font-mono text-[10px]",children:v.count}):null]},v.id))}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Webhook status",children:[i.jsx(_e,{title:"Receipts",value:b,icon:i.jsx(bn,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Duplicates",value:(e==null?void 0:e.duplicate_deliveries)??0,icon:i.jsx(ur,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Cross-source matches",value:(e==null?void 0:e.cross_source_matches)??0,icon:i.jsx(vn,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Mode",value:o?"…":(e==null?void 0:e.mode)??"unknown",icon:i.jsx(Ho,{className:"h-5 w-5"})})]}),a==="overview"?i.jsxs(i.Fragment,{children:[i.jsx(fe,{title:"Delivery activity",children:l?i.jsx(qn,{text:"Loading delivery activity…"}):t!=null&&t.length?i.jsx("div",{className:"h-72","aria-label":"Webhook deliveries over time",children:i.jsx(rr,{width:"100%",height:"100%",children:i.jsxs(Fr,{data:t,children:[i.jsx(ir,{strokeDasharray:"3 3"}),i.jsx(sr,{dataKey:"bucket"}),i.jsx(ar,{allowDecimals:!1}),i.jsx(or,{}),i.jsx(ko,{}),i.jsx(Vt,{dataKey:"observed",stackId:"deliveries",fill:"#2563eb"}),i.jsx(Vt,{dataKey:"duplicate",stackId:"deliveries",fill:"#f59e0b"}),i.jsx(Vt,{dataKey:"unsupported",stackId:"deliveries",fill:"#94a3b8"})]})})}):i.jsx(Z,{text:"No webhook activity in the selected 30-day window."})}),i.jsx(fe,{title:"Receipt states",children:o?i.jsx(qn,{text:"Loading webhook summary…"}):Object.keys((e==null?void 0:e.receipts)??{}).length?i.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:Object.entries((e==null?void 0:e.receipts)??{}).sort(([v],[F])=>v.localeCompare(F)).map(([v,F])=>i.jsx(J,{label:v,value:F},v))}):i.jsx(Z,{text:"No webhook deliveries observed yet."})}),i.jsx(fe,{title:"Cross-source coverage",children:i.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[i.jsx(J,{label:"Both sources",value:((q=e==null?void 0:e.coverage)==null?void 0:q.both)??0}),i.jsx(J,{label:"IMAP only",value:((k=e==null?void 0:e.coverage)==null?void 0:k.imap_only)??0}),i.jsx(J,{label:"Webhook only",value:((B=e==null?void 0:e.coverage)==null?void 0:B.webhook_only)??0}),i.jsx(J,{label:"Coverage",value:((M=e==null?void 0:e.coverage)==null?void 0:M.ratio)==null?"not measurable":`${Math.round(e.coverage.ratio*100)}%`})]})}),i.jsx(fe,{title:"Exceptions requiring review",children:n!=null&&n.length?i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full min-w-[720px] text-left text-sm",children:[i.jsx("thead",{className:"border-b border-border text-xs text-muted",children:i.jsxs("tr",{children:[i.jsx("th",{className:"px-3 py-2",children:"Type"}),i.jsx("th",{className:"px-3 py-2",children:"Repository"}),i.jsx("th",{className:"px-3 py-2",children:"Reference"}),i.jsx("th",{className:"px-3 py-2",children:"Observed"})]})}),i.jsx("tbody",{children:n.map(v=>i.jsxs("tr",{className:"border-b border-border/70 last:border-0",children:[i.jsx("td",{className:"px-3 py-2 font-semibold",children:v.kind}),i.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:v.repository??"unknown"}),i.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:v.event_key??v.reference}),i.jsx("td",{className:"px-3 py-2 font-mono text-xs text-muted",children:v.created_at})]},`${v.kind}:${v.reference}`))})]})}):i.jsx(Z,{text:"No cross-source exceptions in retained data."})})]}):null,a==="hooks"?i.jsx(fe,{title:"Hook inventory",children:l?i.jsx(qn,{text:"Loading hook inventory…"}):r!=null&&r.length?i.jsx(Di,{noun:"hooks",hasMore:c,loading:u,onLoadMore:p,children:i.jsxs("table",{className:"w-full min-w-[920px] text-left text-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"sticky top-0 z-10 border-b border-border bg-panel text-left text-xs text-muted",children:[i.jsx("th",{className:"px-3 py-2",children:"Target"}),i.jsx("th",{className:"px-3 py-2",children:"State"}),i.jsx("th",{className:"px-3 py-2",children:"Configuration"}),i.jsx("th",{className:"px-3 py-2",children:"Last delivery"}),i.jsx("th",{className:"px-3 py-2",children:"Last ping"})]})}),i.jsx("tbody",{children:r.map(v=>i.jsxs("tr",{className:"cursor-pointer border-b border-border/70 last:border-0 hover:bg-slate-50",onClick:()=>w(v.id),children:[i.jsxs("td",{className:"px-3 py-3",children:[i.jsx("button",{type:"button",className:"text-left font-semibold text-primary hover:underline",onClick:F=>{F.stopPropagation(),w(v.id)},children:v.target}),i.jsxs("div",{className:"font-mono text-xs text-muted",children:[v.target_type," · #",v.id]})]}),i.jsx("td",{className:"px-3 py-3",children:i.jsx("span",{className:V("rounded border px-2 py-1 text-xs font-semibold",v.status==="receiving"?"border-emerald-200 bg-emerald-50 text-emerald-700":v.status==="inactive"?"border-red-200 bg-red-50 text-red-700":"border-slate-200 bg-slate-50 text-slate-600"),children:v.status})}),i.jsxs("td",{className:"max-w-sm px-3 py-3 text-xs",children:[i.jsx("div",{children:v.events.join(", ")||"No event snapshot"}),i.jsxs("div",{className:"mt-1 font-mono text-muted",children:[v.content_type??"content type unknown"," · SSL ",v.ssl_verify===null||v.ssl_verify===void 0?"unknown":v.ssl_verify?"verified":"disabled"]})]}),i.jsxs("td",{className:"px-3 py-3 text-xs",children:[i.jsxs("div",{className:"font-semibold",children:[v.last_event_name??"Never",v.last_action?` · ${v.last_action}`:""]}),i.jsx("div",{className:"mt-1 font-mono text-muted",children:v.last_repository??v.last_event_at??"No delivery observed"})]}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs text-muted",children:v.last_ping_at??"Never"})]},v.id))})]})}):i.jsx(Z,{text:"No hook inventory is available. Redeliver a signed ping from GitHub to create the sanitized configuration snapshot."})}):null,a==="deliveries"?i.jsxs(fe,{title:"Recent deliveries",children:[i.jsx(Vf,{filters:d,onChange:y}),l?i.jsx(qn,{text:"Loading deliveries…"}):s!=null&&s.length?i.jsx(Di,{noun:"deliveries",hasMore:c,loading:u,onLoadMore:p,children:i.jsx(Fl,{deliveries:s,onViewHook:w})}):i.jsx(Z,{text:"No deliveries match the current filters."})]}):null]})}function Vf({filters:e,onChange:t}){const n=[{key:"hook_id",label:"Hook ID",placeholder:"690954530"},{key:"event_name",label:"Event",placeholder:"issue_comment"},{key:"repository",label:"Repository",placeholder:"gisce/repository"},{key:"result",label:"Result",placeholder:"observed"}];return i.jsx("div",{className:"grid gap-2 border-b border-border p-3 sm:grid-cols-2 xl:grid-cols-4",children:n.map(r=>i.jsxs("label",{className:"grid gap-1 text-xs font-semibold text-muted",children:[r.label,i.jsx("input",{className:"h-9 rounded-md border border-border bg-white px-2 font-mono text-xs text-foreground",value:e[r.key],placeholder:r.placeholder,onChange:s=>t({...e,[r.key]:s.target.value})})]},r.key))})}function Fl({deliveries:e,onViewHook:t}){return i.jsxs("table",{className:"w-full min-w-[980px] text-left text-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"sticky top-0 z-10 border-b border-border bg-panel text-left text-xs text-muted",children:[i.jsx("th",{className:"px-3 py-2",children:"Received"}),i.jsx("th",{className:"px-3 py-2",children:"Hook"}),i.jsx("th",{className:"px-3 py-2",children:"Event"}),i.jsx("th",{className:"px-3 py-2",children:"Repository"}),i.jsx("th",{className:"px-3 py-2",children:"Result"}),i.jsx("th",{className:"px-3 py-2",children:"Delivery"})]})}),i.jsx("tbody",{children:e.map(n=>{var r;return i.jsxs("tr",{className:"border-b border-border/70 last:border-0",children:[i.jsx("td",{className:"px-3 py-3 font-mono text-xs text-muted",children:n.created_at}),i.jsx("td",{className:"px-3 py-3",children:n.hook_id?i.jsxs("button",{type:"button",className:"text-left text-primary hover:underline",onClick:()=>t(n.hook_id),children:[i.jsx("span",{className:"block font-semibold",children:((r=n.hook)==null?void 0:r.target)??`Hook #${n.hook_id}`}),i.jsxs("span",{className:"font-mono text-xs",children:["#",n.hook_id]})]}):i.jsx("span",{className:"text-xs text-muted",children:"Unknown (legacy)"})}),i.jsxs("td",{className:"px-3 py-3 font-semibold",children:[n.event_name,n.action?` · ${n.action}`:""]}),i.jsx("td",{className:"px-3 py-3",children:n.repository??"—"}),i.jsxs("td",{className:"px-3 py-3",children:[i.jsx("span",{className:"rounded border border-border bg-slate-50 px-2 py-1 text-xs font-semibold",children:n.status}),n.duplicate_count?i.jsxs("span",{className:"ml-2 font-mono text-xs text-muted",children:[n.duplicate_count," retries"]}):null]}),i.jsx("td",{className:"max-w-[14rem] truncate px-3 py-3 font-mono text-xs text-muted",title:n.delivery_id,children:n.delivery_id})]},n.delivery_id)})})]})}function Di({noun:e,hasMore:t,loading:n,onLoadMore:r,children:s,className:a}){return i.jsxs("div",{"data-testid":`lazy-scroll-${e}`,className:V("max-h-[640px] overflow-auto rounded-md border border-border",a),children:[s,i.jsx(Wf,{noun:e,hasMore:t,loading:n,onLoadMore:r})]})}function Wf({noun:e,hasMore:t,loading:n,onLoadMore:r}){const s=T.useRef(null),a=T.useRef(!1);return T.useEffect(()=>{n||(a.current=!1)},[n]),T.useEffect(()=>{const o=s.current;if(!o||!t||n||!r)return;const l=()=>{a.current||(a.current=!0,r())};if(!("IntersectionObserver"in window)){l();return}const u=new IntersectionObserver(c=>{c.some(d=>d.isIntersecting)&&l()},{rootMargin:"240px 0px"});return u.observe(o),()=>u.disconnect()},[t,n,e,r]),!t&&!n?null:i.jsx("div",{ref:s,className:"flex min-h-10 items-center justify-center border-t border-border px-3 py-2 text-xs font-medium text-muted","aria-live":"polite",children:n?`Loading more ${e}...`:`Scroll for more ${e}`})}function Gf({data:e,loading:t,error:n,onBack:r,onRefresh:s,onViewHook:a}){if(t)return i.jsx(qn,{text:"Loading hook detail…"});if(n)return i.jsxs("div",{className:"grid gap-3",children:[i.jsx(Ne,{tone:"error",text:n.message}),i.jsx("button",{type:"button",className:"w-fit rounded border border-border px-3 py-2 text-sm font-semibold",onClick:r,children:"Back to hooks"})]});if(!e)return i.jsx(Z,{text:"Hook detail is not available."});const o=e.hook;return i.jsxs("section",{className:"grid gap-4",children:[i.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[i.jsxs("div",{children:[i.jsxs("button",{type:"button",className:"mb-2 inline-flex items-center gap-2 text-sm font-semibold text-primary hover:underline",onClick:r,children:[i.jsx(Bo,{className:"h-4 w-4","aria-hidden":!0}),"Back to hooks"]}),i.jsx("h2",{className:"text-xl font-semibold",children:o.target}),i.jsxs("p",{className:"font-mono text-xs text-muted",children:[o.target_type," webhook #",o.id]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(lt,{onClick:s}),o.admin_url?i.jsxs("a",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-border px-3 text-sm font-semibold hover:bg-slate-50",href:Ze(o.admin_url),target:"_blank",rel:"noreferrer",children:[i.jsx(Gt,{className:"h-4 w-4","aria-hidden":!0}),"Open in GitHub"]}):null]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[i.jsx(_e,{title:"State",value:o.status,icon:i.jsx(bn,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Deliveries",value:e.stats.deliveries,icon:i.jsx(vn,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Retries",value:e.stats.duplicates,icon:i.jsx(ur,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Unsupported",value:e.stats.unsupported,icon:i.jsx(zr,{className:"h-5 w-5"})})]}),i.jsxs(fe,{title:"Sanitized configuration",children:[i.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[i.jsx(J,{label:"Active",value:o.active?"yes":"no"}),i.jsx(J,{label:"Content type",value:o.content_type??"unknown"}),i.jsx(J,{label:"SSL verification",value:o.ssl_verify===null||o.ssl_verify===void 0?"unknown":o.ssl_verify?"enabled":"disabled"}),i.jsx(J,{label:"Destination URL",value:o.delivery_url??"unknown"}),i.jsx(J,{label:"GitHub created",value:o.github_created_at??"unknown"}),i.jsx(J,{label:"GitHub updated",value:o.github_updated_at??"unknown"}),i.jsx(J,{label:"Last ping",value:o.last_ping_at??"never"}),i.jsx(J,{label:"Last delivery",value:o.last_event_at??"never"}),i.jsx(J,{label:"Last result",value:o.last_result??"unknown"})]}),i.jsxs("div",{className:"mt-3 rounded-md border border-border p-3",children:[i.jsx("div",{className:"text-xs font-semibold text-muted",children:"Subscribed events"}),i.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:o.events.length?o.events.map(l=>i.jsx("span",{className:"rounded border border-border bg-slate-50 px-2 py-1 font-mono text-xs",children:l},l)):i.jsx("span",{className:"text-sm text-muted",children:"No event snapshot; redeliver a ping."})})]})]}),i.jsx(fe,{title:"Latest observed delivery",children:i.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[i.jsx(J,{label:"Event",value:o.last_event_name?`${o.last_event_name}${o.last_action?` · ${o.last_action}`:""}`:"none"}),i.jsx(J,{label:"Repository",value:o.last_repository??"none"}),i.jsx(J,{label:"Delivery ID",value:o.last_delivery_id??"none"})]})}),i.jsx(fe,{title:"Recent deliveries",children:e.recent_deliveries.length?i.jsx(Fl,{deliveries:e.recent_deliveries,onViewHook:a}):i.jsx(Z,{text:"This hook has no retained deliveries."})})]})}function Jf({processes:e,processesLoading:t,processesError:n,systemd:r,systemdLoading:s,systemdError:a,alerts:o,alertsLoading:l,alertsError:u,now:c,onRefreshProcesses:d,onRefreshSystemd:h,onRefreshAlerts:m}){return i.jsxs("section",{className:"grid gap-4","aria-label":"Bridge system",children:[i.jsxs(fe,{title:"Systemd",action:i.jsx(lt,{onClick:h}),children:[a?i.jsx(Ne,{tone:"error",text:a.message}):null,i.jsx(Rx,{data:r,loading:s})]}),i.jsxs(fe,{title:"Process activity",action:i.jsx(lt,{onClick:d}),children:[n?i.jsx(Ne,{tone:"error",text:n.message}):null,i.jsx(Ax,{data:e,loading:t})]}),i.jsxs(fe,{title:"Monitor alerts",action:i.jsx(lt,{onClick:m}),children:[u?i.jsx(Ne,{tone:"error",text:u.message}):null,i.jsx(Lx,{alerts:o,loading:l,now:c})]})]})}function Dn({href:e,active:t,children:n,onNavigate:r}){return i.jsx("a",{className:V("inline-flex h-8 min-w-0 flex-1 items-center justify-center gap-1 rounded-md px-1.5 text-xs font-semibold sm:flex-none sm:gap-1.5 sm:px-3 sm:text-sm [&>span]:truncate [&>svg]:shrink-0",t?"bg-primary text-white shadow-sm":"text-muted hover:bg-slate-50 hover:text-foreground"),href:e,onClick:s=>{!r||s.defaultPrevented||s.button!==0||s.metaKey||s.ctrlKey||s.altKey||s.shiftKey||(s.preventDefault(),r(e))},children:n})}function Xf({jobId:e,detail:t,selectedJob:n,user:r,onBackToDashboard:s,onRetry:a,onDismiss:o,onCancel:l,onRefresh:u}){const[c,d]=T.useState(!1),[h,m]=T.useState(!1),[p,y]=T.useState(!1),w=!!(r!=null&&r.is_admin&&n&&zn(n.status)),j=!!(n&&Oi(n,r)),b=c?"Retrying...":"Retry",S=h?"Dismissing...":"Dismiss",_=p?"Cancelling...":"Cancel";return i.jsxs("div",{className:"grid min-w-0 gap-3 sm:gap-4",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[i.jsxs("a",{className:"inline-flex h-9 items-center gap-2 rounded-md border border-border px-3 text-sm font-semibold text-foreground hover:bg-slate-50",href:"/",onClick:N=>{N.defaultPrevented||N.button!==0||N.metaKey||N.ctrlKey||N.altKey||N.shiftKey||(N.preventDefault(),s())},children:[i.jsx(Bo,{className:"h-4 w-4","aria-hidden":!0}),"Dashboard"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[w?i.jsxs("button",{className:"inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary px-3 text-sm font-semibold text-white disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:c,onClick:async()=>{if(window.confirm(`Retry job #${e}?`)){d(!0);try{await a(e)}finally{d(!1)}}},children:[i.jsx(Gn,{className:"h-4 w-4","aria-hidden":!0}),b]}):null,w?i.jsxs("button",{className:"inline-flex h-9 items-center justify-center gap-2 rounded-md border border-border bg-white px-3 text-sm font-semibold text-foreground hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:h,onClick:async()=>{if(window.confirm(`Dismiss job #${e}?`)){m(!0);try{await o(e)}finally{m(!1)}}},children:[i.jsx(wn,{className:"h-4 w-4","aria-hidden":!0}),S]}):null,j?i.jsxs("button",{className:"inline-flex h-9 items-center justify-center gap-2 rounded-md border border-red-200 bg-red-50 px-3 text-sm font-semibold text-red-700 hover:bg-red-100 disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:p,onClick:async()=>{const N=window.prompt(`Cancel job #${e}? Optional reason:`);if(N!==null){y(!0);try{await l(e,N)}finally{y(!1)}}},children:[i.jsx(Jt,{className:"h-4 w-4","aria-hidden":!0}),_]}):null,i.jsx(lt,{onClick:u})]})]}),i.jsx(fe,{title:`Job #${e}`,className:"p-3 sm:p-4",children:t})]})}function Yf({selectedJobId:e,selectedJob:t,loading:n,error:r,session:s,sessionEvents:a,transcript:o,now:l}){return t?i.jsx(kx,{job:t,session:s,sessionEvents:a,transcript:o,now:l}):e!==null&&n?i.jsx(Z,{text:"Loading selected job..."}):e!==null&&r?i.jsx(Ne,{tone:"error",text:`Job #${e}: ${r.message}`}):i.jsx(Z,{text:"Select a job to inspect its timeline, worklog and GitHub links."})}function Zf({data:e,loading:t,error:n,repo:r,status:s,user:a,now:o,onRepoChange:l,onStatusChange:u,onApprove:c,onReject:d,onUpdateRuleScope:h,onDeleteRule:m,onRefresh:p}){const y=(e==null?void 0:e.summary)??{},[w,j]=T.useState("proposals"),b=[{id:"proposals",label:"Proposals",count:(e==null?void 0:e.proposals.length)??0},{id:"rules",label:"Rules",count:(e==null?void 0:e.rules.length)??0},{id:"events",label:"Events",count:(e==null?void 0:e.events.length)??0}];return i.jsxs("div",{className:"grid min-w-0 gap-4",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("h2",{className:"flex items-center gap-2 text-base font-semibold",children:[i.jsx(Hi,{className:"h-5 w-5 text-muted","aria-hidden":!0}),"Acquired knowledge"]}),i.jsx("p",{className:"text-xs text-muted",children:"Captured feedback, proposed rules and curated agent memory."})]}),i.jsx(lt,{onClick:p})]}),n?i.jsx(Ne,{tone:"error",text:n.message}):null,i.jsxs("section",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4","aria-label":"Knowledge metrics",children:[i.jsx(_e,{title:"Proposed",value:y.proposed??0,icon:i.jsx($o,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Approved",value:y.approved??0,icon:i.jsx(wn,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Rules",value:y.rules??0,icon:i.jsx(Ko,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Events",value:y.events??0,icon:i.jsx(bn,{className:"h-5 w-5"})})]}),i.jsx(fe,{title:"Filters",className:"p-3",children:i.jsxs("div",{className:V("grid gap-3",w==="proposals"?"md:grid-cols-[minmax(0,1fr)_220px]":"md:grid-cols-[minmax(0,1fr)]"),children:[i.jsx(Ye,{label:"Repository",children:i.jsxs("select",{className:"control",value:r,onChange:S=>l(S.target.value),children:[i.jsx("option",{value:"",children:"All repositories"}),((e==null?void 0:e.repositories)??[]).map(S=>i.jsx("option",{value:S,children:S},S))]})}),w==="proposals"?i.jsx(Ye,{label:"Proposal status",children:i.jsxs("select",{className:"control",value:s,onChange:S=>u(S.target.value),children:[i.jsx("option",{value:"",children:"All statuses"}),i.jsx("option",{value:"proposed",children:"proposed"}),i.jsx("option",{value:"approved",children:"approved"}),i.jsx("option",{value:"rejected",children:"rejected"}),i.jsx("option",{value:"error",children:"error"})]})}):null]})}),i.jsxs(fe,{title:"Knowledge records",action:i.jsx("div",{className:"flex max-w-full flex-wrap rounded-md border border-border bg-white p-0.5",role:"tablist","aria-label":"Knowledge record type",children:b.map(S=>i.jsxs("button",{className:V("inline-flex h-8 items-center gap-1.5 rounded px-2.5 text-xs font-semibold",w===S.id?"bg-primary text-white":"text-muted hover:bg-slate-50 hover:text-foreground"),type:"button",role:"tab","aria-label":`${S.label} (${S.count})`,"aria-selected":w===S.id,onClick:()=>j(S.id),children:[i.jsx("span",{children:S.label}),i.jsx("span",{className:V("rounded-sm border px-1 font-mono text-[10px]",w===S.id?"border-white/40 text-white":"border-border text-muted"),children:S.count})]},S.id))}),children:[w==="proposals"?i.jsx(ex,{proposals:(e==null?void 0:e.proposals)??[],loading:t,isAdmin:!!(a!=null&&a.is_admin),now:o,onApprove:c,onReject:d}):null,w==="rules"?i.jsx(rx,{rules:(e==null?void 0:e.rules)??[],loading:t,now:o,onUpdateRuleScope:h,onDeleteRule:m}):null,w==="events"?i.jsx(ix,{events:(e==null?void 0:e.events)??[],loading:t,now:o}):null]})]})}function ex({proposals:e,loading:t,isAdmin:n,now:r,onApprove:s,onReject:a}){const[o,l]=T.useState(null);return t&&e.length===0?i.jsx(Z,{text:"Loading proposals..."}):e.length===0?i.jsx(Z,{text:"No proposals match the current filters."}):i.jsx("div",{className:"grid gap-2",children:e.map(u=>i.jsxs("article",{className:"grid min-w-0 gap-2 rounded-md border border-border bg-white p-3",children:[i.jsx(Bl,{scope:u.scope,type:u.type,confidence:u.confidence,status:u.status,timestamp:u.updated_at,now:r}),i.jsx("p",{className:"min-w-0 break-words text-sm font-medium [overflow-wrap:anywhere]",children:u.rule||u.reason||"No reusable rule proposed."}),u.reason?i.jsx("p",{className:"min-w-0 break-words text-xs text-muted [overflow-wrap:anywhere]",children:u.reason}):null,u.source_event?i.jsx(tx,{event:u.source_event}):i.jsxs("p",{className:"font-mono text-xs text-muted",children:["Source event ",u.event_id]}),u.error?i.jsx(Ne,{tone:"error",text:u.error}):null,n&&u.status==="proposed"?i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md bg-primary px-3 text-sm font-semibold text-white disabled:opacity-60",type:"button",disabled:o===u.id,onClick:async()=>{l(u.id);try{await s(u.id)}finally{l(null)}},children:[i.jsx(wn,{className:"h-4 w-4","aria-hidden":!0}),"Approve"]}),i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-border px-3 text-sm font-semibold text-foreground hover:bg-slate-50 disabled:opacity-60",type:"button",disabled:o===u.id,onClick:async()=>{l(u.id);try{await a(u.id)}finally{l(null)}},children:[i.jsx(Jt,{className:"h-4 w-4","aria-hidden":!0}),"Reject"]})]}):null]},u.id))})}function tx({event:e}){const t=e.trigger_actor||(e.actor!=="github"?e.actor:null);return i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-md border border-border bg-slate-50 px-2 py-1.5",children:[i.jsx(Cn,{actor:t,avatarUrl:e.trigger_actor_avatar_url,framed:!0}),e.source_job_id?i.jsxs("a",{className:"inline-flex h-7 items-center gap-1 rounded-md border border-border bg-white px-2 text-xs font-semibold text-foreground hover:bg-slate-50",href:Sn(e.source_job_id),children:[i.jsx(vn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",e.source_job_id]}):null,e.github_urls.length>0?i.jsx(Xn,{urls:e.github_urls,compact:!0}):i.jsx("span",{className:"font-mono text-xs text-muted",children:"No GitHub link"})]})}function nx(e){const t=[{value:"global",label:"global"}];if(e.startsWith("repo:")){const n=e.slice(5),[r,s]=n.split("/",2);r&&s&&(t.push({value:`org:${r}`,label:`org:${r}`}),t.push({value:`repo:${r}/${s}`,label:`repo:${r}/${s}`}))}else e.startsWith("org:")&&t.push({value:e,label:e});return t.some(n=>n.value===e)||t.push({value:e,label:e}),t}function rx({rules:e,loading:t,now:n,onUpdateRuleScope:r,onDeleteRule:s}){const[a,o]=T.useState(null),[l,u]=T.useState(null),[c,d]=T.useState("");return t&&e.length===0?i.jsx(Z,{text:"Loading curated rules..."}):e.length===0?i.jsx(Z,{text:"No curated rules match the current filters."}):i.jsx("div",{className:"grid gap-2",children:e.map(h=>{const m=h.source_event_details??[],p=m[0],y=p?p.trigger_actor||(p.actor!=="github"?p.actor:null):null,w=m.flatMap(N=>N.github_urls??[]),j=nx(h.scope),b=l===h.id,S=a===h.id,_=!!h.can_manage;return i.jsxs("article",{className:"grid min-w-0 gap-2 rounded-md border border-border bg-white p-3",children:[i.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[i.jsx(Bl,{scope:h.scope,type:h.type,confidence:h.confidence,status:`${h.observations} observation${h.observations===1?"":"s"}`,timestamp:h.last_seen,now:n}),_?i.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[b?i.jsxs(i.Fragment,{children:[i.jsx(Ye,{label:"Scope",children:i.jsx("select",{className:"control h-8 min-w-[180px] py-1 text-xs",value:c,disabled:S,onChange:N=>d(N.target.value),children:j.map(N=>i.jsx("option",{value:N.value,children:N.label},N.value))})}),i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-border px-3 text-sm font-semibold text-foreground hover:bg-slate-50 disabled:opacity-60",type:"button",disabled:S||c===h.scope,title:"Save scope",onClick:async()=>{if(c!==h.scope){o(h.id);try{await r(h.id,c),u(null)}finally{o(null)}}},children:[i.jsx(ic,{className:"h-4 w-4","aria-hidden":!0}),"Save"]}),i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-border px-3 text-sm font-semibold text-muted hover:bg-slate-50 disabled:opacity-60",type:"button",disabled:S,title:"Cancel scope edit",onClick:()=>{u(null),d("")},children:[i.jsx(Jt,{className:"h-4 w-4","aria-hidden":!0}),"Cancel"]})]}):i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-border px-3 text-sm font-semibold text-foreground hover:bg-slate-50 disabled:opacity-60",type:"button",disabled:S,title:"Edit scope",onClick:()=>{u(h.id),d(h.scope)},children:[i.jsx(rc,{className:"h-4 w-4","aria-hidden":!0}),"Edit"]}),i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-red-200 px-3 text-sm font-semibold text-red-700 hover:bg-red-50 disabled:opacity-60",type:"button",disabled:S,onClick:async()=>{if(window.confirm("Delete this curated rule?")){o(h.id);try{await s(h.id)}finally{o(null)}}},children:[i.jsx(ki,{className:"h-4 w-4","aria-hidden":!0}),"Delete"]})]}):null]}),i.jsx("p",{className:"min-w-0 break-words text-sm font-medium [overflow-wrap:anywhere]",children:h.rule}),i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[i.jsx(Cn,{actor:y,avatarUrl:p==null?void 0:p.trigger_actor_avatar_url,framed:!0}),p!=null&&p.source_job_id?i.jsxs("a",{className:"inline-flex h-7 items-center gap-1 rounded-md border border-border px-2 text-xs font-semibold text-foreground hover:bg-white",href:Sn(p.source_job_id),children:[i.jsx(vn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",p.source_job_id]}):null,w.length>0?i.jsx(Xn,{urls:w,compact:!0}):i.jsx("span",{className:"font-mono text-xs text-muted",children:"No GitHub link"})]})]},h.id)})})}function ix({events:e,loading:t,now:n}){return t&&e.length===0?i.jsx(Z,{text:"Loading captured events..."}):e.length===0?i.jsx(Z,{text:"No captured feedback events match the current filters."}):i.jsx("div",{className:"grid gap-2",children:e.map(r=>{const s=r.trigger_actor||(r.actor!=="github"?r.actor:null);return i.jsxs("details",{className:"group rounded-md border border-border bg-white",children:[i.jsxs("summary",{className:"grid cursor-pointer list-none gap-2 px-3 py-2 marker:hidden hover:bg-slate-50",children:[i.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[i.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2 font-mono text-xs font-semibold text-muted",children:[i.jsx(yn,{className:"h-3.5 w-3.5 shrink-0 transition-transform group-open:rotate-180","aria-hidden":!0}),i.jsx("span",{className:"truncate",children:Dl(r.scope)})]}),i.jsx("span",{className:"shrink-0 font-mono text-xs text-muted",children:i.jsx(Ie,{value:r.occurred_at,relative:!0,now:n})})]}),i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[i.jsx(Cn,{actor:s,avatarUrl:r.trigger_actor_avatar_url,framed:!0}),r.source_job_id?i.jsxs("a",{className:"inline-flex h-7 items-center gap-1 rounded-md border border-border px-2 text-xs font-semibold text-foreground hover:bg-white",href:Sn(r.source_job_id),children:[i.jsx(vn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",r.source_job_id]}):null,r.github_urls.length>0?i.jsx(Xn,{urls:r.github_urls,compact:!0}):i.jsx("span",{className:"font-mono text-xs text-muted",children:"No GitHub link"})]}),i.jsx("p",{className:"line-clamp-2 break-words text-sm [overflow-wrap:anywhere]",children:r.comment})]}),i.jsxs("div",{className:"grid gap-2 border-t border-border px-3 py-2",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-xs font-semibold text-muted",children:"GitHub links"}),r.github_urls.length>0?i.jsx(Xn,{urls:r.github_urls}):i.jsx("p",{className:"text-xs text-muted",children:"No links recorded."})]}),i.jsx("pre",{className:"max-h-72 overflow-auto rounded-md bg-slate-950 px-3 py-2 font-mono text-xs leading-relaxed text-slate-100",children:JSON.stringify(r.context,null,2)})]})]},r.id)})})}function sx({tokens:e,loading:t,error:n,user:r,ownerOptions:s,dashboardUrl:a,dashboardUrlSource:o,now:l,onCreate:u,onUpdateOwner:c,onRevoke:d,onRefresh:h}){const[m,p]=T.useState(""),[y,w]=T.useState(""),[j,b]=T.useState(!1),[S,_]=T.useState(null),[N,q]=T.useState(null),[k,B]=T.useState(null),[M,v]=T.useState(""),F=e??[],L=s.find(E=>E.login===y);T.useEffect(()=>{var E;r!=null&&r.is_admin&&(y&&s.some(O=>O.login===y)||w((r==null?void 0:r.login)||((E=s[0])==null?void 0:E.login)||""))},[s,r==null?void 0:r.is_admin,r==null?void 0:r.login,y]);const P=(a||(typeof window>"u"?"":window.location.origin)).replace(/\/$/,""),G=`${P}/mcp`,z=`${P}/api/mcp`;return i.jsxs("div",{className:"grid min-w-0 gap-4",children:[i.jsx(zl,{icon:i.jsx(Tr,{className:"h-5 w-5 text-muted","aria-hidden":!0}),title:"MCP access",subtitle:r!=null&&r.is_admin?"Issue and revoke read-only tokens for any dashboard user.":"Issue and revoke read-only tokens linked to your user.",action:i.jsx(lt,{onClick:h})}),n?i.jsx(Ne,{tone:"error",text:n.message}):null,M?i.jsx(Ne,{tone:"error",text:M}):null,i.jsx(ax,{dashboardUrl:G,endpointUrl:z,dashboardUrlSource:o??"request"}),k?i.jsxs("section",{className:"rounded-md border border-emerald-300 bg-emerald-50 p-3 text-emerald-950","aria-label":"Created MCP token",children:[i.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-sm font-semibold",children:"Token created"}),i.jsx("p",{className:"mt-1 text-xs text-emerald-800",children:"This secret is shown once. Store it in the local agent environment before leaving this page."})]}),i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-emerald-300 bg-white px-3 text-sm font-semibold text-emerald-900 hover:bg-emerald-100",type:"button",onClick:()=>B(null),children:[i.jsx(Jt,{className:"h-4 w-4","aria-hidden":!0}),"Hide"]})]}),i.jsx("pre",{className:"mt-3 overflow-auto rounded bg-emerald-950 px-3 py-2 font-mono text-xs text-emerald-50",children:k.token})]}):null,i.jsx(fe,{title:"Create token",children:i.jsxs("form",{className:r!=null&&r.is_admin?"grid gap-3 md:grid-cols-[minmax(0,1fr)_minmax(12rem,16rem)_auto]":"grid gap-3 md:grid-cols-[minmax(0,1fr)_auto]",onSubmit:async E=>{E.preventDefault();const O=m.trim();if(O){b(!0),v("");try{const Q=await u(O,r!=null&&r.is_admin?y:void 0);B(Q),p("")}catch(Q){v(Q instanceof Error?Q.message:String(Q))}finally{b(!1)}}},children:[i.jsx(Ye,{label:"Token name",children:i.jsx("input",{className:"control",value:m,placeholder:"local agent",disabled:j,onChange:E=>p(E.target.value)})}),r!=null&&r.is_admin?i.jsxs(Ye,{label:"Owner",children:[i.jsx(ql,{ariaLabel:"Owner",value:y,ownerOptions:s,disabled:j||s.length===0,selectedSuffix:E=>E.login===(r==null?void 0:r.login)?" (you)":"",emptyLabel:"No known users",onChange:w}),L?i.jsxs("span",{className:"font-normal text-muted",children:["Token will be linked to @",L.login,"."]}):null]}):null,i.jsxs("button",{className:"inline-flex h-9 items-center justify-center gap-2 self-end rounded-md bg-primary px-3 text-sm font-semibold text-white disabled:cursor-not-allowed disabled:opacity-60",type:"submit",disabled:j||!m.trim()||!!(r!=null&&r.is_admin&&!y),children:[i.jsx(Tr,{className:"h-4 w-4","aria-hidden":!0}),j?"Creating...":"Create token"]})]})}),i.jsx(fe,{title:"Active tokens",children:i.jsx(ox,{tokens:F,loading:t,now:l,ownerOptions:s,canManageOwners:!!(r!=null&&r.is_admin),revokingId:S,updatingOwnerId:N,onUpdateOwner:async(E,O)=>{q(E),v("");try{await c(E,O)}catch(Q){v(Q instanceof Error?Q.message:String(Q))}finally{q(null)}},onRevoke:async E=>{if(window.confirm("Revoke this MCP token?")){_(E),v("");try{await d(E)}catch(O){v(O instanceof Error?O.message:String(O))}finally{_(null)}}}})})]})}function ax({dashboardUrl:e,endpointUrl:t,dashboardUrlSource:n}){const r=n==="configured"?"Configured public URL":n==="forwarded"?"Forwarded public URL":"Needs public URL",s=n==="request",a=s?"Set GITHUB_AGENT_BRIDGE_DASHBOARD_PUBLIC_URL or forward X-Forwarded-* headers":e,o=s?"Public dashboard URL required before connecting remote agents":t,u=`{ + "mcpServers": { + "github-agent-bridge": { + "url": "${s?"https://bridge.example.com/api/mcp":t}", + "headers": { + "Authorization": "Bearer \${GITHUB_AGENT_BRIDGE_MCP_TOKEN}" + } + } + } +}`;return i.jsxs(fe,{title:"Connect an agent",children:[s?i.jsx(Ne,{tone:"warning",text:"Set GITHUB_AGENT_BRIDGE_DASHBOARD_PUBLIC_URL, or forward X-Forwarded-* headers from the proxy, before connecting remote agents."}):null,i.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]",children:[i.jsxs("div",{className:"grid min-w-0 gap-3",children:[i.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-3",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm font-semibold",children:[i.jsx(Gt,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"Public dashboard URL",i.jsx("span",{className:"rounded-sm border border-border bg-slate-50 px-1.5 py-0.5 font-mono text-[11px] font-normal text-muted",children:r})]}),i.jsx("p",{className:"mt-1 text-xs text-muted",children:"Share this page URL with bridge admins only after it resolves to the external dashboard origin."}),i.jsx("pre",{className:"mt-3 overflow-auto rounded-md bg-slate-950 px-3 py-2 font-mono text-xs text-slate-100",children:a})]}),i.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[i.jsx(Gt,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"HTTP MCP endpoint"]}),i.jsx("p",{className:"mt-1 text-xs text-muted",children:"Remote agents connect directly with a bearer token; no local `gab` binary is required on the agent host."}),i.jsx("pre",{className:"mt-3 overflow-auto rounded-md bg-slate-950 px-3 py-2 font-mono text-xs text-slate-100",children:o})]})]}),i.jsxs("div",{className:"grid min-w-0 gap-3",children:[i.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[i.jsx(Tr,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"Agent config"]}),i.jsx("p",{className:"mt-1 text-xs text-muted",children:"Create a token below, then store the one-time secret as `GITHUB_AGENT_BRIDGE_MCP_TOKEN` for the agent."}),i.jsx("pre",{className:"mt-3 max-h-64 overflow-auto rounded-md bg-slate-950 px-3 py-2 font-mono text-xs leading-relaxed text-slate-100",children:u})]}),i.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[i.jsx(Hi,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"Agent prompt"]}),i.jsx("p",{className:"mt-1 text-xs text-muted",children:"Ask the agent to use the read-only bridge knowledge server before acting on repository work."}),i.jsx("pre",{className:"mt-3 max-h-40 overflow-auto rounded-md bg-slate-950 px-3 py-2 font-mono text-xs leading-relaxed text-slate-100",children:"Use the github-agent-bridge MCP server for repository knowledge. Query list_repositories and list_knowledge before making repository decisions."})]})]})]})]})}function zl({icon:e,title:t,subtitle:n,action:r}){return i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("h2",{className:"flex items-center gap-2 text-base font-semibold",children:[e,t]}),i.jsx("p",{className:"text-xs text-muted",children:n})]}),r]})}function ox({tokens:e,loading:t,now:n,ownerOptions:r,canManageOwners:s,revokingId:a,updatingOwnerId:o,onUpdateOwner:l,onRevoke:u}){return t&&e.length===0?i.jsx(Z,{text:"Loading MCP tokens..."}):e.length===0?i.jsx(Z,{text:"No active MCP tokens."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"grid gap-2 md:hidden",children:e.map(c=>i.jsxs("article",{className:"grid min-w-0 gap-3 rounded-md border border-border bg-white p-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h3",{className:"break-words text-sm font-semibold [overflow-wrap:anywhere]",children:c.name}),i.jsx("div",{className:"mt-1 break-all font-mono text-xs text-muted",children:c.id}),s?i.jsx(so,{token:c,ownerOptions:r,disabled:o===c.id,onUpdateOwner:l}):c.user_login?i.jsxs("div",{className:"mt-1 text-xs text-muted",children:["Owner: @",c.user_login]}):null]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[i.jsx(J,{label:"Created",value:i.jsx(Ie,{value:c.created_at,relative:!0,now:n})}),i.jsx(J,{label:"Last used",value:c.last_used_at?i.jsx(Ie,{value:c.last_used_at,relative:!0,now:n}):"never"})]}),i.jsxs("button",{className:"inline-flex h-8 items-center justify-center gap-2 rounded-md border border-red-200 px-3 text-sm font-semibold text-red-700 hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:a===c.id,onClick:()=>u(c.id),children:[i.jsx(ki,{className:"h-4 w-4","aria-hidden":!0}),a===c.id?"Revoking...":"Revoke"]})]},c.id))}),i.jsx("div",{className:"hidden overflow-auto rounded-md border border-border md:block",children:i.jsxs("table",{className:"min-w-full border-collapse text-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-border bg-slate-50 text-left text-xs text-muted",children:[i.jsx("th",{className:"px-3 py-2 font-semibold",children:"Name"}),i.jsx("th",{className:"px-3 py-2 font-semibold",children:"Owner"}),i.jsx("th",{className:"px-3 py-2 font-semibold",children:"Created"}),i.jsx("th",{className:"px-3 py-2 font-semibold",children:"Last used"}),i.jsx("th",{className:"px-3 py-2 font-semibold",children:"ID"}),i.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Actions"})]})}),i.jsx("tbody",{children:e.map(c=>i.jsxs("tr",{className:"border-b border-border last:border-b-0",children:[i.jsx("td",{className:"px-3 py-3 font-semibold",children:c.name}),i.jsx("td",{className:"px-3 py-3 text-xs text-muted",children:s?i.jsx(so,{token:c,ownerOptions:r,disabled:o===c.id,onUpdateOwner:l}):c.user_login?`@${c.user_login}`:"unassigned"}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs",children:i.jsx(Ie,{value:c.created_at,relative:!0,now:n})}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs",children:c.last_used_at?i.jsx(Ie,{value:c.last_used_at,relative:!0,now:n}):"never"}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs text-muted",children:c.id}),i.jsx("td",{className:"px-3 py-3 text-right",children:i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-red-200 px-3 text-sm font-semibold text-red-700 hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:a===c.id,onClick:()=>u(c.id),children:[i.jsx(ki,{className:"h-4 w-4","aria-hidden":!0}),a===c.id?"Revoking...":"Revoke"]})})]},c.id))})]})})]})}function so({token:e,ownerOptions:t,disabled:n,onUpdateOwner:r}){const s=e.user_login??"";return i.jsx(ql,{ariaLabel:`Owner for ${e.name}`,value:s,ownerOptions:t,disabled:n||t.length===0,emptyLabel:"Select owner",size:"compact",onChange:a=>{!a||a===e.user_login||r(e.id,a)}})}function ql({value:e,ownerOptions:t,disabled:n,onChange:r,ariaLabel:s,selectedSuffix:a,emptyLabel:o,size:l="default"}){const u=t.find(d=>d.login===e),c=u?`@${u.login}${(a==null?void 0:a(u))??""}`:o;return i.jsxs("div",{className:V("relative flex min-w-0 items-center gap-2 rounded-md border border-border bg-panel text-foreground focus-within:border-primary focus-within:ring-1 focus-within:ring-primary",n?"opacity-60":"",l==="compact"?"h-8 w-44 max-w-full px-2":"h-9 w-full px-2.5"),children:[i.jsx("span",{className:V("pointer-events-none flex shrink-0 items-center justify-center",l==="compact"?"h-5 w-5":"h-6 w-6"),children:u!=null&&u.avatar_url?i.jsx("img",{className:"h-full w-full rounded-full bg-slate-100",src:Ze(u.avatar_url),alt:"",referrerPolicy:"no-referrer"}):i.jsx(Wn,{className:V("text-muted",l==="compact"?"h-4 w-4":"h-5 w-5"),"aria-hidden":!0})}),i.jsx("span",{className:V("pointer-events-none min-w-0 flex-1 truncate font-mono",u?"text-foreground":"text-muted",l==="compact"?"text-xs":"text-sm"),children:c}),i.jsxs("select",{className:"absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed","aria-label":s,value:e,disabled:n,onChange:d=>r(d.target.value),children:[t.length===0||!e?i.jsx("option",{value:"",children:o}):null,t.map(d=>i.jsxs("option",{value:d.login,children:["@",d.login,(a==null?void 0:a(d))??""]},d.login))]}),i.jsx(yn,{className:V("pointer-events-none shrink-0 text-muted",l==="compact"?"h-3.5 w-3.5":"h-4 w-4"),"aria-hidden":!0})]})}function Xn({urls:e,compact:t=!1}){const n=t?e.slice(0,2):e,r=e.length-n.length;return i.jsxs("div",{className:"flex min-w-0 max-w-full flex-wrap gap-1.5",children:[n.map(s=>i.jsxs("a",{className:V("inline-flex max-w-full items-center gap-1 rounded-md border border-border font-semibold text-primary hover:bg-white hover:underline",t?"h-7 px-2 text-xs":"min-h-7 px-2 py-1 text-xs"),href:Ze(s),"aria-label":s,rel:"noreferrer",target:"_blank",children:[i.jsx(Gt,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),i.jsx("span",{className:"truncate",children:t?lx(s):s})]},s)),r>0?i.jsxs("span",{className:"inline-flex h-7 items-center rounded-md border border-border px-2 font-mono text-xs text-muted",children:["+",r]}):null]})}function lx(e){try{const t=new URL(e);return t.pathname.replace(/^\//,"")+t.hash}catch{return e}}function Bl({scope:e,type:t,confidence:n,status:r,timestamp:s,now:a}){return i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-muted",children:[i.jsx("span",{className:"truncate font-mono font-semibold text-foreground",children:Dl(e)}),i.jsx("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono",children:t}),i.jsxs("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono",children:[Math.round(n*100),"%"]}),i.jsx("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono",children:r}),i.jsx("span",{className:"font-mono",children:i.jsx(Ie,{value:s,relative:!0,now:a})})]})}function ux({user:e,loading:t}){const n=e!=null&&e.login?`@${e.login}`:t?"Loading profile...":"GitHub OAuth",r=e!=null&&e.is_admin?"admin":"read-only",s=e!=null&&e.avatar_url?i.jsx("img",{className:"h-10 w-10 rounded-full border border-slate-700 bg-slate-800",src:e.avatar_url,alt:e.login?`${e.login} avatar`:"",referrerPolicy:"no-referrer"}):i.jsx("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-full border border-slate-700 bg-slate-900",children:i.jsx(Wn,{className:"h-5 w-5","aria-hidden":!0})}),a=e!=null&&e.html_url?i.jsx("a",{className:"truncate font-semibold text-white hover:underline",href:Ze(e.html_url),rel:"noreferrer",target:"_blank",children:n}):i.jsx("div",{className:"truncate font-semibold text-white",children:n});return i.jsxs("div",{className:"flex max-w-full shrink-0 items-center gap-3 text-sm text-slate-300","aria-label":e!=null&&e.login?`Signed in as ${e.login}`:"Dashboard account",children:[i.jsx(Ko,{className:"hidden h-4 w-4 shrink-0 sm:block","aria-hidden":!0}),i.jsxs("div",{className:"hidden min-w-0 text-right sm:block",children:[a,i.jsxs("div",{className:"text-xs text-slate-400",children:["Signed in · ",r]})]}),s]})}function cx({config:e,loading:t,onEnable:n,onDisable:r}){const[s,a]=T.useState(!1),[o,l]=T.useState(""),u=!!(e!=null&&e.status.enabled),c=typeof navigator<"u"&&typeof window<"u"&&Rr(),d=t||s||!(e!=null&&e.configured)||!c,h=c?e!=null&&e.configured?u?"Disable notifications":"Enable notifications":"Notifications not configured":"Notifications unavailable";return i.jsx("div",{className:"relative",children:i.jsx("button",{className:V("inline-flex h-9 w-9 items-center justify-center rounded-md border text-sm font-semibold",u?"border-emerald-400 bg-emerald-50 text-emerald-700":"border-slate-700 bg-slate-900 text-slate-200",d&&"cursor-not-allowed opacity-60"),type:"button","aria-label":h,title:o||h,disabled:d,onClick:async()=>{a(!0),l("");try{u?await r():await n()}catch(m){l(m instanceof Error?m.message:String(m))}finally{a(!1)}},children:i.jsx(Uo,{className:V("h-4 w-4",s&&"animate-live-pulse"),"aria-hidden":!0})})})}function dx({notification:e,onDismiss:t,onNavigate:n}){if(!e)return null;const r=e.title||"GitHub Agent Bridge",s=e.body||e.summary||"Bridge job finished",a=e.url||e.job_url||(e.job_id?Sn(e.job_id):"/"),o=a.startsWith("/");return i.jsx("aside",{className:"fixed right-3 top-20 z-50 w-[min(calc(100vw-1.5rem),28rem)] rounded-md border border-emerald-300 bg-white shadow-xl shadow-slate-950/15","aria-live":"assertive","aria-label":"Bridge notification",children:i.jsxs("div",{className:"flex items-start gap-3 p-3",children:[i.jsx("div",{className:"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-emerald-50 text-emerald-700",children:i.jsx(Uo,{className:"h-4 w-4","aria-hidden":!0})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsx("h2",{className:"min-w-0 break-words text-sm font-semibold text-foreground",children:r}),i.jsx("button",{className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted hover:bg-slate-100 hover:text-foreground",type:"button","aria-label":"Dismiss notification",onClick:t,children:i.jsx(Jt,{className:"h-4 w-4","aria-hidden":!0})})]}),i.jsx("p",{className:"mt-1 min-w-0 break-words text-sm text-muted",children:s}),e.detail?i.jsx("p",{className:"mt-1 line-clamp-2 min-w-0 break-words text-xs text-muted",children:e.detail}):null,i.jsxs("button",{className:"mt-3 inline-flex h-8 items-center gap-1.5 rounded-md border border-border px-2.5 text-xs font-semibold text-foreground hover:bg-slate-50",type:"button",onClick:()=>{t(),o?n(a):window.open(Ze(a),"_blank","noopener,noreferrer")},children:[i.jsx(Gt,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Open"]})]})]})})}function hx({count:e,limit:t,loading:n,onRefresh:r}){return i.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-lg border border-border bg-white px-3 py-3 shadow-sm md:px-4",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-base font-semibold",children:"Jobs"}),i.jsx("p",{className:"text-xs text-muted",children:n?"Refreshing latest jobs...":`Showing ${e} of the latest ${t} requested jobs`})]}),i.jsx(lt,{onClick:r,compactOnMobile:!0})]})}function fe({title:e,action:t,children:n,className:r,flushHeader:s=!1}){return i.jsxs("section",{className:V("min-w-0 rounded-lg border border-border bg-panel p-4 shadow-sm",r),children:[i.jsxs("div",{className:V("flex flex-wrap items-center justify-between gap-3",!s&&"mb-4"),children:[i.jsx("h2",{className:"text-sm font-semibold",children:e}),t]}),n]})}function _e({title:e,value:t,icon:n}){return i.jsxs("div",{className:"rounded-lg border border-border bg-panel p-3 shadow-sm md:p-4",children:[i.jsxs("div",{className:"flex items-center justify-between text-muted",children:[i.jsx("span",{className:"text-sm font-medium",children:e}),n]}),i.jsx("strong",{className:"mt-3 block text-2xl leading-none md:mt-4 md:text-3xl",children:t})]})}function px({filters:e,actorOptions:t,onChange:n}){const[r,s]=T.useState(e);T.useEffect(()=>s(e),[e]);const a=Df(e),o=io(e)||io(r),l=()=>{s(Mi),n(Mi)};return i.jsxs("details",{className:"my-3 rounded-md border border-border bg-slate-50/70",children:[i.jsxs("summary",{className:"grid cursor-pointer list-none grid-cols-[minmax(0,1fr)_auto] items-center gap-3 px-3 py-2 text-sm font-semibold marker:hidden",children:[i.jsxs("span",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[i.jsxs("span",{className:"inline-flex shrink-0 items-center gap-2",children:[i.jsx(tc,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"Filters"]}),a.length>0?i.jsx("span",{className:"flex min-w-0 flex-wrap items-center gap-1.5","aria-label":"Applied filters",children:a.map(u=>i.jsxs("span",{className:"inline-flex max-w-full items-center gap-1 rounded-full border border-blue-200 bg-blue-50 px-2 py-0.5 text-xs font-semibold text-blue-700",children:[i.jsx("span",{className:"text-blue-700/70",children:u.label}),i.jsx("span",{className:"max-w-40 truncate font-mono",children:u.value.trim()})]},u.key))}):null]}),i.jsxs("span",{className:"inline-flex shrink-0 items-center gap-2",children:[o?i.jsxs("button",{className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-md border border-border bg-white px-2.5 text-xs font-semibold text-foreground hover:bg-slate-50",type:"button",onClick:u=>{u.preventDefault(),u.stopPropagation(),l()},children:[i.jsx(Gn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Clear filters"]}):null,i.jsx(yn,{className:"h-4 w-4 text-muted","aria-hidden":!0})]})]}),i.jsxs("form",{className:"grid gap-3 border-t border-border bg-white p-3 md:grid-cols-3 xl:grid-cols-9",onSubmit:u=>{u.preventDefault(),n(r)},children:[i.jsx(Ye,{label:"Status",children:i.jsxs("select",{className:"control",value:r.status,onChange:u=>s({...r,status:u.target.value}),children:[i.jsx("option",{value:"",children:"All"}),i.jsx("option",{value:"pending",children:"pending"}),i.jsx("option",{value:"running",children:"running"}),i.jsx("option",{value:"blocked",children:"blocked"}),i.jsx("option",{value:"done",children:"done"}),i.jsx("option",{value:"denied",children:"denied"}),i.jsx("option",{value:"waiting_approval",children:"waiting_approval"})]})}),i.jsx(Ye,{label:"Repository",children:i.jsx("input",{className:"control",value:r.repo,placeholder:"owner/repo",onChange:u=>s({...r,repo:u.target.value})})}),i.jsx(Ye,{label:"Thread",children:i.jsx("input",{className:"control",value:r.thread,inputMode:"numeric",placeholder:"issue or PR",onChange:u=>s({...r,thread:u.target.value})})}),i.jsx(Ye,{label:"Action",children:i.jsx("input",{className:"control",value:r.action,placeholder:"reply_comment",onChange:u=>s({...r,action:u.target.value})})}),i.jsx(Ye,{label:"Actor",className:"xl:col-span-2",children:i.jsx(mx,{value:r.actor,options:t,onChange:u=>s({...r,actor:u})})}),i.jsx(Ye,{label:"Intent",children:i.jsxs("select",{className:"control",value:r.intent,onChange:u=>s({...r,intent:u.target.value}),children:[i.jsx("option",{value:"",children:"All"}),i.jsx("option",{value:"review_only",children:"review_only"}),i.jsx("option",{value:"work_allowed",children:"work_allowed"})]})}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 self-end xl:col-span-2",children:[i.jsxs("button",{className:"inline-flex h-9 items-center justify-center gap-2 rounded-md border border-border px-3 text-sm font-semibold text-foreground hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-white",type:"button",disabled:!o,onClick:l,children:[i.jsx(Gn,{className:"h-4 w-4","aria-hidden":!0}),"Clear"]}),i.jsxs("button",{className:"inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary px-3 text-sm font-semibold text-white",type:"submit",children:[i.jsx(sc,{className:"h-4 w-4","aria-hidden":!0}),"Apply"]})]})]})]})}function mx({value:e,options:t,onChange:n}){const[r,s]=T.useState(!1),a=e.trim().replace(/^@/,"").toLowerCase(),o=t.filter(u=>!a||u.login.toLowerCase().includes(a)).slice(0,8),l=t.find(u=>u.login.toLowerCase()===a);return i.jsxs("div",{className:"relative min-w-0",children:[i.jsxs("div",{className:"control flex items-center gap-2 px-2",children:[l?i.jsx("img",{className:"h-5 w-5 shrink-0 rounded-full bg-slate-100",src:Ze(l.avatar_url??""),alt:`${l.login} avatar`,referrerPolicy:"no-referrer"}):i.jsx(Wn,{className:"h-4 w-4 shrink-0 text-muted","aria-hidden":!0}),i.jsx("input",{className:"min-w-0 flex-1 bg-transparent font-mono text-sm outline-none",value:e,placeholder:"@login",onChange:u=>{n(u.target.value),s(!0)},onFocus:()=>s(!0),onBlur:()=>window.setTimeout(()=>s(!1),100)}),e?i.jsx("button",{className:"rounded-sm p-1 text-muted hover:bg-slate-100",type:"button","aria-label":"Clear actor filter",onClick:()=>n(""),children:i.jsx(Jt,{className:"h-3.5 w-3.5","aria-hidden":!0})}):null]}),r&&o.length>0?i.jsx("div",{className:"absolute left-0 right-0 z-20 mt-1 max-h-72 overflow-auto rounded-md border border-border bg-white p-1 shadow-lg",children:o.map(u=>i.jsxs("button",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left hover:bg-slate-50",type:"button",onMouseDown:c=>c.preventDefault(),onClick:()=>{n(u.login),s(!1)},children:[u.avatar_url?i.jsx("img",{className:"h-6 w-6 shrink-0 rounded-full bg-slate-100",src:Ze(u.avatar_url),alt:`${u.login} avatar`,referrerPolicy:"no-referrer"}):i.jsx(Wn,{className:"h-5 w-5 shrink-0 text-muted","aria-hidden":!0}),i.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:["@",u.login]}),i.jsx("span",{className:"shrink-0 rounded-full bg-slate-100 px-1.5 py-0.5 text-[10px] font-semibold text-muted",children:u.job_count})]},u.login))}):null]})}function Ye({label:e,children:t,className:n}){return i.jsxs("label",{className:V("grid min-w-0 gap-1 text-xs font-semibold text-muted",n),children:[e,t]})}function fx({jobs:e,loading:t,loadingMore:n=!1,hasMore:r=!1,onLoadMore:s,onViewJob:a,now:o,user:l,onRetry:u,onDismiss:c,onCancel:d}){const[h,m]=T.useState(null),[p,y]=T.useState(null),[w,j]=T.useState(null),b=T.useRef(!1),S=T.useRef(n),_=!!(l!=null&&l.is_admin&&u),N=!!(l!=null&&l.is_admin&&c);T.useEffect(()=>{S.current&&!n&&(b.current=!1),S.current=n},[n]);const q=T.useCallback(()=>{b.current||(b.current=!0,s==null||s())},[s]),k=T.useCallback(async v=>{if(u){m(v);try{await u(v)}finally{m(null)}}},[u]),B=T.useCallback(async v=>{if(c){y(v);try{await c(v)}finally{y(null)}}},[c]),M=T.useCallback(async(v,F)=>{if(d){j(v);try{await d(v,F)}finally{j(null)}}},[d]);return t&&e.length===0?i.jsx(Z,{text:"Loading jobs..."}):e.length===0?i.jsx(Z,{text:"No jobs match the current filters."}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid gap-2 md:hidden",children:[e.map(v=>i.jsx(bx,{job:v,onViewJob:a,now:o,canRetry:_&&zn(v.status),retrying:h===v.id,onRetry:k,canDismiss:N&&zn(v.status),dismissing:p===v.id,onDismiss:B,canCancel:!!(d&&Oi(v,l)),cancelling:w===v.id,onCancel:M},v.id)),i.jsx(gx,{hasMore:r,loading:n,onLoadMore:q})]}),i.jsx(Di,{noun:"jobs",hasMore:r,loading:n,onLoadMore:q,className:"hidden md:block",children:i.jsxs("table",{className:"min-w-[1080px] table-fixed border-collapse text-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"sticky top-0 z-10 border-b border-border bg-panel text-left text-xs text-muted",children:[i.jsx("th",{className:"w-[42%] px-3 py-2 font-semibold",children:"Job"}),i.jsx("th",{className:"w-32 px-3 py-2 font-semibold",children:"Status"}),i.jsx("th",{className:"w-40 px-3 py-2 font-semibold",children:"Action"}),i.jsx("th",{className:"w-36 px-3 py-2 font-semibold",children:"Actor"}),i.jsx("th",{className:"w-36 px-3 py-2 font-semibold",children:"Timing"}),i.jsx("th",{className:"w-28 px-3 py-2 font-semibold",children:"Updated"}),i.jsx("th",{className:"w-24 px-3 py-2 text-right font-semibold",children:"Actions"})]})}),i.jsx("tbody",{children:e.map(v=>i.jsx(xx,{job:v,now:o,onViewJob:a,canRetry:_&&zn(v.status),retrying:h===v.id,onRetry:k,canDismiss:N&&zn(v.status),dismissing:p===v.id,onDismiss:B,canCancel:!!(d&&Oi(v,l)),cancelling:w===v.id,onCancel:M},v.id))})]})})]})}function xx({job:e,now:t,onViewJob:n,canRetry:r,retrying:s,onRetry:a,canDismiss:o,dismissing:l,onDismiss:u,canCancel:c,cancelling:d,onCancel:h}){return i.jsxs("tr",{className:"cursor-pointer border-b border-border align-top hover:bg-slate-50",onClick:()=>n(e.id),children:[i.jsx("td",{className:"min-w-0 px-3 py-3",children:i.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[i.jsxs("span",{className:"mt-0.5 shrink-0 font-mono text-xs font-semibold text-muted",children:["#",e.id]}),i.jsxs("div",{className:"min-w-0 space-y-1",children:[i.jsx("div",{className:"line-clamp-2 text-sm font-semibold leading-snug text-foreground [overflow-wrap:anywhere]",title:e.subject,children:e.subject}),i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted",children:[i.jsx("span",{className:"min-w-0 max-w-full truncate font-mono",children:e.repo??e.work_key}),i.jsxs("span",{className:"shrink-0",children:["thread ",e.thread??"n/a"]})]})]})]})}),i.jsx("td",{className:"px-3 py-3",children:i.jsx(us,{status:e.status})}),i.jsxs("td",{className:"px-3 py-3",children:[i.jsx("div",{className:"min-w-0 truncate text-sm text-foreground",title:e.action,children:e.action}),i.jsx("div",{className:"mt-1",children:i.jsx(ls,{intent:e.intent,actionMode:e.action_mode,display:"intent",compact:!0})})]}),i.jsx("td",{className:"px-3 py-3",children:i.jsx(Cn,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url})}),i.jsxs("td",{className:"px-3 py-3 text-xs text-muted",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("span",{children:"wait"}),i.jsx("span",{className:"font-mono text-foreground",children:Qe(os(e,t))})]}),i.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[i.jsx("span",{children:"run"}),i.jsx("span",{className:"font-mono text-foreground",children:Qe(as(e,t))})]}),i.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[i.jsx("span",{children:"tries"}),i.jsx("span",{className:"font-mono text-foreground",children:e.attempts})]})]}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs",children:i.jsx(Ie,{value:e.updated_at,compact:!0,relative:!0,now:t})}),i.jsx("td",{className:"px-3 py-3 text-right",children:i.jsxs("div",{className:"inline-flex items-center gap-1",children:[i.jsx(Ul,{jobId:e.id,canRetry:r,retrying:s,onRetry:a,compact:!0}),i.jsx($l,{jobId:e.id,canDismiss:o,dismissing:l,onDismiss:u,compact:!0}),i.jsx(Hl,{jobId:e.id,canCancel:c,cancelling:d,onCancel:h,compact:!0})]})})]})}function gx({hasMore:e,loading:t,onLoadMore:n}){return!e&&!t?null:i.jsxs("button",{className:"inline-flex min-h-10 w-full items-center justify-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-semibold text-foreground hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-60 md:hidden",type:"button",disabled:t||!e,onClick:()=>n==null?void 0:n(),children:[i.jsx(yn,{className:"h-4 w-4","aria-hidden":!0}),t?"Loading more jobs...":"Load more jobs"]})}function bx({job:e,onViewJob:t,now:n,canRetry:r,retrying:s,onRetry:a,canDismiss:o,dismissing:l,onDismiss:u,canCancel:c,cancelling:d,onCancel:h}){return i.jsxs("article",{className:"rounded-md border border-border bg-white shadow-[0_1px_0_rgba(15,23,42,0.03)]",children:[i.jsxs("button",{className:"grid w-full gap-2 p-3 text-left hover:bg-slate-50",type:"button",onClick:()=>t(e.id),children:[i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"min-w-0 space-y-1",children:[i.jsxs("div",{className:"grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-2",children:[i.jsxs("span",{className:"shrink-0 font-mono text-xs font-semibold text-muted",children:["#",e.id]}),i.jsx("span",{className:"truncate font-mono text-sm",children:e.repo??e.work_key})]}),i.jsx("div",{className:"line-clamp-2 text-sm leading-snug text-foreground",children:e.subject}),i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted",children:[i.jsxs("span",{children:["thread ",e.thread??"n/a"," · ",e.action]}),i.jsx(ls,{intent:e.intent,actionMode:e.action_mode,compact:!0,display:"intent"}),i.jsx(Cn,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url})]})]}),i.jsx(us,{status:e.status})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[i.jsx(J,{label:"Wait",value:Qe(os(e,n))}),i.jsx(J,{label:"Runtime",value:Qe(as(e,n))}),i.jsx(J,{label:"Updated",value:i.jsx(Ie,{value:e.updated_at,compact:!0,relative:!0,now:n})})]})]}),r||o||c?i.jsxs("div",{className:"flex flex-wrap gap-2 border-t border-border px-3 py-2",children:[i.jsx(Ul,{jobId:e.id,canRetry:r,retrying:s,onRetry:a}),i.jsx($l,{jobId:e.id,canDismiss:o,dismissing:l,onDismiss:u}),i.jsx(Hl,{jobId:e.id,canCancel:c,cancelling:d,onCancel:h})]}):null]})}function Ul({jobId:e,canRetry:t,retrying:n,onRetry:r,compact:s=!1}){if(!t)return null;const a=n?"Retrying...":"Retry";return i.jsxs("button",{className:V("inline-flex h-8 items-center justify-center gap-2 rounded-md border border-border text-sm font-semibold text-foreground hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-60",s?"w-8 px-0":"px-3"),type:"button",disabled:n,"aria-label":`Retry job #${e}`,title:`Retry job #${e}`,onClick:async o=>{o.stopPropagation(),window.confirm(`Retry job #${e}?`)&&await r(e)},children:[i.jsx(Gn,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:V(s&&"sr-only"),children:a})]})}function $l({jobId:e,canDismiss:t,dismissing:n,onDismiss:r,compact:s=!1}){if(!t)return null;const a=n?"Dismissing...":"Dismiss";return i.jsxs("button",{className:V("inline-flex h-8 items-center justify-center gap-2 rounded-md border border-border text-sm font-semibold text-foreground hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-60",s?"w-8 px-0":"px-3"),type:"button",disabled:n,"aria-label":`Dismiss job #${e}`,title:`Dismiss job #${e}`,onClick:async o=>{o.stopPropagation(),window.confirm(`Dismiss job #${e}?`)&&await r(e)},children:[i.jsx(wn,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:V(s&&"sr-only"),children:a})]})}function Hl({jobId:e,canCancel:t,cancelling:n,onCancel:r,compact:s=!1}){if(!t)return null;const a=n?"Cancelling...":"Cancel";return i.jsxs("button",{className:V("inline-flex h-8 items-center justify-center gap-2 rounded-md border border-red-200 bg-red-50 text-sm font-semibold text-red-700 hover:bg-red-100 disabled:cursor-not-allowed disabled:opacity-60",s?"w-8 px-0":"px-3"),type:"button",disabled:n,"aria-label":`Cancel job #${e}`,title:`Cancel job #${e}`,onClick:async o=>{o.stopPropagation();const l=window.prompt(`Cancel job #${e}? Optional reason:`);l!==null&&await r(e,l)},children:[i.jsx(Jt,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:V(s&&"sr-only"),children:a})]})}function Cn({actor:e,avatarUrl:t,framed:n=!1}){const r=t?i.jsx("img",{className:"h-4 w-4 shrink-0 rounded-full bg-slate-100",src:Ze(t),alt:e?`${e} avatar`:"",referrerPolicy:"no-referrer"}):i.jsx(Wn,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),s=i.jsxs(i.Fragment,{children:[r,i.jsx("span",{className:"min-w-0 truncate",children:e?`@${e}`:"unknown actor"})]});return n?i.jsx("span",{className:"inline-flex h-7 max-w-full items-center gap-1 rounded-md border border-border px-2 text-xs font-semibold text-muted",children:s}):i.jsx("span",{className:"inline-flex min-w-0 max-w-full items-center gap-1 font-mono text-xs text-muted",children:s})}function yx(e){return(e==null?void 0:e.model)??"OpenClaw default"}function wx(e){return(e==null?void 0:e.thinking)??"OpenClaw default"}function vx(e){return e?e.configured?"configured":e.summary:"n/a"}function jx(e,t){const n=t||(e==="work_allowed"?"fix_allowed":"review_only");return n==="fix_allowed"||!t&&e==="work_allowed"?{mode:n,intentLabel:"work_allowed",title:"Work allowed"}:{mode:n,intentLabel:"review_only",title:"Review only"}}function ls({intent:e,actionMode:t,compact:n=!1,display:r="mode"}){const s=jx(e,t),a=s.intentLabel==="work_allowed"?oc:Ho,o=r==="intent"?s.intentLabel:s.mode;return i.jsxs("span",{className:V("inline-flex min-h-6 max-w-full items-center gap-1.5 rounded-md border px-2 text-xs font-semibold",s.intentLabel==="work_allowed"?"border-blue-200 bg-blue-50 text-blue-700":"border-violet-200 bg-violet-50 text-violet-700",n&&"min-h-5 px-1.5 text-[11px]"),title:`${s.title}: ${s.mode}`,"aria-label":`${s.title}: ${o}`,children:[i.jsx(a,{className:V("h-3.5 w-3.5 shrink-0",n&&"h-3 w-3"),"aria-hidden":!0}),i.jsx("span",{className:"truncate font-mono",children:o})]})}function kx({job:e,session:t,sessionEvents:n,transcript:r,now:s,compact:a=!1}){var p;const o=Sn(e.id),l=n??[],u=r??[],c=gf(l),d=bf(u),h=as(e,s),m=os(e,s);return i.jsxs("div",{className:"grid min-w-0 gap-4",children:[i.jsxs("div",{className:"sticky top-0 z-20 -mx-3 -mt-3 grid gap-2 border-b border-border bg-panel/95 px-3 py-2 shadow-sm backdrop-blur sm:-mx-4 sm:-mt-4 sm:px-4","aria-label":"Sticky job header",children:[i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[i.jsx(us,{status:e.status}),i.jsxs("a",{className:"inline-flex h-7 items-center gap-1 rounded-md border border-border bg-white px-2 text-xs font-semibold text-foreground hover:bg-slate-50",href:o,children:[i.jsx(vn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",e.id]}),i.jsx(Cn,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url,framed:!0}),i.jsx("span",{className:"min-w-0 break-words font-mono text-xs text-muted [overflow-wrap:anywhere]",children:e.work_key})]}),i.jsxs("div",{className:"grid min-w-0 gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(280px,auto)] lg:items-start",children:[i.jsx("p",{className:"min-w-0 break-words text-sm text-muted [overflow-wrap:anywhere]",children:e.subject}),i.jsxs("div",{className:"grid min-w-0 gap-1",children:[i.jsx("h3",{className:"text-xs font-semibold text-muted",children:"GitHub links"}),e.github_urls.length>0?i.jsx(Xn,{urls:e.github_urls,compact:!0}):i.jsx("p",{className:"text-xs text-muted",children:"No links recorded."})]})]})]}),i.jsxs("div",{className:V("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-3"),children:[i.jsx(J,{label:"Queue wait",value:Qe(m)}),i.jsx(J,{label:e.status==="running"?"Running for":"Runtime",value:Qe(h)}),i.jsx(J,{label:"Coalesced",value:String(e.coalesced_count)})]}),e.queue_state==="serialized_by_work_key"?i.jsxs("p",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900",children:["Serialized behind running job #",e.blocked_by_job_id," for this work key."]}):null,i.jsxs("div",{className:V("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-3"),children:[i.jsx(J,{label:"Model",value:yx(e.model_route)}),i.jsx(J,{label:"Reasoning",value:wx(e.model_route)}),i.jsx(J,{label:"Route",value:vx(e.model_route)})]}),i.jsx(Nx,{job:e,compact:a}),i.jsxs("div",{className:V("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-2 xl:grid-cols-4"),children:[i.jsx(J,{label:"Created",value:i.jsx(Ie,{value:e.created_at,compact:!0,relative:!0,now:s})}),i.jsx(J,{label:"Started",value:e.started_at?i.jsx(Ie,{value:e.started_at,compact:!0,relative:!0,now:s}):"n/a"}),i.jsx(J,{label:"Updated",value:i.jsx(Ie,{value:e.updated_at,compact:!0,relative:!0,now:s})}),i.jsx(J,{label:"Finished",value:e.finished_at?i.jsx(Ie,{value:e.finished_at,compact:!0,relative:!0,now:s}):"n/a"})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Timeline"}),i.jsx("div",{className:"grid min-w-0 gap-3",children:(e.worklog??[]).length>0?(p=e.worklog)==null?void 0:p.map(y=>i.jsxs("div",{className:"min-w-0 border-l-2 border-primary pl-3",children:[i.jsx("div",{className:"text-sm font-semibold",children:y.phase}),i.jsx("div",{className:"font-mono text-xs text-muted",children:i.jsx(Ie,{value:y.ts,relative:!0,now:s})}),i.jsx("div",{className:"break-words text-sm [overflow-wrap:anywhere]",children:y.summary}),y.detail?i.jsx("div",{className:"mt-1 break-words font-mono text-xs text-muted [overflow-wrap:anywhere]",children:y.detail}):null]},y.id)):i.jsx(Z,{text:"No worklog entries."})})]}),i.jsxs("div",{children:[i.jsxs("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[i.jsx(Qo,{className:"h-4 w-4","aria-hidden":!0}),"OpenClaw session"]}),t?i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[i.jsx(J,{label:"Session ID",value:t.id}),i.jsx(J,{label:"Source",value:t.source})]}),i.jsx("p",{className:"break-words text-xs text-muted [overflow-wrap:anywhere]",children:t.detail})]}):i.jsx(Z,{text:"Session correlation is loading."})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Agent activity"}),i.jsx("div",{className:"grid max-h-[460px] min-w-0 gap-2 overflow-auto pr-1",children:c.length>0?c.map((y,w)=>i.jsx(Cx,{event:y,defaultOpen:no(y.eventType,e.status==="running",w,c.length),now:s},y.id)):i.jsx(Z,{text:e.status==="running"?"Waiting for live agent output...":"No agent activity has been recorded for this session."})})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Session transcript"}),i.jsx("div",{className:"grid max-h-[620px] min-w-0 gap-2 overflow-auto pr-1",children:d.length>0?d.map((y,w)=>i.jsx(Sx,{entry:y,defaultOpen:no(y.kind,e.status==="running",w,d.length),now:s},y.id)):i.jsx(Z,{text:e.status==="running"?"Waiting for live transcript entries...":"No OpenClaw transcript entries are available for this session."})})]})]})}function Nx({job:e,compact:t=!1}){const n=e.intent_classifier??null,r=(n==null?void 0:n.llm)??{},s=(n==null?void 0:n.parser)??{},a=typeof r.confidence=="number"?`${Math.round(r.confidence*100)}%`:"n/a";return i.jsxs("div",{className:"grid gap-2",children:[i.jsx("h3",{className:"text-sm font-semibold",children:"Action mode"}),i.jsxs("div",{className:V("grid gap-2 text-sm sm:gap-3",t?"grid-cols-1":"grid-cols-2 xl:grid-cols-4"),children:[i.jsx(J,{label:"Mode",value:i.jsx(ls,{intent:e.intent,actionMode:e.action_mode})}),i.jsx(J,{label:"Intent",value:e.intent}),i.jsx(J,{label:"Addressed",value:n?ao(r.addressed_to_agent):"n/a"}),i.jsx(J,{label:"Write",value:n?r.write_permission??"none":e.intent==="work_allowed"?"allowed":"none"})]}),n?i.jsxs("div",{className:"grid gap-2 rounded-md border border-border bg-panel p-3 text-xs",children:[i.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4",children:[i.jsx(nt,{label:"Classifier",value:n.enabled?"enabled":"disabled"}),i.jsx(nt,{label:"Applied",value:ao(r.applied)}),i.jsx(nt,{label:"Confidence",value:a}),i.jsx(nt,{label:"Parser",value:`${s.action??"n/a"} / ${s.work_intent??"n/a"}`})]}),i.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[i.jsx(nt,{label:"LLM",value:`${r.action??"n/a"} / ${r.work_intent??"n/a"}`}),i.jsx(nt,{label:"Scope",value:r.scope||"n/a"})]}),r.main_request?i.jsx(nt,{label:"Main request",value:r.main_request}):null,r.subordinate_reason?i.jsx(nt,{label:"Subordinate reason",value:r.subordinate_reason}):null,r.reason?i.jsx(nt,{label:"Reason",value:r.reason}):null,n.error?i.jsx(nt,{label:"Error",value:n.error,tone:"danger"}):null]}):i.jsx("p",{className:"text-xs text-muted",children:"No intent classifier metadata recorded for this job."})]})}function ao(e){return e===!0?"yes":e===!1?"no":"n/a"}function nt({label:e,value:t,tone:n="neutral"}){return i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted",children:e}),i.jsx("div",{className:V("mt-0.5 min-w-0 break-words font-mono text-xs [overflow-wrap:anywhere]",n==="danger"?"text-red-700":"text-foreground"),children:t})]})}function Sx({entry:e,defaultOpen:t,now:n}){return i.jsx(Kl,{badge:e.badge,meta:i.jsx(Ie,{value:e.meta,relative:!0,now:n}),count:e.count,summary:e.summary,defaultOpen:t,children:i.jsx("pre",{className:"max-h-72 max-w-full overflow-auto whitespace-pre-wrap break-words rounded bg-slate-950 px-2 py-1.5 font-mono text-xs leading-relaxed text-slate-100 [overflow-wrap:anywhere]",children:e.text})})}function Cx({event:e,defaultOpen:t,now:n}){return i.jsx(Kl,{badge:e.badge,meta:i.jsx(Ie,{value:e.meta,relative:!0,now:n}),count:e.count,summary:e.summary,defaultOpen:t,children:e.detail?i.jsx("pre",{className:"max-h-56 max-w-full overflow-auto whitespace-pre-wrap break-words rounded bg-slate-950 px-2 py-1.5 font-mono text-xs leading-relaxed text-slate-100 [overflow-wrap:anywhere]",children:e.detail}):null})}function Kl({badge:e,meta:t,count:n,summary:r,defaultOpen:s,children:a}){const[o,l]=T.useState(!!s);return i.jsxs("details",{className:"group min-w-0 rounded border border-border bg-slate-50/60",open:o,onToggle:u=>l(u.currentTarget.open),children:[i.jsxs("summary",{className:"grid cursor-pointer list-none gap-1 px-2 py-1.5 marker:hidden hover:bg-white",children:[i.jsxs("div",{className:"grid min-w-0 gap-1 sm:flex sm:items-center sm:justify-between sm:gap-2",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[i.jsx(yn,{className:"h-3.5 w-3.5 shrink-0 text-muted transition-transform group-open:rotate-180","aria-hidden":!0}),i.jsx("span",{className:"truncate font-mono text-[11px] font-semibold text-muted",children:e}),n&&n>1?i.jsx("span",{className:"rounded-sm border border-border px-1 font-mono text-[10px] text-muted",children:n}):null]}),i.jsx("span",{className:"min-w-0 truncate pl-5 font-mono text-[11px] text-muted sm:shrink-0 sm:pl-0",children:t})]}),i.jsx("div",{className:"min-w-0 break-words pl-5 text-xs text-foreground [overflow-wrap:anywhere] sm:truncate",children:r})]}),i.jsx("div",{className:"min-w-0 border-t border-border bg-white px-2 py-2",children:a})]})}function oo({label:e,values:t}){const n=[{name:"median",seconds:(t==null?void 0:t.median)??0},{name:"p90",seconds:(t==null?void 0:t.p90)??0},{name:"p99",seconds:(t==null?void 0:t.p99)??0}];return i.jsx("div",{className:"h-56",children:i.jsx(rr,{width:"100%",height:"100%",children:i.jsxs(Fr,{data:n,children:[i.jsx(ir,{strokeDasharray:"3 3"}),i.jsx(sr,{dataKey:"name"}),i.jsx(ar,{tickFormatter:Qe}),i.jsx(or,{formatter:r=>[Qe(Number(r)),e]}),i.jsx(Vt,{dataKey:"seconds",fill:"#0969da",radius:[4,4,0,0]})]})})})}function _x({values:e,loading:t,totalJobs:n}){const r=Object.entries(e??{}).map(([s,a])=>({day:s,count:a}));return t&&r.length===0?i.jsx(Z,{text:"Loading job history..."}):r.length===0?i.jsx(Z,{text:n>0?"Job history has no valid creation dates.":"No job history available."}):i.jsx("div",{className:"h-56",children:i.jsx(rr,{width:"100%",height:"100%",children:i.jsxs(Fr,{data:r,children:[i.jsx(ir,{strokeDasharray:"3 3"}),i.jsx(sr,{dataKey:"day",minTickGap:16}),i.jsx(ar,{allowDecimals:!1}),i.jsx(or,{formatter:s=>[Number(s),"jobs"]}),i.jsx(Vt,{dataKey:"count",fill:"#16a34a",radius:[4,4,0,0]})]})})})}function Ex({usage:e,loading:t,totalJobs:n}){const[r,s]=T.useState("day"),a=(e==null?void 0:e[r])??[],o=a.map(u=>({...u,label:Px(u.bucket,r)})),l=a.reduce((u,c)=>u+c.seconds,0);return t&&o.length===0?i.jsx(Z,{text:"Loading runtime usage..."}):o.length===0?i.jsx(Z,{text:n>0?"No jobs have recorded runtime yet.":"No job history available."}):i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted",children:[i.jsx(ac,{className:"h-4 w-4","aria-hidden":!0}),i.jsxs("span",{children:[Cr(l)," consumed across ",a.reduce((u,c)=>u+c.jobs,0)," job",a.reduce((u,c)=>u+c.jobs,0)===1?"":"s"]})]}),i.jsx("div",{className:"inline-flex h-8 rounded-md border border-border bg-white p-0.5","aria-label":"Runtime grouping",children:["day","month"].map(u=>i.jsx("button",{className:V("rounded px-2.5 text-xs font-semibold capitalize",r===u?"bg-primary text-white":"text-muted hover:bg-slate-50"),type:"button",onClick:()=>s(u),children:u},u))})]}),i.jsx("div",{className:"h-64",children:i.jsx(rr,{width:"100%",height:"100%",children:i.jsxs(Fr,{data:o,children:[i.jsx(ir,{strokeDasharray:"3 3"}),i.jsx(sr,{dataKey:"label",minTickGap:16,tick:{fontSize:11}}),i.jsx(ar,{tickFormatter:u=>Cr(Number(u))}),i.jsx(ko,{}),i.jsx(or,{formatter:(u,c)=>c==="Work"?[Cr(Number(u)),"work"]:c==="Review"?[Cr(Number(u)),"review"]:[Number(u),String(c)],labelFormatter:u=>String(u)}),i.jsx(Vt,{dataKey:"work_seconds",name:"Work",stackId:"runtime",fill:"#0969da",isAnimationActive:!1}),i.jsx(Vt,{dataKey:"review_seconds",name:"Review",stackId:"runtime",fill:"#8250df",radius:[4,4,0,0],isAnimationActive:!1})]})})})]})}function Px(e,t){if(t==="month"){const[a,o]=e.split("-").map(Number);return!a||!o?e:new Intl.DateTimeFormat(void 0,{month:"short",year:"numeric"}).format(new Date(a,o-1,1))}const[n,r,s]=e.split("-").map(Number);return!n||!r||!s?e:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(new Date(n,r-1,s))}function Cr(e){const t=Math.max(0,Math.round(e));if(t<60)return`${t}s`;const n=Math.round(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60),s=n%60;return s===0?`${r}h`:`${r}h ${s}m`}function lo(e){return Object.values(e).reduce((t,n)=>t+n,0)}function Rx({data:e,loading:t}){if(t&&!e)return i.jsx(Z,{text:"Loading systemd units..."});if(!e)return i.jsx(Z,{text:"No systemd snapshot available."});const n=e.units??[],r=n.filter(o=>o.active_state==="active").length,s=n.filter(o=>o.active_state==="failed"||o.result==="failed").length,a=n.filter(o=>o.kind==="timer").length;return i.jsxs("div",{className:"grid min-w-0 gap-3",children:[e.errors.length>0?i.jsx(Ne,{tone:"error",text:e.errors[0]}):null,n.length===0?i.jsx(Z,{text:"No configured bridge units found."}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[i.jsx(_r,{label:"Units",value:String(n.length)}),i.jsx(_r,{label:"Active",value:String(r)}),i.jsx(_r,{label:"Failed",value:String(s),tone:s>0?"bad":"neutral"}),i.jsx(_r,{label:"Timers",value:String(a)})]}),i.jsxs("div",{className:"overflow-hidden rounded-md border border-border bg-white",children:[i.jsxs("div",{className:"hidden grid-cols-[minmax(0,1.35fr)_90px_120px_90px_minmax(0,1fr)] gap-3 border-b border-border bg-slate-50 px-3 py-2 text-[11px] font-semibold uppercase text-muted md:grid",children:[i.jsx("span",{children:"Unit"}),i.jsx("span",{children:"Status"}),i.jsx("span",{children:"State"}),i.jsx("span",{children:"PID"}),i.jsx("span",{children:"Schedule"})]}),i.jsx("div",{className:"divide-y divide-border",children:n.map(o=>i.jsx(Ix,{unit:o},o.unit))})]})]})]})}function _r({label:e,value:t,tone:n="neutral"}){return i.jsxs("div",{className:V("min-w-0 rounded-md border bg-white px-3 py-2",n==="bad"?"border-red-200":"border-border"),children:[i.jsx("div",{className:V("font-mono text-lg font-semibold",n==="bad"?"text-red-700":"text-foreground"),children:t}),i.jsx("div",{className:"mt-0.5 text-[11px] font-semibold uppercase text-muted",children:e})]})}function Ix({unit:e}){const[t,n]=T.useState(!1),r=e.active_state==="active",s=e.active_state==="failed"||e.result==="failed",a=e.next_elapse||e.last_trigger||"n/a";return i.jsxs("details",{className:"group min-w-0",open:t,onToggle:o=>n(o.currentTarget.open),children:[i.jsxs("summary",{className:"grid min-w-0 cursor-pointer list-none grid-cols-2 gap-2 px-3 py-3 text-sm marker:hidden hover:bg-slate-50 md:grid-cols-[minmax(0,1.35fr)_90px_120px_90px_minmax(0,1fr)] md:items-center md:gap-3",children:[i.jsxs("div",{className:"col-span-2 min-w-0 md:col-span-1",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx(yn,{className:"h-3.5 w-3.5 shrink-0 text-muted transition-transform group-open:rotate-180","aria-hidden":!0}),i.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",children:e.unit})]}),i.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 pl-5 text-[11px] font-semibold uppercase text-muted",children:[i.jsx("span",{children:e.role}),i.jsx("span",{children:e.kind}),i.jsx("span",{children:e.load_state}),i.jsx("span",{children:t?"following log":"expand log"})]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:block",children:[i.jsx("span",{className:"text-[11px] font-semibold uppercase text-muted md:hidden",children:"Status"}),i.jsx("span",{className:V("inline-flex h-6 items-center rounded-full border px-2 text-xs font-semibold",s?"border-red-300 bg-red-50 text-red-700":r?"border-emerald-300 bg-emerald-50 text-emerald-700":"border-slate-300 bg-slate-50 text-slate-700"),children:e.active_state})]}),i.jsx(uo,{label:"State",value:e.sub_state,detail:e.result||"unknown"}),i.jsx(uo,{label:"PID",value:e.main_pid?String(e.main_pid):"n/a",detail:Qe(e.uptime_seconds)}),i.jsxs("div",{className:"col-span-2 min-w-0 md:col-span-1",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted md:hidden",children:"Schedule"}),i.jsx("div",{className:"truncate font-mono text-[11px] text-foreground",title:a,children:e.next_elapse?`next ${e.next_elapse}`:a})]})]}),i.jsx("div",{className:"border-t border-border bg-slate-50 px-3 pb-3 pt-2",children:i.jsx(Tx,{unit:e.unit,active:t})})]})}function uo({label:e,value:t,detail:n}){return i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted md:hidden",children:e}),i.jsx("div",{className:"truncate font-mono text-[11px] text-foreground",children:t}),n?i.jsx("div",{className:"truncate font-mono text-[11px] text-muted",children:n}):null]})}function Tx({unit:e,active:t}){const[n,r]=T.useState([]),[s,a]=T.useState(""),o=T.useRef(null);return T.useEffect(()=>{if(!t){r([]),a("");return}r([]),a("");const l=new EventSource(`/api/systemd/journal/stream?unit=${encodeURIComponent(e)}`);return l.addEventListener("journal_line",u=>{const c=Dr(u);c&&r(d=>[...d.slice(-199),c])}),l.addEventListener("journal_error",u=>{const c=Dr(u);a((c==null?void 0:c.error)??"journal stream failed")}),l.onerror=()=>{},()=>l.close()},[t,e]),T.useEffect(()=>{const l=o.current;l&&(l.scrollTop=l.scrollHeight)},[n]),i.jsxs("div",{className:"grid min-w-0 gap-2",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted",children:"Live journal"}),i.jsx("div",{className:"mt-0.5 truncate font-mono text-[11px] text-muted",children:n.length>0?`${n.length} lines streamed`:"waiting for journal output"})]}),i.jsx("div",{className:"font-mono text-[11px] text-muted",children:"journalctl -f"})]}),s?i.jsx(Ne,{tone:"error",text:s}):null,i.jsx("div",{ref:o,className:"h-72 overflow-auto rounded-md border border-slate-800 bg-slate-950 p-3 font-mono text-xs leading-relaxed text-slate-100",children:n.length>0?n.map((l,u)=>i.jsx("div",{className:"break-words [overflow-wrap:anywhere]",children:l.line},`${l.unit}-${u}`)):i.jsx("div",{className:"text-slate-400",children:"No journal lines received yet."})})]})}function Ax({data:e,loading:t}){var h,m,p,y,w,j;if(t&&!e)return i.jsx(Z,{text:"Loading process activity..."});if(!e)return i.jsx(Z,{text:"No process snapshot available."});const n=e.executor.children??[],r=n.flatMap(b=>Vl(b)),s=r.reduce((b,S)=>b+S.cpu_ticks,0),a=r.reduce((b,S)=>b+Mx(S),0),o=e.executor.service==="active",l=r.slice(0,8).map(b=>({label:`pid ${b.pid}`,ticks:b.cpu_ticks})),u=(e.samples??[]).map(b=>({label:Hn(b.ts),ticks:b.cpu_ticks,io:b.io_bytes,active:b.active_since_last_sample?"active":"quiet"})),c=u.length>0?u:l,d=(h=e.samples)==null?void 0:h[e.samples.length-1];return i.jsxs("div",{className:"grid gap-4",children:[i.jsx("div",{className:"rounded-md border border-slate-200 bg-slate-50 p-3",children:i.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx("span",{className:V("inline-flex h-6 items-center rounded-full border px-2 text-xs font-semibold",o?"border-emerald-300 bg-emerald-50 text-emerald-700":"border-slate-300 bg-white text-slate-600"),children:o?"active":"idle"}),i.jsxs("span",{className:"font-mono text-xs text-muted",children:["service ",e.executor.service]})]}),i.jsx("div",{className:"mt-2 text-sm font-semibold text-foreground",children:e.running_jobs.length>0?`${e.running_jobs.length} running job${e.running_jobs.length===1?"":"s"}`:"No running jobs"}),e.running_jobs.length>0?i.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.running_jobs.slice(0,4).map(b=>i.jsxs("span",{className:"inline-flex min-h-6 items-center gap-1.5 rounded-full border border-blue-200 bg-white px-2 font-mono text-[11px] font-semibold text-blue-700",children:[i.jsx("span",{className:"h-2 w-2 rounded-full bg-blue-600 animate-live-pulse","aria-hidden":!0}),"#",b.id," ",Qe(b.age_seconds)]},b.id))}):null,d?i.jsxs("p",{className:"mt-1 text-xs text-muted",children:["Last persisted sample ",Hn(d.ts)," · ",d.active_since_last_sample?"activity observed":`quiet ${Qe(d.idle_seconds)}`]}):null,i.jsx("p",{className:"mt-1 text-xs text-muted",children:e.detail})]}),i.jsxs("div",{className:"grid min-w-[190px] grid-cols-3 gap-2 text-center text-xs",children:[i.jsx(oi,{label:"PID",value:e.executor.pid?String(e.executor.pid):"n/a"}),i.jsx(oi,{label:"Children",value:String(r.length)}),i.jsx(oi,{label:"CPU ticks",value:String(s)})]})]})}),i.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[i.jsx(Er,{label:"Live process",value:((m=e.signals)==null?void 0:m.live_process.state)??(r.length>0?"live":"no_child_process"),detail:`${((p=e.signals)==null?void 0:p.live_process.child_count)??r.length} children`}),i.jsx(Er,{label:"Process activity",value:((y=e.signals)==null?void 0:y.process_activity.state)??(d!=null&&d.active_since_last_sample?"active":"quiet"),detail:d?`sample ${Hn(d.ts)}`:"no sample"}),i.jsx(Er,{label:"Semantic progress",value:(w=e.signals)!=null&&w.semantic_progress.length?"recent":"none",detail:co(e.running_jobs,"semantic_progress")}),i.jsx(Er,{label:"Visible progress",value:(j=e.signals)!=null&&j.visible_progress.length?"streaming":"none",detail:co(e.running_jobs,"visible_progress")})]}),e.alerts.length>0?i.jsx(Ne,{tone:"error",text:e.alerts[0]}):null,i.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)]",children:[i.jsxs("div",{className:"min-w-0 rounded-md border border-border p-3",children:[i.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[i.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold",children:[i.jsx(ma,{className:"h-4 w-4","aria-hidden":!0}),u.length>0?"CPU history":"CPU ticks"]}),i.jsxs("span",{className:"font-mono text-xs text-muted",children:[Wl(a)," I/O"]})]}),c.length>0?i.jsx("div",{className:"h-40",children:i.jsx(rr,{width:"100%",height:"100%",children:i.jsxs(ou,{data:c,children:[i.jsx(ir,{strokeDasharray:"3 3"}),i.jsx(sr,{dataKey:"label",tick:!1}),i.jsx(ar,{allowDecimals:!1,tick:{fontSize:11}}),i.jsx(or,{formatter:b=>[Number(b),"cpu ticks"]}),i.jsx(lu,{type:"monotone",dataKey:"ticks",stroke:"#0f766e",strokeWidth:2,dot:{r:3},activeDot:{r:5},isAnimationActive:!1})]})})}):i.jsx(Z,{text:"No executor CPU samples available."})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsxs("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[i.jsx(ma,{className:"h-4 w-4","aria-hidden":!0}),"Executor children"]}),n.length>0?i.jsx("div",{className:"grid gap-2",children:n.map(b=>i.jsx(Ql,{process:b},b.pid))}):i.jsx(Z,{text:"No child process detected for the executor."})]})]})]})}function Lx({alerts:e,loading:t,now:n}){if(t&&!e)return i.jsx(Z,{text:"Loading monitor alerts..."});const r=e??[];return r.length===0?i.jsx(Z,{text:"No active monitor alerts."}):i.jsx("div",{className:"grid gap-2",children:r.slice(0,5).map(s=>i.jsxs("div",{className:"rounded-md border border-red-200 bg-red-50 p-2.5",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs font-semibold text-red-700",children:[i.jsx(zr,{className:"h-3.5 w-3.5","aria-hidden":!0}),i.jsx("span",{children:s.severity}),i.jsx("span",{className:"font-normal text-red-600",children:Ll(s.last_seen,n)}),s.observations>1?i.jsxs("span",{className:"rounded-full border border-red-200 bg-white px-1.5",children:[s.observations,"x"]}):null]}),i.jsx("p",{className:"mt-1 break-words text-sm font-medium text-red-950 [overflow-wrap:anywhere]",children:s.message})]},s.fingerprint))})}function Ql({process:e}){var r,s;const t=((r=e.io_bytes)==null?void 0:r.read_bytes)??0,n=((s=e.io_bytes)==null?void 0:s.write_bytes)??0;return i.jsxs("div",{className:"rounded-md border border-border bg-white p-2.5",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[i.jsxs("span",{className:"font-mono",children:["pid ",e.pid]}),i.jsxs("span",{className:"rounded-full border border-border px-2 text-xs text-muted",children:["state ",e.state]}),i.jsxs("span",{className:"rounded-full border border-border px-2 text-xs text-muted",children:["cpu ",e.cpu_ticks]}),i.jsxs("span",{className:"rounded-full border border-border px-2 text-xs text-muted",children:["I/O ",Wl(t+n)]})]}),i.jsx("div",{className:"mt-2 break-words font-mono text-xs text-muted",children:e.cmd||"unknown command"}),e.children&&e.children.length>0?i.jsx("div",{className:"mt-3 border-l-2 border-border pl-3",children:e.children.map(a=>i.jsx(Ql,{process:a},a.pid))}):null]})}function oi({label:e,value:t}){return i.jsxs("div",{className:"rounded-md border border-border bg-white px-2 py-2",children:[i.jsx("div",{className:"font-mono text-sm font-semibold text-foreground",children:t}),i.jsx("div",{className:"mt-0.5 text-[11px] font-semibold uppercase text-muted",children:e})]})}function Er({label:e,value:t,detail:n}){return i.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-2.5",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted",children:e}),i.jsx("div",{className:"mt-1 truncate text-sm font-semibold text-foreground",children:t}),i.jsx("div",{className:"mt-1 truncate font-mono text-[11px] text-muted",children:n})]})}function co(e,t){const n=e.find(s=>s[t]),r=n==null?void 0:n[t];return!n||!r?"no running heartbeat":`#${n.id} ${r.phase} ${Qe(r.age_seconds??null)}`}function Vl(e){return[e,...(e.children??[]).flatMap(t=>Vl(t))]}function Mx(e){var t,n;return(((t=e.io_bytes)==null?void 0:t.read_bytes)??0)+(((n=e.io_bytes)==null?void 0:n.write_bytes)??0)}function Wl(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function J({label:e,value:t}){return i.jsxs("div",{className:"min-w-0 rounded-md border border-border p-3",children:[i.jsx("div",{className:"text-xs font-semibold text-muted",children:e}),i.jsx("div",{className:"mt-1 min-w-0 break-words text-sm [overflow-wrap:anywhere]",children:t})]})}function us({status:e}){const t=yf(e),n=e==="running"||e==="pending";return i.jsxs("span",{className:V("inline-flex min-h-6 items-center gap-1.5 rounded-full border px-2 text-xs font-semibold",t.badge),children:[i.jsx("span",{className:V("h-2.5 w-2.5 rounded-full",t.dot,n&&"animate-live-pulse"),"aria-hidden":!0}),e]})}function Z({text:e}){return i.jsx("div",{className:"rounded-md border border-dashed border-border p-6 text-center text-sm text-muted",children:e})}function Ne({tone:e,text:t}){return i.jsx("div",{className:V("rounded-md border p-3 text-sm",e==="error"&&"border-red-300 bg-red-50 text-red-700",e==="warning"&&"border-amber-300 bg-amber-50 text-amber-800"),children:t})}function lt({onClick:e,compactOnMobile:t=!1}){return i.jsxs("button",{className:V("inline-flex h-8 items-center justify-center gap-2 rounded-md border border-border text-sm font-semibold text-foreground hover:bg-slate-50",t?"w-8 px-0 sm:w-auto sm:px-3":"px-3"),onClick:e,type:"button","aria-label":"Refresh",children:[i.jsx(ur,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:V(t&&"hidden sm:inline"),children:"Refresh"})]})}const ho=document.getElementById("root");ho&&pu.createRoot(ho).render(i.jsx(T.StrictMode,{children:i.jsx(Bu,{client:lf,children:i.jsx(Ff,{})})})); diff --git a/src/github_agent_bridge/dashboard_static/assets/index-BDe9F9HC.css b/src/github_agent_bridge/dashboard_static/assets/index-BDe9F9HC.css new file mode 100644 index 0000000..3af1230 --- /dev/null +++ b/src/github_agent_bridge/dashboard_static/assets/index-BDe9F9HC.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{color-scheme:light;--color-border: 214 20% 88%;--color-background: 210 20% 98%;--color-foreground: 216 28% 14%;--color-muted: 215 16% 47%;--color-panel: 0 0% 100%;--color-primary: 212 92% 42%}@media(prefers-color-scheme:dark){:root{color-scheme:dark;--color-border: 217 24% 25%;--color-background: 222 33% 8%;--color-foreground: 214 30% 92%;--color-muted: 215 18% 68%;--color-panel: 222 31% 13%;--color-primary: 212 92% 58%}}*{box-sizing:border-box}body{margin:0;min-width:320px;overflow-x:clip;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;letter-spacing:0}#root{overflow-x:clip}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.animate-live-pulse{animation:live-pulse 1.25s ease-in-out infinite}.control{height:36px;width:100%;border-radius:6px;border:1px solid hsl(var(--color-border));background:hsl(var(--color-panel));padding:0 10px;color:hsl(var(--color-foreground));font:inherit}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.right-0{right:0}.right-3{right:.75rem}.top-0{top:0}.top-20{top:5rem}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.col-span-2{grid-column:span 2 / span 2}.-mx-3{margin-left:-.75rem;margin-right:-.75rem}.mx-auto{margin-left:auto;margin-right:auto}.my-3{margin-top:.75rem;margin-bottom:.75rem}.-mt-3{margin-top:-.75rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-72{height:18rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-full{height:100%}.max-h-40{max-height:10rem}.max-h-56{max-height:14rem}.max-h-64{max-height:16rem}.max-h-72{max-height:18rem}.max-h-\[460px\]{max-height:460px}.max-h-\[620px\]{max-height:620px}.max-h-\[640px\]{max-height:640px}.min-h-10{min-height:2.5rem}.min-h-5{min-height:1.25rem}.min-h-6{min-height:1.5rem}.min-h-7{min-height:1.75rem}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-44{width:11rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[42\%\]{width:42%}.w-\[min\(calc\(100vw-1\.5rem\)\,28rem\)\]{width:min(calc(100vw - 1.5rem),28rem)}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-5{min-width:1.25rem}.min-w-\[1080px\]{min-width:1080px}.min-w-\[180px\]{min-width:180px}.min-w-\[190px\]{min-width:190px}.min-w-\[720px\]{min-width:720px}.min-w-\[920px\]{min-width:920px}.min-w-\[980px\]{min-width:980px}.min-w-full{min-width:100%}.max-w-40{max-width:10rem}.max-w-\[1440px\]{max-width:1440px}.max-w-\[14rem\]{max-width:14rem}.max-w-full{max-width:100%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[auto_minmax\(0\,1fr\)\]{grid-template-columns:auto minmax(0,1fr)}.grid-cols-\[minmax\(0\,1\.35fr\)_90px_120px_90px_minmax\(0\,1fr\)\]{grid-template-columns:minmax(0,1.35fr) 90px 120px 90px minmax(0,1fr)}.grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-y-1{row-gap:.25rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-border>:not([hidden])~:not([hidden]){border-color:hsl(var(--color-border))}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l-2{border-left-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-300{--tw-border-opacity: 1;border-color:rgb(252 211 77 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--color-border))}.border-border\/70{border-color:hsl(var(--color-border) / .7)}.border-emerald-200{--tw-border-opacity: 1;border-color:rgb(167 243 208 / var(--tw-border-opacity, 1))}.border-emerald-300{--tw-border-opacity: 1;border-color:rgb(110 231 183 / var(--tw-border-opacity, 1))}.border-emerald-400{--tw-border-opacity: 1;border-color:rgb(52 211 153 / var(--tw-border-opacity, 1))}.border-primary{border-color:hsl(var(--color-primary))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-slate-800{--tw-border-opacity: 1;border-color:rgb(30 41 59 / var(--tw-border-opacity, 1))}.border-violet-200{--tw-border-opacity: 1;border-color:rgb(221 214 254 / var(--tw-border-opacity, 1))}.border-white\/40{border-color:#fff6}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-800{--tw-bg-opacity: 1;background-color:rgb(146 64 14 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--color-background))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-emerald-50{--tw-bg-opacity: 1;background-color:rgb(236 253 245 / var(--tw-bg-opacity, 1))}.bg-emerald-600{--tw-bg-opacity: 1;background-color:rgb(5 150 105 / var(--tw-bg-opacity, 1))}.bg-emerald-950{--tw-bg-opacity: 1;background-color:rgb(2 44 34 / var(--tw-bg-opacity, 1))}.bg-panel{background-color:hsl(var(--color-panel))}.bg-panel\/95{background-color:hsl(var(--color-panel) / .95)}.bg-primary{background-color:hsl(var(--color-primary))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-50\/60{background-color:#f8fafc99}.bg-slate-50\/70{background-color:#f8fafcb3}.bg-slate-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-950{--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-violet-50{--tw-bg-opacity: 1;background-color:rgb(245 243 255 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/15{background-color:#ffffff26}.bg-white\/70{background-color:#ffffffb3}.bg-white\/80{background-color:#fffc}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-3{padding-bottom:.75rem}.pl-0\.5{padding-left:.125rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-5{padding-left:1.25rem}.pr-1{padding-right:.25rem}.pt-2{padding-top:.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-top{vertical-align:top}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[0\.85em\]{font-size:.85em}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-amber-950{--tw-text-opacity: 1;color:rgb(69 26 3 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-700\/70{color:#1d4ed8b3}.text-emerald-50{--tw-text-opacity: 1;color:rgb(236 253 245 / var(--tw-text-opacity, 1))}.text-emerald-700{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.text-emerald-800{--tw-text-opacity: 1;color:rgb(6 95 70 / var(--tw-text-opacity, 1))}.text-emerald-900{--tw-text-opacity: 1;color:rgb(6 78 59 / var(--tw-text-opacity, 1))}.text-emerald-950{--tw-text-opacity: 1;color:rgb(2 44 34 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--color-foreground))}.text-muted{color:hsl(var(--color-muted))}.text-primary{color:hsl(var(--color-primary))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-950{--tw-text-opacity: 1;color:rgb(69 10 10 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-violet-700{--tw-text-opacity: 1;color:rgb(109 40 217 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.opacity-0{opacity:0}.opacity-60{opacity:.6}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_1px_0_rgba\(15\,23\,42\,0\.03\)\]{--tw-shadow: 0 1px 0 rgba(15,23,42,.03);--tw-shadow-colored: 0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-slate-950\/15{--tw-shadow-color: rgb(2 6 23 / .15);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.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)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}@media(prefers-color-scheme:dark){.bg-white,.bg-white\/70,.bg-white\/80,.hover\:bg-white:hover{background-color:hsl(var(--color-panel))}.bg-slate-50,.bg-slate-50\/60,.bg-slate-50\/70,.bg-slate-100,.hover\:bg-slate-50:hover,.hover\:bg-slate-100:hover{background-color:#1f2637}.bg-blue-50{background-color:#152847}.bg-amber-50,.bg-amber-100,.hover\:bg-amber-100:hover{background-color:#46310b}.bg-red-50,.hover\:bg-red-50:hover{background-color:#441818}.bg-emerald-50,.hover\:bg-emerald-100:hover{background-color:#163b2b}.border-slate-200,.border-slate-300,.border-slate-700,.border-slate-800{border-color:hsl(var(--color-border))}.border-amber-200,.border-amber-300{border-color:#956b23}.border-blue-200,.border-blue-300{border-color:#2757a5}.border-red-200,.border-red-300{border-color:#a72f2f}.border-emerald-300{border-color:#30976a}.text-slate-600,.text-slate-700,.text-slate-800,.text-slate-900,.hover\:text-slate-900:hover{color:hsl(var(--color-foreground))}.text-slate-300,.text-slate-400,.text-slate-500,.hover\:text-slate-500:hover{color:hsl(var(--color-muted))}.text-blue-700{color:#92c2fc}.text-amber-700,.text-amber-800,.text-amber-900,.text-amber-950{color:#fde7af}.text-red-600,.text-red-700,.text-red-950{color:#fbacac}.text-emerald-700,.text-emerald-800,.text-emerald-900,.text-emerald-950{color:#a3f5cd}}.\[overflow-wrap\:anywhere\]{overflow-wrap:anywhere}@keyframes live-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.72)}}@media(prefers-reduced-motion:reduce){.animate-live-pulse{animation:none}}.marker\:hidden *::marker{display:none}.marker\:hidden::marker{display:none}.first\:mt-0:first-child{margin-top:0}.last\:border-0:last-child{border-width:0px}.last\:border-b-0:last-child{border-bottom-width:0px}.focus-within\:border-primary:focus-within{border-color:hsl(var(--color-primary))}.focus-within\:ring-1:focus-within{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-within\:ring-primary:focus-within{--tw-ring-color: hsl(var(--color-primary))}.hover\:bg-amber-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.hover\:bg-amber-900:hover{--tw-bg-opacity: 1;background-color:rgb(120 53 15 / var(--tw-bg-opacity, 1))}.hover\:bg-emerald-100:hover{--tw-bg-opacity: 1;background-color:rgb(209 250 229 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:text-foreground:hover{color:hsl(var(--color-foreground))}.hover\:underline:hover{text-decoration-line:underline}@media(prefers-color-scheme:dark){.hover\:bg-white:hover{background-color:hsl(var(--color-panel))}.hover\:bg-slate-50:hover,.hover\:bg-slate-100:hover{background-color:#1f2637}.hover\:bg-amber-100:hover{background-color:#46310b}.hover\:bg-red-50:hover{background-color:#441818}}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}.disabled\:hover\:bg-white:hover:disabled{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}@media(prefers-color-scheme:dark){.disabled\:hover\:bg-white:hover:disabled{background-color:hsl(var(--color-panel))}}.group[open] .group-open\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media(min-width:640px){.sm\:-mx-4{margin-left:-1rem;margin-right:-1rem}.sm\:-mt-4{margin-top:-1rem}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:w-auto{width:auto}.sm\:flex-none{flex:none}.sm\:shrink-0{flex-shrink:0}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:gap-1\.5{gap:.375rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sm\:p-4{padding:1rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:pl-0{padding-left:0}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media(min-width:768px){.md\:col-span-1{grid-column:span 1 / span 1}.md\:mt-4{margin-top:1rem}.md\:block{display:block}.md\:grid{display:grid}.md\:hidden{display:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-\[minmax\(0\,1\.35fr\)_90px_120px_90px_minmax\(0\,1fr\)\]{grid-template-columns:minmax(0,1.35fr) 90px 120px 90px minmax(0,1fr)}.md\:grid-cols-\[minmax\(0\,1fr\)\]{grid-template-columns:minmax(0,1fr)}.md\:grid-cols-\[minmax\(0\,1fr\)_220px\]{grid-template-columns:minmax(0,1fr) 220px}.md\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.md\:grid-cols-\[minmax\(0\,1fr\)_minmax\(12rem\,16rem\)_auto\]{grid-template-columns:minmax(0,1fr) minmax(12rem,16rem) auto}.md\:items-center{align-items:center}.md\:gap-3{gap:.75rem}.md\:p-4{padding:1rem}.md\:px-4{padding-left:1rem;padding-right:1rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:py-5{padding-top:1.25rem;padding-bottom:1.25rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}}@media(min-width:1024px){.lg\:min-w-\[420px\]{min-width:420px}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,0\.9fr\)_minmax\(0\,1\.1fr\)\]{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)}.lg\:grid-cols-\[minmax\(0\,1fr\)_minmax\(0\,1fr\)\]{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.lg\:grid-cols-\[minmax\(0\,1fr\)_minmax\(280px\,auto\)\]{grid-template-columns:minmax(0,1fr) minmax(280px,auto)}.lg\:flex-row{flex-direction:row}.lg\:items-start{align-items:flex-start}.lg\:justify-between{justify-content:space-between}}@media(min-width:1280px){.xl\:col-span-2{grid-column:span 2 / span 2}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}}.\[\&\>span\]\:truncate>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0} diff --git a/src/github_agent_bridge/dashboard_static/assets/index-BhOrC4LA.js b/src/github_agent_bridge/dashboard_static/assets/index-BhOrC4LA.js deleted file mode 100644 index 96e6206..0000000 --- a/src/github_agent_bridge/dashboard_static/assets/index-BhOrC4LA.js +++ /dev/null @@ -1,187 +0,0 @@ -var Ys=e=>{throw TypeError(e)};var $r=(e,t,n)=>t.has(e)||Ys("Cannot "+n);var g=(e,t,n)=>($r(e,t,"read from private field"),n?n.call(e):t.get(e)),U=(e,t,n)=>t.has(e)?Ys("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),D=(e,t,n,r)=>($r(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),X=(e,t,n)=>($r(e,t,"access private method"),n);var br=(e,t,n,r)=>({set _(s){D(e,t,s,n)},get _(){return g(e,t,r)}});import{f as nu,h as ru,g as Fi,r as ke,R as T,d as nr,a as Dr,C as rr,X as ir,Y as sr,T as ar,L as jo,B as Qt,e as iu,c as su,b as au}from"./charts-SqBiqy9C.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();var Hr={exports:{}},Pn={};/** - * @license React - * react-jsx-runtime.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Zs;function ou(){if(Zs)return Pn;Zs=1;var e=nu(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(l,u,c){var d,h={},m=null,p=null;c!==void 0&&(m=""+c),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(p=u.ref);for(d in u)r.call(u,d)&&!a.hasOwnProperty(d)&&(h[d]=u[d]);if(l&&l.defaultProps)for(d in u=l.defaultProps,u)h[d]===void 0&&(h[d]=u[d]);return{$$typeof:t,type:l,key:m,ref:p,props:h,_owner:s.current}}return Pn.Fragment=n,Pn.jsx=o,Pn.jsxs=o,Pn}var ea;function lu(){return ea||(ea=1,Hr.exports=ou()),Hr.exports}var i=lu(),yr={},ta;function uu(){if(ta)return yr;ta=1;var e=ru();return yr.createRoot=e.createRoot,yr.hydrateRoot=e.hydrateRoot,yr}var cu=uu();const du=Fi(cu);var or=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(){}},Dt,Nt,rn,ho,hu=(ho=class extends or{constructor(){super();U(this,Dt);U(this,Nt);U(this,rn);D(this,rn,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){g(this,Nt)||this.setEventListener(g(this,rn))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,Nt))==null||t.call(this),D(this,Nt,void 0))}setEventListener(t){var n;D(this,rn,t),(n=g(this,Nt))==null||n.call(this),D(this,Nt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){g(this,Dt)!==t&&(D(this,Dt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof g(this,Dt)=="boolean"?g(this,Dt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Dt=new WeakMap,Nt=new WeakMap,rn=new WeakMap,ho),zi=new hu,pu={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},St,Di,po,mu=(po=class{constructor(){U(this,St,pu);U(this,Di,!1)}setTimeoutProvider(e){D(this,St,e)}setTimeout(e,t){return g(this,St).setTimeout(e,t)}clearTimeout(e){g(this,St).clearTimeout(e)}setInterval(e,t){return g(this,St).setInterval(e,t)}clearInterval(e){g(this,St).clearInterval(e)}},St=new WeakMap,Di=new WeakMap,po),Ot=new mu;function fu(e){setTimeout(e,0)}var xu=typeof window>"u"||"Deno"in globalThis;function Ae(){}function gu(e,t){return typeof e=="function"?e(t):e}function li(e){return typeof e=="number"&&e>=0&&e!==1/0}function ko(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Tt(e,t){return typeof e=="function"?e(t):e}function qe(e,t){return typeof e=="function"?e(t):e}function na(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Bi(o,t.options))return!1}else if(!Kn(t.queryKey,o))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function ra(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Hn(t.options.mutationKey)!==Hn(a))return!1}else if(!Kn(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Bi(e,t){return((t==null?void 0:t.queryKeyHashFn)||Hn)(e)}function Hn(e){return JSON.stringify(e,(t,n)=>ci(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Kn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Kn(e[n],t[n])):!1}var bu=Object.prototype.hasOwnProperty;function No(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=ia(e)&&ia(t);if(!r&&!(ci(e)&&ci(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),l=o.length,u=r?new Array(l):{};let c=0;for(let d=0;d{Ot.setTimeout(t,e)})}function di(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?No(e,t):t}function wu(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function vu(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var qi=Symbol();function So(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===qi?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Co(e,t){return typeof e=="function"?e(...t):!!e}function ju(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Qn=(()=>{let e=()=>xu;return{isServer(){return e()},setIsServer(t){e=t}}})();function hi(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var ku=fu;function Nu(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=ku;const a=l=>{t?e.push(l):s(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;t++;try{u=l()}finally{t--,t||o()}return u},batchCalls:l=>(...u)=>{a(()=>{l(...u)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var je=Nu(),sn,Ct,an,mo,Su=(mo=class extends or{constructor(){super();U(this,sn,!0);U(this,Ct);U(this,an);D(this,an,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){g(this,Ct)||this.setEventListener(g(this,an))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,Ct))==null||t.call(this),D(this,Ct,void 0))}setEventListener(t){var n;D(this,an,t),(n=g(this,Ct))==null||n.call(this),D(this,Ct,t(this.setOnline.bind(this)))}setOnline(t){g(this,sn)!==t&&(D(this,sn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return g(this,sn)}},sn=new WeakMap,Ct=new WeakMap,an=new WeakMap,mo),Rr=new Su;function Cu(e){return Math.min(1e3*2**e,3e4)}function _o(e){return(e??"online")==="online"?Rr.isOnline():!0}var pi=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Eo(e){let t=!1,n=0,r;const s=hi(),a=()=>s.status!=="pending",o=w=>{var j;if(!a()){const b=new pi(w);m(b),(j=e.onCancel)==null||j.call(e,b)}},l=()=>{t=!0},u=()=>{t=!1},c=()=>zi.isFocused()&&(e.networkMode==="always"||Rr.isOnline())&&e.canRun(),d=()=>_o(e.networkMode)&&e.canRun(),h=w=>{a()||(r==null||r(),s.resolve(w))},m=w=>{a()||(r==null||r(),s.reject(w))},p=()=>new Promise(w=>{var j;r=b=>{(a()||c())&&w(b)},(j=e.onPause)==null||j.call(e)}).then(()=>{var w;r=void 0,a()||(w=e.onContinue)==null||w.call(e)}),y=()=>{if(a())return;let w;const j=n===0?e.initialPromise:void 0;try{w=j??e.fn()}catch(b){w=Promise.reject(b)}Promise.resolve(w).then(h).catch(b=>{var k;if(a())return;const v=e.retry??(Qn.isServer()?0:3),N=e.retryDelay??Cu,C=typeof N=="function"?N(n,b):N,z=v===!0||typeof v=="number"&&nc()?void 0:p()).then(()=>{t?m(b):y()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:l,continueRetry:u,canStart:d,start:()=>(d()?y():p().then(y),s)}}var Ft,fo,Po=(fo=class{constructor(){U(this,Ft)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),li(this.gcTime)&&D(this,Ft,Ot.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Qn.isServer()?1/0:300*1e3))}clearGcTimeout(){g(this,Ft)!==void 0&&(Ot.clearTimeout(g(this,Ft)),D(this,Ft,void 0))}},Ft=new WeakMap,fo);function _u(e){return{onFetch:(t,n)=>{var d,h,m,p,y;const r=t.options,s=(m=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:m.direction,a=((p=t.state.data)==null?void 0:p.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const c=async()=>{let w=!1;const j=N=>{ju(N,()=>t.signal,()=>w=!0)},b=So(t.options,t.fetchOptions),v=async(N,C,z)=>{if(w)return Promise.reject(t.signal.reason);if(C==null&&N.pages.length)return Promise.resolve(N);const q=(()=>{const L={client:t.client,queryKey:t.queryKey,pageParam:C,direction:z?"backward":"forward",meta:t.options.meta};return j(L),L})(),M=await b(q),{maxPages:P}=t.options,B=z?vu:wu;return{pages:B(N.pages,M,P),pageParams:B(N.pageParams,C,P)}};if(s&&a.length){const N=s==="backward",C=N?Ro:mi,z={pages:a,pageParams:o},k=C(r,z);l=await v(z,k,N)}else{const N=e??a.length;do{const C=u===0?o[0]??r.initialPageParam:mi(r,l);if(u>0&&C==null)break;l=await v(l,C),u++}while(u{var w,j;return(j=(w=t.options).persister)==null?void 0:j.call(w,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function mi(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ro(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function Eu(e,t){return t?mi(e,t)!=null:!1}function Pu(e,t){return!t||!e.getPreviousPageParam?!1:Ro(e,t)!=null}var on,zt,ln,Qe,Bt,ve,Xn,qt,Be,Io,mt,xo,Ru=(xo=class extends Po{constructor(t){super();U(this,Be);U(this,on);U(this,zt);U(this,ln);U(this,Qe);U(this,Bt);U(this,ve);U(this,Xn);U(this,qt);D(this,qt,!1),D(this,Xn,t.defaultOptions),this.setOptions(t.options),this.observers=[],D(this,Bt,t.client),D(this,Qe,g(this,Bt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,D(this,zt,oa(this.options)),this.state=t.state??g(this,zt),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return g(this,on)}get promise(){var t;return(t=g(this,ve))==null?void 0:t.promise}setOptions(t){if(this.options={...g(this,Xn),...t},t!=null&&t._type&&D(this,on,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=oa(this.options);n.data!==void 0&&(this.setState(aa(n.data,n.dataUpdatedAt)),D(this,zt,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&g(this,Qe).remove(this)}setData(t,n){const r=di(this.state.data,t,this.options);return X(this,Be,mt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){X(this,Be,mt).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=g(this,ve))==null?void 0:r.promise;return(s=g(this,ve))==null||s.cancel(t),n?n.then(Ae).catch(Ae):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return g(this,zt)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>qe(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===qi||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Tt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!ko(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=g(this,ve))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=g(this,ve))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),g(this,Qe).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(g(this,ve)&&(g(this,qt)||X(this,Be,Io).call(this)?g(this,ve).cancel({revert:!0}):g(this,ve).cancelRetry()),this.scheduleGc()),g(this,Qe).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||X(this,Be,mt).call(this,{type:"invalidate"})}async fetch(t,n){var c,d,h,m,p,y,w,j,b,v,N;if(this.state.fetchStatus!=="idle"&&((c=g(this,ve))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(g(this,ve))return g(this,ve).continueRetry(),g(this,ve).promise}if(t&&this.setOptions(t),!this.options.queryFn){const C=this.observers.find(z=>z.options.queryFn);C&&this.setOptions(C.options)}const r=new AbortController,s=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(D(this,qt,!0),r.signal)})},a=()=>{const C=So(this.options,n),k=(()=>{const q={client:g(this,Bt),queryKey:this.queryKey,meta:this.meta};return s(q),q})();return D(this,qt,!1),this.options.persister?this.options.persister(C,k,this):C(k)},l=(()=>{const C={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:g(this,Bt),state:this.state,fetchFn:a};return s(C),C})(),u=g(this,on)==="infinite"?_u(this.options.pages):this.options.behavior;u==null||u.onFetch(l,this),D(this,ln,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&X(this,Be,mt).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta}),D(this,ve,Eo({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:C=>{C instanceof pi&&C.revert&&this.setState({...g(this,ln),fetchStatus:"idle"}),r.abort()},onFail:(C,z)=>{X(this,Be,mt).call(this,{type:"failed",failureCount:C,error:z})},onPause:()=>{X(this,Be,mt).call(this,{type:"pause"})},onContinue:()=>{X(this,Be,mt).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const C=await g(this,ve).start();if(C===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(C),(p=(m=g(this,Qe).config).onSuccess)==null||p.call(m,C,this),(w=(y=g(this,Qe).config).onSettled)==null||w.call(y,C,this.state.error,this),C}catch(C){if(C instanceof pi){if(C.silent)return g(this,ve).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw X(this,Be,mt).call(this,{type:"error",error:C}),(b=(j=g(this,Qe).config).onError)==null||b.call(j,C,this),(N=(v=g(this,Qe).config).onSettled)==null||N.call(v,this.state.data,C,this),C}finally{this.scheduleGc()}}},on=new WeakMap,zt=new WeakMap,ln=new WeakMap,Qe=new WeakMap,Bt=new WeakMap,ve=new WeakMap,Xn=new WeakMap,qt=new WeakMap,Be=new WeakSet,Io=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},mt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...To(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...aa(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return D(this,ln,t.manual?s:void 0),s;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),je.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),g(this,Qe).notify({query:this,type:"updated",action:t})})},xo);function To(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_o(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function aa(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function oa(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Te,Y,Yn,Pe,Ut,un,ft,_t,Zn,cn,dn,$t,Ht,Et,hn,ie,Dn,fi,xi,gi,bi,yi,wi,vi,Lo,go,Ao=(go=class extends or{constructor(t,n){super();U(this,ie);U(this,Te);U(this,Y);U(this,Yn);U(this,Pe);U(this,Ut);U(this,un);U(this,ft);U(this,_t);U(this,Zn);U(this,cn);U(this,dn);U(this,$t);U(this,Ht);U(this,Et);U(this,hn,new Set);this.options=n,D(this,Te,t),D(this,_t,null),D(this,ft,hi()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(g(this,Y).addObserver(this),la(g(this,Y),this.options)?X(this,ie,Dn).call(this):this.updateResult(),X(this,ie,bi).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ji(g(this,Y),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ji(g(this,Y),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,X(this,ie,yi).call(this),X(this,ie,wi).call(this),g(this,Y).removeObserver(this)}setOptions(t){const n=this.options,r=g(this,Y);if(this.options=g(this,Te).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof qe(this.options.enabled,g(this,Y))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");X(this,ie,vi).call(this),g(this,Y).setOptions(this.options),n._defaulted&&!ui(this.options,n)&&g(this,Te).getQueryCache().notify({type:"observerOptionsUpdated",query:g(this,Y),observer:this});const s=this.hasListeners();s&&ua(g(this,Y),r,this.options,n)&&X(this,ie,Dn).call(this),this.updateResult(),s&&(g(this,Y)!==r||qe(this.options.enabled,g(this,Y))!==qe(n.enabled,g(this,Y))||Tt(this.options.staleTime,g(this,Y))!==Tt(n.staleTime,g(this,Y)))&&X(this,ie,fi).call(this);const a=X(this,ie,xi).call(this);s&&(g(this,Y)!==r||qe(this.options.enabled,g(this,Y))!==qe(n.enabled,g(this,Y))||a!==g(this,Et))&&X(this,ie,gi).call(this,a)}getOptimisticResult(t){const n=g(this,Te).getQueryCache().build(g(this,Te),t),r=this.createResult(n,t);return Tu(this,r)&&(D(this,Pe,r),D(this,un,this.options),D(this,Ut,g(this,Y).state)),r}getCurrentResult(){return g(this,Pe)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&g(this,ft).status==="pending"&&g(this,ft).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){g(this,hn).add(t)}getCurrentQuery(){return g(this,Y)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=g(this,Te).defaultQueryOptions(t),r=g(this,Te).getQueryCache().build(g(this,Te),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return X(this,ie,Dn).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),g(this,Pe)))}createResult(t,n){var P;const r=g(this,Y),s=this.options,a=g(this,Pe),o=g(this,Ut),l=g(this,un),c=t!==r?t.state:g(this,Yn),{state:d}=t;let h={...d},m=!1,p;if(n._optimisticResults){const B=this.hasListeners(),L=!B&&la(t,n),E=B&&ua(t,r,n,s);(L||E)&&(h={...h,...To(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:y,errorUpdatedAt:w,status:j}=h;p=h.data;let b=!1;if(n.placeholderData!==void 0&&p===void 0&&j==="pending"){let B;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(B=a.data,b=!0):B=typeof n.placeholderData=="function"?n.placeholderData((P=g(this,dn))==null?void 0:P.state.data,g(this,dn)):n.placeholderData,B!==void 0&&(j="success",p=di(a==null?void 0:a.data,B,n),m=!0)}if(n.select&&p!==void 0&&!b)if(a&&p===(o==null?void 0:o.data)&&n.select===g(this,Zn))p=g(this,cn);else try{D(this,Zn,n.select),p=n.select(p),p=di(a==null?void 0:a.data,p,n),D(this,cn,p),D(this,_t,null)}catch(B){D(this,_t,B)}g(this,_t)&&(y=g(this,_t),p=g(this,cn),w=Date.now(),j="error");const v=h.fetchStatus==="fetching",N=j==="pending",C=j==="error",z=N&&v,k=p!==void 0,M={status:j,fetchStatus:h.fetchStatus,isPending:N,isSuccess:j==="success",isError:C,isInitialLoading:z,isLoading:z,data:p,dataUpdatedAt:h.dataUpdatedAt,error:y,errorUpdatedAt:w,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:v,isRefetching:v&&!N,isLoadingError:C&&!k,isPaused:h.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:C&&k,isStale:Ui(t,n),refetch:this.refetch,promise:g(this,ft),isEnabled:qe(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const B=M.data!==void 0,L=M.status==="error"&&!B,E=_=>{L?_.reject(M.error):B&&_.resolve(M.data)},G=()=>{const _=D(this,ft,M.promise=hi());E(_)},F=g(this,ft);switch(F.status){case"pending":t.queryHash===r.queryHash&&E(F);break;case"fulfilled":(L||M.data!==F.value)&&G();break;case"rejected":(!L||M.error!==F.reason)&&G();break}}return M}updateResult(){const t=g(this,Pe),n=this.createResult(g(this,Y),this.options);if(D(this,Ut,g(this,Y).state),D(this,un,this.options),g(this,Ut).data!==void 0&&D(this,dn,g(this,Y)),ui(n,t))return;D(this,Pe,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!g(this,hn).size)return!0;const o=new Set(a??g(this,hn));return this.options.throwOnError&&o.add("error"),Object.keys(g(this,Pe)).some(l=>{const u=l;return g(this,Pe)[u]!==t[u]&&o.has(u)})};X(this,ie,Lo).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&X(this,ie,bi).call(this)}},Te=new WeakMap,Y=new WeakMap,Yn=new WeakMap,Pe=new WeakMap,Ut=new WeakMap,un=new WeakMap,ft=new WeakMap,_t=new WeakMap,Zn=new WeakMap,cn=new WeakMap,dn=new WeakMap,$t=new WeakMap,Ht=new WeakMap,Et=new WeakMap,hn=new WeakMap,ie=new WeakSet,Dn=function(t){X(this,ie,vi).call(this);let n=g(this,Y).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ae)),n},fi=function(){X(this,ie,yi).call(this);const t=Tt(this.options.staleTime,g(this,Y));if(Qn.isServer()||g(this,Pe).isStale||!li(t))return;const r=ko(g(this,Pe).dataUpdatedAt,t)+1;D(this,$t,Ot.setTimeout(()=>{g(this,Pe).isStale||this.updateResult()},r))},xi=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(g(this,Y)):this.options.refetchInterval)??!1},gi=function(t){X(this,ie,wi).call(this),D(this,Et,t),!(Qn.isServer()||qe(this.options.enabled,g(this,Y))===!1||!li(g(this,Et))||g(this,Et)===0)&&D(this,Ht,Ot.setInterval(()=>{(this.options.refetchIntervalInBackground||zi.isFocused())&&X(this,ie,Dn).call(this)},g(this,Et)))},bi=function(){X(this,ie,fi).call(this),X(this,ie,gi).call(this,X(this,ie,xi).call(this))},yi=function(){g(this,$t)!==void 0&&(Ot.clearTimeout(g(this,$t)),D(this,$t,void 0))},wi=function(){g(this,Ht)!==void 0&&(Ot.clearInterval(g(this,Ht)),D(this,Ht,void 0))},vi=function(){const t=g(this,Te).getQueryCache().build(g(this,Te),this.options);if(t===g(this,Y))return;const n=g(this,Y);D(this,Y,t),D(this,Yn,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Lo=function(t){je.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(g(this,Pe))}),g(this,Te).getQueryCache().notify({query:g(this,Y),type:"observerResultsUpdated"})})},go);function Iu(e,t){return qe(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&qe(t.retryOnMount,e)===!1)}function la(e,t){return Iu(e,t)||e.state.data!==void 0&&ji(e,t,t.refetchOnMount)}function ji(e,t,n){if(qe(t.enabled,e)!==!1&&Tt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ui(e,t)}return!1}function ua(e,t,n,r){return(e!==t||qe(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ui(e,n)}function Ui(e,t){return qe(t.enabled,e)!==!1&&e.isStaleByTime(Tt(t.staleTime,e))}function Tu(e,t){return!ui(e.getCurrentResult(),t)}var Au=class extends Ao{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){var y,w;const{state:n}=e,r=super.createResult(e,t),{isFetching:s,isRefetching:a,isError:o,isRefetchError:l}=r,u=(w=(y=n.fetchMeta)==null?void 0:y.fetchMore)==null?void 0:w.direction,c=o&&u==="forward",d=s&&u==="forward",h=o&&u==="backward",m=s&&u==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Eu(t,n.data),hasPreviousPage:Pu(t,n.data),isFetchNextPageError:c,isFetchingNextPage:d,isFetchPreviousPageError:h,isFetchingPreviousPage:m,isRefetchError:l&&!c&&!h,isRefetching:a&&!d&&!m}}},er,st,Ce,Kt,at,kt,bo,Lu=(bo=class extends Po{constructor(t){super();U(this,at);U(this,er);U(this,st);U(this,Ce);U(this,Kt);D(this,er,t.client),this.mutationId=t.mutationId,D(this,Ce,t.mutationCache),D(this,st,[]),this.state=t.state||Mu(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){g(this,st).includes(t)||(g(this,st).push(t),this.clearGcTimeout(),g(this,Ce).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){D(this,st,g(this,st).filter(n=>n!==t)),this.scheduleGc(),g(this,Ce).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){g(this,st).length||(this.state.status==="pending"?this.scheduleGc():g(this,Ce).remove(this))}continue(){var t;return((t=g(this,Kt))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,u,c,d,h,m,p,y,w,j,b,v,N,C,z,k,q;const n=()=>{X(this,at,kt).call(this,{type:"continue"})},r={client:g(this,er),meta:this.options.meta,mutationKey:this.options.mutationKey};D(this,Kt,Eo({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,P)=>{X(this,at,kt).call(this,{type:"failed",failureCount:M,error:P})},onPause:()=>{X(this,at,kt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>g(this,Ce).canRun(this)}));const s=this.state.status==="pending",a=!g(this,Kt).canStart();try{if(s)n();else{X(this,at,kt).call(this,{type:"pending",variables:t,isPaused:a}),g(this,Ce).config.onMutate&&await g(this,Ce).config.onMutate(t,this,r);const P=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,r));P!==this.state.context&&X(this,at,kt).call(this,{type:"pending",context:P,variables:t,isPaused:a})}const M=await g(this,Kt).start();return await((c=(u=g(this,Ce).config).onSuccess)==null?void 0:c.call(u,M,t,this.state.context,this,r)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,M,t,this.state.context,r)),await((p=(m=g(this,Ce).config).onSettled)==null?void 0:p.call(m,M,null,this.state.variables,this.state.context,this,r)),await((w=(y=this.options).onSettled)==null?void 0:w.call(y,M,null,t,this.state.context,r)),X(this,at,kt).call(this,{type:"success",data:M}),M}catch(M){try{await((b=(j=g(this,Ce).config).onError)==null?void 0:b.call(j,M,t,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((N=(v=this.options).onError)==null?void 0:N.call(v,M,t,this.state.context,r))}catch(P){Promise.reject(P)}try{await((z=(C=g(this,Ce).config).onSettled)==null?void 0:z.call(C,void 0,M,this.state.variables,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((q=(k=this.options).onSettled)==null?void 0:q.call(k,void 0,M,t,this.state.context,r))}catch(P){Promise.reject(P)}throw X(this,at,kt).call(this,{type:"error",error:M}),M}finally{g(this,Ce).runNext(this)}}},er=new WeakMap,st=new WeakMap,Ce=new WeakMap,Kt=new WeakMap,at=new WeakSet,kt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),je.batch(()=>{g(this,st).forEach(r=>{r.onMutationUpdate(t)}),g(this,Ce).notify({mutation:this,type:"updated",action:t})})},bo);function Mu(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xt,Ye,tr,yo,Ou=(yo=class extends or{constructor(t={}){super();U(this,xt);U(this,Ye);U(this,tr);this.config=t,D(this,xt,new Set),D(this,Ye,new Map),D(this,tr,0)}build(t,n,r){const s=new Lu({client:t,mutationCache:this,mutationId:++br(this,tr)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){g(this,xt).add(t);const n=wr(t);if(typeof n=="string"){const r=g(this,Ye).get(n);r?r.push(t):g(this,Ye).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(g(this,xt).delete(t)){const n=wr(t);if(typeof n=="string"){const r=g(this,Ye).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&g(this,Ye).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=wr(t);if(typeof n=="string"){const r=g(this,Ye).get(n),s=r==null?void 0:r.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=wr(t);if(typeof n=="string"){const s=(r=g(this,Ye).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){je.batch(()=>{g(this,xt).forEach(t=>{this.notify({type:"removed",mutation:t})}),g(this,xt).clear(),g(this,Ye).clear()})}getAll(){return Array.from(g(this,xt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ra(n,r))}findAll(t={}){return this.getAll().filter(n=>ra(t,n))}notify(t){je.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return je.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ae))))}},xt=new WeakMap,Ye=new WeakMap,tr=new WeakMap,yo);function wr(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ot,wo,Du=(wo=class extends or{constructor(t={}){super();U(this,ot);this.config=t,D(this,ot,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??Bi(s,n);let o=this.get(a);return o||(o=new Ru({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){g(this,ot).has(t.queryHash)||(g(this,ot).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=g(this,ot).get(t.queryHash);n&&(t.destroy(),n===t&&g(this,ot).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){je.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return g(this,ot).get(t)}getAll(){return[...g(this,ot).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>na(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>na(t,r)):n}notify(t){je.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){je.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){je.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ot=new WeakMap,wo),fe,Pt,Rt,pn,mn,It,fn,xn,vo,Fu=(vo=class{constructor(e={}){U(this,fe);U(this,Pt);U(this,Rt);U(this,pn);U(this,mn);U(this,It);U(this,fn);U(this,xn);D(this,fe,e.queryCache||new Du),D(this,Pt,e.mutationCache||new Ou),D(this,Rt,e.defaultOptions||{}),D(this,pn,new Map),D(this,mn,new Map),D(this,It,0)}mount(){br(this,It)._++,g(this,It)===1&&(D(this,fn,zi.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,fe).onFocus())})),D(this,xn,Rr.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,fe).onOnline())})))}unmount(){var e,t;br(this,It)._--,g(this,It)===0&&((e=g(this,fn))==null||e.call(this),D(this,fn,void 0),(t=g(this,xn))==null||t.call(this),D(this,xn,void 0))}isFetching(e){return g(this,fe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return g(this,Pt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=g(this,fe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=g(this,fe).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Tt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return g(this,fe).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=g(this,fe).get(r.queryHash),a=s==null?void 0:s.state.data,o=gu(t,a);if(o!==void 0)return g(this,fe).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return je.batch(()=>g(this,fe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=g(this,fe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=g(this,fe);je.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=g(this,fe);return je.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=je.batch(()=>g(this,fe).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Ae).catch(Ae)}invalidateQueries(e,t={}){return je.batch(()=>(g(this,fe).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=je.batch(()=>g(this,fe).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(Ae)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Ae)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=g(this,fe).build(this,t);return n.isStaleByTime(Tt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ae).catch(Ae)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ae).catch(Ae)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Rr.isOnline()?g(this,Pt).resumePausedMutations():Promise.resolve()}getQueryCache(){return g(this,fe)}getMutationCache(){return g(this,Pt)}getDefaultOptions(){return g(this,Rt)}setDefaultOptions(e){D(this,Rt,e)}setQueryDefaults(e,t){g(this,pn).set(Hn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...g(this,pn).values()],n={};return t.forEach(r=>{Kn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){g(this,mn).set(Hn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...g(this,mn).values()],n={};return t.forEach(r=>{Kn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...g(this,Rt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Bi(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===qi&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...g(this,Rt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){g(this,fe).clear(),g(this,Pt).clear()}},fe=new WeakMap,Pt=new WeakMap,Rt=new WeakMap,pn=new WeakMap,mn=new WeakMap,It=new WeakMap,fn=new WeakMap,xn=new WeakMap,vo),Mo=ke.createContext(void 0),Oo=e=>{const t=ke.useContext(Mo);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},zu=({client:e,children:t})=>(ke.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(Mo.Provider,{value:e,children:t})),Do=ke.createContext(!1),Bu=()=>ke.useContext(Do);Do.Provider;function qu(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Uu=ke.createContext(qu()),$u=()=>ke.useContext(Uu),Hu=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Co(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ku=e=>{ke.useEffect(()=>{e.clearReset()},[e])},Qu=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||Co(n,[e.error,r])),Vu=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Wu=(e,t)=>e.isLoading&&e.isFetching&&!t,Gu=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ca=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Fo(e,t,n){var m,p,y,w;const r=Bu(),s=$u(),a=Oo(),o=a.defaultQueryOptions(e);(p=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||p.call(m,o);const l=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",Vu(o),Hu(o,s,l),Ku(s);const u=!a.getQueryCache().get(o.queryHash),[c]=ke.useState(()=>new t(a,o)),d=c.getOptimisticResult(o),h=!r&&e.subscribed!==!1;if(ke.useSyncExternalStore(ke.useCallback(j=>{const b=h?c.subscribe(je.batchCalls(j)):Ae;return c.updateResult(),b},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),ke.useEffect(()=>{c.setOptions(o)},[o,c]),Gu(o,d))throw ca(o,c,s);if(Qu({result:d,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw d.error;if((w=(y=a.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||w.call(y,o,d),o.experimental_prefetchInRender&&!Qn.isServer()&&Wu(d,r)){const j=u?ca(o,c,s):l==null?void 0:l.promise;j==null||j.catch(Ae).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?d:c.trackResult(d)}function ge(e,t){return Fo(e,Ao)}function da(e,t){return Fo(e,Au)}/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ju=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zo=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var Xu={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"};/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Yu=ke.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:o,...l},u)=>ke.createElement("svg",{ref:u,...Xu,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:zo("lucide",s),...l},[...o.map(([c,d])=>ke.createElement(c,d)),...Array.isArray(a)?a:[a]]));/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const le=(e,t)=>{const n=ke.forwardRef(({className:r,...s},a)=>ke.createElement(Yu,{ref:a,iconNode:t,className:zo(`lucide-${Ju(e)}`,r),...s}));return n.displayName=`${e}`,n};/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gn=le("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bo=le("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qo=le("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $i=le("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bn=le("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yn=le("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vn=le("CircleUserRound",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Uo=le("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ha=le("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wt=le("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $o=le("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zu=le("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ec=le("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ir=le("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wn=le("Link",[["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"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tc=le("Pencil",[["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"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lr=le("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wn=le("RotateCcw",[["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"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nc=le("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rc=le("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ho=le("ShieldCheck",[["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"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ko=le("SquareTerminal",[["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"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ic=le("TimerReset",[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M12 14v-4",key:"1evpnu"}],["path",{d:"M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6",key:"1ts96g"}],["path",{d:"M9 17H4v5",key:"8t5av"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ki=le("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Fr=le("TriangleAlert",[["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"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sc=le("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Gt=le("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ac(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const oc=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lc=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uc={};function pa(e,t){return(uc.jsx?lc:oc).test(e)}const cc=/[ \t\n\f\r]/g;function dc(e){return typeof e=="object"?e.type==="text"?ma(e.value):!1:ma(e)}function ma(e){return e.replace(cc,"")===""}class ur{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ur.prototype.normal={};ur.prototype.property={};ur.prototype.space=void 0;function Qo(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new ur(n,r,t)}function Ni(e){return e.toLowerCase()}class Me{constructor(t,n){this.attribute=n,this.property=t}}Me.prototype.attribute="";Me.prototype.booleanish=!1;Me.prototype.boolean=!1;Me.prototype.commaOrSpaceSeparated=!1;Me.prototype.commaSeparated=!1;Me.prototype.defined=!1;Me.prototype.mustUseProperty=!1;Me.prototype.number=!1;Me.prototype.overloadedBoolean=!1;Me.prototype.property="";Me.prototype.spaceSeparated=!1;Me.prototype.space=void 0;let hc=0;const K=Jt(),be=Jt(),Si=Jt(),R=Jt(),oe=Jt(),Vt=Jt(),ze=Jt();function Jt(){return 2**++hc}const Ci=Object.freeze(Object.defineProperty({__proto__:null,boolean:K,booleanish:be,commaOrSpaceSeparated:ze,commaSeparated:Vt,number:R,overloadedBoolean:Si,spaceSeparated:oe},Symbol.toStringTag,{value:"Module"})),Kr=Object.keys(Ci);class Hi extends Me{constructor(t,n,r,s){let a=-1;if(super(t,n),fa(this,"space",s),typeof r=="number")for(;++a4&&n.slice(0,4)==="data"&&gc.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(xa,wc);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!xa.test(a)){let o=a.replace(xc,yc);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=Hi}return new s(r,t)}function yc(e){return"-"+e.toLowerCase()}function wc(e){return e.charAt(1).toUpperCase()}const vc=Qo([Vo,pc,Jo,Xo,Yo],"html"),Ki=Qo([Vo,mc,Jo,Xo,Yo],"svg");function jc(e){return e.join(" ").trim()}var Zt={},Qr,ga;function kc(){if(ga)return Qr;ga=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,u=` -`,c="/",d="*",h="",m="comment",p="declaration";function y(j,b){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];b=b||{};var v=1,N=1;function C(F){var _=F.match(t);_&&(v+=_.length);var O=F.lastIndexOf(u);N=~O?F.length-O:N+F.length}function z(){var F={line:v,column:N};return function(_){return _.position=new k(F),P(),_}}function k(F){this.start=F,this.end={line:v,column:N},this.source=b.source}k.prototype.content=j;function q(F){var _=new Error(b.source+":"+v+":"+N+": "+F);if(_.reason=F,_.filename=b.source,_.line=v,_.column=N,_.source=j,!b.silent)throw _}function M(F){var _=F.exec(j);if(_){var O=_[0];return C(O),j=j.slice(O.length),_}}function P(){M(n)}function B(F){var _;for(F=F||[];_=L();)_!==!1&&F.push(_);return F}function L(){var F=z();if(!(c!=j.charAt(0)||d!=j.charAt(1))){for(var _=2;h!=j.charAt(_)&&(d!=j.charAt(_)||c!=j.charAt(_+1));)++_;if(_+=2,h===j.charAt(_-1))return q("End of comment missing");var O=j.slice(2,_-2);return N+=2,C(O),j=j.slice(_),N+=2,F({type:m,comment:O})}}function E(){var F=z(),_=M(r);if(_){if(L(),!M(s))return q("property missing ':'");var O=M(a),Q=F({type:p,property:w(_[0].replace(e,h)),value:O?w(O[0].replace(e,h)):h});return M(o),Q}}function G(){var F=[];B(F);for(var _;_=E();)_!==!1&&(F.push(_),B(F));return F}return P(),G()}function w(j){return j?j.replace(l,h):h}return Qr=y,Qr}var ba;function Nc(){if(ba)return Zt;ba=1;var e=Zt&&Zt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.default=n;const t=e(kc());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),l=typeof s=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:c,value:d}=u;l?s(c,d,u):d&&(a=a||{},a[c]=d)}),a}return Zt}var Rn={},ya;function Sc(){if(ya)return Rn;ya=1,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(c){return!c||n.test(c)||e.test(c)},o=function(c,d){return d.toUpperCase()},l=function(c,d){return"".concat(d,"-")},u=function(c,d){return d===void 0&&(d={}),a(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(s,l):c=c.replace(r,l),c.replace(t,o))};return Rn.camelCase=u,Rn}var In,wa;function Cc(){if(wa)return In;wa=1;var e=In&&In.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(Nc()),n=Sc();function r(s,a){var o={};return!s||typeof s!="string"||(0,t.default)(s,function(l,u){l&&u&&(o[(0,n.camelCase)(l,a)]=u)}),o}return r.default=r,In=r,In}var _c=Cc();const Ec=Fi(_c),Zo=el("end"),Qi=el("start");function el(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Pc(e){const t=Qi(e),n=Zo(e);if(t&&n)return{start:t,end:n}}function Bn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?va(e.position):"start"in e||"end"in e?va(e):"line"in e||"column"in e?_i(e):""}function _i(e){return ja(e&&e.line)+":"+ja(e&&e.column)}function va(e){return _i(e&&e.start)+"-"+_i(e&&e.end)}function ja(e){return e&&typeof e=="number"?e:1}class Ee extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(o=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=Bn(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ee.prototype.file="";Ee.prototype.name="";Ee.prototype.reason="";Ee.prototype.message="";Ee.prototype.stack="";Ee.prototype.column=void 0;Ee.prototype.line=void 0;Ee.prototype.ancestors=void 0;Ee.prototype.cause=void 0;Ee.prototype.fatal=void 0;Ee.prototype.place=void 0;Ee.prototype.ruleId=void 0;Ee.prototype.source=void 0;const Vi={}.hasOwnProperty,Rc=new Map,Ic=/[A-Z]/g,Tc=new Set(["table","tbody","thead","tfoot","tr"]),Ac=new Set(["td","th"]),tl="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Lc(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Uc(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=qc(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ki:vc,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=nl(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function nl(e,t,n){if(t.type==="element")return Mc(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Oc(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Fc(e,t,n);if(t.type==="mdxjsEsm")return Dc(e,t);if(t.type==="root")return zc(e,t,n);if(t.type==="text")return Bc(e,t)}function Mc(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Ki,e.schema=s),e.ancestors.push(t);const a=il(e,t.tagName,!1),o=$c(e,t);let l=Gi(e,t);return Tc.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!dc(u):!0})),rl(e,o,a,t),Wi(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Oc(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Gn(e,t.position)}function Dc(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Gn(e,t.position)}function Fc(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Ki,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:il(e,t.name,!0),o=Hc(e,t),l=Gi(e,t);return rl(e,o,a,t),Wi(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function zc(e,t,n){const r={};return Wi(r,Gi(e,t)),e.create(t,e.Fragment,r,n)}function Bc(e,t){return t.value}function rl(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wi(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function qc(e,t,n){return r;function r(s,a,o,l){const c=Array.isArray(o.children)?n:t;return l?c(a,o,l):c(a,o)}}function Uc(e,t){return n;function n(r,s,a,o){const l=Array.isArray(a.children),u=Qi(r);return t(s,a,o,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function $c(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Vi.call(t.properties,s)){const a=Kc(e,s,t.properties[s]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Ac.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Hc(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Gn(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else Gn(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function Gi(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:Rc;for(;++rs?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(ct(e,e.length,0,t),e):t}const Sa={}.hasOwnProperty;function Zc(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function tn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lt=At(/[A-Za-z]/),Ue=At(/[\dA-Za-z]/),nd=At(/[#-'*+\--9=?A-Z^-~]/);function Ei(e){return e!==null&&(e<32||e===127)}const Pi=At(/\d/),rd=At(/[\dA-Fa-f]/),id=At(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function Le(e){return e!==null&&(e<0||e===32)}function re(e){return e===-2||e===-1||e===32}const sd=At(new RegExp("\\p{P}|\\p{S}","u")),ad=At(/\s/);function At(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function jn(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),s=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function ue(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(u){return re(u)?(e.enter(n),l(u)):t(u)}function l(u){return re(u)&&a++o))return;const q=t.events.length;let M=q,P,B;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(P){B=t.events[M][1].end;break}P=!0}for(b(r),k=q;kN;){const z=n[C];t.containerState=z[1],z[0].exit.call(t,e)}n.length=N}function v(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function dd(e,t,n){return ue(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _a(e){if(e===null||Le(e)||ad(e))return 1;if(sd(e))return 2}function Xi(e,t,n){const r=[];let s=-1;for(;++s1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},m={...e[n][1].start};Ea(h,-u),Ea(m,u),o={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},a={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:u>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ve(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Ve(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",a,t]]),c=Ve(c,Xi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Ve(c,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=Ve(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ct(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&re(k)?ue(e,v,"linePrefix",a+1)(k):v(k)}function v(k){return k===null||$(k)?e.check(Pa,w,C)(k):(e.enter("codeFlowValue"),N(k))}function N(k){return k===null||$(k)?(e.exit("codeFlowValue"),v(k)):(e.consume(k),N)}function C(k){return e.exit("codeFenced"),t(k)}function z(k,q,M){let P=0;return B;function B(_){return k.enter("lineEnding"),k.consume(_),k.exit("lineEnding"),L}function L(_){return k.enter("codeFencedFence"),re(_)?ue(k,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):E(_)}function E(_){return _===l?(k.enter("codeFencedFenceSequence"),G(_)):M(_)}function G(_){return _===l?(P++,k.consume(_),G):P>=o?(k.exit("codeFencedFenceSequence"),re(_)?ue(k,F,"whitespace")(_):F(_)):M(_)}function F(_){return _===null||$(_)?(k.exit("codeFencedFence"),q(_)):M(_)}}}function kd(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Wr={name:"codeIndented",tokenize:Sd},Nd={partial:!0,tokenize:Cd};function Sd(e,t,n){const r=this;return s;function s(c){return e.enter("codeIndented"),ue(e,a,"linePrefix",5)(c)}function a(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):$(c)?e.attempt(Nd,o,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||$(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function Cd(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):$(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):ue(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):$(o)?s(o):n(o)}}const _d={name:"codeText",previous:Pd,resolve:Ed,tokenize:Rd};function Ed(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Tn(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Tn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Tn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function dl(e,t,n,r,s,a,o,l,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return h;function h(b){return b===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(b),e.exit(a),m):b===null||b===32||b===41||Ei(b)?n(b):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),w(b))}function m(b){return b===62?(e.enter(a),e.consume(b),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===62?(e.exit("chunkString"),e.exit(l),m(b)):b===null||b===60||$(b)?n(b):(e.consume(b),b===92?y:p)}function y(b){return b===60||b===62||b===92?(e.consume(b),p):p(b)}function w(b){return!d&&(b===null||b===41||Le(b))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(b)):d999||p===null||p===91||p===93&&!u||p===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(a),e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):$(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||$(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),u||(u=!re(p)),p===92?m:h)}function m(p){return p===91||p===92||p===93?(e.consume(p),l++,h):h(p)}}function pl(e,t,n,r,s,a){let o;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(s),e.consume(m),e.exit(s),o=m===40?41:m,u):n(m)}function u(m){return m===o?(e.enter(s),e.consume(m),e.exit(s),e.exit(r),t):(e.enter(a),c(m))}function c(m){return m===o?(e.exit(a),u(o)):m===null?n(m):$(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ue(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===o||m===null||$(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?h:d)}function h(m){return m===o||m===92?(e.consume(m),d):d(m)}}function qn(e,t){let n;return r;function r(s){return $(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):re(s)?ue(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const Fd={name:"definition",tokenize:Bd},zd={partial:!0,tokenize:qd};function Bd(e,t,n){const r=this;let s;return a;function a(p){return e.enter("definition"),o(p)}function o(p){return hl.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return s=tn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):n(p)}function u(p){return Le(p)?qn(e,c)(p):c(p)}function c(p){return dl(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(zd,h,h)(p)}function h(p){return re(p)?ue(e,m,"whitespace")(p):m(p)}function m(p){return p===null||$(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function qd(e,t,n){return r;function r(l){return Le(l)?qn(e,s)(l):n(l)}function s(l){return pl(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return re(l)?ue(e,o,"whitespace")(l):o(l)}function o(l){return l===null||$(l)?t(l):n(l)}}const Ud={name:"hardBreakEscape",tokenize:$d};function $d(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return $(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Hd={name:"headingAtx",resolve:Kd,tokenize:Qd};function Kd(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ct(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function Qd(e,t,n){let r=0;return s;function s(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||Le(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||$(d)?(e.exit("atxHeading"),t(d)):re(d)?ue(e,l,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),l(d))}function c(d){return d===null||d===35||Le(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),c)}}const Vd=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ia=["pre","script","style","textarea"],Wd={concrete:!0,name:"htmlFlow",resolveTo:Xd,tokenize:Yd},Gd={partial:!0,tokenize:eh},Jd={partial:!0,tokenize:Zd};function Xd(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Yd(e,t,n){const r=this;let s,a,o,l,u;return c;function c(x){return d(x)}function d(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),h}function h(x){return x===33?(e.consume(x),m):x===47?(e.consume(x),a=!0,w):x===63?(e.consume(x),s=3,r.interrupt?t:f):lt(x)?(e.consume(x),o=String.fromCharCode(x),j):n(x)}function m(x){return x===45?(e.consume(x),s=2,p):x===91?(e.consume(x),s=5,l=0,y):lt(x)?(e.consume(x),s=4,r.interrupt?t:f):n(x)}function p(x){return x===45?(e.consume(x),r.interrupt?t:f):n(x)}function y(x){const Oe="CDATA[";return x===Oe.charCodeAt(l++)?(e.consume(x),l===Oe.length?r.interrupt?t:E:y):n(x)}function w(x){return lt(x)?(e.consume(x),o=String.fromCharCode(x),j):n(x)}function j(x){if(x===null||x===47||x===62||Le(x)){const Oe=x===47,ye=o.toLowerCase();return!Oe&&!a&&Ia.includes(ye)?(s=1,r.interrupt?t(x):E(x)):Vd.includes(o.toLowerCase())?(s=6,Oe?(e.consume(x),b):r.interrupt?t(x):E(x)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):a?v(x):N(x))}return x===45||Ue(x)?(e.consume(x),o+=String.fromCharCode(x),j):n(x)}function b(x){return x===62?(e.consume(x),r.interrupt?t:E):n(x)}function v(x){return re(x)?(e.consume(x),v):B(x)}function N(x){return x===47?(e.consume(x),B):x===58||x===95||lt(x)?(e.consume(x),C):re(x)?(e.consume(x),N):B(x)}function C(x){return x===45||x===46||x===58||x===95||Ue(x)?(e.consume(x),C):z(x)}function z(x){return x===61?(e.consume(x),k):re(x)?(e.consume(x),z):N(x)}function k(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),u=x,q):re(x)?(e.consume(x),k):M(x)}function q(x){return x===u?(e.consume(x),u=null,P):x===null||$(x)?n(x):(e.consume(x),q)}function M(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||Le(x)?z(x):(e.consume(x),M)}function P(x){return x===47||x===62||re(x)?N(x):n(x)}function B(x){return x===62?(e.consume(x),L):n(x)}function L(x){return x===null||$(x)?E(x):re(x)?(e.consume(x),L):n(x)}function E(x){return x===45&&s===2?(e.consume(x),O):x===60&&s===1?(e.consume(x),Q):x===62&&s===4?(e.consume(x),ce):x===63&&s===3?(e.consume(x),f):x===93&&s===5?(e.consume(x),se):$(x)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(Gd,Se,G)(x)):x===null||$(x)?(e.exit("htmlFlowData"),G(x)):(e.consume(x),E)}function G(x){return e.check(Jd,F,Se)(x)}function F(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),_}function _(x){return x===null||$(x)?G(x):(e.enter("htmlFlowData"),E(x))}function O(x){return x===45?(e.consume(x),f):E(x)}function Q(x){return x===47?(e.consume(x),o="",he):E(x)}function he(x){if(x===62){const Oe=o.toLowerCase();return Ia.includes(Oe)?(e.consume(x),ce):E(x)}return lt(x)&&o.length<8?(e.consume(x),o+=String.fromCharCode(x),he):E(x)}function se(x){return x===93?(e.consume(x),f):E(x)}function f(x){return x===62?(e.consume(x),ce):x===45&&s===2?(e.consume(x),f):E(x)}function ce(x){return x===null||$(x)?(e.exit("htmlFlowData"),Se(x)):(e.consume(x),ce)}function Se(x){return e.exit("htmlFlow"),t(x)}}function Zd(e,t,n){const r=this;return s;function s(o){return $(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function eh(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(zr,t,n)}}const th={name:"htmlText",tokenize:nh};function nh(e,t,n){const r=this;let s,a,o;return l;function l(f){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(f),u}function u(f){return f===33?(e.consume(f),c):f===47?(e.consume(f),z):f===63?(e.consume(f),N):lt(f)?(e.consume(f),M):n(f)}function c(f){return f===45?(e.consume(f),d):f===91?(e.consume(f),a=0,y):lt(f)?(e.consume(f),v):n(f)}function d(f){return f===45?(e.consume(f),p):n(f)}function h(f){return f===null?n(f):f===45?(e.consume(f),m):$(f)?(o=h,Q(f)):(e.consume(f),h)}function m(f){return f===45?(e.consume(f),p):h(f)}function p(f){return f===62?O(f):f===45?m(f):h(f)}function y(f){const ce="CDATA[";return f===ce.charCodeAt(a++)?(e.consume(f),a===ce.length?w:y):n(f)}function w(f){return f===null?n(f):f===93?(e.consume(f),j):$(f)?(o=w,Q(f)):(e.consume(f),w)}function j(f){return f===93?(e.consume(f),b):w(f)}function b(f){return f===62?O(f):f===93?(e.consume(f),b):w(f)}function v(f){return f===null||f===62?O(f):$(f)?(o=v,Q(f)):(e.consume(f),v)}function N(f){return f===null?n(f):f===63?(e.consume(f),C):$(f)?(o=N,Q(f)):(e.consume(f),N)}function C(f){return f===62?O(f):N(f)}function z(f){return lt(f)?(e.consume(f),k):n(f)}function k(f){return f===45||Ue(f)?(e.consume(f),k):q(f)}function q(f){return $(f)?(o=q,Q(f)):re(f)?(e.consume(f),q):O(f)}function M(f){return f===45||Ue(f)?(e.consume(f),M):f===47||f===62||Le(f)?P(f):n(f)}function P(f){return f===47?(e.consume(f),O):f===58||f===95||lt(f)?(e.consume(f),B):$(f)?(o=P,Q(f)):re(f)?(e.consume(f),P):O(f)}function B(f){return f===45||f===46||f===58||f===95||Ue(f)?(e.consume(f),B):L(f)}function L(f){return f===61?(e.consume(f),E):$(f)?(o=L,Q(f)):re(f)?(e.consume(f),L):P(f)}function E(f){return f===null||f===60||f===61||f===62||f===96?n(f):f===34||f===39?(e.consume(f),s=f,G):$(f)?(o=E,Q(f)):re(f)?(e.consume(f),E):(e.consume(f),F)}function G(f){return f===s?(e.consume(f),s=void 0,_):f===null?n(f):$(f)?(o=G,Q(f)):(e.consume(f),G)}function F(f){return f===null||f===34||f===39||f===60||f===61||f===96?n(f):f===47||f===62||Le(f)?P(f):(e.consume(f),F)}function _(f){return f===47||f===62||Le(f)?P(f):n(f)}function O(f){return f===62?(e.consume(f),e.exit("htmlTextData"),e.exit("htmlText"),t):n(f)}function Q(f){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),he}function he(f){return re(f)?ue(e,se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):se(f)}function se(f){return e.enter("htmlTextData"),o(f)}}const Yi={name:"labelEnd",resolveAll:ah,resolveTo:oh,tokenize:lh},rh={tokenize:uh},ih={tokenize:ch},sh={tokenize:dh};function ah(e){let t=-1;const n=[];for(;++t=3&&(c===null||$(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===s?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),re(c)?ue(e,l,"whitespace")(c):l(c))}}const Ie={continuation:{tokenize:vh},exit:kh,name:"list",tokenize:wh},bh={partial:!0,tokenize:Nh},yh={partial:!0,tokenize:jh};function wh(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return l;function l(p){const y=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Pi(p)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Er,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return n(p)}function u(p){return Pi(p)&&++o<10?(e.consume(p),u):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(zr,r.interrupt?n:d,e.attempt(bh,m,h))}function d(p){return r.containerState.initialBlankLine=!0,a++,m(p)}function h(p){return re(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):n(p)}function m(p){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function vh(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(zr,s,a);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ue(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!re(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(yh,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ue(e,e.attempt(Ie,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function jh(e,t,n){const r=this;return ue(e,s,"listItemIndent",r.containerState.size+1);function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function kh(e){e.exit(this.containerState.type)}function Nh(e,t,n){const r=this;return ue(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const o=r.events[r.events.length-1];return!re(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Ta={name:"setextUnderline",resolveTo:Sh,tokenize:Ch};function Sh(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Ch(e,t,n){const r=this;let s;return a;function a(c){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),s=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===s?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),re(c)?ue(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||$(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const _h={tokenize:Eh};function Eh(e){const t=this,n=e.attempt(zr,r,e.attempt(this.parser.constructs.flowInitial,s,ue(e,e.attempt(this.parser.constructs.flow,s,e.attempt(Ad,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Ph={resolveAll:fl()},Rh=ml("string"),Ih=ml("text");function ml(e){return{resolveAll:fl(e==="text"?Th:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,o,l);return o;function o(d){return c(d)?a(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),a(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const h=s[d];let m=-1;if(h)for(;++m-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[s].slice(0,a))}return o}function Kh(e,t){let n=-1;const r=[];let s;for(;++n0){const Fe=H.tokenStack[H.tokenStack.length-1];(Fe[1]||La).call(H,void 0,Fe[0])}for(I.position={start:wt(S.length>0?S[0][1].start:{line:1,column:1,offset:0}),end:wt(S.length>0?S[S.length-2][1].end:{line:1,column:1,offset:0})},ne=-1;++ne0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function sp(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ap(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function op(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=jn(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function lp(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function up(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function bl(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function cp(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bl(e,t);const s={src:jn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function dp(e,t){const n={src:jn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function hp(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function pp(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bl(e,t);const s={href:jn(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function mp(e,t){const n={href:jn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fp(e,t,n){const r=e.all(t),s=n?xp(n):yl(t),a={},o=[];if(typeof t.checked=="boolean"){const d=r[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l1}function gp(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Qi(t.children[1]),u=Zo(t.children[t.children.length-1]);l&&u&&(o.position={start:l,end:u}),s.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function jp(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(Da(t.slice(s),s>0,!1)),a.join("")}function Da(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===Ma||a===Oa;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===Ma||a===Oa;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function Sp(e,t){const n={type:"text",value:Np(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Cp(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const _p={blockquote:np,break:rp,code:ip,delete:sp,emphasis:ap,footnoteReference:op,heading:lp,html:up,imageReference:cp,image:dp,inlineCode:hp,linkReference:pp,link:mp,listItem:fp,list:gp,paragraph:bp,root:yp,strong:wp,table:vp,tableCell:kp,tableRow:jp,text:Sp,thematicBreak:Cp,toml:vr,yaml:vr,definition:vr,footnoteDefinition:vr};function vr(){}const wl=-1,Br=0,Un=1,Tr=2,Zi=3,es=4,ts=5,ns=6,vl=7,jl=8,Ep=typeof self=="object"?self:globalThis,Fa=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Ep[e](t)},Pp=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,o]=t[s];switch(a){case Br:case wl:return n(o,s);case Un:{const l=n([],s);for(const u of o)l.push(r(u));return l}case Tr:{const l=n({},s);for(const[u,c]of o)l[r(u)]=r(c);return l}case Zi:return n(new Date(o),s);case es:{const{source:l,flags:u}=o;return n(new RegExp(l,u),s)}case ts:{const l=n(new Map,s);for(const[u,c]of o)l.set(r(u),r(c));return l}case ns:{const l=n(new Set,s);for(const u of o)l.add(r(u));return l}case vl:{const{name:l,message:u}=o;return n(Fa(l,u),s)}case jl:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(Fa(a,o),s)};return r},za=e=>Pp(new Map,e)(0),en="",{toString:Rp}={},{keys:Ip}=Object,An=e=>{const t=typeof e;if(t!=="object"||!e)return[Br,t];const n=Rp.call(e).slice(8,-1);switch(n){case"Array":return[Un,en];case"Object":return[Tr,en];case"Date":return[Zi,en];case"RegExp":return[es,en];case"Map":return[ts,en];case"Set":return[ns,en];case"DataView":return[Un,n]}return n.includes("Array")?[Un,n]:n.includes("Error")?[vl,n]:[Tr,n]},jr=([e,t])=>e===Br&&(t==="function"||t==="symbol"),Tp=(e,t,n,r)=>{const s=(o,l)=>{const u=r.push(o)-1;return n.set(l,u),u},a=o=>{if(n.has(o))return n.get(o);let[l,u]=An(o);switch(l){case Br:{let d=o;switch(u){case"bigint":l=jl,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return s([wl],o)}return s([l,d],o)}case Un:{if(u){let m=o;return u==="DataView"?m=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(o)),s([u,[...m]],o)}const d=[],h=s([l,d],o);for(const m of o)d.push(a(m));return h}case Tr:{if(u)switch(u){case"BigInt":return s([u,o.toString()],o);case"Boolean":case"Number":case"String":return s([u,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const d=[],h=s([l,d],o);for(const m of Ip(o))(e||!jr(An(o[m])))&&d.push([a(m),a(o[m])]);return h}case Zi:return s([l,o.toISOString()],o);case es:{const{source:d,flags:h}=o;return s([l,{source:d,flags:h}],o)}case ts:{const d=[],h=s([l,d],o);for(const[m,p]of o)(e||!(jr(An(m))||jr(An(p))))&&d.push([a(m),a(p)]);return h}case ns:{const d=[],h=s([l,d],o);for(const m of o)(e||!jr(An(m)))&&d.push(a(m));return h}}const{message:c}=o;return s([l,{name:u,message:c}],o)};return a},Ba=(e,{json:t,lossy:n}={})=>{const r=[];return Tp(!(t||n),!!t,new Map,r)(e),r},Ar=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?za(Ba(e,t)):structuredClone(e):(e,t)=>za(Ba(e,t));function Ap(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Lp(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Mp(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Ap,r=e.options.footnoteBackLabel||Lp,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u0&&y.push({type:"text",value:" "});let v=typeof n=="string"?n:n(u,p);typeof v=="string"&&(v={type:"text",value:v}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const j=d[d.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const v=j.children[j.children.length-1];v&&v.type==="text"?v.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...y)}else d.push(...y);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(d,!0)};e.patch(c,b),l.push(b)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Ar(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const kl=(function(e){if(e==null)return zp;if(typeof e=="function")return qr(e);if(typeof e=="object")return Array.isArray(e)?Op(e):Dp(e);if(typeof e=="string")return Fp(e);throw new Error("Expected function, string, or object as test")});function Op(e){const t=[];let n=-1;for(;++n":""))+")"})}return m;function m(){let p=Nl,y,w,j;if((!t||a(u,c,d[d.length-1]||void 0))&&(p=Hp(n(u,d)),p[0]===qa))return p;if("children"in u&&u.children){const b=u;if(b.children&&p[0]!==Up)for(w=(r?b.children.length:-1)+o,j=d.concat(b);w>-1&&w0&&n.push({type:"text",value:` -`}),n}function Ua(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function $a(e,t){const n=Qp(e,t),r=n.one(e,void 0),s=Mp(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:` -`},s),a}function Xp(e,t){return e&&"run"in e?async function(n,r){const s=$a(n,{file:r,...t});await e.run(s,r)}:function(n,r){return $a(n,{file:r,...e||t})}}function Ha(e){if(e)throw e}var Jr,Ka;function Yp(){if(Ka)return Jr;Ka=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},a=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!h)return!1;var m;for(m in c);return typeof m>"u"||e.call(c,m)},o=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},l=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return Jr=function u(){var c,d,h,m,p,y,w=arguments[0],j=1,b=arguments.length,v=!1;for(typeof w=="boolean"&&(v=w,w=arguments[1]||{},j=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});jo.length;let u;l&&o.push(s);try{u=e.apply(this,o)}catch(c){const d=c;if(l&&n)throw d;return s(d)}l||(u&&u.then&&typeof u.then=="function"?u.then(a,s):u instanceof Error?s(u):a(u))}function s(o,...l){n||(n=!0,t(o,...l))}function a(o){s(null,o)}}const it={basename:nm,dirname:rm,extname:im,join:sm,sep:"/"};function nm(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');cr(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else o<0&&(a=!0,o=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(r=s):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function rm(e){if(cr(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function im(e){cr(e);let t=e.length,n=-1,r=0,s=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function sm(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function om(e,t){let n="",r=0,s=-1,a=0,o=-1,l,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),s=o,a=0;continue}}else if(n.length>0){n="",r=0,s=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function cr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const lm={cwd:um};function um(){return"/"}function Ai(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function cm(e){if(typeof e=="string")e=new URL(e);else if(!Ai(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return dm(e)}function dm(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[p,...y]=d;const w=r[m][1];Ti(w)&&Ti(p)&&(p=Xr(!0,w,p)),r[m]=[c,p,...y]}}}}const fm=new rs().freeze();function ti(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ni(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ri(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Va(e){if(!Ti(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Wa(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function kr(e){return xm(e)?e:new Cl(e)}function xm(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function gm(e){return typeof e=="string"||bm(e)}function bm(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ym="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ga=[],Ja={allowDangerousHtml:!0},wm=/^(https?|ircs?|mailto|xmpp)$/i,vm=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function jm(e){const t=km(e),n=Nm(e);return Sm(t.runSync(t.parse(n),n),e)}function km(e){const t=e.rehypePlugins||Ga,n=e.remarkPlugins||Ga,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ja}:Ja;return fm().use(tp).use(n).use(Xp,r).use(t)}function Nm(e){const t=e.children||"",n=new Cl;return typeof t=="string"&&(n.value=t),n}function Sm(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||Cm;for(const d of vm)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+ym+d.id,void 0);return Sl(e,c),Lc(e,{Fragment:i.Fragment,components:s,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function c(d,h,m){if(d.type==="raw"&&m&&typeof h=="number")return o?m.children.splice(h,1):m.children[h]={type:"text",value:d.value},h;if(d.type==="element"){let p;for(p in Vr)if(Object.hasOwn(Vr,p)&&Object.hasOwn(d.properties,p)){const y=d.properties[p],w=Vr[p];(w===null||w.includes(d.tagName))&&(d.properties[p]=u(String(y||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!p&&r&&typeof h=="number"&&(p=!r(d,h,m)),p&&m&&typeof h=="number")return l&&d.children?m.children.splice(h,1,...d.children):m.children.splice(h,1),h}}}function Cm(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||wm.test(e.slice(0,t))?e:""}const is="-",_m=e=>{const t=Pm(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(is);return l[0]===""&&l.length!==1&&l.shift(),_l(l,t)||Em(o)},getConflictingClassGroupIds:(o,l)=>{const u=n[o]||[];return l&&r[o]?[...u,...r[o]]:u}}},_l=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?_l(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(is);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},Xa=/^\[(.+)\]$/,Em=e=>{if(Xa.test(e)){const t=Xa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Pm=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Im(Object.entries(e.classGroups),n).forEach(([a,o])=>{Li(o,r,a,t)}),r},Li=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:Ya(t,s);a.classGroupId=n;return}if(typeof s=="function"){if(Rm(s)){Li(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([a,o])=>{Li(o,Ya(t,a),n,r)})})},Ya=(e,t)=>{let n=e;return t.split(is).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Rm=e=>e.isThemeGetter,Im=(e,t)=>t?e.map(([n,r])=>{const s=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,l])=>[t+o,l])):a);return[n,s]}):e,Tm=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return s(a,o),o},set(a,o){n.has(a)?n.set(a,o):s(a,o)}}},El="!",Am=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],a=t.length,o=l=>{const u=[];let c=0,d=0,h;for(let j=0;jd?h-d:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:w}};return n?l=>n({className:l,parseClassName:o}):o},Lm=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Mm=e=>({cache:Tm(e.cacheSize),parseClassName:Am(e),..._m(e)}),Om=/\s+/,Dm=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,a=[],o=e.trim().split(Om);let l="";for(let u=o.length-1;u>=0;u-=1){const c=o[u],{modifiers:d,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}=n(c);let y=!!p,w=r(y?m.substring(0,p):m);if(!w){if(!y){l=c+(l.length>0?" "+l:l);continue}if(w=r(m),!w){l=c+(l.length>0?" "+l:l);continue}y=!1}const j=Lm(d).join(":"),b=h?j+El:j,v=b+w;if(a.includes(v))continue;a.push(v);const N=s(w,y);for(let C=0;C0?" "+l:l)}return l};function Fm(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rh(d),e());return n=Mm(c),r=n.cache.get,s=n.cache.set,a=l,l(u)}function l(u){const c=r(u);if(c)return c;const d=Dm(u,n);return s(u,d),d}return function(){return a(Fm.apply(null,arguments))}}const de=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Rl=/^\[(?:([a-z-]+):)?(.+)\]$/i,Bm=/^\d+\/\d+$/,qm=new Set(["px","full","screen"]),Um=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$m=/\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$/,Hm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Km=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pt=e=>nn(e)||qm.has(e)||Bm.test(e),vt=e=>kn(e,"length",ef),nn=e=>!!e&&!Number.isNaN(Number(e)),ii=e=>kn(e,"number",nn),Ln=e=>!!e&&Number.isInteger(Number(e)),Vm=e=>e.endsWith("%")&&nn(e.slice(0,-1)),W=e=>Rl.test(e),jt=e=>Um.test(e),Wm=new Set(["length","size","percentage"]),Gm=e=>kn(e,Wm,Il),Jm=e=>kn(e,"position",Il),Xm=new Set(["image","url"]),Ym=e=>kn(e,Xm,nf),Zm=e=>kn(e,"",tf),Mn=()=>!0,kn=(e,t,n)=>{const r=Rl.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},ef=e=>$m.test(e)&&!Hm.test(e),Il=()=>!1,tf=e=>Km.test(e),nf=e=>Qm.test(e),rf=()=>{const e=de("colors"),t=de("spacing"),n=de("blur"),r=de("brightness"),s=de("borderColor"),a=de("borderRadius"),o=de("borderSpacing"),l=de("borderWidth"),u=de("contrast"),c=de("grayscale"),d=de("hueRotate"),h=de("invert"),m=de("gap"),p=de("gradientColorStops"),y=de("gradientColorStopPositions"),w=de("inset"),j=de("margin"),b=de("opacity"),v=de("padding"),N=de("saturate"),C=de("scale"),z=de("sepia"),k=de("skew"),q=de("space"),M=de("translate"),P=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",W,t],E=()=>[W,t],G=()=>["",pt,vt],F=()=>["auto",nn,W],_=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>["start","end","center","between","around","evenly","stretch"],se=()=>["","0",W],f=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ce=()=>[nn,W];return{cacheSize:500,separator:":",theme:{colors:[Mn],spacing:[pt,vt],blur:["none","",jt,W],brightness:ce(),borderColor:[e],borderRadius:["none","","full",jt,W],borderSpacing:E(),borderWidth:G(),contrast:ce(),grayscale:se(),hueRotate:ce(),invert:se(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[Vm,vt],inset:L(),margin:L(),opacity:ce(),padding:E(),saturate:ce(),scale:ce(),sepia:se(),skew:ce(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",W]}],container:["container"],columns:[{columns:[jt]}],"break-after":[{"break-after":f()}],"break-before":[{"break-before":f()}],"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"],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:[..._(),W]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ln,W]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",W]}],grow:[{grow:se()}],shrink:[{shrink:se()}],order:[{order:["first","last","none",Ln,W]}],"grid-cols":[{"grid-cols":[Mn]}],"col-start-end":[{col:["auto",{span:["full",Ln,W]},W]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[Mn]}],"row-start-end":[{row:["auto",{span:[Ln,W]},W]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",W]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",W]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...he()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...he(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...he(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[q]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[q]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",W,t]}],"min-w":[{"min-w":[W,t,"min","max","fit"]}],"max-w":[{"max-w":[W,t,"none","full","min","max","fit","prose",{screen:[jt]},jt]}],h:[{h:[W,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[W,t,"auto","min","max","fit"]}],"font-size":[{text:["base",jt,vt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ii]}],"font-family":[{font:[Mn]}],"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:["tighter","tight","normal","wide","wider","widest",W]}],"line-clamp":[{"line-clamp":["none",nn,ii]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",pt,W]}],"list-image":[{"list-image":["none",W]}],"list-style-type":[{list:["none","disc","decimal",W]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",pt,vt]}],"underline-offset":[{"underline-offset":["auto",pt,W]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[..._(),Jm]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Gm]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ym]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:O()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[pt,W]}],"outline-w":[{outline:[pt,vt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[pt,vt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",jt,Zm]}],"shadow-color":[{shadow:[Mn]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",jt,W]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[N]}],sepia:[{sepia:[z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",W]}],duration:[{duration:ce()}],ease:[{ease:["linear","in","out","in-out",W]}],delay:[{delay:ce()}],animate:[{animate:["none","spin","ping","pulse","bounce",W]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Ln,W]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",W]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",W]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",W]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[pt,vt,ii]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}},sf=zm(rf),Mi={status:"",repo:"",thread:"",action:"",intent:"",actor:""},af=new Fu({defaultOptions:{queries:{retry:1}}}),Za=12,of=12,lf=10080*60*1e3,uf=1e3,Tl=Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function V(...e){return sf(iu(e))}async function ee(e,t){const n=new Headers(t==null?void 0:t.headers);n.set("Accept","application/json");const r=await fetch(e,{...t,headers:n});if(!r.ok)throw new Error(`${r.status} ${r.statusText}`);return r.json()}function We(e){if(e==null)return"n/a";const t=Math.max(0,Math.floor(e));if(t<60)return`${t}s`;const n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}const cf=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}),df=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});function dr(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function hf(e){const t=dr(e);return t?cf.format(t):e??""}function $n(e){const t=dr(e);return t?df.format(t):e??""}function Al(e,t){const n=dr(e);if(!n)return e??"";const r=t-n.getTime(),s=Math.abs(r);if(s>lf)return $n(e);const a=r>=0?"ago":"from now",o=Math.round(s/1e3);if(o<45)return r>=0?"just now":"soon";if(o<90)return`1m ${a}`;const l=Math.round(o/60);if(l<60)return`${l}m ${a}`;if(l<90)return`1h ${a}`;const u=Math.round(l/60);return u<24?`${u}h ${a}`:u<36?`1d ${a}`:`${Math.round(u/24)}d ${a}`}function Re({value:e,compact:t=!1,relative:n=!1,now:r=Date.now()}){const s=dr(e);return s?i.jsx("time",{dateTime:s.toISOString(),title:`UTC: ${s.toISOString()}`,children:n?Al(e,r):t?$n(e):hf(e)}):i.jsx(i.Fragment,{children:e??""})}function Ll(e,t){const n=dr(e);return n?Math.max(0,Math.floor((t-n.getTime())/1e3)):null}function ss(e,t){return e.status==="running"?Ll(e.started_at,t)??e.runtime_seconds:e.runtime_seconds}function as(e,t){return e.status==="pending"?Ll(e.created_at,t)??e.queue_wait_seconds:e.queue_wait_seconds}function pf(e){const[t,n]=T.useState(()=>Date.now());return T.useEffect(()=>{if(!e)return;n(Date.now());const r=window.setInterval(()=>n(Date.now()),uf);return()=>window.clearInterval(r)},[e]),t}function mf(e){return(e??"").split(/\r?\n/).map(n=>n.trim()).find(Boolean)??""}function Lr(e,t,n=1){const r=mf(t),s=n>1?` (${n})`:"";return r?`${e}${s}: ${r}`:`${e}${s}`}function Mr(e){return e==="openclaw_stdout"||e==="openclaw_stderr"}function Ml(e){return e.map(t=>t==null?void 0:t.trim()).filter(Boolean).join(` -`)}function ff(e){const t=[];for(const n of e){const r=t[t.length-1];if(r&&Mr(n.event_type)&&r.eventType===n.event_type){r.count+=1,r.meta=n.ts,r.detail=Ml([r.detail,n.detail]),r.summary=Lr(n.summary,r.detail,r.count);continue}t.push({id:String(n.id),badge:n.event_type,meta:n.ts,summary:Mr(n.event_type)?Lr(n.summary,n.detail):n.summary,detail:n.detail,eventType:n.event_type,count:1})}return t}function xf(e){const t=[];return e.forEach((n,r)=>{const s=t[t.length-1];if(s&&Mr(n.kind)&&s.kind===n.kind){s.count+=1,s.meta=n.timestamp,s.text=Ml([s.text,n.text]),s.summary=Lr(`${n.role} · ${n.kind}`,s.text,s.count);return}t.push({id:`${n.timestamp??"entry"}-${r}`,badge:n.title,meta:n.timestamp,summary:Mr(n.kind)?Lr(`${n.role} · ${n.kind}`,n.text):`${n.role} · ${n.kind}`,text:n.text,kind:n.kind,count:1})}),t}function eo(e,t,n,r){return e==="openclaw_stdout"?!1:t||n>=r-2}function gf(e){return{pending:{badge:"border-amber-300 bg-amber-50 text-amber-800",dot:"bg-amber-500"},running:{badge:"border-blue-300 bg-blue-50 text-blue-700",dot:"bg-blue-600"},blocked:{badge:"border-red-300 bg-red-50 text-red-700",dot:"bg-red-600"},denied:{badge:"border-red-300 bg-red-50 text-red-700",dot:"bg-red-600"},done:{badge:"border-emerald-300 bg-emerald-50 text-emerald-700",dot:"bg-emerald-600"},waiting_approval:{badge:"border-slate-300 bg-slate-50 text-slate-700",dot:"bg-slate-500"}}[e]??{badge:"border-slate-300 bg-slate-50 text-slate-700",dot:"bg-slate-500"}}function bf(e,t){const n=new URLSearchParams;for(const[r,s]of Object.entries(e))s.trim()&&n.set(r,s.trim());return n.set("limit",String(t)),`/api/jobs?${n.toString()}`}function yf(e,t,n=50){const r=new URLSearchParams;return e.trim()&&r.set("repo",e.trim()),t.trim()&&r.set("status",t.trim()),r.set("limit",String(n)),`/api/knowledge?${r.toString()}`}function wf(e){return{timeseries:e==="overview",hooks:e==="hooks",deliveries:e==="deliveries"}}function vf(e,t,n="day"){return`/api/webhooks/github/timeseries?${new URLSearchParams({from:e,to:t,bucket:n}).toString()}`}function jf(e=50,t){const n=new URLSearchParams({limit:String(e)});return t&&n.set("cursor",t),`/api/webhooks/github/hooks?${n.toString()}`}function kf(e=50,t,n){const r=new URLSearchParams({limit:String(e)});t&&r.set("cursor",t);for(const[s,a]of Object.entries(n??{}))a!=null&&a.trim()&&r.set(s,a.trim());return`/api/webhooks/github/deliveries?${r.toString()}`}function Nr(e=new Date){return{from:new Date(e.getTime()-720*60*60*1e3).toISOString(),to:e.toISOString()}}function Nf(e=Tl){return`/api/metrics/summary?timezone=${encodeURIComponent(e)}`}function et(e){try{const t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"?t.href:"#"}catch{return"#"}}function Pr(){return"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}function Sf(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="github-agent-bridge:push")}function Cf(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),r=window.atob(n),s=new Uint8Array(r.length);for(let a=0;an.id===t.id)?e:[...e,t]}function Ef(e,t){const n=to(t);return e.some(r=>to(r)===n)?e:[...e,t]}function to(e){return`${e.timestamp??""}:${e.role}:${e.kind}:${e.title}:${e.text}`}function Pf(e){return["claimed","dispatch_started","dispatch_finished","done","blocked","denied","waiting_approval"].includes(e)}function Fn(e){return["blocked","denied","waiting_approval"].includes(e)}function Oi(e,t){return e.status!=="running"?!1:t!=null&&t.is_admin?!0:!!(t!=null&&t.login&&e.trigger_actor&&t.login.toLowerCase()===e.trigger_actor.toLowerCase())}function Rf(e=window.location.pathname){const t=e.match(/^\/jobs\/(\d+)\/?$/);return t?Number(t[1]):null}function If(e=window.location.pathname){return/^\/knowledge\/?$/.test(e)}function Tf(e=window.location.pathname){return/^\/mcp\/?$/.test(e)}function Af(e=window.location.pathname){return/^\/system\/?$/.test(e)}function Lf(e=window.location.pathname){const t=e.match(/^\/webhooks\/hooks\/([^/]+)\/?$/);return t?decodeURIComponent(t[1]):null}function si(e=window.location.pathname){return/^\/webhooks(?:\/hooks\/[^/]+)?\/?$/.test(e)}function Ol(e){return e.startsWith("repo:")?e.slice(5):e}function no(e){return Object.values(e).some(t=>t.trim()!=="")}function Mf(e){return[{key:"status",label:"Status",value:e.status},{key:"repo",label:"Repo",value:e.repo},{key:"thread",label:"Thread",value:e.thread},{key:"action",label:"Action",value:e.action},{key:"actor",label:"Actor",value:e.actor.trim()?`@${e.actor.trim().replace(/^@/,"")}`:""},{key:"intent",label:"Intent",value:e.intent}].filter(t=>t.value.trim()!=="")}function Of(){var us,cs,ds,hs,ps,ms,fs,xs,gs,bs,ys,ws,vs,js,ks,Ns,Ss,Cs,_s,Es,Ps,Rs,Is,Ts,As,Ls,Ms,Os,Ds,Fs,zs,Bs,qs,Us,$s,Hs,Ks,Qs,Vs,Ws,Gs,Js;const e=Oo(),[t,n]=T.useState(Mi),[r,s]=T.useState(Za),a=T.useRef(!1),[o,l]=T.useState(""),[u,c]=T.useState("proposed"),[d,h]=T.useState("overview"),[m,p]=T.useState({hook_id:"",event_name:"",repository:"",result:""}),[y,w]=T.useState(()=>Nr()),[j,b]=T.useState(null),[v,N]=T.useState(""),[C,z]=T.useState(()=>window.location.pathname),[k,q]=T.useState(null),M=Rf(C),P=M!==null,B=If(C),L=Tf(C),E=Af(C),G=si(C),F=Lf(C),_=!P&&!B&&!L&&!E&&!G,O=M,Q=ge({queryKey:["metrics",Tl],queryFn:()=>ee(Nf()),enabled:_||E}),he=ge({queryKey:["dashboard-status"],queryFn:()=>ee("/api/status")}),se=ge({queryKey:["me"],queryFn:()=>ee("/api/me"),refetchInterval:!1}),f=G&&!!((cs=(us=se.data)==null?void 0:us.user)!=null&&cs.is_admin&&((ds=he.data)!=null&&ds.webhook_configured)),ce=wf(d),Se=ge({queryKey:["web-push-config"],queryFn:()=>ee("/api/web-push/config"),enabled:!!((hs=se.data)!=null&&hs.user)}),x=ge({queryKey:["about"],queryFn:()=>ee("/api/about")}),Oe=ge({queryKey:["job-actors"],queryFn:()=>ee("/api/jobs/actors"),enabled:_}),ye=ge({queryKey:["jobs",t,r],queryFn:()=>ee(bf(t,r)),enabled:_,placeholderData:A=>A}),me=ge({queryKey:["processes"],queryFn:()=>ee("/api/processes"),enabled:E}),tt=ge({queryKey:["systemd"],queryFn:()=>ee("/api/systemd"),enabled:E}),De=ge({queryKey:["alerts"],queryFn:()=>ee("/api/alerts"),enabled:E}),Ge=ge({queryKey:["webhook-summary"],queryFn:()=>ee("/api/webhooks/github/summary"),enabled:f}),nt=ge({queryKey:["webhook-timeseries",y.from,y.to,"day"],queryFn:()=>ee(vf(y.from,y.to)),enabled:f&&ce.timeseries}),$e=da({queryKey:["webhook-hooks"],queryFn:({pageParam:A})=>ee(jf(50,A)),initialPageParam:null,getNextPageParam:A=>A.next_cursor??void 0,enabled:f&&ce.hooks&&F===null}),dt=da({queryKey:["webhook-deliveries",m],queryFn:({pageParam:A})=>ee(kf(50,A,m)),initialPageParam:null,getNextPageParam:A=>A.next_cursor??void 0,enabled:f&&ce.deliveries&&F===null}),Xt=ge({queryKey:["webhook-hook",F],queryFn:()=>ee(`/api/webhooks/github/hooks/${encodeURIComponent(F??"")}`),enabled:f&&F!==null}),Yt=ge({queryKey:["knowledge",o,u],queryFn:()=>ee(yf(o,u)),enabled:B}),Lt=ge({queryKey:["mcp-tokens"],queryFn:()=>ee("/api/mcp/tokens"),enabled:L&&!!((ps=se.data)!=null&&ps.user)}),hr=ge({queryKey:["mcp-users"],queryFn:()=>ee("/api/mcp/users"),enabled:L&&!!((ms=se.data)!=null&&ms.user)}),Mt=ge({queryKey:["job",O],queryFn:()=>ee(`/api/jobs/${O}`),enabled:O!==null}),pr=ge({queryKey:["job-session",O],queryFn:()=>ee(`/api/jobs/${O}/session`),enabled:O!==null}),Cn=ge({queryKey:["job-session-events",O],queryFn:()=>ee(`/api/jobs/${O}/session/events`),enabled:O!==null}),_n=ge({queryKey:["job-session-transcript",O],queryFn:()=>ee(`/api/jobs/${O}/session/transcript`),enabled:O!==null}),mr=T.useCallback(async A=>{const ae=await ee(`/api/jobs/${A}/retry`,{method:"POST"});e.setQueryData(["job",A],{job:ae.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]})},[e]),fr=T.useCallback(async A=>{const ae=await ee(`/api/jobs/${A}/dismiss`,{method:"POST"});e.setQueryData(["job",A],{job:ae.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]})},[e]),xr=T.useCallback(async(A,ae)=>{const pe=await ee(`/api/jobs/${A}/cancel`,{method:"POST",body:JSON.stringify({reason:ae||""})});e.setQueryData(["job",A],{job:pe.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]}),e.invalidateQueries({queryKey:["dashboard-status"]})},[e]),gr=T.useCallback(async(A,ae)=>{await ee(`/api/knowledge/proposals/${encodeURIComponent(A)}/${ae}`,{method:"POST"}),e.invalidateQueries({queryKey:["knowledge"]}),e.invalidateQueries({queryKey:["dashboard-status"]})},[e]),Ur=T.useCallback(async A=>{await ee(`/api/knowledge/rules/${encodeURIComponent(A)}`,{method:"DELETE"}),e.invalidateQueries({queryKey:["knowledge"]})},[e]),S=T.useCallback(async(A,ae)=>{await ee(`/api/knowledge/rules/${encodeURIComponent(A)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:ae})}),e.invalidateQueries({queryKey:["knowledge"]})},[e]),I=T.useCallback(async(A,ae)=>{const pe=await ee("/api/mcp/tokens",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:A,user_login:ae||void 0})});return e.invalidateQueries({queryKey:["mcp-tokens"]}),pe},[e]),H=T.useCallback(async(A,ae)=>{await ee(`/api/mcp/tokens/${encodeURIComponent(A)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_login:ae})}),e.invalidateQueries({queryKey:["mcp-tokens"]}),e.invalidateQueries({queryKey:["mcp-users"]})},[e]),J=T.useCallback(async A=>{await ee(`/api/mcp/tokens/${encodeURIComponent(A)}`,{method:"DELETE"}),e.invalidateQueries({queryKey:["mcp-tokens"]})},[e]),ne=T.useCallback(async A=>{const ae={refresh:"/api/autoupdate/refresh",apply:"/api/autoupdate/apply",complete:"/api/autoupdate/complete-pending"}[A];b(A),N("");try{await ee(ae,{method:"POST"}),e.invalidateQueries({queryKey:["dashboard-status"]})}catch(pe){e.invalidateQueries({queryKey:["dashboard-status"]}),N(pe instanceof Error?pe.message:String(pe))}finally{b(null)}},[e]),Fe=T.useCallback(async()=>{var Xs;const A=(Xs=Se.data)==null?void 0:Xs.public_key;if(!A)throw new Error("web_push_not_configured");if(!Pr())throw new Error("web_push_not_supported");if(await window.Notification.requestPermission()!=="granted")throw new Error("notification_permission_denied");const pe=await navigator.serviceWorker.register("/service-worker.js"),tu=await pe.pushManager.getSubscription()??await pe.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Cf(A)});await ee("/api/web-push/subscriptions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(tu.toJSON())}),e.invalidateQueries({queryKey:["web-push-config"]})},[e,(fs=Se.data)==null?void 0:fs.public_key]),ht=T.useCallback(async()=>{if(!Pr())return;const ae=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(!ae)return;const pe=ae.endpoint;await ae.unsubscribe(),await ee("/api/web-push/subscriptions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:pe})}),e.invalidateQueries({queryKey:["web-push-config"]})},[e]);T.useEffect(()=>{var A;!((A=Se.data)!=null&&A.status.enabled)||!Pr()||navigator.serviceWorker.register("/service-worker.js").catch(()=>{})},[(xs=Se.data)==null?void 0:xs.status.enabled]),T.useEffect(()=>{if(O===null)return;const A=new EventSource(`/api/jobs/${O}/session/stream`);return A.addEventListener("session_event",ae=>{const pe=Or(ae);pe&&(e.setQueryData(["job-session-events",O],yt=>({events:_f((yt==null?void 0:yt.events)??[],pe)})),Pf(pe.event_type)&&(e.invalidateQueries({queryKey:["job",O]}),e.invalidateQueries({queryKey:["jobs"]})))}),A.addEventListener("transcript_entry",ae=>{const pe=Or(ae);!pe||pe.job_id!==O||e.setQueryData(["job-session-transcript",O],yt=>({entries:Ef((yt==null?void 0:yt.entries)??[],pe.entry)}))}),A.onerror=()=>{e.invalidateQueries({queryKey:["job",O]}),e.invalidateQueries({queryKey:["job-session-events",O]}),e.invalidateQueries({queryKey:["job-session-transcript",O]})},()=>A.close()},[O,e]),T.useEffect(()=>{const A=()=>{si(window.location.pathname)&&w(Nr()),z(window.location.pathname)};return window.addEventListener("popstate",A),()=>window.removeEventListener("popstate",A)},[]),T.useEffect(()=>{if(!("serviceWorker"in navigator))return;const A=ae=>{if(!Sf(ae.data))return;const pe={...ae.data.payload,id:Date.now(),receivedAt:Date.now()};q(pe),pe.job_id&&(e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["job",pe.job_id]}),e.invalidateQueries({queryKey:["metrics"]}))};return navigator.serviceWorker.addEventListener("message",A),()=>navigator.serviceWorker.removeEventListener("message",A)},[e]),T.useEffect(()=>{if(!k)return;const A=window.setTimeout(()=>q(null),12e3);return()=>window.clearTimeout(A)},[k]);const Je=T.useCallback(A=>{window.history.pushState({},"",Nn(A)),z(window.location.pathname)},[]),He=T.useCallback(A=>{window.history.pushState({},"",A),si(A)&&w(Nr()),z(window.location.pathname)},[]),Ke=((gs=Q.data)==null?void 0:gs.metrics.status_counts)??{},we=((bs=ye.data)==null?void 0:bs.jobs)??[],gt=T.useCallback(A=>{n(A),s(Za),a.current=!1},[]);T.useEffect(()=>{ye.isFetching||(a.current=!1)},[ye.isFetching]);const Xe=T.useCallback(()=>{a.current||(a.current=!0,s(A=>A+of))},[]),bt=O?((ys=Mt.data)==null?void 0:ys.job)??null:null,Wl=we.some(A=>A.status==="running"||A.status==="pending")||(bt==null?void 0:bt.status)==="running"||(bt==null?void 0:bt.status)==="pending"||!!((ws=me.data)!=null&&ws.running_jobs.length),En=pf(Wl),Gl=i.jsx(Gf,{selectedJobId:O,selectedJob:bt,loading:Mt.isLoading,error:Mt.error,session:(vs=pr.data)==null?void 0:vs.session,sessionEvents:(js=Cn.data)==null?void 0:js.events,transcript:(ks=_n.data)==null?void 0:ks.entries,now:En}),Jl=((Ns=$e.data)==null?void 0:Ns.pages.flatMap(A=>A.hooks))??[],Xl=((Ss=dt.data)==null?void 0:Ss.pages.flatMap(A=>A.deliveries))??[],Yl=d==="overview"?nt.isLoading:d==="hooks"?$e.isLoading:dt.isLoading,Zl=d==="overview"?nt.error:d==="hooks"?$e.error:dt.error,eu=()=>{Ge.refetch(),d==="overview"&&w(Nr()),d==="hooks"&&$e.refetch(),d==="deliveries"&&dt.refetch()};return i.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[i.jsx("header",{className:"border-b border-slate-800 bg-slate-950 text-white",children:i.jsxs("div",{className:"mx-auto flex w-full max-w-[1440px] items-center justify-between gap-3 px-4 py-4 md:px-6",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h1",{className:"truncate text-xl font-semibold",children:"GitHub Agent Bridge"}),i.jsx(Df,{about:x.data})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[i.jsx(ox,{config:Se.data,loading:Se.isLoading,onEnable:Fe,onDisable:ht}),i.jsx(ax,{user:(Cs=se.data)==null?void 0:Cs.user,loading:se.isLoading})]})]})}),i.jsxs("main",{className:"mx-auto grid w-full max-w-[1440px] gap-4 px-3 py-4 sm:px-4 md:px-6 md:py-5",children:[i.jsx($f,{isDashboardRoute:_,isSystemRoute:E,isKnowledgeRoute:B,isMcpRoute:L,isWebhooksRoute:G,showWebhooks:!!((Es=(_s=se.data)==null?void 0:_s.user)!=null&&Es.is_admin&&((Ps=he.data)!=null&&Ps.webhook_configured)),knowledgeBadgeCount:((Ts=(Is=(Rs=he.data)==null?void 0:Rs.metrics)==null?void 0:Is.knowledge)==null?void 0:Ts.proposed)??0,onNavigate:He}),i.jsx(lx,{notification:k,onDismiss:()=>q(null),onNavigate:He}),M!==null?i.jsx(Wf,{jobId:M,detail:Gl,selectedJob:bt,user:(As=se.data)==null?void 0:As.user,onBackToDashboard:()=>He("/"),onRetry:mr,onDismiss:fr,onCancel:xr,onRefresh:()=>{Mt.refetch(),pr.refetch(),Cn.refetch(),_n.refetch()}}):B?i.jsx(Jf,{data:Yt.data,loading:Yt.isLoading,error:Yt.error,repo:o,status:u,user:(Ls=se.data)==null?void 0:Ls.user,now:En,onRepoChange:l,onStatusChange:c,onApprove:A=>gr(A,"approve"),onReject:A=>gr(A,"reject"),onUpdateRuleScope:S,onDeleteRule:Ur,onRefresh:()=>Yt.refetch()}):L?i.jsx(nx,{tokens:(Ms=Lt.data)==null?void 0:Ms.tokens,loading:Lt.isLoading,error:Lt.error,user:(Os=se.data)==null?void 0:Os.user,ownerOptions:((Ds=hr.data)==null?void 0:Ds.users)??[],dashboardUrl:(Fs=he.data)==null?void 0:Fs.dashboard_url,dashboardUrlSource:(zs=he.data)==null?void 0:zs.dashboard_url_source,now:En,onCreate:I,onUpdateOwner:H,onRevoke:J,onRefresh:()=>Lt.refetch()}):G?F?i.jsx(Qf,{data:Xt.data,loading:Xt.isLoading,error:Xt.error,onBack:()=>{h("hooks"),He("/webhooks")},onRefresh:()=>Xt.refetch(),onViewHook:A=>He(`/webhooks/hooks/${encodeURIComponent(A)}`)}):i.jsx(Hf,{summary:Ge.data,timeseries:(Bs=nt.data)==null?void 0:Bs.points,hooks:Jl,deliveries:Xl,section:d,summaryLoading:Ge.isLoading,sectionLoading:Yl,loadingMore:d==="hooks"?$e.isFetchingNextPage:dt.isFetchingNextPage,hasMore:d==="hooks"?$e.hasNextPage:dt.hasNextPage,deliveryFilters:m,error:Ge.error??Zl,onSectionChange:h,onLoadMore:()=>d==="hooks"?$e.fetchNextPage():dt.fetchNextPage(),onDeliveryFiltersChange:p,onViewHook:A=>He(`/webhooks/hooks/${encodeURIComponent(A)}`),onRefresh:eu}):E?i.jsx(Vf,{processes:me.data,processesLoading:me.isLoading,processesError:me.error,systemd:tt.data,systemdLoading:tt.isLoading,systemdError:tt.error,alerts:(qs=De.data)==null?void 0:qs.alerts,alertsLoading:De.isLoading,alertsError:De.error,now:En,onRefreshProcesses:()=>me.refetch(),onRefreshSystemd:()=>tt.refetch(),onRefreshAlerts:()=>De.refetch()}):i.jsxs(i.Fragment,{children:[Q.error?i.jsx(Ne,{tone:"error",text:Q.error.message}):null,he.error?i.jsx(Ne,{tone:"error",text:he.error.message}):null,i.jsx(Ff,{state:(Us=he.data)==null?void 0:Us.autoupdate,isAdmin:!!((Hs=($s=se.data)==null?void 0:$s.user)!=null&&Hs.is_admin),runningAction:j,actionError:v,onRefresh:()=>ne("refresh"),onApply:()=>ne("apply"),onCompletePending:()=>ne("complete")}),i.jsxs("section",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Summary metrics",children:[i.jsx(_e,{title:"Pending",value:Ke.pending??0,icon:i.jsx(Uo,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Running",value:Ke.running??0,icon:i.jsx(gn,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Blocked",value:Ke.blocked??0,icon:i.jsx(Fr,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Done",value:Ke.done??0,icon:i.jsx(yn,{className:"h-5 w-5"})})]}),i.jsxs("section",{className:"grid gap-3",children:[i.jsx(ux,{count:we.length,limit:r,loading:ye.isLoading,onRefresh:()=>ye.refetch()}),i.jsxs(xe,{title:"Recent jobs",flushHeader:!0,children:[i.jsx(cx,{filters:t,actorOptions:((Ks=Oe.data)==null?void 0:Ks.actors)??[],onChange:gt}),ye.error?i.jsx(Ne,{tone:"error",text:ye.error.message}):null,i.jsx(hx,{jobs:we,loading:ye.isLoading,loadingMore:ye.isFetching&&!ye.isLoading,hasMore:we.length>=r,onLoadMore:Xe,onViewJob:Je,now:En,user:(Qs=se.data)==null?void 0:Qs.user,onRetry:mr,onDismiss:fr,onCancel:xr})]}),i.jsx(xe,{title:"Runtime usage",action:i.jsx(ut,{onClick:()=>Q.refetch()}),children:i.jsx(Cx,{usage:(Vs=Q.data)==null?void 0:Vs.metrics.runtime_usage,loading:Q.isLoading,totalJobs:oo(Ke)})})]}),i.jsxs("section",{className:"grid gap-4 xl:grid-cols-3",children:[i.jsx(xe,{title:"Runtime percentiles",children:i.jsx(ao,{label:"runtime",values:(Ws=Q.data)==null?void 0:Ws.metrics.runtime_seconds})}),i.jsx(xe,{title:"Jobs per day",children:i.jsx(Sx,{values:(Gs=Q.data)==null?void 0:Gs.metrics.by_created_day,loading:Q.isLoading,totalJobs:oo(Ke)})}),i.jsx(xe,{title:"Queue wait percentiles",children:i.jsx(ao,{label:"queue wait",values:(Js=Q.data)==null?void 0:Js.metrics.queue_wait_seconds})})]})]})]})]})}function Df({about:e}){const t=e!=null&&e.version?`v${e.version}`:"version loading";return i.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-slate-300",children:[i.jsx("span",{children:"Operational dashboard"}),i.jsx("span",{className:"font-mono text-xs text-slate-400",children:t}),e!=null&&e.repository_url?i.jsxs("a",{className:"inline-flex items-center gap-1 text-xs font-semibold text-slate-200 hover:underline",href:et(e.repository_url),rel:"noreferrer",target:"_blank",children:[i.jsx(Wt,{className:"h-3.5 w-3.5","aria-hidden":!0}),"GitHub"]}):null]})}function Ff({state:e,isAdmin:t,runningAction:n=null,actionError:r="",onRefresh:s,onApply:a,onCompletePending:o}){var j,b,v,N,C,z,k,q,M,P,B;if(!e)return null;const l=(b=(j=e==null?void 0:e.target)==null?void 0:j.tag_name)==null?void 0:b.trim();if(!t||!l||(e==null?void 0:e.decision)==="noop")return null;const u=zf(e.decision),c=((v=e.queue)==null?void 0:v.active_total)??0,d=Bf((N=e.classification)==null?void 0:N.risk),h=qf((C=e.target)==null?void 0:C.body),m=((k=(z=e.classification)==null?void 0:z.migration_files)==null?void 0:k.length)??0,p=((M=(q=e.classification)==null?void 0:q.risky_files)==null?void 0:M.length)??0,y=!!(e.executor_reload_pending&&e.dashboard_applied_at&&o),w=!!(a&&m===0);return i.jsxs("section",{className:"rounded-md border border-amber-300 bg-amber-50 p-3 text-amber-950 shadow-sm","aria-label":"Update available",children:[i.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx(Fr,{className:"h-4 w-4 text-amber-700","aria-hidden":!0}),i.jsx("h2",{className:"text-sm font-semibold",children:"Update available"}),i.jsx("span",{className:"rounded-sm border border-amber-300 bg-white px-1.5 py-0.5 font-mono text-[11px] text-amber-800",children:l}),(P=e.target)!=null&&P.url?i.jsxs("a",{className:"inline-flex items-center gap-1 text-xs font-semibold text-amber-800 hover:underline",href:et(e.target.url),rel:"noreferrer",target:"_blank",children:[i.jsx(Wt,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Release"]}):null]}),i.jsxs("p",{className:"mt-1 text-sm text-amber-900",children:[u,e.installed_tag?i.jsxs("span",{className:"font-mono",children:[" from ",e.installed_tag]}):null]}),i.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[s?i.jsxs("button",{className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-md border border-amber-300 bg-white px-2.5 text-xs font-semibold text-amber-900 hover:bg-amber-100 disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:n!==null,onClick:s,children:[i.jsx(lr,{className:V("h-3.5 w-3.5",n==="refresh"&&"animate-spin"),"aria-hidden":!0}),n==="refresh"?"Checking...":"Check now"]}):null,w?i.jsxs("button",{className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-md bg-amber-800 px-2.5 text-xs font-semibold text-white hover:bg-amber-900 disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:n!==null,onClick:()=>{window.confirm(`Apply ${l}? This can restart bridge services according to the recorded safe plan.`)&&(a==null||a())},children:[i.jsx(yn,{className:"h-3.5 w-3.5","aria-hidden":!0}),n==="apply"?"Applying...":"Apply update"]}):null,y?i.jsxs("button",{className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-md border border-amber-300 bg-white px-2.5 text-xs font-semibold text-amber-900 hover:bg-amber-100 disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:n!==null,onClick:o,children:[i.jsx(Wn,{className:"h-3.5 w-3.5","aria-hidden":!0}),n==="complete"?"Completing...":"Complete reload"]}):null]})]}),i.jsxs("div",{className:"grid gap-2 text-xs sm:grid-cols-3 lg:min-w-[420px]",children:[i.jsx(ai,{label:"Impact",value:d}),i.jsx(ai,{label:"Active jobs",value:String(c)}),i.jsx(ai,{label:"Admin only",value:"autoupdate"})]})]}),e.blocked_reason||e.executor_reload_pending||m>0||p>0?i.jsxs("div",{className:"mt-3 flex flex-wrap gap-2 text-xs",children:[e.executor_reload_pending?i.jsx("span",{className:"rounded-sm border border-amber-300 bg-white px-2 py-1 font-semibold",children:"executor reload pending"}):null,e.blocked_reason?i.jsx("span",{className:"rounded-sm border border-amber-300 bg-white px-2 py-1 font-mono",children:e.blocked_reason}):null,m>0?i.jsxs("span",{className:"rounded-sm border border-amber-300 bg-white px-2 py-1",children:[m," migration file",m===1?"":"s"]}):null,p>0?i.jsxs("span",{className:"rounded-sm border border-amber-300 bg-white px-2 py-1",children:[p," executor/shared file",p===1?"":"s"]}):null]}):null,h?i.jsxs("div",{className:"mt-3 rounded-md border border-amber-200 bg-white/70 p-2.5",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase text-amber-800",children:"Changelog preview"}),i.jsx(Uf,{markdown:h})]}):null,(B=e.warnings)!=null&&B.length?i.jsx("div",{className:"mt-2 font-mono text-xs text-amber-800",children:e.warnings[0]}):null,r?i.jsxs("div",{className:"mt-2 rounded-sm border border-amber-300 bg-white px-2 py-1 font-mono text-xs text-amber-900",children:["Action failed: ",r]}):null]})}function ai({label:e,value:t}){return i.jsxs("div",{className:"min-w-0 rounded-md border border-amber-200 bg-white/80 px-2 py-1.5",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase text-amber-700",children:e}),i.jsx("div",{className:"mt-0.5 truncate font-mono text-xs text-amber-950",children:t})]})}function zf(e){return{stage_dashboard_reload:"Dashboard reload can be staged now",stage_defer_executor_reload:"Dashboard reload can be staged; executor reload waits for the queue",stage_full_reload:"Full reload can be staged now",defer_migration:"Migration release is waiting for a quiet queue"}[e??""]??"Update plan recorded"}function Bf(e){return{dashboard_only:"dashboard only",executor_or_queue:"executor or queue",executor_or_shared:"executor or shared",migration_required:"migration",none:"none"}[e??""]??"unknown"}function qf(e){return(e??"").trim()}function Uf({markdown:e}){return i.jsx("div",{className:"mt-1 text-sm leading-relaxed text-amber-950",children:i.jsx(jm,{allowedElements:["a","blockquote","code","em","h1","h2","h3","h4","li","ol","p","strong","ul"],components:{a:({href:t,children:n})=>i.jsx("a",{className:"font-semibold text-amber-800 underline underline-offset-2",href:et(t??""),rel:"noreferrer",target:"_blank",children:n}),blockquote:({children:t})=>i.jsx("blockquote",{className:"mt-2 border-l-2 border-amber-300 pl-2 text-amber-900",children:t}),code:({children:t})=>i.jsx("code",{className:"rounded-sm bg-amber-100 px-1 py-0.5 font-mono text-[0.85em] text-amber-950",children:t}),h1:({children:t})=>i.jsx("h3",{className:"mt-2 text-sm font-semibold text-amber-950 first:mt-0",children:t}),h2:({children:t})=>i.jsx("h3",{className:"mt-2 text-sm font-semibold text-amber-950 first:mt-0",children:t}),h3:({children:t})=>i.jsx("h3",{className:"mt-2 text-sm font-semibold text-amber-950 first:mt-0",children:t}),h4:({children:t})=>i.jsx("h4",{className:"mt-2 text-xs font-semibold uppercase text-amber-800 first:mt-0",children:t}),li:({children:t})=>i.jsx("li",{className:"break-words pl-0.5 [overflow-wrap:anywhere]",children:t}),ol:({children:t})=>i.jsx("ol",{className:"mt-1 list-decimal space-y-1 pl-5 first:mt-0",children:t}),p:({children:t})=>i.jsx("p",{className:"mt-1 break-words [overflow-wrap:anywhere] first:mt-0",children:t}),strong:({children:t})=>i.jsx("strong",{className:"font-semibold",children:t}),em:({children:t})=>i.jsx("em",{className:"italic",children:t}),ul:({children:t})=>i.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-5 first:mt-0",children:t})},children:e})})}function $f({isDashboardRoute:e,isSystemRoute:t=!1,isKnowledgeRoute:n,isMcpRoute:r=!1,isWebhooksRoute:s=!1,showWebhooks:a=!1,knowledgeBadgeCount:o=0,onNavigate:l}){return i.jsxs("nav",{className:"flex min-w-0 rounded-lg border border-border bg-panel p-1 shadow-sm","aria-label":"Dashboard sections",children:[i.jsxs(On,{href:"/",active:e,onNavigate:l,children:[i.jsx(Ko,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"Jobs"})]}),i.jsxs(On,{href:"/system",active:t,onNavigate:l,children:[i.jsx(ec,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"System"})]}),a?i.jsxs(On,{href:"/webhooks",active:s,onNavigate:l,children:[i.jsx(gn,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"Webhooks"})]}):null,i.jsxs(On,{href:"/knowledge",active:n,onNavigate:l,children:[i.jsx($i,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"Knowledge"}),o>0?i.jsx("span",{className:V("inline-flex h-5 min-w-5 items-center justify-center rounded-full border px-1 font-mono text-[11px] leading-none",n?"border-white/40 bg-white/15 text-white":"border-amber-200 bg-amber-100 text-amber-800"),"aria-label":`${o} proposed knowledge ${o===1?"item":"items"}`,children:o}):null]}),i.jsxs(On,{href:"/mcp",active:r,onNavigate:l,children:[i.jsx(Ir,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"MCP"})]})]})}function zn({text:e}){return i.jsxs("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted",children:[i.jsx(lr,{className:"h-4 w-4 animate-spin","aria-hidden":!0}),e]})}function Hf({summary:e,timeseries:t,hooks:n,deliveries:r,section:s,summaryLoading:a,sectionLoading:o,loadingMore:l,hasMore:u,deliveryFilters:c,error:d,onSectionChange:h,onLoadMore:m,onDeliveryFiltersChange:p,onViewHook:y,onRefresh:w}){const j=Object.values((e==null?void 0:e.receipts)??{}).reduce((v,N)=>v+N,0),b=[{id:"overview",label:"Overview"},{id:"hooks",label:"Hooks",count:n==null?void 0:n.length},{id:"deliveries",label:"Deliveries",count:r==null?void 0:r.length}];return i.jsxs("section",{className:"grid gap-4",children:[i.jsx(Fl,{icon:i.jsx(gn,{className:"h-5 w-5 text-muted","aria-hidden":!0}),title:"GitHub webhooks",subtitle:"Shadow ingestion health. Deliveries are observed but do not create jobs.",action:i.jsx(ut,{onClick:w})}),d?i.jsx(Ne,{tone:"error",text:d.message}):null,i.jsx("div",{className:"flex max-w-full flex-wrap rounded-md border border-border bg-white p-1",role:"tablist","aria-label":"Webhook dashboard section",children:b.map(v=>i.jsxs("button",{type:"button",role:"tab","aria-selected":s===v.id,className:V("inline-flex h-8 items-center gap-2 rounded px-3 text-sm font-semibold",s===v.id?"bg-primary text-white":"text-muted hover:bg-slate-50 hover:text-foreground"),onClick:()=>h(v.id),children:[v.label,v.count!==void 0?i.jsx("span",{className:"rounded border border-current/30 px-1 font-mono text-[10px]",children:v.count}):null]},v.id))}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Webhook status",children:[i.jsx(_e,{title:"Receipts",value:j,icon:i.jsx(gn,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Duplicates",value:(e==null?void 0:e.duplicate_deliveries)??0,icon:i.jsx(lr,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Cross-source matches",value:(e==null?void 0:e.cross_source_matches)??0,icon:i.jsx(wn,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Mode",value:a?"…":(e==null?void 0:e.mode)??"unknown",icon:i.jsx($o,{className:"h-5 w-5"})})]}),s==="overview"?i.jsxs(i.Fragment,{children:[i.jsx(xe,{title:"Delivery activity",children:o?i.jsx(zn,{text:"Loading delivery activity…"}):t!=null&&t.length?i.jsx("div",{className:"h-72","aria-label":"Webhook deliveries over time",children:i.jsx(nr,{width:"100%",height:"100%",children:i.jsxs(Dr,{data:t,children:[i.jsx(rr,{strokeDasharray:"3 3"}),i.jsx(ir,{dataKey:"bucket"}),i.jsx(sr,{allowDecimals:!1}),i.jsx(ar,{}),i.jsx(jo,{}),i.jsx(Qt,{dataKey:"observed",stackId:"deliveries",fill:"#2563eb"}),i.jsx(Qt,{dataKey:"duplicate",stackId:"deliveries",fill:"#f59e0b"}),i.jsx(Qt,{dataKey:"unsupported",stackId:"deliveries",fill:"#94a3b8"})]})})}):i.jsx(Z,{text:"No webhook activity in the selected 30-day window."})}),i.jsx(xe,{title:"Receipt states",children:a?i.jsx(zn,{text:"Loading webhook summary…"}):Object.keys((e==null?void 0:e.receipts)??{}).length?i.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:Object.entries((e==null?void 0:e.receipts)??{}).sort(([v],[N])=>v.localeCompare(N)).map(([v,N])=>i.jsx(te,{label:v,value:N},v))}):i.jsx(Z,{text:"No webhook deliveries observed yet."})})]}):null,s==="hooks"?i.jsx(xe,{title:"Hook inventory",children:o?i.jsx(zn,{text:"Loading hook inventory…"}):n!=null&&n.length?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full min-w-[920px] text-left text-sm",children:[i.jsx("thead",{className:"border-b border-border text-xs text-muted",children:i.jsxs("tr",{children:[i.jsx("th",{className:"px-3 py-2",children:"Target"}),i.jsx("th",{className:"px-3 py-2",children:"State"}),i.jsx("th",{className:"px-3 py-2",children:"Configuration"}),i.jsx("th",{className:"px-3 py-2",children:"Last delivery"}),i.jsx("th",{className:"px-3 py-2",children:"Last ping"})]})}),i.jsx("tbody",{children:n.map(v=>i.jsxs("tr",{className:"cursor-pointer border-b border-border/70 last:border-0 hover:bg-slate-50",onClick:()=>y(v.id),children:[i.jsxs("td",{className:"px-3 py-3",children:[i.jsx("button",{type:"button",className:"text-left font-semibold text-primary hover:underline",onClick:N=>{N.stopPropagation(),y(v.id)},children:v.target}),i.jsxs("div",{className:"font-mono text-xs text-muted",children:[v.target_type," · #",v.id]})]}),i.jsx("td",{className:"px-3 py-3",children:i.jsx("span",{className:V("rounded border px-2 py-1 text-xs font-semibold",v.status==="receiving"?"border-emerald-200 bg-emerald-50 text-emerald-700":v.status==="inactive"?"border-red-200 bg-red-50 text-red-700":"border-slate-200 bg-slate-50 text-slate-600"),children:v.status})}),i.jsxs("td",{className:"max-w-sm px-3 py-3 text-xs",children:[i.jsx("div",{children:v.events.join(", ")||"No event snapshot"}),i.jsxs("div",{className:"mt-1 font-mono text-muted",children:[v.content_type??"content type unknown"," · SSL ",v.ssl_verify===null||v.ssl_verify===void 0?"unknown":v.ssl_verify?"verified":"disabled"]})]}),i.jsxs("td",{className:"px-3 py-3 text-xs",children:[i.jsxs("div",{className:"font-semibold",children:[v.last_event_name??"Never",v.last_action?` · ${v.last_action}`:""]}),i.jsx("div",{className:"mt-1 font-mono text-muted",children:v.last_repository??v.last_event_at??"No delivery observed"})]}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs text-muted",children:v.last_ping_at??"Never"})]},v.id))})]})}),i.jsx(ro,{kind:"hooks",hasMore:u,loading:l,onLoadMore:m})]}):i.jsx(Z,{text:"No hook inventory is available. Redeliver a signed ping from GitHub to create the sanitized configuration snapshot."})}):null,s==="deliveries"?i.jsxs(xe,{title:"Recent deliveries",children:[i.jsx(Kf,{filters:c,onChange:p}),o?i.jsx(zn,{text:"Loading deliveries…"}):r!=null&&r.length?i.jsxs(i.Fragment,{children:[i.jsx(Dl,{deliveries:r,onViewHook:y}),i.jsx(ro,{kind:"deliveries",hasMore:u,loading:l,onLoadMore:m})]}):i.jsx(Z,{text:"No deliveries match the current filters."})]}):null]})}function Kf({filters:e,onChange:t}){const n=[{key:"hook_id",label:"Hook ID",placeholder:"690954530"},{key:"event_name",label:"Event",placeholder:"issue_comment"},{key:"repository",label:"Repository",placeholder:"gisce/repository"},{key:"result",label:"Result",placeholder:"observed"}];return i.jsx("div",{className:"grid gap-2 border-b border-border p-3 sm:grid-cols-2 xl:grid-cols-4",children:n.map(r=>i.jsxs("label",{className:"grid gap-1 text-xs font-semibold text-muted",children:[r.label,i.jsx("input",{className:"h-9 rounded-md border border-border bg-white px-2 font-mono text-xs text-foreground",value:e[r.key],placeholder:r.placeholder,onChange:s=>t({...e,[r.key]:s.target.value})})]},r.key))})}function Dl({deliveries:e,onViewHook:t}){return i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full min-w-[980px] text-left text-sm",children:[i.jsx("thead",{className:"border-b border-border text-xs text-muted",children:i.jsxs("tr",{children:[i.jsx("th",{className:"px-3 py-2",children:"Received"}),i.jsx("th",{className:"px-3 py-2",children:"Hook"}),i.jsx("th",{className:"px-3 py-2",children:"Event"}),i.jsx("th",{className:"px-3 py-2",children:"Repository"}),i.jsx("th",{className:"px-3 py-2",children:"Result"}),i.jsx("th",{className:"px-3 py-2",children:"Delivery"})]})}),i.jsx("tbody",{children:e.map(n=>{var r;return i.jsxs("tr",{className:"border-b border-border/70 last:border-0",children:[i.jsx("td",{className:"px-3 py-3 font-mono text-xs text-muted",children:n.created_at}),i.jsx("td",{className:"px-3 py-3",children:n.hook_id?i.jsxs("button",{type:"button",className:"text-left text-primary hover:underline",onClick:()=>t(n.hook_id),children:[i.jsx("span",{className:"block font-semibold",children:((r=n.hook)==null?void 0:r.target)??`Hook #${n.hook_id}`}),i.jsxs("span",{className:"font-mono text-xs",children:["#",n.hook_id]})]}):i.jsx("span",{className:"text-xs text-muted",children:"Unknown (legacy)"})}),i.jsxs("td",{className:"px-3 py-3 font-semibold",children:[n.event_name,n.action?` · ${n.action}`:""]}),i.jsx("td",{className:"px-3 py-3",children:n.repository??"—"}),i.jsxs("td",{className:"px-3 py-3",children:[i.jsx("span",{className:"rounded border border-border bg-slate-50 px-2 py-1 text-xs font-semibold",children:n.status}),n.duplicate_count?i.jsxs("span",{className:"ml-2 font-mono text-xs text-muted",children:[n.duplicate_count," retries"]}):null]}),i.jsx("td",{className:"max-w-[14rem] truncate px-3 py-3 font-mono text-xs text-muted",title:n.delivery_id,children:n.delivery_id})]},n.delivery_id)})})]})})}function ro({kind:e,hasMore:t,loading:n,onLoadMore:r}){const s=T.useRef(null);if(T.useEffect(()=>{const o=s.current;if(!o||!t||n||!("IntersectionObserver"in window))return;const l=new IntersectionObserver(u=>{u.some(c=>c.isIntersecting)&&r()},{rootMargin:"240px 0px"});return l.observe(o),()=>l.disconnect()},[t,e,n,r]),!t&&!n)return null;const a=e==="hooks"?"hooks":"deliveries";return i.jsx("div",{ref:s,className:"flex min-h-12 items-center justify-center border-t border-border p-3",children:i.jsx("button",{type:"button",className:"rounded-md border border-border px-3 py-1.5 text-sm font-semibold hover:bg-slate-50 disabled:opacity-60",disabled:n||!t,onClick:r,children:n?`Loading more ${a}…`:`Load more ${a}`})})}function Qf({data:e,loading:t,error:n,onBack:r,onRefresh:s,onViewHook:a}){if(t)return i.jsx(zn,{text:"Loading hook detail…"});if(n)return i.jsxs("div",{className:"grid gap-3",children:[i.jsx(Ne,{tone:"error",text:n.message}),i.jsx("button",{type:"button",className:"w-fit rounded border border-border px-3 py-2 text-sm font-semibold",onClick:r,children:"Back to hooks"})]});if(!e)return i.jsx(Z,{text:"Hook detail is not available."});const o=e.hook;return i.jsxs("section",{className:"grid gap-4",children:[i.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[i.jsxs("div",{children:[i.jsxs("button",{type:"button",className:"mb-2 inline-flex items-center gap-2 text-sm font-semibold text-primary hover:underline",onClick:r,children:[i.jsx(Bo,{className:"h-4 w-4","aria-hidden":!0}),"Back to hooks"]}),i.jsx("h2",{className:"text-xl font-semibold",children:o.target}),i.jsxs("p",{className:"font-mono text-xs text-muted",children:[o.target_type," webhook #",o.id]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ut,{onClick:s}),o.admin_url?i.jsxs("a",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-border px-3 text-sm font-semibold hover:bg-slate-50",href:et(o.admin_url),target:"_blank",rel:"noreferrer",children:[i.jsx(Wt,{className:"h-4 w-4","aria-hidden":!0}),"Open in GitHub"]}):null]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[i.jsx(_e,{title:"State",value:o.status,icon:i.jsx(gn,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Deliveries",value:e.stats.deliveries,icon:i.jsx(wn,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Retries",value:e.stats.duplicates,icon:i.jsx(lr,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Unsupported",value:e.stats.unsupported,icon:i.jsx(Fr,{className:"h-5 w-5"})})]}),i.jsxs(xe,{title:"Sanitized configuration",children:[i.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[i.jsx(te,{label:"Active",value:o.active?"yes":"no"}),i.jsx(te,{label:"Content type",value:o.content_type??"unknown"}),i.jsx(te,{label:"SSL verification",value:o.ssl_verify===null||o.ssl_verify===void 0?"unknown":o.ssl_verify?"enabled":"disabled"}),i.jsx(te,{label:"Destination URL",value:o.delivery_url??"unknown"}),i.jsx(te,{label:"GitHub created",value:o.github_created_at??"unknown"}),i.jsx(te,{label:"GitHub updated",value:o.github_updated_at??"unknown"}),i.jsx(te,{label:"Last ping",value:o.last_ping_at??"never"}),i.jsx(te,{label:"Last delivery",value:o.last_event_at??"never"}),i.jsx(te,{label:"Last result",value:o.last_result??"unknown"})]}),i.jsxs("div",{className:"mt-3 rounded-md border border-border p-3",children:[i.jsx("div",{className:"text-xs font-semibold text-muted",children:"Subscribed events"}),i.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:o.events.length?o.events.map(l=>i.jsx("span",{className:"rounded border border-border bg-slate-50 px-2 py-1 font-mono text-xs",children:l},l)):i.jsx("span",{className:"text-sm text-muted",children:"No event snapshot; redeliver a ping."})})]})]}),i.jsx(xe,{title:"Latest observed delivery",children:i.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[i.jsx(te,{label:"Event",value:o.last_event_name?`${o.last_event_name}${o.last_action?` · ${o.last_action}`:""}`:"none"}),i.jsx(te,{label:"Repository",value:o.last_repository??"none"}),i.jsx(te,{label:"Delivery ID",value:o.last_delivery_id??"none"})]})}),i.jsx(xe,{title:"Recent deliveries",children:e.recent_deliveries.length?i.jsx(Dl,{deliveries:e.recent_deliveries,onViewHook:a}):i.jsx(Z,{text:"This hook has no retained deliveries."})})]})}function Vf({processes:e,processesLoading:t,processesError:n,systemd:r,systemdLoading:s,systemdError:a,alerts:o,alertsLoading:l,alertsError:u,now:c,onRefreshProcesses:d,onRefreshSystemd:h,onRefreshAlerts:m}){return i.jsxs("section",{className:"grid gap-4","aria-label":"Bridge system",children:[i.jsxs(xe,{title:"Systemd",action:i.jsx(ut,{onClick:h}),children:[a?i.jsx(Ne,{tone:"error",text:a.message}):null,i.jsx(Ex,{data:r,loading:s})]}),i.jsxs(xe,{title:"Process activity",action:i.jsx(ut,{onClick:d}),children:[n?i.jsx(Ne,{tone:"error",text:n.message}):null,i.jsx(Ix,{data:e,loading:t})]}),i.jsxs(xe,{title:"Monitor alerts",action:i.jsx(ut,{onClick:m}),children:[u?i.jsx(Ne,{tone:"error",text:u.message}):null,i.jsx(Tx,{alerts:o,loading:l,now:c})]})]})}function On({href:e,active:t,children:n,onNavigate:r}){return i.jsx("a",{className:V("inline-flex h-8 min-w-0 flex-1 items-center justify-center gap-1 rounded-md px-1.5 text-xs font-semibold sm:flex-none sm:gap-1.5 sm:px-3 sm:text-sm [&>span]:truncate [&>svg]:shrink-0",t?"bg-primary text-white shadow-sm":"text-muted hover:bg-slate-50 hover:text-foreground"),href:e,onClick:s=>{!r||s.defaultPrevented||s.button!==0||s.metaKey||s.ctrlKey||s.altKey||s.shiftKey||(s.preventDefault(),r(e))},children:n})}function Wf({jobId:e,detail:t,selectedJob:n,user:r,onBackToDashboard:s,onRetry:a,onDismiss:o,onCancel:l,onRefresh:u}){const[c,d]=T.useState(!1),[h,m]=T.useState(!1),[p,y]=T.useState(!1),w=!!(r!=null&&r.is_admin&&n&&Fn(n.status)),j=!!(n&&Oi(n,r)),b=c?"Retrying...":"Retry",v=h?"Dismissing...":"Dismiss",N=p?"Cancelling...":"Cancel";return i.jsxs("div",{className:"grid min-w-0 gap-3 sm:gap-4",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[i.jsxs("a",{className:"inline-flex h-9 items-center gap-2 rounded-md border border-border px-3 text-sm font-semibold text-foreground hover:bg-slate-50",href:"/",onClick:C=>{C.defaultPrevented||C.button!==0||C.metaKey||C.ctrlKey||C.altKey||C.shiftKey||(C.preventDefault(),s())},children:[i.jsx(Bo,{className:"h-4 w-4","aria-hidden":!0}),"Dashboard"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[w?i.jsxs("button",{className:"inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary px-3 text-sm font-semibold text-white disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:c,onClick:async()=>{if(window.confirm(`Retry job #${e}?`)){d(!0);try{await a(e)}finally{d(!1)}}},children:[i.jsx(Wn,{className:"h-4 w-4","aria-hidden":!0}),b]}):null,w?i.jsxs("button",{className:"inline-flex h-9 items-center justify-center gap-2 rounded-md border border-border bg-white px-3 text-sm font-semibold text-foreground hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:h,onClick:async()=>{if(window.confirm(`Dismiss job #${e}?`)){m(!0);try{await o(e)}finally{m(!1)}}},children:[i.jsx(yn,{className:"h-4 w-4","aria-hidden":!0}),v]}):null,j?i.jsxs("button",{className:"inline-flex h-9 items-center justify-center gap-2 rounded-md border border-red-200 bg-red-50 px-3 text-sm font-semibold text-red-700 hover:bg-red-100 disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:p,onClick:async()=>{const C=window.prompt(`Cancel job #${e}? Optional reason:`);if(C!==null){y(!0);try{await l(e,C)}finally{y(!1)}}},children:[i.jsx(Gt,{className:"h-4 w-4","aria-hidden":!0}),N]}):null,i.jsx(ut,{onClick:u})]})]}),i.jsx(xe,{title:`Job #${e}`,className:"p-3 sm:p-4",children:t})]})}function Gf({selectedJobId:e,selectedJob:t,loading:n,error:r,session:s,sessionEvents:a,transcript:o,now:l}){return t?i.jsx(vx,{job:t,session:s,sessionEvents:a,transcript:o,now:l}):e!==null&&n?i.jsx(Z,{text:"Loading selected job..."}):e!==null&&r?i.jsx(Ne,{tone:"error",text:`Job #${e}: ${r.message}`}):i.jsx(Z,{text:"Select a job to inspect its timeline, worklog and GitHub links."})}function Jf({data:e,loading:t,error:n,repo:r,status:s,user:a,now:o,onRepoChange:l,onStatusChange:u,onApprove:c,onReject:d,onUpdateRuleScope:h,onDeleteRule:m,onRefresh:p}){const y=(e==null?void 0:e.summary)??{},[w,j]=T.useState("proposals"),b=[{id:"proposals",label:"Proposals",count:(e==null?void 0:e.proposals.length)??0},{id:"rules",label:"Rules",count:(e==null?void 0:e.rules.length)??0},{id:"events",label:"Events",count:(e==null?void 0:e.events.length)??0}];return i.jsxs("div",{className:"grid min-w-0 gap-4",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("h2",{className:"flex items-center gap-2 text-base font-semibold",children:[i.jsx($i,{className:"h-5 w-5 text-muted","aria-hidden":!0}),"Acquired knowledge"]}),i.jsx("p",{className:"text-xs text-muted",children:"Captured feedback, proposed rules and curated agent memory."})]}),i.jsx(ut,{onClick:p})]}),n?i.jsx(Ne,{tone:"error",text:n.message}):null,i.jsxs("section",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4","aria-label":"Knowledge metrics",children:[i.jsx(_e,{title:"Proposed",value:y.proposed??0,icon:i.jsx(Uo,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Approved",value:y.approved??0,icon:i.jsx(yn,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Rules",value:y.rules??0,icon:i.jsx(Ho,{className:"h-5 w-5"})}),i.jsx(_e,{title:"Events",value:y.events??0,icon:i.jsx(gn,{className:"h-5 w-5"})})]}),i.jsx(xe,{title:"Filters",className:"p-3",children:i.jsxs("div",{className:V("grid gap-3",w==="proposals"?"md:grid-cols-[minmax(0,1fr)_220px]":"md:grid-cols-[minmax(0,1fr)]"),children:[i.jsx(Ze,{label:"Repository",children:i.jsxs("select",{className:"control",value:r,onChange:v=>l(v.target.value),children:[i.jsx("option",{value:"",children:"All repositories"}),((e==null?void 0:e.repositories)??[]).map(v=>i.jsx("option",{value:v,children:v},v))]})}),w==="proposals"?i.jsx(Ze,{label:"Proposal status",children:i.jsxs("select",{className:"control",value:s,onChange:v=>u(v.target.value),children:[i.jsx("option",{value:"",children:"All statuses"}),i.jsx("option",{value:"proposed",children:"proposed"}),i.jsx("option",{value:"approved",children:"approved"}),i.jsx("option",{value:"rejected",children:"rejected"}),i.jsx("option",{value:"error",children:"error"})]})}):null]})}),i.jsxs(xe,{title:"Knowledge records",action:i.jsx("div",{className:"flex max-w-full flex-wrap rounded-md border border-border bg-white p-0.5",role:"tablist","aria-label":"Knowledge record type",children:b.map(v=>i.jsxs("button",{className:V("inline-flex h-8 items-center gap-1.5 rounded px-2.5 text-xs font-semibold",w===v.id?"bg-primary text-white":"text-muted hover:bg-slate-50 hover:text-foreground"),type:"button",role:"tab","aria-label":`${v.label} (${v.count})`,"aria-selected":w===v.id,onClick:()=>j(v.id),children:[i.jsx("span",{children:v.label}),i.jsx("span",{className:V("rounded-sm border px-1 font-mono text-[10px]",w===v.id?"border-white/40 text-white":"border-border text-muted"),children:v.count})]},v.id))}),children:[w==="proposals"?i.jsx(Xf,{proposals:(e==null?void 0:e.proposals)??[],loading:t,isAdmin:!!(a!=null&&a.is_admin),now:o,onApprove:c,onReject:d}):null,w==="rules"?i.jsx(ex,{rules:(e==null?void 0:e.rules)??[],loading:t,now:o,onUpdateRuleScope:h,onDeleteRule:m}):null,w==="events"?i.jsx(tx,{events:(e==null?void 0:e.events)??[],loading:t,now:o}):null]})]})}function Xf({proposals:e,loading:t,isAdmin:n,now:r,onApprove:s,onReject:a}){const[o,l]=T.useState(null);return t&&e.length===0?i.jsx(Z,{text:"Loading proposals..."}):e.length===0?i.jsx(Z,{text:"No proposals match the current filters."}):i.jsx("div",{className:"grid gap-2",children:e.map(u=>i.jsxs("article",{className:"grid min-w-0 gap-2 rounded-md border border-border bg-white p-3",children:[i.jsx(Bl,{scope:u.scope,type:u.type,confidence:u.confidence,status:u.status,timestamp:u.updated_at,now:r}),i.jsx("p",{className:"min-w-0 break-words text-sm font-medium [overflow-wrap:anywhere]",children:u.rule||u.reason||"No reusable rule proposed."}),u.reason?i.jsx("p",{className:"min-w-0 break-words text-xs text-muted [overflow-wrap:anywhere]",children:u.reason}):null,u.source_event?i.jsx(Yf,{event:u.source_event}):i.jsxs("p",{className:"font-mono text-xs text-muted",children:["Source event ",u.event_id]}),u.error?i.jsx(Ne,{tone:"error",text:u.error}):null,n&&u.status==="proposed"?i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md bg-primary px-3 text-sm font-semibold text-white disabled:opacity-60",type:"button",disabled:o===u.id,onClick:async()=>{l(u.id);try{await s(u.id)}finally{l(null)}},children:[i.jsx(yn,{className:"h-4 w-4","aria-hidden":!0}),"Approve"]}),i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-border px-3 text-sm font-semibold text-foreground hover:bg-slate-50 disabled:opacity-60",type:"button",disabled:o===u.id,onClick:async()=>{l(u.id);try{await a(u.id)}finally{l(null)}},children:[i.jsx(Gt,{className:"h-4 w-4","aria-hidden":!0}),"Reject"]})]}):null]},u.id))})}function Yf({event:e}){const t=e.trigger_actor||(e.actor!=="github"?e.actor:null);return i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-md border border-border bg-slate-50 px-2 py-1.5",children:[i.jsx(Sn,{actor:t,avatarUrl:e.trigger_actor_avatar_url,framed:!0}),e.source_job_id?i.jsxs("a",{className:"inline-flex h-7 items-center gap-1 rounded-md border border-border bg-white px-2 text-xs font-semibold text-foreground hover:bg-slate-50",href:Nn(e.source_job_id),children:[i.jsx(wn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",e.source_job_id]}):null,e.github_urls.length>0?i.jsx(Jn,{urls:e.github_urls,compact:!0}):i.jsx("span",{className:"font-mono text-xs text-muted",children:"No GitHub link"})]})}function Zf(e){const t=[{value:"global",label:"global"}];if(e.startsWith("repo:")){const n=e.slice(5),[r,s]=n.split("/",2);r&&s&&(t.push({value:`org:${r}`,label:`org:${r}`}),t.push({value:`repo:${r}/${s}`,label:`repo:${r}/${s}`}))}else e.startsWith("org:")&&t.push({value:e,label:e});return t.some(n=>n.value===e)||t.push({value:e,label:e}),t}function ex({rules:e,loading:t,now:n,onUpdateRuleScope:r,onDeleteRule:s}){const[a,o]=T.useState(null),[l,u]=T.useState(null),[c,d]=T.useState("");return t&&e.length===0?i.jsx(Z,{text:"Loading curated rules..."}):e.length===0?i.jsx(Z,{text:"No curated rules match the current filters."}):i.jsx("div",{className:"grid gap-2",children:e.map(h=>{const m=h.source_event_details??[],p=m[0],y=p?p.trigger_actor||(p.actor!=="github"?p.actor:null):null,w=m.flatMap(C=>C.github_urls??[]),j=Zf(h.scope),b=l===h.id,v=a===h.id,N=!!h.can_manage;return i.jsxs("article",{className:"grid min-w-0 gap-2 rounded-md border border-border bg-white p-3",children:[i.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[i.jsx(Bl,{scope:h.scope,type:h.type,confidence:h.confidence,status:`${h.observations} observation${h.observations===1?"":"s"}`,timestamp:h.last_seen,now:n}),N?i.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[b?i.jsxs(i.Fragment,{children:[i.jsx(Ze,{label:"Scope",children:i.jsx("select",{className:"control h-8 min-w-[180px] py-1 text-xs",value:c,disabled:v,onChange:C=>d(C.target.value),children:j.map(C=>i.jsx("option",{value:C.value,children:C.label},C.value))})}),i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-border px-3 text-sm font-semibold text-foreground hover:bg-slate-50 disabled:opacity-60",type:"button",disabled:v||c===h.scope,title:"Save scope",onClick:async()=>{if(c!==h.scope){o(h.id);try{await r(h.id,c),u(null)}finally{o(null)}}},children:[i.jsx(nc,{className:"h-4 w-4","aria-hidden":!0}),"Save"]}),i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-border px-3 text-sm font-semibold text-muted hover:bg-slate-50 disabled:opacity-60",type:"button",disabled:v,title:"Cancel scope edit",onClick:()=>{u(null),d("")},children:[i.jsx(Gt,{className:"h-4 w-4","aria-hidden":!0}),"Cancel"]})]}):i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-border px-3 text-sm font-semibold text-foreground hover:bg-slate-50 disabled:opacity-60",type:"button",disabled:v,title:"Edit scope",onClick:()=>{u(h.id),d(h.scope)},children:[i.jsx(tc,{className:"h-4 w-4","aria-hidden":!0}),"Edit"]}),i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-red-200 px-3 text-sm font-semibold text-red-700 hover:bg-red-50 disabled:opacity-60",type:"button",disabled:v,onClick:async()=>{if(window.confirm("Delete this curated rule?")){o(h.id);try{await s(h.id)}finally{o(null)}}},children:[i.jsx(ki,{className:"h-4 w-4","aria-hidden":!0}),"Delete"]})]}):null]}),i.jsx("p",{className:"min-w-0 break-words text-sm font-medium [overflow-wrap:anywhere]",children:h.rule}),i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[i.jsx(Sn,{actor:y,avatarUrl:p==null?void 0:p.trigger_actor_avatar_url,framed:!0}),p!=null&&p.source_job_id?i.jsxs("a",{className:"inline-flex h-7 items-center gap-1 rounded-md border border-border px-2 text-xs font-semibold text-foreground hover:bg-white",href:Nn(p.source_job_id),children:[i.jsx(wn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",p.source_job_id]}):null,w.length>0?i.jsx(Jn,{urls:w,compact:!0}):i.jsx("span",{className:"font-mono text-xs text-muted",children:"No GitHub link"})]})]},h.id)})})}function tx({events:e,loading:t,now:n}){return t&&e.length===0?i.jsx(Z,{text:"Loading captured events..."}):e.length===0?i.jsx(Z,{text:"No captured feedback events match the current filters."}):i.jsx("div",{className:"grid gap-2",children:e.map(r=>{const s=r.trigger_actor||(r.actor!=="github"?r.actor:null);return i.jsxs("details",{className:"group rounded-md border border-border bg-white",children:[i.jsxs("summary",{className:"grid cursor-pointer list-none gap-2 px-3 py-2 marker:hidden hover:bg-slate-50",children:[i.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[i.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2 font-mono text-xs font-semibold text-muted",children:[i.jsx(bn,{className:"h-3.5 w-3.5 shrink-0 transition-transform group-open:rotate-180","aria-hidden":!0}),i.jsx("span",{className:"truncate",children:Ol(r.scope)})]}),i.jsx("span",{className:"shrink-0 font-mono text-xs text-muted",children:i.jsx(Re,{value:r.occurred_at,relative:!0,now:n})})]}),i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[i.jsx(Sn,{actor:s,avatarUrl:r.trigger_actor_avatar_url,framed:!0}),r.source_job_id?i.jsxs("a",{className:"inline-flex h-7 items-center gap-1 rounded-md border border-border px-2 text-xs font-semibold text-foreground hover:bg-white",href:Nn(r.source_job_id),children:[i.jsx(wn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",r.source_job_id]}):null,r.github_urls.length>0?i.jsx(Jn,{urls:r.github_urls,compact:!0}):i.jsx("span",{className:"font-mono text-xs text-muted",children:"No GitHub link"})]}),i.jsx("p",{className:"line-clamp-2 break-words text-sm [overflow-wrap:anywhere]",children:r.comment})]}),i.jsxs("div",{className:"grid gap-2 border-t border-border px-3 py-2",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-xs font-semibold text-muted",children:"GitHub links"}),r.github_urls.length>0?i.jsx(Jn,{urls:r.github_urls}):i.jsx("p",{className:"text-xs text-muted",children:"No links recorded."})]}),i.jsx("pre",{className:"max-h-72 overflow-auto rounded-md bg-slate-950 px-3 py-2 font-mono text-xs leading-relaxed text-slate-100",children:JSON.stringify(r.context,null,2)})]})]},r.id)})})}function nx({tokens:e,loading:t,error:n,user:r,ownerOptions:s,dashboardUrl:a,dashboardUrlSource:o,now:l,onCreate:u,onUpdateOwner:c,onRevoke:d,onRefresh:h}){const[m,p]=T.useState(""),[y,w]=T.useState(""),[j,b]=T.useState(!1),[v,N]=T.useState(null),[C,z]=T.useState(null),[k,q]=T.useState(null),[M,P]=T.useState(""),B=e??[],L=s.find(_=>_.login===y);T.useEffect(()=>{var _;r!=null&&r.is_admin&&(y&&s.some(O=>O.login===y)||w((r==null?void 0:r.login)||((_=s[0])==null?void 0:_.login)||""))},[s,r==null?void 0:r.is_admin,r==null?void 0:r.login,y]);const E=(a||(typeof window>"u"?"":window.location.origin)).replace(/\/$/,""),G=`${E}/mcp`,F=`${E}/api/mcp`;return i.jsxs("div",{className:"grid min-w-0 gap-4",children:[i.jsx(Fl,{icon:i.jsx(Ir,{className:"h-5 w-5 text-muted","aria-hidden":!0}),title:"MCP access",subtitle:r!=null&&r.is_admin?"Issue and revoke read-only tokens for any dashboard user.":"Issue and revoke read-only tokens linked to your user.",action:i.jsx(ut,{onClick:h})}),n?i.jsx(Ne,{tone:"error",text:n.message}):null,M?i.jsx(Ne,{tone:"error",text:M}):null,i.jsx(rx,{dashboardUrl:G,endpointUrl:F,dashboardUrlSource:o??"request"}),k?i.jsxs("section",{className:"rounded-md border border-emerald-300 bg-emerald-50 p-3 text-emerald-950","aria-label":"Created MCP token",children:[i.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-sm font-semibold",children:"Token created"}),i.jsx("p",{className:"mt-1 text-xs text-emerald-800",children:"This secret is shown once. Store it in the local agent environment before leaving this page."})]}),i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-emerald-300 bg-white px-3 text-sm font-semibold text-emerald-900 hover:bg-emerald-100",type:"button",onClick:()=>q(null),children:[i.jsx(Gt,{className:"h-4 w-4","aria-hidden":!0}),"Hide"]})]}),i.jsx("pre",{className:"mt-3 overflow-auto rounded bg-emerald-950 px-3 py-2 font-mono text-xs text-emerald-50",children:k.token})]}):null,i.jsx(xe,{title:"Create token",children:i.jsxs("form",{className:r!=null&&r.is_admin?"grid gap-3 md:grid-cols-[minmax(0,1fr)_minmax(12rem,16rem)_auto]":"grid gap-3 md:grid-cols-[minmax(0,1fr)_auto]",onSubmit:async _=>{_.preventDefault();const O=m.trim();if(O){b(!0),P("");try{const Q=await u(O,r!=null&&r.is_admin?y:void 0);q(Q),p("")}catch(Q){P(Q instanceof Error?Q.message:String(Q))}finally{b(!1)}}},children:[i.jsx(Ze,{label:"Token name",children:i.jsx("input",{className:"control",value:m,placeholder:"local agent",disabled:j,onChange:_=>p(_.target.value)})}),r!=null&&r.is_admin?i.jsxs(Ze,{label:"Owner",children:[i.jsx(zl,{ariaLabel:"Owner",value:y,ownerOptions:s,disabled:j||s.length===0,selectedSuffix:_=>_.login===(r==null?void 0:r.login)?" (you)":"",emptyLabel:"No known users",onChange:w}),L?i.jsxs("span",{className:"font-normal text-muted",children:["Token will be linked to @",L.login,"."]}):null]}):null,i.jsxs("button",{className:"inline-flex h-9 items-center justify-center gap-2 self-end rounded-md bg-primary px-3 text-sm font-semibold text-white disabled:cursor-not-allowed disabled:opacity-60",type:"submit",disabled:j||!m.trim()||!!(r!=null&&r.is_admin&&!y),children:[i.jsx(Ir,{className:"h-4 w-4","aria-hidden":!0}),j?"Creating...":"Create token"]})]})}),i.jsx(xe,{title:"Active tokens",children:i.jsx(ix,{tokens:B,loading:t,now:l,ownerOptions:s,canManageOwners:!!(r!=null&&r.is_admin),revokingId:v,updatingOwnerId:C,onUpdateOwner:async(_,O)=>{z(_),P("");try{await c(_,O)}catch(Q){P(Q instanceof Error?Q.message:String(Q))}finally{z(null)}},onRevoke:async _=>{if(window.confirm("Revoke this MCP token?")){N(_),P("");try{await d(_)}catch(O){P(O instanceof Error?O.message:String(O))}finally{N(null)}}}})})]})}function rx({dashboardUrl:e,endpointUrl:t,dashboardUrlSource:n}){const r=n==="configured"?"Configured public URL":n==="forwarded"?"Forwarded public URL":"Needs public URL",s=n==="request",a=s?"Set GITHUB_AGENT_BRIDGE_DASHBOARD_PUBLIC_URL or forward X-Forwarded-* headers":e,o=s?"Public dashboard URL required before connecting remote agents":t,u=`{ - "mcpServers": { - "github-agent-bridge": { - "url": "${s?"https://bridge.example.com/api/mcp":t}", - "headers": { - "Authorization": "Bearer \${GITHUB_AGENT_BRIDGE_MCP_TOKEN}" - } - } - } -}`;return i.jsxs(xe,{title:"Connect an agent",children:[s?i.jsx(Ne,{tone:"warning",text:"Set GITHUB_AGENT_BRIDGE_DASHBOARD_PUBLIC_URL, or forward X-Forwarded-* headers from the proxy, before connecting remote agents."}):null,i.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]",children:[i.jsxs("div",{className:"grid min-w-0 gap-3",children:[i.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-3",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm font-semibold",children:[i.jsx(Wt,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"Public dashboard URL",i.jsx("span",{className:"rounded-sm border border-border bg-slate-50 px-1.5 py-0.5 font-mono text-[11px] font-normal text-muted",children:r})]}),i.jsx("p",{className:"mt-1 text-xs text-muted",children:"Share this page URL with bridge admins only after it resolves to the external dashboard origin."}),i.jsx("pre",{className:"mt-3 overflow-auto rounded-md bg-slate-950 px-3 py-2 font-mono text-xs text-slate-100",children:a})]}),i.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[i.jsx(Wt,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"HTTP MCP endpoint"]}),i.jsx("p",{className:"mt-1 text-xs text-muted",children:"Remote agents connect directly with a bearer token; no local `gab` binary is required on the agent host."}),i.jsx("pre",{className:"mt-3 overflow-auto rounded-md bg-slate-950 px-3 py-2 font-mono text-xs text-slate-100",children:o})]})]}),i.jsxs("div",{className:"grid min-w-0 gap-3",children:[i.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[i.jsx(Ir,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"Agent config"]}),i.jsx("p",{className:"mt-1 text-xs text-muted",children:"Create a token below, then store the one-time secret as `GITHUB_AGENT_BRIDGE_MCP_TOKEN` for the agent."}),i.jsx("pre",{className:"mt-3 max-h-64 overflow-auto rounded-md bg-slate-950 px-3 py-2 font-mono text-xs leading-relaxed text-slate-100",children:u})]}),i.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[i.jsx($i,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"Agent prompt"]}),i.jsx("p",{className:"mt-1 text-xs text-muted",children:"Ask the agent to use the read-only bridge knowledge server before acting on repository work."}),i.jsx("pre",{className:"mt-3 max-h-40 overflow-auto rounded-md bg-slate-950 px-3 py-2 font-mono text-xs leading-relaxed text-slate-100",children:"Use the github-agent-bridge MCP server for repository knowledge. Query list_repositories and list_knowledge before making repository decisions."})]})]})]})]})}function Fl({icon:e,title:t,subtitle:n,action:r}){return i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("h2",{className:"flex items-center gap-2 text-base font-semibold",children:[e,t]}),i.jsx("p",{className:"text-xs text-muted",children:n})]}),r]})}function ix({tokens:e,loading:t,now:n,ownerOptions:r,canManageOwners:s,revokingId:a,updatingOwnerId:o,onUpdateOwner:l,onRevoke:u}){return t&&e.length===0?i.jsx(Z,{text:"Loading MCP tokens..."}):e.length===0?i.jsx(Z,{text:"No active MCP tokens."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"grid gap-2 md:hidden",children:e.map(c=>i.jsxs("article",{className:"grid min-w-0 gap-3 rounded-md border border-border bg-white p-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h3",{className:"break-words text-sm font-semibold [overflow-wrap:anywhere]",children:c.name}),i.jsx("div",{className:"mt-1 break-all font-mono text-xs text-muted",children:c.id}),s?i.jsx(io,{token:c,ownerOptions:r,disabled:o===c.id,onUpdateOwner:l}):c.user_login?i.jsxs("div",{className:"mt-1 text-xs text-muted",children:["Owner: @",c.user_login]}):null]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[i.jsx(te,{label:"Created",value:i.jsx(Re,{value:c.created_at,relative:!0,now:n})}),i.jsx(te,{label:"Last used",value:c.last_used_at?i.jsx(Re,{value:c.last_used_at,relative:!0,now:n}):"never"})]}),i.jsxs("button",{className:"inline-flex h-8 items-center justify-center gap-2 rounded-md border border-red-200 px-3 text-sm font-semibold text-red-700 hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:a===c.id,onClick:()=>u(c.id),children:[i.jsx(ki,{className:"h-4 w-4","aria-hidden":!0}),a===c.id?"Revoking...":"Revoke"]})]},c.id))}),i.jsx("div",{className:"hidden overflow-auto rounded-md border border-border md:block",children:i.jsxs("table",{className:"min-w-full border-collapse text-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-border bg-slate-50 text-left text-xs text-muted",children:[i.jsx("th",{className:"px-3 py-2 font-semibold",children:"Name"}),i.jsx("th",{className:"px-3 py-2 font-semibold",children:"Owner"}),i.jsx("th",{className:"px-3 py-2 font-semibold",children:"Created"}),i.jsx("th",{className:"px-3 py-2 font-semibold",children:"Last used"}),i.jsx("th",{className:"px-3 py-2 font-semibold",children:"ID"}),i.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Actions"})]})}),i.jsx("tbody",{children:e.map(c=>i.jsxs("tr",{className:"border-b border-border last:border-b-0",children:[i.jsx("td",{className:"px-3 py-3 font-semibold",children:c.name}),i.jsx("td",{className:"px-3 py-3 text-xs text-muted",children:s?i.jsx(io,{token:c,ownerOptions:r,disabled:o===c.id,onUpdateOwner:l}):c.user_login?`@${c.user_login}`:"unassigned"}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs",children:i.jsx(Re,{value:c.created_at,relative:!0,now:n})}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs",children:c.last_used_at?i.jsx(Re,{value:c.last_used_at,relative:!0,now:n}):"never"}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs text-muted",children:c.id}),i.jsx("td",{className:"px-3 py-3 text-right",children:i.jsxs("button",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-red-200 px-3 text-sm font-semibold text-red-700 hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-60",type:"button",disabled:a===c.id,onClick:()=>u(c.id),children:[i.jsx(ki,{className:"h-4 w-4","aria-hidden":!0}),a===c.id?"Revoking...":"Revoke"]})})]},c.id))})]})})]})}function io({token:e,ownerOptions:t,disabled:n,onUpdateOwner:r}){const s=e.user_login??"";return i.jsx(zl,{ariaLabel:`Owner for ${e.name}`,value:s,ownerOptions:t,disabled:n||t.length===0,emptyLabel:"Select owner",size:"compact",onChange:a=>{!a||a===e.user_login||r(e.id,a)}})}function zl({value:e,ownerOptions:t,disabled:n,onChange:r,ariaLabel:s,selectedSuffix:a,emptyLabel:o,size:l="default"}){const u=t.find(d=>d.login===e),c=u?`@${u.login}${(a==null?void 0:a(u))??""}`:o;return i.jsxs("div",{className:V("relative flex min-w-0 items-center gap-2 rounded-md border border-border bg-panel text-foreground focus-within:border-primary focus-within:ring-1 focus-within:ring-primary",n?"opacity-60":"",l==="compact"?"h-8 w-44 max-w-full px-2":"h-9 w-full px-2.5"),children:[i.jsx("span",{className:V("pointer-events-none flex shrink-0 items-center justify-center",l==="compact"?"h-5 w-5":"h-6 w-6"),children:u!=null&&u.avatar_url?i.jsx("img",{className:"h-full w-full rounded-full bg-slate-100",src:et(u.avatar_url),alt:"",referrerPolicy:"no-referrer"}):i.jsx(Vn,{className:V("text-muted",l==="compact"?"h-4 w-4":"h-5 w-5"),"aria-hidden":!0})}),i.jsx("span",{className:V("pointer-events-none min-w-0 flex-1 truncate font-mono",u?"text-foreground":"text-muted",l==="compact"?"text-xs":"text-sm"),children:c}),i.jsxs("select",{className:"absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed","aria-label":s,value:e,disabled:n,onChange:d=>r(d.target.value),children:[t.length===0||!e?i.jsx("option",{value:"",children:o}):null,t.map(d=>i.jsxs("option",{value:d.login,children:["@",d.login,(a==null?void 0:a(d))??""]},d.login))]}),i.jsx(bn,{className:V("pointer-events-none shrink-0 text-muted",l==="compact"?"h-3.5 w-3.5":"h-4 w-4"),"aria-hidden":!0})]})}function Jn({urls:e,compact:t=!1}){const n=t?e.slice(0,2):e,r=e.length-n.length;return i.jsxs("div",{className:"flex min-w-0 max-w-full flex-wrap gap-1.5",children:[n.map(s=>i.jsxs("a",{className:V("inline-flex max-w-full items-center gap-1 rounded-md border border-border font-semibold text-primary hover:bg-white hover:underline",t?"h-7 px-2 text-xs":"min-h-7 px-2 py-1 text-xs"),href:et(s),"aria-label":s,rel:"noreferrer",target:"_blank",children:[i.jsx(Wt,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),i.jsx("span",{className:"truncate",children:t?sx(s):s})]},s)),r>0?i.jsxs("span",{className:"inline-flex h-7 items-center rounded-md border border-border px-2 font-mono text-xs text-muted",children:["+",r]}):null]})}function sx(e){try{const t=new URL(e);return t.pathname.replace(/^\//,"")+t.hash}catch{return e}}function Bl({scope:e,type:t,confidence:n,status:r,timestamp:s,now:a}){return i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-muted",children:[i.jsx("span",{className:"truncate font-mono font-semibold text-foreground",children:Ol(e)}),i.jsx("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono",children:t}),i.jsxs("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono",children:[Math.round(n*100),"%"]}),i.jsx("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono",children:r}),i.jsx("span",{className:"font-mono",children:i.jsx(Re,{value:s,relative:!0,now:a})})]})}function ax({user:e,loading:t}){const n=e!=null&&e.login?`@${e.login}`:t?"Loading profile...":"GitHub OAuth",r=e!=null&&e.is_admin?"admin":"read-only",s=e!=null&&e.avatar_url?i.jsx("img",{className:"h-10 w-10 rounded-full border border-slate-700 bg-slate-800",src:e.avatar_url,alt:e.login?`${e.login} avatar`:"",referrerPolicy:"no-referrer"}):i.jsx("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-full border border-slate-700 bg-slate-900",children:i.jsx(Vn,{className:"h-5 w-5","aria-hidden":!0})}),a=e!=null&&e.html_url?i.jsx("a",{className:"truncate font-semibold text-white hover:underline",href:et(e.html_url),rel:"noreferrer",target:"_blank",children:n}):i.jsx("div",{className:"truncate font-semibold text-white",children:n});return i.jsxs("div",{className:"flex max-w-full shrink-0 items-center gap-3 text-sm text-slate-300","aria-label":e!=null&&e.login?`Signed in as ${e.login}`:"Dashboard account",children:[i.jsx(Ho,{className:"hidden h-4 w-4 shrink-0 sm:block","aria-hidden":!0}),i.jsxs("div",{className:"hidden min-w-0 text-right sm:block",children:[a,i.jsxs("div",{className:"text-xs text-slate-400",children:["Signed in · ",r]})]}),s]})}function ox({config:e,loading:t,onEnable:n,onDisable:r}){const[s,a]=T.useState(!1),[o,l]=T.useState(""),u=!!(e!=null&&e.status.enabled),c=typeof navigator<"u"&&typeof window<"u"&&Pr(),d=t||s||!(e!=null&&e.configured)||!c,h=c?e!=null&&e.configured?u?"Disable notifications":"Enable notifications":"Notifications not configured":"Notifications unavailable";return i.jsx("div",{className:"relative",children:i.jsx("button",{className:V("inline-flex h-9 w-9 items-center justify-center rounded-md border text-sm font-semibold",u?"border-emerald-400 bg-emerald-50 text-emerald-700":"border-slate-700 bg-slate-900 text-slate-200",d&&"cursor-not-allowed opacity-60"),type:"button","aria-label":h,title:o||h,disabled:d,onClick:async()=>{a(!0),l("");try{u?await r():await n()}catch(m){l(m instanceof Error?m.message:String(m))}finally{a(!1)}},children:i.jsx(qo,{className:V("h-4 w-4",s&&"animate-live-pulse"),"aria-hidden":!0})})})}function lx({notification:e,onDismiss:t,onNavigate:n}){if(!e)return null;const r=e.title||"GitHub Agent Bridge",s=e.body||e.summary||"Bridge job finished",a=e.url||e.job_url||(e.job_id?Nn(e.job_id):"/"),o=a.startsWith("/");return i.jsx("aside",{className:"fixed right-3 top-20 z-50 w-[min(calc(100vw-1.5rem),28rem)] rounded-md border border-emerald-300 bg-white shadow-xl shadow-slate-950/15","aria-live":"assertive","aria-label":"Bridge notification",children:i.jsxs("div",{className:"flex items-start gap-3 p-3",children:[i.jsx("div",{className:"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-emerald-50 text-emerald-700",children:i.jsx(qo,{className:"h-4 w-4","aria-hidden":!0})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsx("h2",{className:"min-w-0 break-words text-sm font-semibold text-foreground",children:r}),i.jsx("button",{className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted hover:bg-slate-100 hover:text-foreground",type:"button","aria-label":"Dismiss notification",onClick:t,children:i.jsx(Gt,{className:"h-4 w-4","aria-hidden":!0})})]}),i.jsx("p",{className:"mt-1 min-w-0 break-words text-sm text-muted",children:s}),e.detail?i.jsx("p",{className:"mt-1 line-clamp-2 min-w-0 break-words text-xs text-muted",children:e.detail}):null,i.jsxs("button",{className:"mt-3 inline-flex h-8 items-center gap-1.5 rounded-md border border-border px-2.5 text-xs font-semibold text-foreground hover:bg-slate-50",type:"button",onClick:()=>{t(),o?n(a):window.open(et(a),"_blank","noopener,noreferrer")},children:[i.jsx(Wt,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Open"]})]})]})})}function ux({count:e,limit:t,loading:n,onRefresh:r}){return i.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-lg border border-border bg-white px-3 py-3 shadow-sm md:px-4",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-base font-semibold",children:"Jobs"}),i.jsx("p",{className:"text-xs text-muted",children:n?"Refreshing latest jobs...":`Showing ${e} of the latest ${t} requested jobs`})]}),i.jsx(ut,{onClick:r,compactOnMobile:!0})]})}function xe({title:e,action:t,children:n,className:r,flushHeader:s=!1}){return i.jsxs("section",{className:V("min-w-0 rounded-lg border border-border bg-panel p-4 shadow-sm",r),children:[i.jsxs("div",{className:V("flex flex-wrap items-center justify-between gap-3",!s&&"mb-4"),children:[i.jsx("h2",{className:"text-sm font-semibold",children:e}),t]}),n]})}function _e({title:e,value:t,icon:n}){return i.jsxs("div",{className:"rounded-lg border border-border bg-panel p-3 shadow-sm md:p-4",children:[i.jsxs("div",{className:"flex items-center justify-between text-muted",children:[i.jsx("span",{className:"text-sm font-medium",children:e}),n]}),i.jsx("strong",{className:"mt-3 block text-2xl leading-none md:mt-4 md:text-3xl",children:t})]})}function cx({filters:e,actorOptions:t,onChange:n}){const[r,s]=T.useState(e);T.useEffect(()=>s(e),[e]);const a=Mf(e),o=no(e)||no(r),l=()=>{s(Mi),n(Mi)};return i.jsxs("details",{className:"my-3 rounded-md border border-border bg-slate-50/70",children:[i.jsxs("summary",{className:"grid cursor-pointer list-none grid-cols-[minmax(0,1fr)_auto] items-center gap-3 px-3 py-2 text-sm font-semibold marker:hidden",children:[i.jsxs("span",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[i.jsxs("span",{className:"inline-flex shrink-0 items-center gap-2",children:[i.jsx(Zu,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"Filters"]}),a.length>0?i.jsx("span",{className:"flex min-w-0 flex-wrap items-center gap-1.5","aria-label":"Applied filters",children:a.map(u=>i.jsxs("span",{className:"inline-flex max-w-full items-center gap-1 rounded-full border border-blue-200 bg-blue-50 px-2 py-0.5 text-xs font-semibold text-blue-700",children:[i.jsx("span",{className:"text-blue-700/70",children:u.label}),i.jsx("span",{className:"max-w-40 truncate font-mono",children:u.value.trim()})]},u.key))}):null]}),i.jsxs("span",{className:"inline-flex shrink-0 items-center gap-2",children:[o?i.jsxs("button",{className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-md border border-border bg-white px-2.5 text-xs font-semibold text-foreground hover:bg-slate-50",type:"button",onClick:u=>{u.preventDefault(),u.stopPropagation(),l()},children:[i.jsx(Wn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Clear filters"]}):null,i.jsx(bn,{className:"h-4 w-4 text-muted","aria-hidden":!0})]})]}),i.jsxs("form",{className:"grid gap-3 border-t border-border bg-white p-3 md:grid-cols-3 xl:grid-cols-9",onSubmit:u=>{u.preventDefault(),n(r)},children:[i.jsx(Ze,{label:"Status",children:i.jsxs("select",{className:"control",value:r.status,onChange:u=>s({...r,status:u.target.value}),children:[i.jsx("option",{value:"",children:"All"}),i.jsx("option",{value:"pending",children:"pending"}),i.jsx("option",{value:"running",children:"running"}),i.jsx("option",{value:"blocked",children:"blocked"}),i.jsx("option",{value:"done",children:"done"}),i.jsx("option",{value:"denied",children:"denied"}),i.jsx("option",{value:"waiting_approval",children:"waiting_approval"})]})}),i.jsx(Ze,{label:"Repository",children:i.jsx("input",{className:"control",value:r.repo,placeholder:"owner/repo",onChange:u=>s({...r,repo:u.target.value})})}),i.jsx(Ze,{label:"Thread",children:i.jsx("input",{className:"control",value:r.thread,inputMode:"numeric",placeholder:"issue or PR",onChange:u=>s({...r,thread:u.target.value})})}),i.jsx(Ze,{label:"Action",children:i.jsx("input",{className:"control",value:r.action,placeholder:"reply_comment",onChange:u=>s({...r,action:u.target.value})})}),i.jsx(Ze,{label:"Actor",className:"xl:col-span-2",children:i.jsx(dx,{value:r.actor,options:t,onChange:u=>s({...r,actor:u})})}),i.jsx(Ze,{label:"Intent",children:i.jsxs("select",{className:"control",value:r.intent,onChange:u=>s({...r,intent:u.target.value}),children:[i.jsx("option",{value:"",children:"All"}),i.jsx("option",{value:"review_only",children:"review_only"}),i.jsx("option",{value:"work_allowed",children:"work_allowed"})]})}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 self-end xl:col-span-2",children:[i.jsxs("button",{className:"inline-flex h-9 items-center justify-center gap-2 rounded-md border border-border px-3 text-sm font-semibold text-foreground hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-white",type:"button",disabled:!o,onClick:l,children:[i.jsx(Wn,{className:"h-4 w-4","aria-hidden":!0}),"Clear"]}),i.jsxs("button",{className:"inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary px-3 text-sm font-semibold text-white",type:"submit",children:[i.jsx(rc,{className:"h-4 w-4","aria-hidden":!0}),"Apply"]})]})]})]})}function dx({value:e,options:t,onChange:n}){const[r,s]=T.useState(!1),a=e.trim().replace(/^@/,"").toLowerCase(),o=t.filter(u=>!a||u.login.toLowerCase().includes(a)).slice(0,8),l=t.find(u=>u.login.toLowerCase()===a);return i.jsxs("div",{className:"relative min-w-0",children:[i.jsxs("div",{className:"control flex items-center gap-2 px-2",children:[l?i.jsx("img",{className:"h-5 w-5 shrink-0 rounded-full bg-slate-100",src:et(l.avatar_url??""),alt:`${l.login} avatar`,referrerPolicy:"no-referrer"}):i.jsx(Vn,{className:"h-4 w-4 shrink-0 text-muted","aria-hidden":!0}),i.jsx("input",{className:"min-w-0 flex-1 bg-transparent font-mono text-sm outline-none",value:e,placeholder:"@login",onChange:u=>{n(u.target.value),s(!0)},onFocus:()=>s(!0),onBlur:()=>window.setTimeout(()=>s(!1),100)}),e?i.jsx("button",{className:"rounded-sm p-1 text-muted hover:bg-slate-100",type:"button","aria-label":"Clear actor filter",onClick:()=>n(""),children:i.jsx(Gt,{className:"h-3.5 w-3.5","aria-hidden":!0})}):null]}),r&&o.length>0?i.jsx("div",{className:"absolute left-0 right-0 z-20 mt-1 max-h-72 overflow-auto rounded-md border border-border bg-white p-1 shadow-lg",children:o.map(u=>i.jsxs("button",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left hover:bg-slate-50",type:"button",onMouseDown:c=>c.preventDefault(),onClick:()=>{n(u.login),s(!1)},children:[u.avatar_url?i.jsx("img",{className:"h-6 w-6 shrink-0 rounded-full bg-slate-100",src:et(u.avatar_url),alt:`${u.login} avatar`,referrerPolicy:"no-referrer"}):i.jsx(Vn,{className:"h-5 w-5 shrink-0 text-muted","aria-hidden":!0}),i.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:["@",u.login]}),i.jsx("span",{className:"shrink-0 rounded-full bg-slate-100 px-1.5 py-0.5 text-[10px] font-semibold text-muted",children:u.job_count})]},u.login))}):null]})}function Ze({label:e,children:t,className:n}){return i.jsxs("label",{className:V("grid min-w-0 gap-1 text-xs font-semibold text-muted",n),children:[e,t]})}function hx({jobs:e,loading:t,loadingMore:n=!1,hasMore:r=!1,onLoadMore:s,onViewJob:a,now:o,user:l,onRetry:u,onDismiss:c,onCancel:d}){const[h,m]=T.useState(null),[p,y]=T.useState(null),[w,j]=T.useState(null),b=T.useRef(!1),v=T.useRef(n),N=!!(l!=null&&l.is_admin&&u),C=!!(l!=null&&l.is_admin&&c);T.useEffect(()=>{v.current&&!n&&(b.current=!1),v.current=n},[n]);const z=T.useCallback(()=>{b.current||(b.current=!0,s==null||s())},[s]),k=T.useCallback(async P=>{if(u){m(P);try{await u(P)}finally{m(null)}}},[u]),q=T.useCallback(async P=>{if(c){y(P);try{await c(P)}finally{y(null)}}},[c]),M=T.useCallback(async(P,B)=>{if(d){j(P);try{await d(P,B)}finally{j(null)}}},[d]);return t&&e.length===0?i.jsx(Z,{text:"Loading jobs..."}):e.length===0?i.jsx(Z,{text:"No jobs match the current filters."}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid gap-2 md:hidden",children:[e.map(P=>i.jsx(xx,{job:P,onViewJob:a,now:o,canRetry:N&&Fn(P.status),retrying:h===P.id,onRetry:k,canDismiss:C&&Fn(P.status),dismissing:p===P.id,onDismiss:q,canCancel:!!(d&&Oi(P,l)),cancelling:w===P.id,onCancel:M},P.id)),i.jsx(mx,{hasMore:r,loading:n,onLoadMore:z})]}),i.jsxs("div",{className:"hidden max-h-[640px] overflow-auto rounded-md border border-border md:block",children:[i.jsxs("table",{className:"min-w-[1080px] table-fixed border-collapse text-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"sticky top-0 z-10 border-b border-border bg-panel text-left text-xs text-muted",children:[i.jsx("th",{className:"w-[42%] px-3 py-2 font-semibold",children:"Job"}),i.jsx("th",{className:"w-32 px-3 py-2 font-semibold",children:"Status"}),i.jsx("th",{className:"w-40 px-3 py-2 font-semibold",children:"Action"}),i.jsx("th",{className:"w-36 px-3 py-2 font-semibold",children:"Actor"}),i.jsx("th",{className:"w-36 px-3 py-2 font-semibold",children:"Timing"}),i.jsx("th",{className:"w-28 px-3 py-2 font-semibold",children:"Updated"}),i.jsx("th",{className:"w-24 px-3 py-2 text-right font-semibold",children:"Actions"})]})}),i.jsx("tbody",{children:e.map(P=>i.jsx(px,{job:P,now:o,onViewJob:a,canRetry:N&&Fn(P.status),retrying:h===P.id,onRetry:k,canDismiss:C&&Fn(P.status),dismissing:p===P.id,onDismiss:q,canCancel:!!(d&&Oi(P,l)),cancelling:w===P.id,onCancel:M},P.id))})]}),i.jsx(fx,{hasMore:r,loading:n,onLoadMore:z})]})]})}function px({job:e,now:t,onViewJob:n,canRetry:r,retrying:s,onRetry:a,canDismiss:o,dismissing:l,onDismiss:u,canCancel:c,cancelling:d,onCancel:h}){return i.jsxs("tr",{className:"cursor-pointer border-b border-border align-top hover:bg-slate-50",onClick:()=>n(e.id),children:[i.jsx("td",{className:"min-w-0 px-3 py-3",children:i.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[i.jsxs("span",{className:"mt-0.5 shrink-0 font-mono text-xs font-semibold text-muted",children:["#",e.id]}),i.jsxs("div",{className:"min-w-0 space-y-1",children:[i.jsx("div",{className:"line-clamp-2 text-sm font-semibold leading-snug text-foreground [overflow-wrap:anywhere]",title:e.subject,children:e.subject}),i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted",children:[i.jsx("span",{className:"min-w-0 max-w-full truncate font-mono",children:e.repo??e.work_key}),i.jsxs("span",{className:"shrink-0",children:["thread ",e.thread??"n/a"]})]})]})]})}),i.jsx("td",{className:"px-3 py-3",children:i.jsx(ls,{status:e.status})}),i.jsxs("td",{className:"px-3 py-3",children:[i.jsx("div",{className:"min-w-0 truncate text-sm text-foreground",title:e.action,children:e.action}),i.jsx("div",{className:"mt-1",children:i.jsx(os,{intent:e.intent,actionMode:e.action_mode,display:"intent",compact:!0})})]}),i.jsx("td",{className:"px-3 py-3",children:i.jsx(Sn,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url})}),i.jsxs("td",{className:"px-3 py-3 text-xs text-muted",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("span",{children:"wait"}),i.jsx("span",{className:"font-mono text-foreground",children:We(as(e,t))})]}),i.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[i.jsx("span",{children:"run"}),i.jsx("span",{className:"font-mono text-foreground",children:We(ss(e,t))})]}),i.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[i.jsx("span",{children:"tries"}),i.jsx("span",{className:"font-mono text-foreground",children:e.attempts})]})]}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs",children:i.jsx(Re,{value:e.updated_at,compact:!0,relative:!0,now:t})}),i.jsx("td",{className:"px-3 py-3 text-right",children:i.jsxs("div",{className:"inline-flex items-center gap-1",children:[i.jsx(ql,{jobId:e.id,canRetry:r,retrying:s,onRetry:a,compact:!0}),i.jsx(Ul,{jobId:e.id,canDismiss:o,dismissing:l,onDismiss:u,compact:!0}),i.jsx($l,{jobId:e.id,canCancel:c,cancelling:d,onCancel:h,compact:!0})]})})]})}function mx({hasMore:e,loading:t,onLoadMore:n}){return!e&&!t?null:i.jsxs("button",{className:"inline-flex min-h-10 w-full items-center justify-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-semibold text-foreground hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-60 md:hidden",type:"button",disabled:t||!e,onClick:()=>n==null?void 0:n(),children:[i.jsx(bn,{className:"h-4 w-4","aria-hidden":!0}),t?"Loading more jobs...":"Load more jobs"]})}function fx({hasMore:e,loading:t,onLoadMore:n}){const r=T.useRef(null);return T.useEffect(()=>{const s=r.current;if(!s||!e||t||!n)return;if(!("IntersectionObserver"in window)){n();return}const a=new IntersectionObserver(o=>{o.some(l=>l.isIntersecting)&&n()},{rootMargin:"240px 0px"});return a.observe(s),()=>a.disconnect()},[e,t,n]),!e&&!t?null:i.jsx("div",{ref:r,className:"flex min-h-10 items-center justify-center px-3 py-2 text-xs font-medium text-muted","aria-live":"polite",children:t?"Loading more jobs...":"Scroll for more jobs"})}function xx({job:e,onViewJob:t,now:n,canRetry:r,retrying:s,onRetry:a,canDismiss:o,dismissing:l,onDismiss:u,canCancel:c,cancelling:d,onCancel:h}){return i.jsxs("article",{className:"rounded-md border border-border bg-white shadow-[0_1px_0_rgba(15,23,42,0.03)]",children:[i.jsxs("button",{className:"grid w-full gap-2 p-3 text-left hover:bg-slate-50",type:"button",onClick:()=>t(e.id),children:[i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"min-w-0 space-y-1",children:[i.jsxs("div",{className:"grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-2",children:[i.jsxs("span",{className:"shrink-0 font-mono text-xs font-semibold text-muted",children:["#",e.id]}),i.jsx("span",{className:"truncate font-mono text-sm",children:e.repo??e.work_key})]}),i.jsx("div",{className:"line-clamp-2 text-sm leading-snug text-foreground",children:e.subject}),i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted",children:[i.jsxs("span",{children:["thread ",e.thread??"n/a"," · ",e.action]}),i.jsx(os,{intent:e.intent,actionMode:e.action_mode,compact:!0,display:"intent"}),i.jsx(Sn,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url})]})]}),i.jsx(ls,{status:e.status})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[i.jsx(te,{label:"Wait",value:We(as(e,n))}),i.jsx(te,{label:"Runtime",value:We(ss(e,n))}),i.jsx(te,{label:"Updated",value:i.jsx(Re,{value:e.updated_at,compact:!0,relative:!0,now:n})})]})]}),r||o||c?i.jsxs("div",{className:"flex flex-wrap gap-2 border-t border-border px-3 py-2",children:[i.jsx(ql,{jobId:e.id,canRetry:r,retrying:s,onRetry:a}),i.jsx(Ul,{jobId:e.id,canDismiss:o,dismissing:l,onDismiss:u}),i.jsx($l,{jobId:e.id,canCancel:c,cancelling:d,onCancel:h})]}):null]})}function ql({jobId:e,canRetry:t,retrying:n,onRetry:r,compact:s=!1}){if(!t)return null;const a=n?"Retrying...":"Retry";return i.jsxs("button",{className:V("inline-flex h-8 items-center justify-center gap-2 rounded-md border border-border text-sm font-semibold text-foreground hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-60",s?"w-8 px-0":"px-3"),type:"button",disabled:n,"aria-label":`Retry job #${e}`,title:`Retry job #${e}`,onClick:async o=>{o.stopPropagation(),window.confirm(`Retry job #${e}?`)&&await r(e)},children:[i.jsx(Wn,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:V(s&&"sr-only"),children:a})]})}function Ul({jobId:e,canDismiss:t,dismissing:n,onDismiss:r,compact:s=!1}){if(!t)return null;const a=n?"Dismissing...":"Dismiss";return i.jsxs("button",{className:V("inline-flex h-8 items-center justify-center gap-2 rounded-md border border-border text-sm font-semibold text-foreground hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-60",s?"w-8 px-0":"px-3"),type:"button",disabled:n,"aria-label":`Dismiss job #${e}`,title:`Dismiss job #${e}`,onClick:async o=>{o.stopPropagation(),window.confirm(`Dismiss job #${e}?`)&&await r(e)},children:[i.jsx(yn,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:V(s&&"sr-only"),children:a})]})}function $l({jobId:e,canCancel:t,cancelling:n,onCancel:r,compact:s=!1}){if(!t)return null;const a=n?"Cancelling...":"Cancel";return i.jsxs("button",{className:V("inline-flex h-8 items-center justify-center gap-2 rounded-md border border-red-200 bg-red-50 text-sm font-semibold text-red-700 hover:bg-red-100 disabled:cursor-not-allowed disabled:opacity-60",s?"w-8 px-0":"px-3"),type:"button",disabled:n,"aria-label":`Cancel job #${e}`,title:`Cancel job #${e}`,onClick:async o=>{o.stopPropagation();const l=window.prompt(`Cancel job #${e}? Optional reason:`);l!==null&&await r(e,l)},children:[i.jsx(Gt,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:V(s&&"sr-only"),children:a})]})}function Sn({actor:e,avatarUrl:t,framed:n=!1}){const r=t?i.jsx("img",{className:"h-4 w-4 shrink-0 rounded-full bg-slate-100",src:et(t),alt:e?`${e} avatar`:"",referrerPolicy:"no-referrer"}):i.jsx(Vn,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),s=i.jsxs(i.Fragment,{children:[r,i.jsx("span",{className:"min-w-0 truncate",children:e?`@${e}`:"unknown actor"})]});return n?i.jsx("span",{className:"inline-flex h-7 max-w-full items-center gap-1 rounded-md border border-border px-2 text-xs font-semibold text-muted",children:s}):i.jsx("span",{className:"inline-flex min-w-0 max-w-full items-center gap-1 font-mono text-xs text-muted",children:s})}function gx(e){return(e==null?void 0:e.model)??"OpenClaw default"}function bx(e){return(e==null?void 0:e.thinking)??"OpenClaw default"}function yx(e){return e?e.configured?"configured":e.summary:"n/a"}function wx(e,t){const n=t||(e==="work_allowed"?"fix_allowed":"review_only");return n==="fix_allowed"||!t&&e==="work_allowed"?{mode:n,intentLabel:"work_allowed",title:"Work allowed"}:{mode:n,intentLabel:"review_only",title:"Review only"}}function os({intent:e,actionMode:t,compact:n=!1,display:r="mode"}){const s=wx(e,t),a=s.intentLabel==="work_allowed"?sc:$o,o=r==="intent"?s.intentLabel:s.mode;return i.jsxs("span",{className:V("inline-flex min-h-6 max-w-full items-center gap-1.5 rounded-md border px-2 text-xs font-semibold",s.intentLabel==="work_allowed"?"border-blue-200 bg-blue-50 text-blue-700":"border-violet-200 bg-violet-50 text-violet-700",n&&"min-h-5 px-1.5 text-[11px]"),title:`${s.title}: ${s.mode}`,"aria-label":`${s.title}: ${o}`,children:[i.jsx(a,{className:V("h-3.5 w-3.5 shrink-0",n&&"h-3 w-3"),"aria-hidden":!0}),i.jsx("span",{className:"truncate font-mono",children:o})]})}function vx({job:e,session:t,sessionEvents:n,transcript:r,now:s,compact:a=!1}){var p;const o=Nn(e.id),l=n??[],u=r??[],c=ff(l),d=xf(u),h=ss(e,s),m=as(e,s);return i.jsxs("div",{className:"grid min-w-0 gap-4",children:[i.jsxs("div",{className:"sticky top-0 z-20 -mx-3 -mt-3 grid gap-2 border-b border-border bg-panel/95 px-3 py-2 shadow-sm backdrop-blur sm:-mx-4 sm:-mt-4 sm:px-4","aria-label":"Sticky job header",children:[i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[i.jsx(ls,{status:e.status}),i.jsxs("a",{className:"inline-flex h-7 items-center gap-1 rounded-md border border-border bg-white px-2 text-xs font-semibold text-foreground hover:bg-slate-50",href:o,children:[i.jsx(wn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",e.id]}),i.jsx(Sn,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url,framed:!0}),i.jsx("span",{className:"min-w-0 break-words font-mono text-xs text-muted [overflow-wrap:anywhere]",children:e.work_key})]}),i.jsxs("div",{className:"grid min-w-0 gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(280px,auto)] lg:items-start",children:[i.jsx("p",{className:"min-w-0 break-words text-sm text-muted [overflow-wrap:anywhere]",children:e.subject}),i.jsxs("div",{className:"grid min-w-0 gap-1",children:[i.jsx("h3",{className:"text-xs font-semibold text-muted",children:"GitHub links"}),e.github_urls.length>0?i.jsx(Jn,{urls:e.github_urls,compact:!0}):i.jsx("p",{className:"text-xs text-muted",children:"No links recorded."})]})]})]}),i.jsxs("div",{className:V("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-3"),children:[i.jsx(te,{label:"Queue wait",value:We(m)}),i.jsx(te,{label:e.status==="running"?"Running for":"Runtime",value:We(h)}),i.jsx(te,{label:"Coalesced",value:String(e.coalesced_count)})]}),e.queue_state==="serialized_by_work_key"?i.jsxs("p",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900",children:["Serialized behind running job #",e.blocked_by_job_id," for this work key."]}):null,i.jsxs("div",{className:V("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-3"),children:[i.jsx(te,{label:"Model",value:gx(e.model_route)}),i.jsx(te,{label:"Reasoning",value:bx(e.model_route)}),i.jsx(te,{label:"Route",value:yx(e.model_route)})]}),i.jsx(jx,{job:e,compact:a}),i.jsxs("div",{className:V("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-2 xl:grid-cols-4"),children:[i.jsx(te,{label:"Created",value:i.jsx(Re,{value:e.created_at,compact:!0,relative:!0,now:s})}),i.jsx(te,{label:"Started",value:e.started_at?i.jsx(Re,{value:e.started_at,compact:!0,relative:!0,now:s}):"n/a"}),i.jsx(te,{label:"Updated",value:i.jsx(Re,{value:e.updated_at,compact:!0,relative:!0,now:s})}),i.jsx(te,{label:"Finished",value:e.finished_at?i.jsx(Re,{value:e.finished_at,compact:!0,relative:!0,now:s}):"n/a"})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Timeline"}),i.jsx("div",{className:"grid min-w-0 gap-3",children:(e.worklog??[]).length>0?(p=e.worklog)==null?void 0:p.map(y=>i.jsxs("div",{className:"min-w-0 border-l-2 border-primary pl-3",children:[i.jsx("div",{className:"text-sm font-semibold",children:y.phase}),i.jsx("div",{className:"font-mono text-xs text-muted",children:i.jsx(Re,{value:y.ts,relative:!0,now:s})}),i.jsx("div",{className:"break-words text-sm [overflow-wrap:anywhere]",children:y.summary}),y.detail?i.jsx("div",{className:"mt-1 break-words font-mono text-xs text-muted [overflow-wrap:anywhere]",children:y.detail}):null]},y.id)):i.jsx(Z,{text:"No worklog entries."})})]}),i.jsxs("div",{children:[i.jsxs("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[i.jsx(Ko,{className:"h-4 w-4","aria-hidden":!0}),"OpenClaw session"]}),t?i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[i.jsx(te,{label:"Session ID",value:t.id}),i.jsx(te,{label:"Source",value:t.source})]}),i.jsx("p",{className:"break-words text-xs text-muted [overflow-wrap:anywhere]",children:t.detail})]}):i.jsx(Z,{text:"Session correlation is loading."})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Agent activity"}),i.jsx("div",{className:"grid max-h-[460px] min-w-0 gap-2 overflow-auto pr-1",children:c.length>0?c.map((y,w)=>i.jsx(Nx,{event:y,defaultOpen:eo(y.eventType,e.status==="running",w,c.length),now:s},y.id)):i.jsx(Z,{text:e.status==="running"?"Waiting for live agent output...":"No agent activity has been recorded for this session."})})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Session transcript"}),i.jsx("div",{className:"grid max-h-[620px] min-w-0 gap-2 overflow-auto pr-1",children:d.length>0?d.map((y,w)=>i.jsx(kx,{entry:y,defaultOpen:eo(y.kind,e.status==="running",w,d.length),now:s},y.id)):i.jsx(Z,{text:e.status==="running"?"Waiting for live transcript entries...":"No OpenClaw transcript entries are available for this session."})})]})]})}function jx({job:e,compact:t=!1}){const n=e.intent_classifier??null,r=(n==null?void 0:n.llm)??{},s=(n==null?void 0:n.parser)??{},a=typeof r.confidence=="number"?`${Math.round(r.confidence*100)}%`:"n/a";return i.jsxs("div",{className:"grid gap-2",children:[i.jsx("h3",{className:"text-sm font-semibold",children:"Action mode"}),i.jsxs("div",{className:V("grid gap-2 text-sm sm:gap-3",t?"grid-cols-1":"grid-cols-2 xl:grid-cols-4"),children:[i.jsx(te,{label:"Mode",value:i.jsx(os,{intent:e.intent,actionMode:e.action_mode})}),i.jsx(te,{label:"Intent",value:e.intent}),i.jsx(te,{label:"Addressed",value:n?so(r.addressed_to_agent):"n/a"}),i.jsx(te,{label:"Write",value:n?r.write_permission??"none":e.intent==="work_allowed"?"allowed":"none"})]}),n?i.jsxs("div",{className:"grid gap-2 rounded-md border border-border bg-panel p-3 text-xs",children:[i.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4",children:[i.jsx(rt,{label:"Classifier",value:n.enabled?"enabled":"disabled"}),i.jsx(rt,{label:"Applied",value:so(r.applied)}),i.jsx(rt,{label:"Confidence",value:a}),i.jsx(rt,{label:"Parser",value:`${s.action??"n/a"} / ${s.work_intent??"n/a"}`})]}),i.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[i.jsx(rt,{label:"LLM",value:`${r.action??"n/a"} / ${r.work_intent??"n/a"}`}),i.jsx(rt,{label:"Scope",value:r.scope||"n/a"})]}),r.main_request?i.jsx(rt,{label:"Main request",value:r.main_request}):null,r.subordinate_reason?i.jsx(rt,{label:"Subordinate reason",value:r.subordinate_reason}):null,r.reason?i.jsx(rt,{label:"Reason",value:r.reason}):null,n.error?i.jsx(rt,{label:"Error",value:n.error,tone:"danger"}):null]}):i.jsx("p",{className:"text-xs text-muted",children:"No intent classifier metadata recorded for this job."})]})}function so(e){return e===!0?"yes":e===!1?"no":"n/a"}function rt({label:e,value:t,tone:n="neutral"}){return i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted",children:e}),i.jsx("div",{className:V("mt-0.5 min-w-0 break-words font-mono text-xs [overflow-wrap:anywhere]",n==="danger"?"text-red-700":"text-foreground"),children:t})]})}function kx({entry:e,defaultOpen:t,now:n}){return i.jsx(Hl,{badge:e.badge,meta:i.jsx(Re,{value:e.meta,relative:!0,now:n}),count:e.count,summary:e.summary,defaultOpen:t,children:i.jsx("pre",{className:"max-h-72 max-w-full overflow-auto whitespace-pre-wrap break-words rounded bg-slate-950 px-2 py-1.5 font-mono text-xs leading-relaxed text-slate-100 [overflow-wrap:anywhere]",children:e.text})})}function Nx({event:e,defaultOpen:t,now:n}){return i.jsx(Hl,{badge:e.badge,meta:i.jsx(Re,{value:e.meta,relative:!0,now:n}),count:e.count,summary:e.summary,defaultOpen:t,children:e.detail?i.jsx("pre",{className:"max-h-56 max-w-full overflow-auto whitespace-pre-wrap break-words rounded bg-slate-950 px-2 py-1.5 font-mono text-xs leading-relaxed text-slate-100 [overflow-wrap:anywhere]",children:e.detail}):null})}function Hl({badge:e,meta:t,count:n,summary:r,defaultOpen:s,children:a}){const[o,l]=T.useState(!!s);return i.jsxs("details",{className:"group min-w-0 rounded border border-border bg-slate-50/60",open:o,onToggle:u=>l(u.currentTarget.open),children:[i.jsxs("summary",{className:"grid cursor-pointer list-none gap-1 px-2 py-1.5 marker:hidden hover:bg-white",children:[i.jsxs("div",{className:"grid min-w-0 gap-1 sm:flex sm:items-center sm:justify-between sm:gap-2",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[i.jsx(bn,{className:"h-3.5 w-3.5 shrink-0 text-muted transition-transform group-open:rotate-180","aria-hidden":!0}),i.jsx("span",{className:"truncate font-mono text-[11px] font-semibold text-muted",children:e}),n&&n>1?i.jsx("span",{className:"rounded-sm border border-border px-1 font-mono text-[10px] text-muted",children:n}):null]}),i.jsx("span",{className:"min-w-0 truncate pl-5 font-mono text-[11px] text-muted sm:shrink-0 sm:pl-0",children:t})]}),i.jsx("div",{className:"min-w-0 break-words pl-5 text-xs text-foreground [overflow-wrap:anywhere] sm:truncate",children:r})]}),i.jsx("div",{className:"min-w-0 border-t border-border bg-white px-2 py-2",children:a})]})}function ao({label:e,values:t}){const n=[{name:"median",seconds:(t==null?void 0:t.median)??0},{name:"p90",seconds:(t==null?void 0:t.p90)??0},{name:"p99",seconds:(t==null?void 0:t.p99)??0}];return i.jsx("div",{className:"h-56",children:i.jsx(nr,{width:"100%",height:"100%",children:i.jsxs(Dr,{data:n,children:[i.jsx(rr,{strokeDasharray:"3 3"}),i.jsx(ir,{dataKey:"name"}),i.jsx(sr,{tickFormatter:We}),i.jsx(ar,{formatter:r=>[We(Number(r)),e]}),i.jsx(Qt,{dataKey:"seconds",fill:"#0969da",radius:[4,4,0,0]})]})})})}function Sx({values:e,loading:t,totalJobs:n}){const r=Object.entries(e??{}).map(([s,a])=>({day:s,count:a}));return t&&r.length===0?i.jsx(Z,{text:"Loading job history..."}):r.length===0?i.jsx(Z,{text:n>0?"Job history has no valid creation dates.":"No job history available."}):i.jsx("div",{className:"h-56",children:i.jsx(nr,{width:"100%",height:"100%",children:i.jsxs(Dr,{data:r,children:[i.jsx(rr,{strokeDasharray:"3 3"}),i.jsx(ir,{dataKey:"day",minTickGap:16}),i.jsx(sr,{allowDecimals:!1}),i.jsx(ar,{formatter:s=>[Number(s),"jobs"]}),i.jsx(Qt,{dataKey:"count",fill:"#16a34a",radius:[4,4,0,0]})]})})})}function Cx({usage:e,loading:t,totalJobs:n}){const[r,s]=T.useState("day"),a=(e==null?void 0:e[r])??[],o=a.map(u=>({...u,label:_x(u.bucket,r)})),l=a.reduce((u,c)=>u+c.seconds,0);return t&&o.length===0?i.jsx(Z,{text:"Loading runtime usage..."}):o.length===0?i.jsx(Z,{text:n>0?"No jobs have recorded runtime yet.":"No job history available."}):i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted",children:[i.jsx(ic,{className:"h-4 w-4","aria-hidden":!0}),i.jsxs("span",{children:[Sr(l)," consumed across ",a.reduce((u,c)=>u+c.jobs,0)," job",a.reduce((u,c)=>u+c.jobs,0)===1?"":"s"]})]}),i.jsx("div",{className:"inline-flex h-8 rounded-md border border-border bg-white p-0.5","aria-label":"Runtime grouping",children:["day","month"].map(u=>i.jsx("button",{className:V("rounded px-2.5 text-xs font-semibold capitalize",r===u?"bg-primary text-white":"text-muted hover:bg-slate-50"),type:"button",onClick:()=>s(u),children:u},u))})]}),i.jsx("div",{className:"h-64",children:i.jsx(nr,{width:"100%",height:"100%",children:i.jsxs(Dr,{data:o,children:[i.jsx(rr,{strokeDasharray:"3 3"}),i.jsx(ir,{dataKey:"label",minTickGap:16,tick:{fontSize:11}}),i.jsx(sr,{tickFormatter:u=>Sr(Number(u))}),i.jsx(jo,{}),i.jsx(ar,{formatter:(u,c)=>c==="Work"?[Sr(Number(u)),"work"]:c==="Review"?[Sr(Number(u)),"review"]:[Number(u),String(c)],labelFormatter:u=>String(u)}),i.jsx(Qt,{dataKey:"work_seconds",name:"Work",stackId:"runtime",fill:"#0969da",isAnimationActive:!1}),i.jsx(Qt,{dataKey:"review_seconds",name:"Review",stackId:"runtime",fill:"#8250df",radius:[4,4,0,0],isAnimationActive:!1})]})})})]})}function _x(e,t){if(t==="month"){const[a,o]=e.split("-").map(Number);return!a||!o?e:new Intl.DateTimeFormat(void 0,{month:"short",year:"numeric"}).format(new Date(a,o-1,1))}const[n,r,s]=e.split("-").map(Number);return!n||!r||!s?e:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(new Date(n,r-1,s))}function Sr(e){const t=Math.max(0,Math.round(e));if(t<60)return`${t}s`;const n=Math.round(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60),s=n%60;return s===0?`${r}h`:`${r}h ${s}m`}function oo(e){return Object.values(e).reduce((t,n)=>t+n,0)}function Ex({data:e,loading:t}){if(t&&!e)return i.jsx(Z,{text:"Loading systemd units..."});if(!e)return i.jsx(Z,{text:"No systemd snapshot available."});const n=e.units??[],r=n.filter(o=>o.active_state==="active").length,s=n.filter(o=>o.active_state==="failed"||o.result==="failed").length,a=n.filter(o=>o.kind==="timer").length;return i.jsxs("div",{className:"grid min-w-0 gap-3",children:[e.errors.length>0?i.jsx(Ne,{tone:"error",text:e.errors[0]}):null,n.length===0?i.jsx(Z,{text:"No configured bridge units found."}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[i.jsx(Cr,{label:"Units",value:String(n.length)}),i.jsx(Cr,{label:"Active",value:String(r)}),i.jsx(Cr,{label:"Failed",value:String(s),tone:s>0?"bad":"neutral"}),i.jsx(Cr,{label:"Timers",value:String(a)})]}),i.jsxs("div",{className:"overflow-hidden rounded-md border border-border bg-white",children:[i.jsxs("div",{className:"hidden grid-cols-[minmax(0,1.35fr)_90px_120px_90px_minmax(0,1fr)] gap-3 border-b border-border bg-slate-50 px-3 py-2 text-[11px] font-semibold uppercase text-muted md:grid",children:[i.jsx("span",{children:"Unit"}),i.jsx("span",{children:"Status"}),i.jsx("span",{children:"State"}),i.jsx("span",{children:"PID"}),i.jsx("span",{children:"Schedule"})]}),i.jsx("div",{className:"divide-y divide-border",children:n.map(o=>i.jsx(Px,{unit:o},o.unit))})]})]})]})}function Cr({label:e,value:t,tone:n="neutral"}){return i.jsxs("div",{className:V("min-w-0 rounded-md border bg-white px-3 py-2",n==="bad"?"border-red-200":"border-border"),children:[i.jsx("div",{className:V("font-mono text-lg font-semibold",n==="bad"?"text-red-700":"text-foreground"),children:t}),i.jsx("div",{className:"mt-0.5 text-[11px] font-semibold uppercase text-muted",children:e})]})}function Px({unit:e}){const[t,n]=T.useState(!1),r=e.active_state==="active",s=e.active_state==="failed"||e.result==="failed",a=e.next_elapse||e.last_trigger||"n/a";return i.jsxs("details",{className:"group min-w-0",open:t,onToggle:o=>n(o.currentTarget.open),children:[i.jsxs("summary",{className:"grid min-w-0 cursor-pointer list-none grid-cols-2 gap-2 px-3 py-3 text-sm marker:hidden hover:bg-slate-50 md:grid-cols-[minmax(0,1.35fr)_90px_120px_90px_minmax(0,1fr)] md:items-center md:gap-3",children:[i.jsxs("div",{className:"col-span-2 min-w-0 md:col-span-1",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx(bn,{className:"h-3.5 w-3.5 shrink-0 text-muted transition-transform group-open:rotate-180","aria-hidden":!0}),i.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",children:e.unit})]}),i.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 pl-5 text-[11px] font-semibold uppercase text-muted",children:[i.jsx("span",{children:e.role}),i.jsx("span",{children:e.kind}),i.jsx("span",{children:e.load_state}),i.jsx("span",{children:t?"following log":"expand log"})]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:block",children:[i.jsx("span",{className:"text-[11px] font-semibold uppercase text-muted md:hidden",children:"Status"}),i.jsx("span",{className:V("inline-flex h-6 items-center rounded-full border px-2 text-xs font-semibold",s?"border-red-300 bg-red-50 text-red-700":r?"border-emerald-300 bg-emerald-50 text-emerald-700":"border-slate-300 bg-slate-50 text-slate-700"),children:e.active_state})]}),i.jsx(lo,{label:"State",value:e.sub_state,detail:e.result||"unknown"}),i.jsx(lo,{label:"PID",value:e.main_pid?String(e.main_pid):"n/a",detail:We(e.uptime_seconds)}),i.jsxs("div",{className:"col-span-2 min-w-0 md:col-span-1",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted md:hidden",children:"Schedule"}),i.jsx("div",{className:"truncate font-mono text-[11px] text-foreground",title:a,children:e.next_elapse?`next ${e.next_elapse}`:a})]})]}),i.jsx("div",{className:"border-t border-border bg-slate-50 px-3 pb-3 pt-2",children:i.jsx(Rx,{unit:e.unit,active:t})})]})}function lo({label:e,value:t,detail:n}){return i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted md:hidden",children:e}),i.jsx("div",{className:"truncate font-mono text-[11px] text-foreground",children:t}),n?i.jsx("div",{className:"truncate font-mono text-[11px] text-muted",children:n}):null]})}function Rx({unit:e,active:t}){const[n,r]=T.useState([]),[s,a]=T.useState(""),o=T.useRef(null);return T.useEffect(()=>{if(!t){r([]),a("");return}r([]),a("");const l=new EventSource(`/api/systemd/journal/stream?unit=${encodeURIComponent(e)}`);return l.addEventListener("journal_line",u=>{const c=Or(u);c&&r(d=>[...d.slice(-199),c])}),l.addEventListener("journal_error",u=>{const c=Or(u);a((c==null?void 0:c.error)??"journal stream failed")}),l.onerror=()=>{},()=>l.close()},[t,e]),T.useEffect(()=>{const l=o.current;l&&(l.scrollTop=l.scrollHeight)},[n]),i.jsxs("div",{className:"grid min-w-0 gap-2",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted",children:"Live journal"}),i.jsx("div",{className:"mt-0.5 truncate font-mono text-[11px] text-muted",children:n.length>0?`${n.length} lines streamed`:"waiting for journal output"})]}),i.jsx("div",{className:"font-mono text-[11px] text-muted",children:"journalctl -f"})]}),s?i.jsx(Ne,{tone:"error",text:s}):null,i.jsx("div",{ref:o,className:"h-72 overflow-auto rounded-md border border-slate-800 bg-slate-950 p-3 font-mono text-xs leading-relaxed text-slate-100",children:n.length>0?n.map((l,u)=>i.jsx("div",{className:"break-words [overflow-wrap:anywhere]",children:l.line},`${l.unit}-${u}`)):i.jsx("div",{className:"text-slate-400",children:"No journal lines received yet."})})]})}function Ix({data:e,loading:t}){var h,m,p,y,w,j;if(t&&!e)return i.jsx(Z,{text:"Loading process activity..."});if(!e)return i.jsx(Z,{text:"No process snapshot available."});const n=e.executor.children??[],r=n.flatMap(b=>Ql(b)),s=r.reduce((b,v)=>b+v.cpu_ticks,0),a=r.reduce((b,v)=>b+Ax(v),0),o=e.executor.service==="active",l=r.slice(0,8).map(b=>({label:`pid ${b.pid}`,ticks:b.cpu_ticks})),u=(e.samples??[]).map(b=>({label:$n(b.ts),ticks:b.cpu_ticks,io:b.io_bytes,active:b.active_since_last_sample?"active":"quiet"})),c=u.length>0?u:l,d=(h=e.samples)==null?void 0:h[e.samples.length-1];return i.jsxs("div",{className:"grid gap-4",children:[i.jsx("div",{className:"rounded-md border border-slate-200 bg-slate-50 p-3",children:i.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx("span",{className:V("inline-flex h-6 items-center rounded-full border px-2 text-xs font-semibold",o?"border-emerald-300 bg-emerald-50 text-emerald-700":"border-slate-300 bg-white text-slate-600"),children:o?"active":"idle"}),i.jsxs("span",{className:"font-mono text-xs text-muted",children:["service ",e.executor.service]})]}),i.jsx("div",{className:"mt-2 text-sm font-semibold text-foreground",children:e.running_jobs.length>0?`${e.running_jobs.length} running job${e.running_jobs.length===1?"":"s"}`:"No running jobs"}),e.running_jobs.length>0?i.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.running_jobs.slice(0,4).map(b=>i.jsxs("span",{className:"inline-flex min-h-6 items-center gap-1.5 rounded-full border border-blue-200 bg-white px-2 font-mono text-[11px] font-semibold text-blue-700",children:[i.jsx("span",{className:"h-2 w-2 rounded-full bg-blue-600 animate-live-pulse","aria-hidden":!0}),"#",b.id," ",We(b.age_seconds)]},b.id))}):null,d?i.jsxs("p",{className:"mt-1 text-xs text-muted",children:["Last persisted sample ",$n(d.ts)," · ",d.active_since_last_sample?"activity observed":`quiet ${We(d.idle_seconds)}`]}):null,i.jsx("p",{className:"mt-1 text-xs text-muted",children:e.detail})]}),i.jsxs("div",{className:"grid min-w-[190px] grid-cols-3 gap-2 text-center text-xs",children:[i.jsx(oi,{label:"PID",value:e.executor.pid?String(e.executor.pid):"n/a"}),i.jsx(oi,{label:"Children",value:String(r.length)}),i.jsx(oi,{label:"CPU ticks",value:String(s)})]})]})}),i.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[i.jsx(_r,{label:"Live process",value:((m=e.signals)==null?void 0:m.live_process.state)??(r.length>0?"live":"no_child_process"),detail:`${((p=e.signals)==null?void 0:p.live_process.child_count)??r.length} children`}),i.jsx(_r,{label:"Process activity",value:((y=e.signals)==null?void 0:y.process_activity.state)??(d!=null&&d.active_since_last_sample?"active":"quiet"),detail:d?`sample ${$n(d.ts)}`:"no sample"}),i.jsx(_r,{label:"Semantic progress",value:(w=e.signals)!=null&&w.semantic_progress.length?"recent":"none",detail:uo(e.running_jobs,"semantic_progress")}),i.jsx(_r,{label:"Visible progress",value:(j=e.signals)!=null&&j.visible_progress.length?"streaming":"none",detail:uo(e.running_jobs,"visible_progress")})]}),e.alerts.length>0?i.jsx(Ne,{tone:"error",text:e.alerts[0]}):null,i.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)]",children:[i.jsxs("div",{className:"min-w-0 rounded-md border border-border p-3",children:[i.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[i.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold",children:[i.jsx(ha,{className:"h-4 w-4","aria-hidden":!0}),u.length>0?"CPU history":"CPU ticks"]}),i.jsxs("span",{className:"font-mono text-xs text-muted",children:[Vl(a)," I/O"]})]}),c.length>0?i.jsx("div",{className:"h-40",children:i.jsx(nr,{width:"100%",height:"100%",children:i.jsxs(su,{data:c,children:[i.jsx(rr,{strokeDasharray:"3 3"}),i.jsx(ir,{dataKey:"label",tick:!1}),i.jsx(sr,{allowDecimals:!1,tick:{fontSize:11}}),i.jsx(ar,{formatter:b=>[Number(b),"cpu ticks"]}),i.jsx(au,{type:"monotone",dataKey:"ticks",stroke:"#0f766e",strokeWidth:2,dot:{r:3},activeDot:{r:5},isAnimationActive:!1})]})})}):i.jsx(Z,{text:"No executor CPU samples available."})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsxs("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[i.jsx(ha,{className:"h-4 w-4","aria-hidden":!0}),"Executor children"]}),n.length>0?i.jsx("div",{className:"grid gap-2",children:n.map(b=>i.jsx(Kl,{process:b},b.pid))}):i.jsx(Z,{text:"No child process detected for the executor."})]})]})]})}function Tx({alerts:e,loading:t,now:n}){if(t&&!e)return i.jsx(Z,{text:"Loading monitor alerts..."});const r=e??[];return r.length===0?i.jsx(Z,{text:"No active monitor alerts."}):i.jsx("div",{className:"grid gap-2",children:r.slice(0,5).map(s=>i.jsxs("div",{className:"rounded-md border border-red-200 bg-red-50 p-2.5",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs font-semibold text-red-700",children:[i.jsx(Fr,{className:"h-3.5 w-3.5","aria-hidden":!0}),i.jsx("span",{children:s.severity}),i.jsx("span",{className:"font-normal text-red-600",children:Al(s.last_seen,n)}),s.observations>1?i.jsxs("span",{className:"rounded-full border border-red-200 bg-white px-1.5",children:[s.observations,"x"]}):null]}),i.jsx("p",{className:"mt-1 break-words text-sm font-medium text-red-950 [overflow-wrap:anywhere]",children:s.message})]},s.fingerprint))})}function Kl({process:e}){var r,s;const t=((r=e.io_bytes)==null?void 0:r.read_bytes)??0,n=((s=e.io_bytes)==null?void 0:s.write_bytes)??0;return i.jsxs("div",{className:"rounded-md border border-border bg-white p-2.5",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[i.jsxs("span",{className:"font-mono",children:["pid ",e.pid]}),i.jsxs("span",{className:"rounded-full border border-border px-2 text-xs text-muted",children:["state ",e.state]}),i.jsxs("span",{className:"rounded-full border border-border px-2 text-xs text-muted",children:["cpu ",e.cpu_ticks]}),i.jsxs("span",{className:"rounded-full border border-border px-2 text-xs text-muted",children:["I/O ",Vl(t+n)]})]}),i.jsx("div",{className:"mt-2 break-words font-mono text-xs text-muted",children:e.cmd||"unknown command"}),e.children&&e.children.length>0?i.jsx("div",{className:"mt-3 border-l-2 border-border pl-3",children:e.children.map(a=>i.jsx(Kl,{process:a},a.pid))}):null]})}function oi({label:e,value:t}){return i.jsxs("div",{className:"rounded-md border border-border bg-white px-2 py-2",children:[i.jsx("div",{className:"font-mono text-sm font-semibold text-foreground",children:t}),i.jsx("div",{className:"mt-0.5 text-[11px] font-semibold uppercase text-muted",children:e})]})}function _r({label:e,value:t,detail:n}){return i.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-2.5",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted",children:e}),i.jsx("div",{className:"mt-1 truncate text-sm font-semibold text-foreground",children:t}),i.jsx("div",{className:"mt-1 truncate font-mono text-[11px] text-muted",children:n})]})}function uo(e,t){const n=e.find(s=>s[t]),r=n==null?void 0:n[t];return!n||!r?"no running heartbeat":`#${n.id} ${r.phase} ${We(r.age_seconds??null)}`}function Ql(e){return[e,...(e.children??[]).flatMap(t=>Ql(t))]}function Ax(e){var t,n;return(((t=e.io_bytes)==null?void 0:t.read_bytes)??0)+(((n=e.io_bytes)==null?void 0:n.write_bytes)??0)}function Vl(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function te({label:e,value:t}){return i.jsxs("div",{className:"min-w-0 rounded-md border border-border p-3",children:[i.jsx("div",{className:"text-xs font-semibold text-muted",children:e}),i.jsx("div",{className:"mt-1 min-w-0 break-words text-sm [overflow-wrap:anywhere]",children:t})]})}function ls({status:e}){const t=gf(e),n=e==="running"||e==="pending";return i.jsxs("span",{className:V("inline-flex min-h-6 items-center gap-1.5 rounded-full border px-2 text-xs font-semibold",t.badge),children:[i.jsx("span",{className:V("h-2.5 w-2.5 rounded-full",t.dot,n&&"animate-live-pulse"),"aria-hidden":!0}),e]})}function Z({text:e}){return i.jsx("div",{className:"rounded-md border border-dashed border-border p-6 text-center text-sm text-muted",children:e})}function Ne({tone:e,text:t}){return i.jsx("div",{className:V("rounded-md border p-3 text-sm",e==="error"&&"border-red-300 bg-red-50 text-red-700",e==="warning"&&"border-amber-300 bg-amber-50 text-amber-800"),children:t})}function ut({onClick:e,compactOnMobile:t=!1}){return i.jsxs("button",{className:V("inline-flex h-8 items-center justify-center gap-2 rounded-md border border-border text-sm font-semibold text-foreground hover:bg-slate-50",t?"w-8 px-0 sm:w-auto sm:px-3":"px-3"),onClick:e,type:"button","aria-label":"Refresh",children:[i.jsx(lr,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:V(t&&"hidden sm:inline"),children:"Refresh"})]})}const co=document.getElementById("root");co&&du.createRoot(co).render(i.jsx(T.StrictMode,{children:i.jsx(zu,{client:af,children:i.jsx(Of,{})})})); diff --git a/src/github_agent_bridge/dashboard_static/index.html b/src/github_agent_bridge/dashboard_static/index.html index d1a5516..854314e 100644 --- a/src/github_agent_bridge/dashboard_static/index.html +++ b/src/github_agent_bridge/dashboard_static/index.html @@ -4,9 +4,9 @@ GitHub Agent Bridge Dashboard - + - +
diff --git a/tests/test_webhook.py b/tests/test_webhook.py index 6364663..74be921 100644 --- a/tests/test_webhook.py +++ b/tests/test_webhook.py @@ -150,6 +150,7 @@ def test_webhook_status_requires_dashboard_admin(tmp_path): "/api/webhooks/github/timeseries", "/api/webhooks/github/hooks", "/api/webhooks/github/deliveries", + "/api/webhooks/github/exceptions", ) assert {client.get(path).status_code for path in paths} == {401} assert client.get("/api/webhooks/github/hooks/42").status_code == 401 @@ -197,6 +198,11 @@ def test_webhook_monitoring_endpoints_keep_summary_light_and_return_real_data(tm "mode": "shadow", "configured": True, "receipts": {"observed": 1, "unsupported": 1}, "duplicate_deliveries": 0, "cross_source_matches": 0, + "totals": {"hooks": 1, "deliveries": 2}, + "coverage": { + "both": 0, "imap_only": 0, "webhook_only": 1, + "imap_eligible": 0, "ratio": None, "mean_match_delay_ms": None, + }, } assert client.get("/api/webhooks/github/status").json() == summary @@ -260,6 +266,10 @@ def test_webhook_monitoring_endpoints_keep_summary_light_and_return_real_data(tm assert timeseries["bucket"] == "hour" assert timeseries["points"][0]["observed"] == 1 assert timeseries["points"][0]["unsupported"] == 1 + exceptions = client.get("/api/webhooks/github/exceptions").json()["exceptions"] + assert {(item["kind"], item["reference"]) for item in exceptions} == { + ("unmatchable", "ping-1"), ("webhook_only", "delivery-1"), + } def test_webhook_monitoring_rejects_unbounded_ranges_and_invalid_cursors(tmp_path):