From 0367a3fa73a07ca863ae95f16b6879f71985a474 Mon Sep 17 00:00:00 2001 From: GISCE Bot Date: Fri, 2 Oct 2026 13:53:35 +0200 Subject: [PATCH 1/3] feat(dashboard): add webhook monitoring views Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com> --- dashboard/src/main.test.tsx | 13 ++ dashboard/src/main.tsx | 63 +++++- .../assets/index-CTkV4-hW.css | 1 - .../assets/index-D2uz4i7l.css | 1 + .../dashboard_static/assets/index-DNlul-q9.js | 187 ------------------ .../dashboard_static/assets/index-lIzCm8Xd.js | 187 ++++++++++++++++++ .../dashboard_static/index.html | 4 +- 7 files changed, 259 insertions(+), 197 deletions(-) delete mode 100644 src/github_agent_bridge/dashboard_static/assets/index-CTkV4-hW.css create mode 100644 src/github_agent_bridge/dashboard_static/assets/index-D2uz4i7l.css delete mode 100644 src/github_agent_bridge/dashboard_static/assets/index-DNlul-q9.js create mode 100644 src/github_agent_bridge/dashboard_static/assets/index-lIzCm8Xd.js diff --git a/dashboard/src/main.test.tsx b/dashboard/src/main.test.tsx index 5704f06..bd1e6f0 100644 --- a/dashboard/src/main.test.tsx +++ b/dashboard/src/main.test.tsx @@ -122,6 +122,19 @@ describe("dashboard routing and API query helpers", () => { expect(screen.getAllByText("7").length).toBeGreaterThan(0); }); + it("navigates webhook hook inventory and delivery details", async () => { + const user = userEvent.setup(); + render(); + + await user.click(screen.getByRole("tab", { name: /Hooks/ })); + expect(screen.getByText("organization · #42")).toBeInTheDocument(); + expect(screen.getByText("receiving")).toBeInTheDocument(); + + await user.click(screen.getByRole("tab", { name: /Deliveries/ })); + expect(screen.getByText("issue_comment · created")).toBeInTheDocument(); + expect(screen.getByText("gisce/github-agent-bridge")).toBeInTheDocument(); + }); + it("uses client-side navigation for dashboard section links", async () => { const user = userEvent.setup(); const onNavigate = vi.fn(); diff --git a/dashboard/src/main.tsx b/dashboard/src/main.tsx index c0ddc22..1560d38 100644 --- a/dashboard/src/main.tsx +++ b/dashboard/src/main.tsx @@ -75,6 +75,39 @@ type WebhookStatus = { receipts: Record; duplicate_deliveries: number; cross_source_matches: number; + timeseries?: WebhookTimeseriesPoint[]; + hooks?: WebhookHook[]; + recent_deliveries?: WebhookDelivery[]; +}; + +type WebhookTimeseriesPoint = { + bucket: string; + observed: number; + duplicate: number; + unsupported: number; +}; + +type WebhookHook = { + id: string; + target: string; + target_type: "organization" | "repository"; + active: boolean; + events: string[]; + last_ping_at?: string | null; + last_event_at?: string | null; + status: "receiving" | "quiet" | "inactive" | "never_seen" | "stale_config"; + admin_url?: string | null; +}; + +type WebhookDelivery = { + delivery_id: string; + created_at: string; + hook_id?: string | null; + event_name: string; + action?: string | null; + repository?: string | null; + status: string; + event_key?: string | null; }; type AutoupdateState = { @@ -1494,23 +1527,39 @@ function SectionNav({ function WebhookPage({ status, loading, error, onRefresh }: { status: WebhookStatus | undefined; loading: boolean; error: Error | null; onRefresh: () => void }) { const observed = Object.values(status?.receipts ?? {}).reduce((total, count) => total + count, 0); + const [section, setSection] = React.useState<"overview" | "hooks" | "deliveries">("overview"); + const sections = [ + { id: "overview" as const, label: "Overview" }, + { id: "hooks" as const, label: "Hooks", count: status?.hooks?.length }, + { id: "deliveries" as const, label: "Deliveries", count: status?.recent_deliveries?.length }, + ]; return (
} title="GitHub webhooks" subtitle="Shadow ingestion health. Deliveries are observed but do not create jobs." action={} /> {error ? : null} +
+ {sections.map((item) => )} +
} /> } /> } /> } />
- - {loading ? : Object.keys(status?.receipts ?? {}).length ? ( -
- {Object.entries(status?.receipts ?? {}).sort(([left], [right]) => left.localeCompare(right)).map(([state, count]) => )} -
- ) : } -
+ {section === "overview" ? <> + + {status?.timeseries?.length ?
: } +
+ + {loading ? : Object.keys(status?.receipts ?? {}).length ?
{Object.entries(status?.receipts ?? {}).sort(([left], [right]) => left.localeCompare(right)).map(([state, count]) => )}
: } +
+ : null} + {section === "hooks" ? + {status?.hooks?.length ?
{status.hooks.map((hook) => )}
TargetStateEventsLast pingLast delivery
{hook.target}
{hook.target_type} · #{hook.id}
{hook.status}{hook.events.join(", ") || "All events"}{hook.last_ping_at ?? "Never"}{hook.last_event_at ?? "Never"}
: } +
: null} + {section === "deliveries" ? + {status?.recent_deliveries?.length ?
{status.recent_deliveries.map((delivery) => )}
ReceivedEventRepositoryResultDelivery
{delivery.created_at}{delivery.event_name}{delivery.action ? ` · ${delivery.action}` : ""}{delivery.repository ?? "—"}{delivery.status}{delivery.delivery_id}
: } +
: null}
); } diff --git a/src/github_agent_bridge/dashboard_static/assets/index-CTkV4-hW.css b/src/github_agent_bridge/dashboard_static/assets/index-CTkV4-hW.css deleted file mode 100644 index 886a978..0000000 --- a/src/github_agent_bridge/dashboard_static/assets/index-CTkV4-hW.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}.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-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-full{min-width:100%}.max-w-40{max-width:10rem}.max-w-\[1440px\]{max-width:1440px}.max-w-full{max-width:100%}.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}.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-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-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-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-D2uz4i7l.css b/src/github_agent_bridge/dashboard_static/assets/index-D2uz4i7l.css new file mode 100644 index 0000000..df7f6b4 --- /dev/null +++ b/src/github_agent_bridge/dashboard_static/assets/index-D2uz4i7l.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}.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-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-\[760px\]{min-width:760px}.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-xs{max-width:20rem}.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-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-DNlul-q9.js b/src/github_agent_bridge/dashboard_static/assets/index-DNlul-q9.js deleted file mode 100644 index ddc61d3..0000000 --- a/src/github_agent_bridge/dashboard_static/assets/index-DNlul-q9.js +++ /dev/null @@ -1,187 +0,0 @@ -var Ls=e=>{throw TypeError(e)};var Or=(e,t,n)=>t.has(e)||Ls("Cannot "+n);var g=(e,t,n)=>(Or(e,t,"read from private field"),n?n.call(e):t.get(e)),U=(e,t,n)=>t.has(e)?Ls("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),M=(e,t,n,r)=>(Or(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),X=(e,t,n)=>(Or(e,t,"access private method"),n);var rr=(e,t,n,r)=>({set _(i){M(e,t,i,n)},get _(){return g(e,t,r)}});import{f as Nl,h as Sl,g as Pi,r as we,R as A,d as jr,a as Ri,C as kr,X as Nr,Y as Sr,L as Cl,T as Cr,B as mr,e as _l,c as El,b as Pl}from"./charts-SqBiqy9C.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)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(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var Fr={exports:{}},vn={};/** - * @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 Ms;function Rl(){if(Ms)return vn;Ms=1;var e=Nl(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=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:i.current}}return vn.Fragment=n,vn.jsx=o,vn.jsxs=o,vn}var Os;function Tl(){return Os||(Os=1,Fr.exports=Rl()),Fr.exports}var s=Tl(),ir={},Fs;function Il(){if(Fs)return ir;Fs=1;var e=Sl();return ir.createRoot=e.createRoot,ir.hydrateRoot=e.hydrateRoot,ir}var Al=Il();const Ll=Pi(Al);var Gn=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(){}},Lt,jt,Yt,Ka,Ml=(Ka=class extends Gn{constructor(){super();U(this,Lt);U(this,jt);U(this,Yt);M(this,Yt,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){g(this,jt)||this.setEventListener(g(this,Yt))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,jt))==null||t.call(this),M(this,jt,void 0))}setEventListener(t){var n;M(this,Yt,t),(n=g(this,jt))==null||n.call(this),M(this,jt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){g(this,Lt)!==t&&(M(this,Lt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof g(this,Lt)=="boolean"?g(this,Lt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Lt=new WeakMap,jt=new WeakMap,Yt=new WeakMap,Ka),Ti=new Ml,Ol={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},kt,Ei,Va,Fl=(Va=class{constructor(){U(this,kt,Ol);U(this,Ei,!1)}setTimeoutProvider(e){M(this,kt,e)}setTimeout(e,t){return g(this,kt).setTimeout(e,t)}clearTimeout(e){g(this,kt).clearTimeout(e)}setInterval(e,t){return g(this,kt).setInterval(e,t)}clearInterval(e){g(this,kt).clearInterval(e)}},kt=new WeakMap,Ei=new WeakMap,Va),At=new Fl;function Dl(e){setTimeout(e,0)}var zl=typeof window>"u"||"Deno"in globalThis;function Ae(){}function Bl(e,t){return typeof e=="function"?e(t):e}function ei(e){return typeof e=="number"&&e>=0&&e!==1/0}function no(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rt(e,t){return typeof e=="function"?e(t):e}function De(e,t){return typeof e=="function"?e(t):e}function Ds(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Ii(o,t.options))return!1}else if(!On(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||i&&i!==t.state.fetchStatus||a&&!a(t))}function zs(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Mn(t.options.mutationKey)!==Mn(a))return!1}else if(!On(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ii(e,t){return((t==null?void 0:t.queryKeyHashFn)||Mn)(e)}function Mn(e){return JSON.stringify(e,(t,n)=>ni(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function On(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>On(e[n],t[n])):!1}var ql=Object.prototype.hasOwnProperty;function ro(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Bs(e)&&Bs(t);if(!r&&!(ni(e)&&ni(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{At.setTimeout(t,e)})}function ri(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?ro(e,t):t}function $l(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Hl(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ai=Symbol();function io(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ai?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function so(e,t){return typeof e=="function"?e(...t):!!e}function Ql(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var Fn=(()=>{let e=()=>zl;return{isServer(){return e()},setIsServer(t){e=t}}})();function ii(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var Kl=Dl;function Vl(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=Kl;const a=l=>{t?e.push(l):i(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{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=>{i=l}}}var ye=Vl(),Zt,Nt,en,Ga,Gl=(Ga=class extends Gn{constructor(){super();U(this,Zt,!0);U(this,Nt);U(this,en);M(this,en,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,Nt)||this.setEventListener(g(this,en))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,Nt))==null||t.call(this),M(this,Nt,void 0))}setEventListener(t){var n;M(this,en,t),(n=g(this,Nt))==null||n.call(this),M(this,Nt,t(this.setOnline.bind(this)))}setOnline(t){g(this,Zt)!==t&&(M(this,Zt,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return g(this,Zt)}},Zt=new WeakMap,Nt=new WeakMap,en=new WeakMap,Ga),fr=new Gl;function Wl(e){return Math.min(1e3*2**e,3e4)}function ao(e){return(e??"online")==="online"?fr.isOnline():!0}var si=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function oo(e){let t=!1,n=0,r;const i=ii(),a=()=>i.status!=="pending",o=w=>{var v;if(!a()){const b=new si(w);m(b),(v=e.onCancel)==null||v.call(e,b)}},l=()=>{t=!0},u=()=>{t=!1},c=()=>Ti.isFocused()&&(e.networkMode==="always"||fr.isOnline())&&e.canRun(),d=()=>ao(e.networkMode)&&e.canRun(),h=w=>{a()||(r==null||r(),i.resolve(w))},m=w=>{a()||(r==null||r(),i.reject(w))},p=()=>new Promise(w=>{var v;r=b=>{(a()||c())&&w(b)},(v=e.onPause)==null||v.call(e)}).then(()=>{var w;r=void 0,a()||(w=e.onContinue)==null||w.call(e)}),y=()=>{if(a())return;let w;const v=n===0?e.initialPromise:void 0;try{w=v??e.fn()}catch(b){w=Promise.reject(b)}Promise.resolve(w).then(h).catch(b=>{var j;if(a())return;const N=e.retry??(Fn.isServer()?0:3),_=e.retryDelay??Wl,S=typeof _=="function"?_(n,b):_,F=N===!0||typeof N=="number"&&nc()?void 0:p()).then(()=>{t?m(b):y()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:l,continueRetry:u,canStart:d,start:()=>(d()?y():p().then(y),i)}}var Mt,Wa,lo=(Wa=class{constructor(){U(this,Mt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ei(this.gcTime)&&M(this,Mt,At.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fn.isServer()?1/0:300*1e3))}clearGcTimeout(){g(this,Mt)!==void 0&&(At.clearTimeout(g(this,Mt)),M(this,Mt,void 0))}},Mt=new WeakMap,Wa);function Jl(e){return{onFetch:(t,n)=>{var d,h,m,p,y;const r=t.options,i=(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 v=_=>{Ql(_,()=>t.signal,()=>w=!0)},b=io(t.options,t.fetchOptions),N=async(_,S,F)=>{if(w)return Promise.reject(t.signal.reason);if(S==null&&_.pages.length)return Promise.resolve(_);const B=(()=>{const I={client:t.client,queryKey:t.queryKey,pageParam:S,direction:F?"backward":"forward",meta:t.options.meta};return v(I),I})(),L=await b(B),{maxPages:C}=t.options,O=F?Hl:$l;return{pages:O(_.pages,L,C),pageParams:O(_.pageParams,S,C)}};if(i&&a.length){const _=i==="backward",S=_?Xl:Us,F={pages:a,pageParams:o},j=S(r,F);l=await N(F,j,_)}else{const _=e??a.length;do{const S=u===0?o[0]??r.initialPageParam:Us(r,l);if(u>0&&S==null)break;l=await N(l,S),u++}while(u<_)}return l};t.options.persister?t.fetchFn=()=>{var w,v;return(v=(w=t.options).persister)==null?void 0:v.call(w,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Us(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 Xl(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}var tn,Ot,nn,Ue,Ft,be,$n,Dt,Fe,uo,ut,Ja,Yl=(Ja=class extends lo{constructor(t){super();U(this,Fe);U(this,tn);U(this,Ot);U(this,nn);U(this,Ue);U(this,Ft);U(this,be);U(this,$n);U(this,Dt);M(this,Dt,!1),M(this,$n,t.defaultOptions),this.setOptions(t.options),this.observers=[],M(this,Ft,t.client),M(this,Ue,g(this,Ft).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,M(this,Ot,Hs(this.options)),this.state=t.state??g(this,Ot),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return g(this,tn)}get promise(){var t;return(t=g(this,be))==null?void 0:t.promise}setOptions(t){if(this.options={...g(this,$n),...t},t!=null&&t._type&&M(this,tn,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Hs(this.options);n.data!==void 0&&(this.setState($s(n.data,n.dataUpdatedAt)),M(this,Ot,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&g(this,Ue).remove(this)}setData(t,n){const r=ri(this.state.data,t,this.options);return X(this,Fe,ut).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,Fe,ut).call(this,{type:"setState",state:t})}cancel(t){var r,i;const n=(r=g(this,be))==null?void 0:r.promise;return(i=g(this,be))==null||i.cancel(t),n?n.then(Ae).catch(Ae):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return g(this,Ot)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>De(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ai||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Rt(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,be))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=g(this,be))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),g(this,Ue).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,be)&&(g(this,Dt)||X(this,Fe,uo).call(this)?g(this,be).cancel({revert:!0}):g(this,be).cancelRetry()),this.scheduleGc()),g(this,Ue).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||X(this,Fe,ut).call(this,{type:"invalidate"})}async fetch(t,n){var c,d,h,m,p,y,w,v,b,N,_;if(this.state.fetchStatus!=="idle"&&((c=g(this,be))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(g(this,be))return g(this,be).continueRetry(),g(this,be).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(F=>F.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,i=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(M(this,Dt,!0),r.signal)})},a=()=>{const S=io(this.options,n),j=(()=>{const B={client:g(this,Ft),queryKey:this.queryKey,meta:this.meta};return i(B),B})();return M(this,Dt,!1),this.options.persister?this.options.persister(S,j,this):S(j)},l=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:g(this,Ft),state:this.state,fetchFn:a};return i(S),S})(),u=g(this,tn)==="infinite"?Jl(this.options.pages):this.options.behavior;u==null||u.onFetch(l,this),M(this,nn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&X(this,Fe,ut).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta}),M(this,be,oo({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:S=>{S instanceof si&&S.revert&&this.setState({...g(this,nn),fetchStatus:"idle"}),r.abort()},onFail:(S,F)=>{X(this,Fe,ut).call(this,{type:"failed",failureCount:S,error:F})},onPause:()=>{X(this,Fe,ut).call(this,{type:"pause"})},onContinue:()=>{X(this,Fe,ut).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const S=await g(this,be).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(p=(m=g(this,Ue).config).onSuccess)==null||p.call(m,S,this),(w=(y=g(this,Ue).config).onSettled)==null||w.call(y,S,this.state.error,this),S}catch(S){if(S instanceof si){if(S.silent)return g(this,be).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw X(this,Fe,ut).call(this,{type:"error",error:S}),(b=(v=g(this,Ue).config).onError)==null||b.call(v,S,this),(_=(N=g(this,Ue).config).onSettled)==null||_.call(N,this.state.data,S,this),S}finally{this.scheduleGc()}}},tn=new WeakMap,Ot=new WeakMap,nn=new WeakMap,Ue=new WeakMap,Ft=new WeakMap,be=new WeakMap,$n=new WeakMap,Dt=new WeakMap,Fe=new WeakSet,uo=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ut=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,...co(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...$s(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return M(this,nn,t.manual?i:void 0),i;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),ye.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),g(this,Ue).notify({query:this,type:"updated",action:t})})},Ja);function co(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ao(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $s(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Hs(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 Ie,Y,Hn,Ce,zt,rn,ct,St,Qn,sn,an,Bt,qt,Ct,on,re,Pn,ai,oi,li,ui,ci,di,hi,ho,Xa,Zl=(Xa=class extends Gn{constructor(t,n){super();U(this,re);U(this,Ie);U(this,Y);U(this,Hn);U(this,Ce);U(this,zt);U(this,rn);U(this,ct);U(this,St);U(this,Qn);U(this,sn);U(this,an);U(this,Bt);U(this,qt);U(this,Ct);U(this,on,new Set);this.options=n,M(this,Ie,t),M(this,St,null),M(this,ct,ii()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(g(this,Y).addObserver(this),Qs(g(this,Y),this.options)?X(this,re,Pn).call(this):this.updateResult(),X(this,re,ui).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pi(g(this,Y),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pi(g(this,Y),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,X(this,re,ci).call(this),X(this,re,di).call(this),g(this,Y).removeObserver(this)}setOptions(t){const n=this.options,r=g(this,Y);if(this.options=g(this,Ie).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof De(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,re,hi).call(this),g(this,Y).setOptions(this.options),n._defaulted&&!ti(this.options,n)&&g(this,Ie).getQueryCache().notify({type:"observerOptionsUpdated",query:g(this,Y),observer:this});const i=this.hasListeners();i&&Ks(g(this,Y),r,this.options,n)&&X(this,re,Pn).call(this),this.updateResult(),i&&(g(this,Y)!==r||De(this.options.enabled,g(this,Y))!==De(n.enabled,g(this,Y))||Rt(this.options.staleTime,g(this,Y))!==Rt(n.staleTime,g(this,Y)))&&X(this,re,ai).call(this);const a=X(this,re,oi).call(this);i&&(g(this,Y)!==r||De(this.options.enabled,g(this,Y))!==De(n.enabled,g(this,Y))||a!==g(this,Ct))&&X(this,re,li).call(this,a)}getOptimisticResult(t){const n=g(this,Ie).getQueryCache().build(g(this,Ie),t),r=this.createResult(n,t);return tu(this,r)&&(M(this,Ce,r),M(this,rn,this.options),M(this,zt,g(this,Y).state)),r}getCurrentResult(){return g(this,Ce)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&g(this,ct).status==="pending"&&g(this,ct).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){g(this,on).add(t)}getCurrentQuery(){return g(this,Y)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=g(this,Ie).defaultQueryOptions(t),r=g(this,Ie).getQueryCache().build(g(this,Ie),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return X(this,re,Pn).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),g(this,Ce)))}createResult(t,n){var C;const r=g(this,Y),i=this.options,a=g(this,Ce),o=g(this,zt),l=g(this,rn),c=t!==r?t.state:g(this,Hn),{state:d}=t;let h={...d},m=!1,p;if(n._optimisticResults){const O=this.hasListeners(),I=!O&&Qs(t,n),E=O&&Ks(t,r,n,i);(I||E)&&(h={...h,...co(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:y,errorUpdatedAt:w,status:v}=h;p=h.data;let b=!1;if(n.placeholderData!==void 0&&p===void 0&&v==="pending"){let O;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(O=a.data,b=!0):O=typeof n.placeholderData=="function"?n.placeholderData((C=g(this,an))==null?void 0:C.state.data,g(this,an)):n.placeholderData,O!==void 0&&(v="success",p=ri(a==null?void 0:a.data,O,n),m=!0)}if(n.select&&p!==void 0&&!b)if(a&&p===(o==null?void 0:o.data)&&n.select===g(this,Qn))p=g(this,sn);else try{M(this,Qn,n.select),p=n.select(p),p=ri(a==null?void 0:a.data,p,n),M(this,sn,p),M(this,St,null)}catch(O){M(this,St,O)}g(this,St)&&(y=g(this,St),p=g(this,sn),w=Date.now(),v="error");const N=h.fetchStatus==="fetching",_=v==="pending",S=v==="error",F=_&&N,j=p!==void 0,L={status:v,fetchStatus:h.fetchStatus,isPending:_,isSuccess:v==="success",isError:S,isInitialLoading:F,isLoading:F,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:N,isRefetching:N&&!_,isLoadingError:S&&!j,isPaused:h.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:S&&j,isStale:Li(t,n),refetch:this.refetch,promise:g(this,ct),isEnabled:De(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const O=L.data!==void 0,I=L.status==="error"&&!O,E=P=>{I?P.reject(L.error):O&&P.resolve(L.data)},K=()=>{const P=M(this,ct,L.promise=ii());E(P)},D=g(this,ct);switch(D.status){case"pending":t.queryHash===r.queryHash&&E(D);break;case"fulfilled":(I||L.data!==D.value)&&K();break;case"rejected":(!I||L.error!==D.reason)&&K();break}}return L}updateResult(){const t=g(this,Ce),n=this.createResult(g(this,Y),this.options);if(M(this,zt,g(this,Y).state),M(this,rn,this.options),g(this,zt).data!==void 0&&M(this,an,g(this,Y)),ti(n,t))return;M(this,Ce,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!g(this,on).size)return!0;const o=new Set(a??g(this,on));return this.options.throwOnError&&o.add("error"),Object.keys(g(this,Ce)).some(l=>{const u=l;return g(this,Ce)[u]!==t[u]&&o.has(u)})};X(this,re,ho).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&X(this,re,ui).call(this)}},Ie=new WeakMap,Y=new WeakMap,Hn=new WeakMap,Ce=new WeakMap,zt=new WeakMap,rn=new WeakMap,ct=new WeakMap,St=new WeakMap,Qn=new WeakMap,sn=new WeakMap,an=new WeakMap,Bt=new WeakMap,qt=new WeakMap,Ct=new WeakMap,on=new WeakMap,re=new WeakSet,Pn=function(t){X(this,re,hi).call(this);let n=g(this,Y).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ae)),n},ai=function(){X(this,re,ci).call(this);const t=Rt(this.options.staleTime,g(this,Y));if(Fn.isServer()||g(this,Ce).isStale||!ei(t))return;const r=no(g(this,Ce).dataUpdatedAt,t)+1;M(this,Bt,At.setTimeout(()=>{g(this,Ce).isStale||this.updateResult()},r))},oi=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(g(this,Y)):this.options.refetchInterval)??!1},li=function(t){X(this,re,di).call(this),M(this,Ct,t),!(Fn.isServer()||De(this.options.enabled,g(this,Y))===!1||!ei(g(this,Ct))||g(this,Ct)===0)&&M(this,qt,At.setInterval(()=>{(this.options.refetchIntervalInBackground||Ti.isFocused())&&X(this,re,Pn).call(this)},g(this,Ct)))},ui=function(){X(this,re,ai).call(this),X(this,re,li).call(this,X(this,re,oi).call(this))},ci=function(){g(this,Bt)!==void 0&&(At.clearTimeout(g(this,Bt)),M(this,Bt,void 0))},di=function(){g(this,qt)!==void 0&&(At.clearInterval(g(this,qt)),M(this,qt,void 0))},hi=function(){const t=g(this,Ie).getQueryCache().build(g(this,Ie),this.options);if(t===g(this,Y))return;const n=g(this,Y);M(this,Y,t),M(this,Hn,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},ho=function(t){ye.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(g(this,Ce))}),g(this,Ie).getQueryCache().notify({query:g(this,Y),type:"observerResultsUpdated"})})},Xa);function eu(e,t){return De(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&De(t.retryOnMount,e)===!1)}function Qs(e,t){return eu(e,t)||e.state.data!==void 0&&pi(e,t,t.refetchOnMount)}function pi(e,t,n){if(De(t.enabled,e)!==!1&&Rt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Li(e,t)}return!1}function Ks(e,t,n,r){return(e!==t||De(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Li(e,n)}function Li(e,t){return De(t.enabled,e)!==!1&&e.isStaleByTime(Rt(t.staleTime,e))}function tu(e,t){return!ti(e.getCurrentResult(),t)}var Kn,Ze,ke,Ut,et,vt,Ya,nu=(Ya=class extends lo{constructor(t){super();U(this,et);U(this,Kn);U(this,Ze);U(this,ke);U(this,Ut);M(this,Kn,t.client),this.mutationId=t.mutationId,M(this,ke,t.mutationCache),M(this,Ze,[]),this.state=t.state||ru(),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,Ze).includes(t)||(g(this,Ze).push(t),this.clearGcTimeout(),g(this,ke).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){M(this,Ze,g(this,Ze).filter(n=>n!==t)),this.scheduleGc(),g(this,ke).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){g(this,Ze).length||(this.state.status==="pending"?this.scheduleGc():g(this,ke).remove(this))}continue(){var t;return((t=g(this,Ut))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,u,c,d,h,m,p,y,w,v,b,N,_,S,F,j,B;const n=()=>{X(this,et,vt).call(this,{type:"continue"})},r={client:g(this,Kn),meta:this.options.meta,mutationKey:this.options.mutationKey};M(this,Ut,oo({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,C)=>{X(this,et,vt).call(this,{type:"failed",failureCount:L,error:C})},onPause:()=>{X(this,et,vt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>g(this,ke).canRun(this)}));const i=this.state.status==="pending",a=!g(this,Ut).canStart();try{if(i)n();else{X(this,et,vt).call(this,{type:"pending",variables:t,isPaused:a}),g(this,ke).config.onMutate&&await g(this,ke).config.onMutate(t,this,r);const C=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,r));C!==this.state.context&&X(this,et,vt).call(this,{type:"pending",context:C,variables:t,isPaused:a})}const L=await g(this,Ut).start();return await((c=(u=g(this,ke).config).onSuccess)==null?void 0:c.call(u,L,t,this.state.context,this,r)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,L,t,this.state.context,r)),await((p=(m=g(this,ke).config).onSettled)==null?void 0:p.call(m,L,null,this.state.variables,this.state.context,this,r)),await((w=(y=this.options).onSettled)==null?void 0:w.call(y,L,null,t,this.state.context,r)),X(this,et,vt).call(this,{type:"success",data:L}),L}catch(L){try{await((b=(v=g(this,ke).config).onError)==null?void 0:b.call(v,L,t,this.state.context,this,r))}catch(C){Promise.reject(C)}try{await((_=(N=this.options).onError)==null?void 0:_.call(N,L,t,this.state.context,r))}catch(C){Promise.reject(C)}try{await((F=(S=g(this,ke).config).onSettled)==null?void 0:F.call(S,void 0,L,this.state.variables,this.state.context,this,r))}catch(C){Promise.reject(C)}try{await((B=(j=this.options).onSettled)==null?void 0:B.call(j,void 0,L,t,this.state.context,r))}catch(C){Promise.reject(C)}throw X(this,et,vt).call(this,{type:"error",error:L}),L}finally{g(this,ke).runNext(this)}}},Kn=new WeakMap,Ze=new WeakMap,ke=new WeakMap,Ut=new WeakMap,et=new WeakSet,vt=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),ye.batch(()=>{g(this,Ze).forEach(r=>{r.onMutationUpdate(t)}),g(this,ke).notify({mutation:this,type:"updated",action:t})})},Ya);function ru(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var dt,Ve,Vn,Za,iu=(Za=class extends Gn{constructor(t={}){super();U(this,dt);U(this,Ve);U(this,Vn);this.config=t,M(this,dt,new Set),M(this,Ve,new Map),M(this,Vn,0)}build(t,n,r){const i=new nu({client:t,mutationCache:this,mutationId:++rr(this,Vn)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){g(this,dt).add(t);const n=sr(t);if(typeof n=="string"){const r=g(this,Ve).get(n);r?r.push(t):g(this,Ve).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(g(this,dt).delete(t)){const n=sr(t);if(typeof n=="string"){const r=g(this,Ve).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&g(this,Ve).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=sr(t);if(typeof n=="string"){const r=g(this,Ve).get(n),i=r==null?void 0:r.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=sr(t);if(typeof n=="string"){const i=(r=g(this,Ve).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ye.batch(()=>{g(this,dt).forEach(t=>{this.notify({type:"removed",mutation:t})}),g(this,dt).clear(),g(this,Ve).clear()})}getAll(){return Array.from(g(this,dt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>zs(n,r))}findAll(t={}){return this.getAll().filter(n=>zs(t,n))}notify(t){ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ye.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ae))))}},dt=new WeakMap,Ve=new WeakMap,Vn=new WeakMap,Za);function sr(e){var t;return(t=e.options.scope)==null?void 0:t.id}var tt,eo,su=(eo=class extends Gn{constructor(t={}){super();U(this,tt);this.config=t,M(this,tt,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??Ii(i,n);let o=this.get(a);return o||(o=new Yl({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){g(this,tt).has(t.queryHash)||(g(this,tt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=g(this,tt).get(t.queryHash);n&&(t.destroy(),n===t&&g(this,tt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ye.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return g(this,tt).get(t)}getAll(){return[...g(this,tt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ds(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Ds(t,r)):n}notify(t){ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ye.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ye.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},tt=new WeakMap,eo),de,_t,Et,ln,un,Pt,cn,dn,to,au=(to=class{constructor(e={}){U(this,de);U(this,_t);U(this,Et);U(this,ln);U(this,un);U(this,Pt);U(this,cn);U(this,dn);M(this,de,e.queryCache||new su),M(this,_t,e.mutationCache||new iu),M(this,Et,e.defaultOptions||{}),M(this,ln,new Map),M(this,un,new Map),M(this,Pt,0)}mount(){rr(this,Pt)._++,g(this,Pt)===1&&(M(this,cn,Ti.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,de).onFocus())})),M(this,dn,fr.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,de).onOnline())})))}unmount(){var e,t;rr(this,Pt)._--,g(this,Pt)===0&&((e=g(this,cn))==null||e.call(this),M(this,cn,void 0),(t=g(this,dn))==null||t.call(this),M(this,dn,void 0))}isFetching(e){return g(this,de).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return g(this,_t).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=g(this,de).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=g(this,de).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Rt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return g(this,de).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=g(this,de).get(r.queryHash),a=i==null?void 0:i.state.data,o=Bl(t,a);if(o!==void 0)return g(this,de).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ye.batch(()=>g(this,de).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,de).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=g(this,de);ye.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=g(this,de);return ye.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ye.batch(()=>g(this,de).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Ae).catch(Ae)}invalidateQueries(e,t={}){return ye.batch(()=>(g(this,de).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=ye.batch(()=>g(this,de).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(Ae)),i.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,de).build(this,t);return n.isStaleByTime(Rt(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 fr.isOnline()?g(this,_t).resumePausedMutations():Promise.resolve()}getQueryCache(){return g(this,de)}getMutationCache(){return g(this,_t)}getDefaultOptions(){return g(this,Et)}setDefaultOptions(e){M(this,Et,e)}setQueryDefaults(e,t){g(this,ln).set(Mn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...g(this,ln).values()],n={};return t.forEach(r=>{On(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){g(this,un).set(Mn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...g(this,un).values()],n={};return t.forEach(r=>{On(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...g(this,Et).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ii(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===Ai&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...g(this,Et).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){g(this,de).clear(),g(this,_t).clear()}},de=new WeakMap,_t=new WeakMap,Et=new WeakMap,ln=new WeakMap,un=new WeakMap,Pt=new WeakMap,cn=new WeakMap,dn=new WeakMap,to),po=we.createContext(void 0),mo=e=>{const t=we.useContext(po);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ou=({client:e,children:t})=>(we.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(po.Provider,{value:e,children:t})),fo=we.createContext(!1),lu=()=>we.useContext(fo);fo.Provider;function uu(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var cu=we.createContext(uu()),du=()=>we.useContext(cu),hu=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?so(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},pu=e=>{we.useEffect(()=>{e.clearReset()},[e])},mu=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||so(n,[e.error,r])),fu=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},xu=(e,t)=>e.isLoading&&e.isFetching&&!t,gu=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Vs=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function bu(e,t,n){var m,p,y,w;const r=lu(),i=du(),a=mo(),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",fu(o),hu(o,i,l),pu(i);const u=!a.getQueryCache().get(o.queryHash),[c]=we.useState(()=>new t(a,o)),d=c.getOptimisticResult(o),h=!r&&e.subscribed!==!1;if(we.useSyncExternalStore(we.useCallback(v=>{const b=h?c.subscribe(ye.batchCalls(v)):Ae;return c.updateResult(),b},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),we.useEffect(()=>{c.setOptions(o)},[o,c]),gu(o,d))throw Vs(o,c,i);if(mu({result:d,errorResetBoundary:i,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&&!Fn.isServer()&&xu(d,r)){const v=u?Vs(o,c,i):l==null?void 0:l.promise;v==null||v.catch(Ae).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?d:c.trackResult(d)}function ge(e,t){return bu(e,Zl)}/** - * @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(),xo=(...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 wu={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 vu=we.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...l},u)=>we.createElement("svg",{ref:u,...wu,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:xo("lucide",i),...l},[...o.map(([c,d])=>we.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 ae=(e,t)=>{const n=we.forwardRef(({className:r,...i},a)=>we.createElement(vu,{ref:a,iconNode:t,className:xo(`lucide-${yu(e)}`,r),...i}));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 Dn=ae("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 ju=ae("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 go=ae("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 Mi=ae("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 pn=ae("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 mn=ae("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 zn=ae("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 bo=ae("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 Gs=ae("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 hn=ae("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 yo=ae("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 ku=ae("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 Nu=ae("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 xr=ae("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=ae("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 Su=ae("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 Oi=ae("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 Bn=ae("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 Cu=ae("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 _u=ae("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 wo=ae("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 vo=ae("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 Eu=ae("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 mi=ae("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 Fi=ae("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 Pu=ae("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 Ht=ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Ru(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Tu=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Iu=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Au={};function Ws(e,t){return(Au.jsx?Iu:Tu).test(e)}const Lu=/[ \t\n\f\r]/g;function Mu(e){return typeof e=="object"?e.type==="text"?Js(e.value):!1:Js(e)}function Js(e){return e.replace(Lu,"")===""}class Jn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Jn.prototype.normal={};Jn.prototype.property={};Jn.prototype.space=void 0;function jo(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Jn(n,r,t)}function fi(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 Ou=0;const Q=Qt(),xe=Qt(),xi=Qt(),R=Qt(),se=Qt(),$t=Qt(),Oe=Qt();function Qt(){return 2**++Ou}const gi=Object.freeze(Object.defineProperty({__proto__:null,boolean:Q,booleanish:xe,commaOrSpaceSeparated:Oe,commaSeparated:$t,number:R,overloadedBoolean:xi,spaceSeparated:se},Symbol.toStringTag,{value:"Module"})),Dr=Object.keys(gi);class Di extends Me{constructor(t,n,r,i){let a=-1;if(super(t,n),Xs(this,"space",i),typeof r=="number")for(;++a4&&n.slice(0,4)==="data"&&qu.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Ys,Hu);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Ys.test(a)){let o=a.replace(Bu,$u);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Di}return new i(r,t)}function $u(e){return"-"+e.toLowerCase()}function Hu(e){return e.charAt(1).toUpperCase()}const Qu=jo([ko,Fu,Co,_o,Eo],"html"),zi=jo([ko,Du,Co,_o,Eo],"svg");function Ku(e){return e.join(" ").trim()}var Gt={},zr,Zs;function Vu(){if(Zs)return zr;Zs=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,u=` -`,c="/",d="*",h="",m="comment",p="declaration";function y(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var N=1,_=1;function S(D){var P=D.match(t);P&&(N+=P.length);var q=D.lastIndexOf(u);_=~q?D.length-q:_+D.length}function F(){var D={line:N,column:_};return function(P){return P.position=new j(D),C(),P}}function j(D){this.start=D,this.end={line:N,column:_},this.source=b.source}j.prototype.content=v;function B(D){var P=new Error(b.source+":"+N+":"+_+": "+D);if(P.reason=D,P.filename=b.source,P.line=N,P.column=_,P.source=v,!b.silent)throw P}function L(D){var P=D.exec(v);if(P){var q=P[0];return S(q),v=v.slice(q.length),P}}function C(){L(n)}function O(D){var P;for(D=D||[];P=I();)P!==!1&&D.push(P);return D}function I(){var D=F();if(!(c!=v.charAt(0)||d!=v.charAt(1))){for(var P=2;h!=v.charAt(P)&&(d!=v.charAt(P)||c!=v.charAt(P+1));)++P;if(P+=2,h===v.charAt(P-1))return B("End of comment missing");var q=v.slice(2,P-2);return _+=2,S(q),v=v.slice(P),_+=2,D({type:m,comment:q})}}function E(){var D=F(),P=L(r);if(P){if(I(),!L(i))return B("property missing ':'");var q=L(a),W=D({type:p,property:w(P[0].replace(e,h)),value:q?w(q[0].replace(e,h)):h});return L(o),W}}function K(){var D=[];O(D);for(var P;P=E();)P!==!1&&(D.push(P),O(D));return D}return C(),K()}function w(v){return v?v.replace(l,h):h}return zr=y,zr}var ea;function Gu(){if(ea)return Gt;ea=1;var e=Gt&&Gt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.default=n;const t=e(Vu());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),l=typeof i=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:c,value:d}=u;l?i(c,d,u):d&&(a=a||{},a[c]=d)}),a}return Gt}var jn={},ta;function Wu(){if(ta)return jn;ta=1,Object.defineProperty(jn,"__esModule",{value:!0}),jn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(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(i,l):c=c.replace(r,l),c.replace(t,o))};return jn.camelCase=u,jn}var kn,na;function Ju(){if(na)return kn;na=1;var e=kn&&kn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Gu()),n=Wu();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,u){l&&u&&(o[(0,n.camelCase)(l,a)]=u)}),o}return r.default=r,kn=r,kn}var Xu=Ju();const Yu=Pi(Xu),Po=Ro("end"),Bi=Ro("start");function Ro(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 Zu(e){const t=Bi(e),n=Po(e);if(t&&n)return{start:t,end:n}}function Tn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ra(e.position):"start"in e||"end"in e?ra(e):"line"in e||"column"in e?bi(e):""}function bi(e){return ia(e&&e.line)+":"+ia(e&&e.column)}function ra(e){return bi(e&&e.start)+"-"+bi(e&&e.end)}function ia(e){return e&&typeof e=="number"?e:1}class Se extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",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"?i=t:!a.cause&&t&&(o=!0,i=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=i,this.line=l?l.line:void 0,this.name=Tn(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}}Se.prototype.file="";Se.prototype.name="";Se.prototype.reason="";Se.prototype.message="";Se.prototype.stack="";Se.prototype.column=void 0;Se.prototype.line=void 0;Se.prototype.ancestors=void 0;Se.prototype.cause=void 0;Se.prototype.fatal=void 0;Se.prototype.place=void 0;Se.prototype.ruleId=void 0;Se.prototype.source=void 0;const qi={}.hasOwnProperty,ec=new Map,tc=/[A-Z]/g,nc=new Set(["table","tbody","thead","tfoot","tr"]),rc=new Set(["td","th"]),To="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ic(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=dc(n,t.jsx,t.jsxs)}const i={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"?zi:Qu,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Io(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Io(e,t,n){if(t.type==="element")return sc(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ac(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return lc(e,t,n);if(t.type==="mdxjsEsm")return oc(e,t);if(t.type==="root")return uc(e,t,n);if(t.type==="text")return cc(e,t)}function sc(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=zi,e.schema=i),e.ancestors.push(t);const a=Lo(e,t.tagName,!1),o=pc(e,t);let l=$i(e,t);return nc.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!Mu(u):!0})),Ao(e,o,a,t),Ui(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ac(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)}qn(e,t.position)}function oc(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);qn(e,t.position)}function lc(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=zi,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:Lo(e,t.name,!0),o=mc(e,t),l=$i(e,t);return Ao(e,o,a,t),Ui(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function uc(e,t,n){const r={};return Ui(r,$i(e,t)),e.create(t,e.Fragment,r,n)}function cc(e,t){return t.value}function Ao(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ui(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function dc(e,t,n){return r;function r(i,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,i,a,o){const l=Array.isArray(a.children),u=Bi(r);return t(i,a,o,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function pc(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&qi.call(t.properties,i)){const a=fc(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&rc.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 mc(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 qn(e,t.position);else{const i=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 qn(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function $i(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:ec;for(;++ri?0:i+t:t=t>i?i: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?(rt(e,e.length,0,t),e):t}const oa={}.hasOwnProperty;function kc(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 Jt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const nt=Tt(/[A-Za-z]/),ze=Tt(/[\dA-Za-z]/),Cc=Tt(/[#-'*+\--9=?A-Z^-~]/);function yi(e){return e!==null&&(e<32||e===127)}const wi=Tt(/\d/),_c=Tt(/[\dA-Fa-f]/),Ec=Tt(/[!-/:-@[-`{-~]/);function H(e){return e!==null&&e<-2}function Le(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}const Pc=Tt(new RegExp("\\p{P}|\\p{S}","u")),Rc=Tt(/\s/);function Tt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function xn(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function le(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(u){return Z(u)?(e.enter(n),l(u)):t(u)}function l(u){return Z(u)&&a++o))return;const B=t.events.length;let L=B,C,O;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(C){O=t.events[L][1].end;break}C=!0}for(b(r),j=B;j_;){const F=n[S];t.containerState=F[1],F[0].exit.call(t,e)}n.length=_}function N(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Mc(e,t,n){return le(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ua(e){if(e===null||Le(e)||Rc(e))return 1;if(Pc(e))return 2}function Qi(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},m={...e[n][1].start};ca(h,-u),ca(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}},i={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=$e(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=$e(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),c=$e(c,Qi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=$e(c,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=$e(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,rt(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&Z(j)?le(e,N,"linePrefix",a+1)(j):N(j)}function N(j){return j===null||H(j)?e.check(da,w,S)(j):(e.enter("codeFlowValue"),_(j))}function _(j){return j===null||H(j)?(e.exit("codeFlowValue"),N(j)):(e.consume(j),_)}function S(j){return e.exit("codeFenced"),t(j)}function F(j,B,L){let C=0;return O;function O(P){return j.enter("lineEnding"),j.consume(P),j.exit("lineEnding"),I}function I(P){return j.enter("codeFencedFence"),Z(P)?le(j,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):E(P)}function E(P){return P===l?(j.enter("codeFencedFenceSequence"),K(P)):L(P)}function K(P){return P===l?(C++,j.consume(P),K):C>=o?(j.exit("codeFencedFenceSequence"),Z(P)?le(j,D,"whitespace")(P):D(P)):L(P)}function D(P){return P===null||H(P)?(j.exit("codeFencedFence"),B(P)):L(P)}}}function Vc(e,t,n){const r=this;return i;function i(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 qr={name:"codeIndented",tokenize:Wc},Gc={partial:!0,tokenize:Jc};function Wc(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),le(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):H(c)?e.attempt(Gc,o,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||H(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function Jc(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):H(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):le(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):H(o)?i(o):n(o)}}const Xc={name:"codeText",previous:Zc,resolve:Yc,tokenize:ed};function Yc(e){let t=e.length-4,n=3,r,i;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 i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Nn(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),Nn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Nn(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 qo(e,t,n,r,i,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(i),e.enter(a),e.consume(b),e.exit(a),m):b===null||b===32||b===41||yi(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(i),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||H(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(i),e.consume(p),e.exit(i),e.exit(r),t):H(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||H(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),u||(u=!Z(p)),p===92?m:h)}function m(p){return p===91||p===92||p===93?(e.consume(p),l++,h):h(p)}}function $o(e,t,n,r,i,a){let o;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),o=m===40?41:m,u):n(m)}function u(m){return m===o?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(a),c(m))}function c(m){return m===o?(e.exit(a),u(o)):m===null?n(m):H(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),le(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===o||m===null||H(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 In(e,t){let n;return r;function r(i){return H(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Z(i)?le(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ld={name:"definition",tokenize:cd},ud={partial:!0,tokenize:dd};function cd(e,t,n){const r=this;let i;return a;function a(p){return e.enter("definition"),o(p)}function o(p){return Uo.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=Jt(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)?In(e,c)(p):c(p)}function c(p){return qo(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(ud,h,h)(p)}function h(p){return Z(p)?le(e,m,"whitespace")(p):m(p)}function m(p){return p===null||H(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function dd(e,t,n){return r;function r(l){return Le(l)?In(e,i)(l):n(l)}function i(l){return $o(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Z(l)?le(e,o,"whitespace")(l):o(l)}function o(l){return l===null||H(l)?t(l):n(l)}}const hd={name:"hardBreakEscape",tokenize:pd};function pd(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return H(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const md={name:"headingAtx",resolve:fd,tokenize:xd};function fd(e,t){let n=e.length-2,r=3,i,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&&(i={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"},rt(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function xd(e,t,n){let r=0;return i;function i(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||H(d)?(e.exit("atxHeading"),t(d)):Z(d)?le(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 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"],pa=["pre","script","style","textarea"],bd={concrete:!0,name:"htmlFlow",resolveTo:vd,tokenize:jd},yd={partial:!0,tokenize:Nd},wd={partial:!0,tokenize:kd};function vd(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 jd(e,t,n){const r=this;let i,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),i=3,r.interrupt?t:f):nt(x)?(e.consume(x),o=String.fromCharCode(x),v):n(x)}function m(x){return x===45?(e.consume(x),i=2,p):x===91?(e.consume(x),i=5,l=0,y):nt(x)?(e.consume(x),i=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 ve="CDATA[";return x===ve.charCodeAt(l++)?(e.consume(x),l===ve.length?r.interrupt?t:E:y):n(x)}function w(x){return nt(x)?(e.consume(x),o=String.fromCharCode(x),v):n(x)}function v(x){if(x===null||x===47||x===62||Le(x)){const ve=x===47,We=o.toLowerCase();return!ve&&!a&&pa.includes(We)?(i=1,r.interrupt?t(x):E(x)):gd.includes(o.toLowerCase())?(i=6,ve?(e.consume(x),b):r.interrupt?t(x):E(x)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):a?N(x):_(x))}return x===45||ze(x)?(e.consume(x),o+=String.fromCharCode(x),v):n(x)}function b(x){return x===62?(e.consume(x),r.interrupt?t:E):n(x)}function N(x){return Z(x)?(e.consume(x),N):O(x)}function _(x){return x===47?(e.consume(x),O):x===58||x===95||nt(x)?(e.consume(x),S):Z(x)?(e.consume(x),_):O(x)}function S(x){return x===45||x===46||x===58||x===95||ze(x)?(e.consume(x),S):F(x)}function F(x){return x===61?(e.consume(x),j):Z(x)?(e.consume(x),F):_(x)}function j(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),u=x,B):Z(x)?(e.consume(x),j):L(x)}function B(x){return x===u?(e.consume(x),u=null,C):x===null||H(x)?n(x):(e.consume(x),B)}function L(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||Le(x)?F(x):(e.consume(x),L)}function C(x){return x===47||x===62||Z(x)?_(x):n(x)}function O(x){return x===62?(e.consume(x),I):n(x)}function I(x){return x===null||H(x)?E(x):Z(x)?(e.consume(x),I):n(x)}function E(x){return x===45&&i===2?(e.consume(x),q):x===60&&i===1?(e.consume(x),W):x===62&&i===4?(e.consume(x),oe):x===63&&i===3?(e.consume(x),f):x===93&&i===5?(e.consume(x),me):H(x)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(yd,Pe,K)(x)):x===null||H(x)?(e.exit("htmlFlowData"),K(x)):(e.consume(x),E)}function K(x){return e.check(wd,D,Pe)(x)}function D(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),P}function P(x){return x===null||H(x)?K(x):(e.enter("htmlFlowData"),E(x))}function q(x){return x===45?(e.consume(x),f):E(x)}function W(x){return x===47?(e.consume(x),o="",pe):E(x)}function pe(x){if(x===62){const ve=o.toLowerCase();return pa.includes(ve)?(e.consume(x),oe):E(x)}return nt(x)&&o.length<8?(e.consume(x),o+=String.fromCharCode(x),pe):E(x)}function me(x){return x===93?(e.consume(x),f):E(x)}function f(x){return x===62?(e.consume(x),oe):x===45&&i===2?(e.consume(x),f):E(x)}function oe(x){return x===null||H(x)?(e.exit("htmlFlowData"),Pe(x)):(e.consume(x),oe)}function Pe(x){return e.exit("htmlFlow"),t(x)}}function kd(e,t,n){const r=this;return i;function i(o){return H(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 Nd(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(_r,t,n)}}const Sd={name:"htmlText",tokenize:Cd};function Cd(e,t,n){const r=this;let i,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),F):f===63?(e.consume(f),_):nt(f)?(e.consume(f),L):n(f)}function c(f){return f===45?(e.consume(f),d):f===91?(e.consume(f),a=0,y):nt(f)?(e.consume(f),N):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):H(f)?(o=h,W(f)):(e.consume(f),h)}function m(f){return f===45?(e.consume(f),p):h(f)}function p(f){return f===62?q(f):f===45?m(f):h(f)}function y(f){const oe="CDATA[";return f===oe.charCodeAt(a++)?(e.consume(f),a===oe.length?w:y):n(f)}function w(f){return f===null?n(f):f===93?(e.consume(f),v):H(f)?(o=w,W(f)):(e.consume(f),w)}function v(f){return f===93?(e.consume(f),b):w(f)}function b(f){return f===62?q(f):f===93?(e.consume(f),b):w(f)}function N(f){return f===null||f===62?q(f):H(f)?(o=N,W(f)):(e.consume(f),N)}function _(f){return f===null?n(f):f===63?(e.consume(f),S):H(f)?(o=_,W(f)):(e.consume(f),_)}function S(f){return f===62?q(f):_(f)}function F(f){return nt(f)?(e.consume(f),j):n(f)}function j(f){return f===45||ze(f)?(e.consume(f),j):B(f)}function B(f){return H(f)?(o=B,W(f)):Z(f)?(e.consume(f),B):q(f)}function L(f){return f===45||ze(f)?(e.consume(f),L):f===47||f===62||Le(f)?C(f):n(f)}function C(f){return f===47?(e.consume(f),q):f===58||f===95||nt(f)?(e.consume(f),O):H(f)?(o=C,W(f)):Z(f)?(e.consume(f),C):q(f)}function O(f){return f===45||f===46||f===58||f===95||ze(f)?(e.consume(f),O):I(f)}function I(f){return f===61?(e.consume(f),E):H(f)?(o=I,W(f)):Z(f)?(e.consume(f),I):C(f)}function E(f){return f===null||f===60||f===61||f===62||f===96?n(f):f===34||f===39?(e.consume(f),i=f,K):H(f)?(o=E,W(f)):Z(f)?(e.consume(f),E):(e.consume(f),D)}function K(f){return f===i?(e.consume(f),i=void 0,P):f===null?n(f):H(f)?(o=K,W(f)):(e.consume(f),K)}function D(f){return f===null||f===34||f===39||f===60||f===61||f===96?n(f):f===47||f===62||Le(f)?C(f):(e.consume(f),D)}function P(f){return f===47||f===62||Le(f)?C(f):n(f)}function q(f){return f===62?(e.consume(f),e.exit("htmlTextData"),e.exit("htmlText"),t):n(f)}function W(f){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),pe}function pe(f){return Z(f)?le(e,me,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):me(f)}function me(f){return e.enter("htmlTextData"),o(f)}}const Ki={name:"labelEnd",resolveAll:Rd,resolveTo:Td,tokenize:Id},_d={tokenize:Ad},Ed={tokenize:Ld},Pd={tokenize:Md};function Rd(e){let t=-1;const n=[];for(;++t=3&&(c===null||H(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),Z(c)?le(e,l,"whitespace")(c):l(c))}}const Te={continuation:{tokenize:Qd},exit:Vd,name:"list",tokenize:Hd},Ud={partial:!0,tokenize:Gd},$d={partial:!0,tokenize:Kd};function Hd(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[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:wi(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(hr,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 wi(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(_r,r.interrupt?n:d,e.attempt(Ud,m,h))}function d(p){return r.containerState.initialBlankLine=!0,a++,m(p)}function h(p){return Z(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 Qd(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(_r,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,le(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!Z(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($d,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,le(e,e.attempt(Te,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Kd(e,t,n){const r=this;return le(e,i,"listItemIndent",r.containerState.size+1);function i(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 Vd(e){e.exit(this.containerState.type)}function Gd(e,t,n){const r=this;return le(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!Z(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const ma={name:"setextUnderline",resolveTo:Wd,tokenize:Jd};function Wd(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=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[i][1].type="setextHeadingText",a?(e.splice(i,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 Jd(e,t,n){const r=this;let i;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"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===i?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),Z(c)?le(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||H(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Xd={tokenize:Yd};function Yd(e){const t=this,n=e.attempt(_r,r,e.attempt(this.parser.constructs.flowInitial,i,le(e,e.attempt(this.parser.constructs.flow,i,e.attempt(rd,i)),"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 i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Zd={resolveAll:Qo()},eh=Ho("string"),th=Ho("text");function Ho(e){return{resolveAll:Qo(e==="text"?nh:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,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=i[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[i].slice(0,a))}return o}function fh(e,t){let n=-1;const r=[];let i;for(;++n0){const Re=$.tokenStack[$.tokenStack.length-1];(Re[1]||xa).call($,void 0,Re[0])}for(T.position={start:bt(k.length>0?k[0][1].start:{line:1,column:1,offset:0}),end:bt(k.length>0?k[k.length-2][1].end:{line:1,column:1,offset:0})},te=-1;++te0&&(r.className=["language-"+i[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 Ph(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rh(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Th(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=xn(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-"+i,id:n+"fnref-"+i+(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 Ih(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 Ah(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Go(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 i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Lh(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Go(e,t);const i={src:xn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Mh(e,t){const n={src:xn(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 Oh(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 Fh(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Go(e,t);const i={href:xn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Dh(e,t){const n={href:xn(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 zh(e,t,n){const r=e.all(t),i=n?Bh(n):Wo(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 qh(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Bi(t.children[1]),u=Po(t.children[t.children.length-1]);l&&u&&(o.position={start:l,end:u}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Kh(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]),i=r.index+r[0].length,r=n.exec(t);return a.push(ya(t.slice(i),i>0,!1)),a.join("")}function ya(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===ga||a===ba;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===ga||a===ba;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Wh(e,t){const n={type:"text",value:Gh(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Jh(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Xh={blockquote:Ch,break:_h,code:Eh,delete:Ph,emphasis:Rh,footnoteReference:Th,heading:Ih,html:Ah,imageReference:Lh,image:Mh,inlineCode:Oh,linkReference:Fh,link:Dh,listItem:zh,list:qh,paragraph:Uh,root:$h,strong:Hh,table:Qh,tableCell:Vh,tableRow:Kh,text:Wh,thematicBreak:Jh,toml:ar,yaml:ar,definition:ar,footnoteDefinition:ar};function ar(){}const Jo=-1,Er=0,An=1,gr=2,Vi=3,Gi=4,Wi=5,Ji=6,Xo=7,Yo=8,Yh=typeof self=="object"?self:globalThis,wa=(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 Yh[e](t)},Zh=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case Er:case Jo:return n(o,i);case An:{const l=n([],i);for(const u of o)l.push(r(u));return l}case gr:{const l=n({},i);for(const[u,c]of o)l[r(u)]=r(c);return l}case Vi:return n(new Date(o),i);case Gi:{const{source:l,flags:u}=o;return n(new RegExp(l,u),i)}case Wi:{const l=n(new Map,i);for(const[u,c]of o)l.set(r(u),r(c));return l}case Ji:{const l=n(new Set,i);for(const u of o)l.add(r(u));return l}case Xo:{const{name:l,message:u}=o;return n(wa(l,u),i)}case Yo:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);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(wa(a,o),i)};return r},va=e=>Zh(new Map,e)(0),Wt="",{toString:ep}={},{keys:tp}=Object,Sn=e=>{const t=typeof e;if(t!=="object"||!e)return[Er,t];const n=ep.call(e).slice(8,-1);switch(n){case"Array":return[An,Wt];case"Object":return[gr,Wt];case"Date":return[Vi,Wt];case"RegExp":return[Gi,Wt];case"Map":return[Wi,Wt];case"Set":return[Ji,Wt];case"DataView":return[An,n]}return n.includes("Array")?[An,n]:n.includes("Error")?[Xo,n]:[gr,n]},or=([e,t])=>e===Er&&(t==="function"||t==="symbol"),np=(e,t,n,r)=>{const i=(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]=Sn(o);switch(l){case Er:{let d=o;switch(u){case"bigint":l=Yo,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return i([Jo],o)}return i([l,d],o)}case An:{if(u){let m=o;return u==="DataView"?m=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(o)),i([u,[...m]],o)}const d=[],h=i([l,d],o);for(const m of o)d.push(a(m));return h}case gr:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const d=[],h=i([l,d],o);for(const m of tp(o))(e||!or(Sn(o[m])))&&d.push([a(m),a(o[m])]);return h}case Vi:return i([l,o.toISOString()],o);case Gi:{const{source:d,flags:h}=o;return i([l,{source:d,flags:h}],o)}case Wi:{const d=[],h=i([l,d],o);for(const[m,p]of o)(e||!(or(Sn(m))||or(Sn(p))))&&d.push([a(m),a(p)]);return h}case Ji:{const d=[],h=i([l,d],o);for(const m of o)(e||!or(Sn(m)))&&d.push(a(m));return h}}const{message:c}=o;return i([l,{name:u,message:c}],o)};return a},ja=(e,{json:t,lossy:n}={})=>{const r=[];return np(!(t||n),!!t,new Map,r)(e),r},br=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?va(ja(e,t)):structuredClone(e):(e,t)=>va(ja(e,t));function rp(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 ip(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function sp(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||rp,r=e.options.footnoteBackLabel||ip,i=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 N=typeof n=="string"?n:n(u,p);typeof N=="string"&&(N={type:"text",value:N}),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(N)?N:[N]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const N=v.children[v.children.length-1];N&&N.type==="text"?N.value+=" ":v.children.push({type:"text",value:" "}),v.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:{...br(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const Zo=(function(e){if(e==null)return up;if(typeof e=="function")return Pr(e);if(typeof e=="object")return Array.isArray(e)?ap(e):op(e);if(typeof e=="string")return lp(e);throw new Error("Expected function, string, or object as test")});function ap(e){const t=[];let n=-1;for(;++n":""))+")"})}return m;function m(){let p=el,y,w,v;if((!t||a(u,c,d[d.length-1]||void 0))&&(p=mp(n(u,d)),p[0]===ka))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,v=d.concat(b);w>-1&&w0&&n.push({type:"text",value:` -`}),n}function Na(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Sa(e,t){const n=xp(e,t),r=n.one(e,void 0),i=sp(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:` -`},i),a}function vp(e,t){return e&&"run"in e?async function(n,r){const i=Sa(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Sa(n,{file:r,...e||t})}}function Ca(e){if(e)throw e}var $r,_a;function jp(){if(_a)return $r;_a=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=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 $r=function u(){var c,d,h,m,p,y,w=arguments[0],v=1,b=arguments.length,N=!1;for(typeof w=="boolean"&&(N=w,w=arguments[1]||{},v=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});vo.length;let u;l&&o.push(i);try{u=e.apply(this,o)}catch(c){const d=c;if(l&&n)throw d;return i(d)}l||(u&&u.then&&typeof u.then=="function"?u.then(a,i):u instanceof Error?i(u):a(u))}function i(o,...l){n||(n=!0,t(o,...l))}function a(o){i(null,o)}}const Ye={basename:Cp,dirname:_p,extname:Ep,join:Pp,sep:"/"};function Cp(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Xn(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function _p(e){if(Xn(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 Ep(e){Xn(e);let t=e.length,n=-1,r=0,i=-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?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Pp(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Tp(e,t){let n="",r=0,i=-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("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function Xn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ip={cwd:Ap};function Ap(){return"/"}function Ni(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Lp(e){if(typeof e=="string")e=new URL(e);else if(!Ni(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 Mp(e)}function Mp(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];ki(w)&&ki(p)&&(p=Hr(!0,w,p)),r[m]=[c,p,...y]}}}}const zp=new Xi().freeze();function Gr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Wr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Jr(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 Pa(e){if(!ki(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ra(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function lr(e){return Bp(e)?e:new nl(e)}function Bp(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function qp(e){return typeof e=="string"||Up(e)}function Up(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $p="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ta=[],Ia={allowDangerousHtml:!0},Hp=/^(https?|ircs?|mailto|xmpp)$/i,Qp=[{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 Kp(e){const t=Vp(e),n=Gp(e);return Wp(t.runSync(t.parse(n),n),e)}function Vp(e){const t=e.rehypePlugins||Ta,n=e.remarkPlugins||Ta,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ia}:Ia;return zp().use(Sh).use(n).use(vp,r).use(t)}function Gp(e){const t=e.children||"",n=new nl;return typeof t=="string"&&(n.value=t),n}function Wp(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||Jp;for(const d of Qp)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+$p+d.id,void 0);return tl(e,c),ic(e,{Fragment:s.Fragment,components:i,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.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 Br)if(Object.hasOwn(Br,p)&&Object.hasOwn(d.properties,p)){const y=d.properties[p],w=Br[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 Jp(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Hp.test(e.slice(0,t))?e:""}const Yi="-",Xp=e=>{const t=Zp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(Yi);return l[0]===""&&l.length!==1&&l.shift(),rl(l,t)||Yp(o)},getConflictingClassGroupIds:(o,l)=>{const u=n[o]||[];return l&&r[o]?[...u,...r[o]]:u}}},rl=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?rl(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(Yi);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},Aa=/^\[(.+)\]$/,Yp=e=>{if(Aa.test(e)){const t=Aa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Zp=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return tm(Object.entries(e.classGroups),n).forEach(([a,o])=>{Si(o,r,a,t)}),r},Si=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:La(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(em(i)){Si(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,o])=>{Si(o,La(t,a),n,r)})})},La=(e,t)=>{let n=e;return t.split(Yi).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},em=e=>e.isThemeGetter,tm=(e,t)=>t?e.map(([n,r])=>{const i=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,i]}):e,nm=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(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 i(a,o),o},set(a,o){n.has(a)?n.set(a,o):i(a,o)}}},il="!",rm=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=l=>{const u=[];let c=0,d=0,h;for(let v=0;vd?h-d:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:w}};return n?l=>n({className:l,parseClassName:o}):o},im=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},sm=e=>({cache:nm(e.cacheSize),parseClassName:rm(e),...Xp(e)}),am=/\s+/,om=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(am);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 v=im(d).join(":"),b=h?v+il:v,N=b+w;if(a.includes(N))continue;a.push(N);const _=i(w,y);for(let S=0;S<_.length;++S){const F=_[S];a.push(b+F)}l=c+(l.length>0?" "+l:l)}return l};function lm(){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=sm(c),r=n.cache.get,i=n.cache.set,a=l,l(u)}function l(u){const c=r(u);if(c)return c;const d=om(u,n);return i(u,d),d}return function(){return a(lm.apply(null,arguments))}}const ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},al=/^\[(?:([a-z-]+):)?(.+)\]$/i,cm=/^\d+\/\d+$/,dm=new Set(["px","full","screen"]),hm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pm=/\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$/,mm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lt=e=>Xt(e)||dm.has(e)||cm.test(e),yt=e=>gn(e,"length",Nm),Xt=e=>!!e&&!Number.isNaN(Number(e)),Xr=e=>gn(e,"number",Xt),Cn=e=>!!e&&Number.isInteger(Number(e)),gm=e=>e.endsWith("%")&&Xt(e.slice(0,-1)),V=e=>al.test(e),wt=e=>hm.test(e),bm=new Set(["length","size","percentage"]),ym=e=>gn(e,bm,ol),wm=e=>gn(e,"position",ol),vm=new Set(["image","url"]),jm=e=>gn(e,vm,Cm),km=e=>gn(e,"",Sm),_n=()=>!0,gn=(e,t,n)=>{const r=al.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Nm=e=>pm.test(e)&&!mm.test(e),ol=()=>!1,Sm=e=>fm.test(e),Cm=e=>xm.test(e),_m=()=>{const e=ue("colors"),t=ue("spacing"),n=ue("blur"),r=ue("brightness"),i=ue("borderColor"),a=ue("borderRadius"),o=ue("borderSpacing"),l=ue("borderWidth"),u=ue("contrast"),c=ue("grayscale"),d=ue("hueRotate"),h=ue("invert"),m=ue("gap"),p=ue("gradientColorStops"),y=ue("gradientColorStopPositions"),w=ue("inset"),v=ue("margin"),b=ue("opacity"),N=ue("padding"),_=ue("saturate"),S=ue("scale"),F=ue("sepia"),j=ue("skew"),B=ue("space"),L=ue("translate"),C=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",V,t],E=()=>[V,t],K=()=>["",lt,yt],D=()=>["auto",Xt,V],P=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>["start","end","center","between","around","evenly","stretch"],me=()=>["","0",V],f=()=>["auto","avoid","all","avoid-page","page","left","right","column"],oe=()=>[Xt,V];return{cacheSize:500,separator:":",theme:{colors:[_n],spacing:[lt,yt],blur:["none","",wt,V],brightness:oe(),borderColor:[e],borderRadius:["none","","full",wt,V],borderSpacing:E(),borderWidth:K(),contrast:oe(),grayscale:me(),hueRotate:oe(),invert:me(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[gm,yt],inset:I(),margin:I(),opacity:oe(),padding:E(),saturate:oe(),scale:oe(),sepia:me(),skew:oe(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",V]}],container:["container"],columns:[{columns:[wt]}],"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:[...P(),V]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],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",Cn,V]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",V]}],grow:[{grow:me()}],shrink:[{shrink:me()}],order:[{order:["first","last","none",Cn,V]}],"grid-cols":[{"grid-cols":[_n]}],"col-start-end":[{col:["auto",{span:["full",Cn,V]},V]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[_n]}],"row-start-end":[{row:["auto",{span:[Cn,V]},V]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",V]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",V]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...pe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...pe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...pe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"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",V,t]}],"min-w":[{"min-w":[V,t,"min","max","fit"]}],"max-w":[{"max-w":[V,t,"none","full","min","max","fit","prose",{screen:[wt]},wt]}],h:[{h:[V,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[V,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[V,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[V,t,"auto","min","max","fit"]}],"font-size":[{text:["base",wt,yt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xr]}],"font-family":[{font:[_n]}],"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",V]}],"line-clamp":[{"line-clamp":["none",Xt,Xr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",lt,V]}],"list-image":[{"list-image":["none",V]}],"list-style-type":[{list:["none","disc","decimal",V]}],"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:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",lt,yt]}],"underline-offset":[{"underline-offset":["auto",lt,V]}],"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",V]}],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",V]}],"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:[...P(),wm]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ym]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jm]}],"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:[...q(),"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:q()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...q()]}],"outline-offset":[{"outline-offset":[lt,V]}],"outline-w":[{outline:[lt,yt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[lt,yt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",wt,km]}],"shadow-color":[{shadow:[_n]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",wt,V]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[_]}],sepia:[{sepia:[F]}],"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":[F]}],"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",V]}],duration:[{duration:oe()}],ease:[{ease:["linear","in","out","in-out",V]}],delay:[{delay:oe()}],animate:[{animate:["none","spin","ping","pulse","bounce",V]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Cn,V]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",V]}],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",V]}],"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",V]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[lt,yt,Xr]}],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"]}}},Em=um(_m),Ci={status:"",repo:"",thread:"",action:"",intent:"",actor:""},Pm=new au({defaultOptions:{queries:{retry:1}}}),Ma=12,Rm=12,Tm=10080*60*1e3,Im=1e3,ll=Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function G(...e){return Em(_l(e))}async function ne(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 Am=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}),Lm=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});function Yn(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Mm(e){const t=Yn(e);return t?Am.format(t):e??""}function Ln(e){const t=Yn(e);return t?Lm.format(t):e??""}function ul(e,t){const n=Yn(e);if(!n)return e??"";const r=t-n.getTime(),i=Math.abs(r);if(i>Tm)return Ln(e);const a=r>=0?"ago":"from now",o=Math.round(i/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 _e({value:e,compact:t=!1,relative:n=!1,now:r=Date.now()}){const i=Yn(e);return i?s.jsx("time",{dateTime:i.toISOString(),title:`UTC: ${i.toISOString()}`,children:n?ul(e,r):t?Ln(e):Mm(e)}):s.jsx(s.Fragment,{children:e??""})}function cl(e,t){const n=Yn(e);return n?Math.max(0,Math.floor((t-n.getTime())/1e3)):null}function Zi(e,t){return e.status==="running"?cl(e.started_at,t)??e.runtime_seconds:e.runtime_seconds}function es(e,t){return e.status==="pending"?cl(e.created_at,t)??e.queue_wait_seconds:e.queue_wait_seconds}function Om(e){const[t,n]=A.useState(()=>Date.now());return A.useEffect(()=>{if(!e)return;n(Date.now());const r=window.setInterval(()=>n(Date.now()),Im);return()=>window.clearInterval(r)},[e]),t}function Fm(e){return(e??"").split(/\r?\n/).map(n=>n.trim()).find(Boolean)??""}function yr(e,t,n=1){const r=Fm(t),i=n>1?` (${n})`:"";return r?`${e}${i}: ${r}`:`${e}${i}`}function wr(e){return e==="openclaw_stdout"||e==="openclaw_stderr"}function dl(e){return e.map(t=>t==null?void 0:t.trim()).filter(Boolean).join(` -`)}function Dm(e){const t=[];for(const n of e){const r=t[t.length-1];if(r&&wr(n.event_type)&&r.eventType===n.event_type){r.count+=1,r.meta=n.ts,r.detail=dl([r.detail,n.detail]),r.summary=yr(n.summary,r.detail,r.count);continue}t.push({id:String(n.id),badge:n.event_type,meta:n.ts,summary:wr(n.event_type)?yr(n.summary,n.detail):n.summary,detail:n.detail,eventType:n.event_type,count:1})}return t}function zm(e){const t=[];return e.forEach((n,r)=>{const i=t[t.length-1];if(i&&wr(n.kind)&&i.kind===n.kind){i.count+=1,i.meta=n.timestamp,i.text=dl([i.text,n.text]),i.summary=yr(`${n.role} · ${n.kind}`,i.text,i.count);return}t.push({id:`${n.timestamp??"entry"}-${r}`,badge:n.title,meta:n.timestamp,summary:wr(n.kind)?yr(`${n.role} · ${n.kind}`,n.text):`${n.role} · ${n.kind}`,text:n.text,kind:n.kind,count:1})}),t}function Oa(e,t,n,r){return e==="openclaw_stdout"?!1:t||n>=r-2}function Bm(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 qm(e,t){const n=new URLSearchParams;for(const[r,i]of Object.entries(e))i.trim()&&n.set(r,i.trim());return n.set("limit",String(t)),`/api/jobs?${n.toString()}`}function Um(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 $m(e=ll){return`/api/metrics/summary?timezone=${encodeURIComponent(e)}`}function it(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 Hm(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="github-agent-bridge:push")}function Qm(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),r=window.atob(n),i=new Uint8Array(r.length);for(let a=0;an.id===t.id)?e:[...e,t]}function Vm(e,t){const n=Fa(t);return e.some(r=>Fa(r)===n)?e:[...e,t]}function Fa(e){return`${e.timestamp??""}:${e.role}:${e.kind}:${e.title}:${e.text}`}function Gm(e){return["claimed","dispatch_started","dispatch_finished","done","blocked","denied","waiting_approval"].includes(e)}function Rn(e){return["blocked","denied","waiting_approval"].includes(e)}function _i(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 Wm(e=window.location.pathname){const t=e.match(/^\/jobs\/(\d+)\/?$/);return t?Number(t[1]):null}function Jm(e=window.location.pathname){return/^\/knowledge\/?$/.test(e)}function Xm(e=window.location.pathname){return/^\/mcp\/?$/.test(e)}function Ym(e=window.location.pathname){return/^\/system\/?$/.test(e)}function Zm(e=window.location.pathname){return/^\/webhooks\/?$/.test(e)}function hl(e){return e.startsWith("repo:")?e.slice(5):e}function Da(e){return Object.values(e).some(t=>t.trim()!=="")}function ef(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 tf(){var te,Re,Je,Be,ft,xt,je,ot,qe,rs,is,ss,as,os,ls,us,cs,ds,hs,ps,ms,fs,xs,gs,bs,ys,ws,vs,js,ks,Ns,Ss,Cs,_s,Es,Ps,Rs,Ts,Is;const e=mo(),[t,n]=A.useState(Ci),[r,i]=A.useState(Ma),a=A.useRef(!1),[o,l]=A.useState(""),[u,c]=A.useState("proposed"),[d,h]=A.useState(null),[m,p]=A.useState(""),[y,w]=A.useState(()=>window.location.pathname),[v,b]=A.useState(null),N=Wm(y),_=N!==null,S=Jm(y),F=Xm(y),j=Ym(y),B=Zm(y),L=!_&&!S&&!F&&!j&&!B,C=N,O=ge({queryKey:["metrics",ll],queryFn:()=>ne($m()),enabled:L||j}),I=ge({queryKey:["dashboard-status"],queryFn:()=>ne("/api/status")}),E=ge({queryKey:["me"],queryFn:()=>ne("/api/me"),refetchInterval:!1}),K=ge({queryKey:["web-push-config"],queryFn:()=>ne("/api/web-push/config"),enabled:!!((te=E.data)!=null&&te.user)}),D=ge({queryKey:["about"],queryFn:()=>ne("/api/about")}),P=ge({queryKey:["job-actors"],queryFn:()=>ne("/api/jobs/actors"),enabled:L}),q=ge({queryKey:["jobs",t,r],queryFn:()=>ne(qm(t,r)),enabled:L,placeholderData:z=>z}),W=ge({queryKey:["processes"],queryFn:()=>ne("/api/processes"),enabled:j}),pe=ge({queryKey:["systemd"],queryFn:()=>ne("/api/systemd"),enabled:j}),me=ge({queryKey:["alerts"],queryFn:()=>ne("/api/alerts"),enabled:j}),f=ge({queryKey:["webhook-status"],queryFn:()=>ne("/api/webhooks/github/status"),enabled:B&&!!((Je=(Re=E.data)==null?void 0:Re.user)!=null&&Je.is_admin&&((Be=I.data)!=null&&Be.webhook_configured))}),oe=ge({queryKey:["knowledge",o,u],queryFn:()=>ne(Um(o,u)),enabled:S}),Pe=ge({queryKey:["mcp-tokens"],queryFn:()=>ne("/api/mcp/tokens"),enabled:F&&!!((ft=E.data)!=null&&ft.user)}),x=ge({queryKey:["mcp-users"],queryFn:()=>ne("/api/mcp/users"),enabled:F&&!!((xt=E.data)!=null&&xt.user)}),ve=ge({queryKey:["job",C],queryFn:()=>ne(`/api/jobs/${C}`),enabled:C!==null}),We=ge({queryKey:["job-session",C],queryFn:()=>ne(`/api/jobs/${C}/session`),enabled:C!==null}),fe=ge({queryKey:["job-session-events",C],queryFn:()=>ne(`/api/jobs/${C}/session/events`),enabled:C!==null}),pt=ge({queryKey:["job-session-transcript",C],queryFn:()=>ne(`/api/jobs/${C}/session/transcript`),enabled:C!==null}),Ke=A.useCallback(async z=>{const ie=await ne(`/api/jobs/${z}/retry`,{method:"POST"});e.setQueryData(["job",z],{job:ie.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]})},[e]),st=A.useCallback(async z=>{const ie=await ne(`/api/jobs/${z}/dismiss`,{method:"POST"});e.setQueryData(["job",z],{job:ie.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]})},[e]),at=A.useCallback(async(z,ie)=>{const ce=await ne(`/api/jobs/${z}/cancel`,{method:"POST",body:JSON.stringify({reason:ie||""})});e.setQueryData(["job",z],{job:ce.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]}),e.invalidateQueries({queryKey:["dashboard-status"]})},[e]),It=A.useCallback(async(z,ie)=>{await ne(`/api/knowledge/proposals/${encodeURIComponent(z)}/${ie}`,{method:"POST"}),e.invalidateQueries({queryKey:["knowledge"]}),e.invalidateQueries({queryKey:["dashboard-status"]})},[e]),Rr=A.useCallback(async z=>{await ne(`/api/knowledge/rules/${encodeURIComponent(z)}`,{method:"DELETE"}),e.invalidateQueries({queryKey:["knowledge"]})},[e]),Tr=A.useCallback(async(z,ie)=>{await ne(`/api/knowledge/rules/${encodeURIComponent(z)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:ie})}),e.invalidateQueries({queryKey:["knowledge"]})},[e]),Ir=A.useCallback(async(z,ie)=>{const ce=await ne("/api/mcp/tokens",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:z,user_login:ie||void 0})});return e.invalidateQueries({queryKey:["mcp-tokens"]}),ce},[e]),Zn=A.useCallback(async(z,ie)=>{await ne(`/api/mcp/tokens/${encodeURIComponent(z)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_login:ie})}),e.invalidateQueries({queryKey:["mcp-tokens"]}),e.invalidateQueries({queryKey:["mcp-users"]})},[e]),er=A.useCallback(async z=>{await ne(`/api/mcp/tokens/${encodeURIComponent(z)}`,{method:"DELETE"}),e.invalidateQueries({queryKey:["mcp-tokens"]})},[e]),Kt=A.useCallback(async z=>{const ie={refresh:"/api/autoupdate/refresh",apply:"/api/autoupdate/apply",complete:"/api/autoupdate/complete-pending"}[z];h(z),p("");try{await ne(ie,{method:"POST"}),e.invalidateQueries({queryKey:["dashboard-status"]})}catch(ce){e.invalidateQueries({queryKey:["dashboard-status"]}),p(ce instanceof Error?ce.message:String(ce))}finally{h(null)}},[e]),Ar=A.useCallback(async()=>{var As;const z=(As=K.data)==null?void 0:As.public_key;if(!z)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 ce=await navigator.serviceWorker.register("/service-worker.js"),kl=await ce.pushManager.getSubscription()??await ce.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Qm(z)});await ne("/api/web-push/subscriptions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(kl.toJSON())}),e.invalidateQueries({queryKey:["web-push-config"]})},[e,(je=K.data)==null?void 0:je.public_key]),tr=A.useCallback(async()=>{if(!pr())return;const ie=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(!ie)return;const ce=ie.endpoint;await ie.unsubscribe(),await ne("/api/web-push/subscriptions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:ce})}),e.invalidateQueries({queryKey:["web-push-config"]})},[e]);A.useEffect(()=>{var z;!((z=K.data)!=null&&z.status.enabled)||!pr()||navigator.serviceWorker.register("/service-worker.js").catch(()=>{})},[(ot=K.data)==null?void 0:ot.status.enabled]),A.useEffect(()=>{if(C===null)return;const z=new EventSource(`/api/jobs/${C}/session/stream`);return z.addEventListener("session_event",ie=>{const ce=vr(ie);ce&&(e.setQueryData(["job-session-events",C],gt=>({events:Km((gt==null?void 0:gt.events)??[],ce)})),Gm(ce.event_type)&&(e.invalidateQueries({queryKey:["job",C]}),e.invalidateQueries({queryKey:["jobs"]})))}),z.addEventListener("transcript_entry",ie=>{const ce=vr(ie);!ce||ce.job_id!==C||e.setQueryData(["job-session-transcript",C],gt=>({entries:Vm((gt==null?void 0:gt.entries)??[],ce.entry)}))}),z.onerror=()=>{e.invalidateQueries({queryKey:["job",C]}),e.invalidateQueries({queryKey:["job-session-events",C]}),e.invalidateQueries({queryKey:["job-session-transcript",C]})},()=>z.close()},[C,e]),A.useEffect(()=>{const z=()=>{w(window.location.pathname)};return window.addEventListener("popstate",z),()=>window.removeEventListener("popstate",z)},[]),A.useEffect(()=>{if(!("serviceWorker"in navigator))return;const z=ie=>{if(!Hm(ie.data))return;const ce={...ie.data.payload,id:Date.now(),receivedAt:Date.now()};b(ce),ce.job_id&&(e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["job",ce.job_id]}),e.invalidateQueries({queryKey:["metrics"]}))};return navigator.serviceWorker.addEventListener("message",z),()=>navigator.serviceWorker.removeEventListener("message",z)},[e]),A.useEffect(()=>{if(!v)return;const z=window.setTimeout(()=>b(null),12e3);return()=>window.clearTimeout(z)},[v]);const nr=A.useCallback(z=>{window.history.pushState({},"",bn(z)),w(window.location.pathname)},[]),wn=A.useCallback(z=>{window.history.pushState({},"",z),w(window.location.pathname)},[]),mt=((qe=O.data)==null?void 0:qe.metrics.status_counts)??{},Vt=((rs=q.data)==null?void 0:rs.jobs)??[],Lr=A.useCallback(z=>{n(z),i(Ma),a.current=!1},[]);A.useEffect(()=>{q.isFetching||(a.current=!1)},[q.isFetching]);const Mr=A.useCallback(()=>{a.current||(a.current=!0,i(z=>z+Rm))},[]),k=C?((is=ve.data)==null?void 0:is.job)??null:null,T=Vt.some(z=>z.status==="running"||z.status==="pending")||(k==null?void 0:k.status)==="running"||(k==null?void 0:k.status)==="pending"||!!((ss=W.data)!=null&&ss.running_jobs.length),$=Om(T),J=s.jsx(pf,{selectedJobId:C,selectedJob:k,loading:ve.isLoading,error:ve.error,session:(as=We.data)==null?void 0:as.session,sessionEvents:(os=fe.data)==null?void 0:os.events,transcript:(ls=pt.data)==null?void 0:ls.entries,now:$});return s.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[s.jsx("header",{className:"border-b border-slate-800 bg-slate-950 text-white",children:s.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:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("h1",{className:"truncate text-xl font-semibold",children:"GitHub Agent Bridge"}),s.jsx(nf,{about:D.data})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsx(Sf,{config:K.data,loading:K.isLoading,onEnable:Ar,onDisable:tr}),s.jsx(Nf,{user:(us=E.data)==null?void 0:us.user,loading:E.isLoading})]})]})}),s.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:[s.jsx(uf,{isDashboardRoute:L,isSystemRoute:j,isKnowledgeRoute:S,isMcpRoute:F,isWebhooksRoute:B,showWebhooks:!!((ds=(cs=E.data)==null?void 0:cs.user)!=null&&ds.is_admin&&((hs=I.data)!=null&&hs.webhook_configured)),knowledgeBadgeCount:((fs=(ms=(ps=I.data)==null?void 0:ps.metrics)==null?void 0:ms.knowledge)==null?void 0:fs.proposed)??0,onNavigate:wn}),s.jsx(Cf,{notification:v,onDismiss:()=>b(null),onNavigate:wn}),N!==null?s.jsx(hf,{jobId:N,detail:J,selectedJob:k,user:(xs=E.data)==null?void 0:xs.user,onBackToDashboard:()=>wn("/"),onRetry:Ke,onDismiss:st,onCancel:at,onRefresh:()=>{ve.refetch(),We.refetch(),fe.refetch(),pt.refetch()}}):S?s.jsx(mf,{data:oe.data,loading:oe.isLoading,error:oe.error,repo:o,status:u,user:(gs=E.data)==null?void 0:gs.user,now:$,onRepoChange:l,onStatusChange:c,onApprove:z=>It(z,"approve"),onReject:z=>It(z,"reject"),onUpdateRuleScope:Tr,onDeleteRule:Rr,onRefresh:()=>oe.refetch()}):F?s.jsx(wf,{tokens:(bs=Pe.data)==null?void 0:bs.tokens,loading:Pe.isLoading,error:Pe.error,user:(ys=E.data)==null?void 0:ys.user,ownerOptions:((ws=x.data)==null?void 0:ws.users)??[],dashboardUrl:(vs=I.data)==null?void 0:vs.dashboard_url,dashboardUrlSource:(js=I.data)==null?void 0:js.dashboard_url_source,now:$,onCreate:Ir,onUpdateOwner:Zn,onRevoke:er,onRefresh:()=>Pe.refetch()}):B?s.jsx(cf,{status:f.data,loading:f.isLoading,error:f.error,onRefresh:()=>f.refetch()}):j?s.jsx(df,{processes:W.data,processesLoading:W.isLoading,processesError:W.error,systemd:pe.data,systemdLoading:pe.isLoading,systemdError:pe.error,alerts:(ks=me.data)==null?void 0:ks.alerts,alertsLoading:me.isLoading,alertsError:me.error,now:$,onRefreshProcesses:()=>W.refetch(),onRefreshSystemd:()=>pe.refetch(),onRefreshAlerts:()=>me.refetch()}):s.jsxs(s.Fragment,{children:[O.error?s.jsx(Ne,{tone:"error",text:O.error.message}):null,I.error?s.jsx(Ne,{tone:"error",text:I.error.message}):null,s.jsx(rf,{state:(Ns=I.data)==null?void 0:Ns.autoupdate,isAdmin:!!((Cs=(Ss=E.data)==null?void 0:Ss.user)!=null&&Cs.is_admin),runningAction:d,actionError:m,onRefresh:()=>Kt("refresh"),onApply:()=>Kt("apply"),onCompletePending:()=>Kt("complete")}),s.jsxs("section",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Summary metrics",children:[s.jsx(He,{title:"Pending",value:mt.pending??0,icon:s.jsx(bo,{className:"h-5 w-5"})}),s.jsx(He,{title:"Running",value:mt.running??0,icon:s.jsx(Dn,{className:"h-5 w-5"})}),s.jsx(He,{title:"Blocked",value:mt.blocked??0,icon:s.jsx(Fi,{className:"h-5 w-5"})}),s.jsx(He,{title:"Done",value:mt.done??0,icon:s.jsx(mn,{className:"h-5 w-5"})})]}),s.jsxs("section",{className:"grid gap-3",children:[s.jsx(_f,{count:Vt.length,limit:r,loading:q.isLoading,onRefresh:()=>q.refetch()}),s.jsxs(Ee,{title:"Recent jobs",flushHeader:!0,children:[s.jsx(Ef,{filters:t,actorOptions:((_s=P.data)==null?void 0:_s.actors)??[],onChange:Lr}),q.error?s.jsx(Ne,{tone:"error",text:q.error.message}):null,s.jsx(Rf,{jobs:Vt,loading:q.isLoading,loadingMore:q.isFetching&&!q.isLoading,hasMore:Vt.length>=r,onLoadMore:Mr,onViewJob:nr,now:$,user:(Es=E.data)==null?void 0:Es.user,onRetry:Ke,onDismiss:st,onCancel:at})]}),s.jsx(Ee,{title:"Runtime usage",action:s.jsx(ht,{onClick:()=>O.refetch()}),children:s.jsx(Hf,{usage:(Ps=O.data)==null?void 0:Ps.metrics.runtime_usage,loading:O.isLoading,totalJobs:Ua(mt)})})]}),s.jsxs("section",{className:"grid gap-4 xl:grid-cols-3",children:[s.jsx(Ee,{title:"Runtime percentiles",children:s.jsx(qa,{label:"runtime",values:(Rs=O.data)==null?void 0:Rs.metrics.runtime_seconds})}),s.jsx(Ee,{title:"Jobs per day",children:s.jsx($f,{values:(Ts=O.data)==null?void 0:Ts.metrics.by_created_day,loading:O.isLoading,totalJobs:Ua(mt)})}),s.jsx(Ee,{title:"Queue wait percentiles",children:s.jsx(qa,{label:"queue wait",values:(Is=O.data)==null?void 0:Is.metrics.queue_wait_seconds})})]})]})]})]})}function nf({about:e}){const t=e!=null&&e.version?`v${e.version}`:"version loading";return s.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-slate-300",children:[s.jsx("span",{children:"Operational dashboard"}),s.jsx("span",{className:"font-mono text-xs text-slate-400",children:t}),e!=null&&e.repository_url?s.jsxs("a",{className:"inline-flex items-center gap-1 text-xs font-semibold text-slate-200 hover:underline",href:it(e.repository_url),rel:"noreferrer",target:"_blank",children:[s.jsx(hn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"GitHub"]}):null]})}function rf({state:e,isAdmin:t,runningAction:n=null,actionError:r="",onRefresh:i,onApply:a,onCompletePending:o}){var v,b,N,_,S,F,j,B,L,C,O;if(!e)return null;const l=(b=(v=e==null?void 0:e.target)==null?void 0:v.tag_name)==null?void 0:b.trim();if(!t||!l||(e==null?void 0:e.decision)==="noop")return null;const u=sf(e.decision),c=((N=e.queue)==null?void 0:N.active_total)??0,d=af((_=e.classification)==null?void 0:_.risk),h=of((S=e.target)==null?void 0:S.body),m=((j=(F=e.classification)==null?void 0:F.migration_files)==null?void 0:j.length)??0,p=((L=(B=e.classification)==null?void 0:B.risky_files)==null?void 0:L.length)??0,y=!!(e.executor_reload_pending&&e.dashboard_applied_at&&o),w=!!(a&&m===0);return s.jsxs("section",{className:"rounded-md border border-amber-300 bg-amber-50 p-3 text-amber-950 shadow-sm","aria-label":"Update available",children:[s.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Fi,{className:"h-4 w-4 text-amber-700","aria-hidden":!0}),s.jsx("h2",{className:"text-sm font-semibold",children:"Update available"}),s.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}),(C=e.target)!=null&&C.url?s.jsxs("a",{className:"inline-flex items-center gap-1 text-xs font-semibold text-amber-800 hover:underline",href:it(e.target.url),rel:"noreferrer",target:"_blank",children:[s.jsx(hn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Release"]}):null]}),s.jsxs("p",{className:"mt-1 text-sm text-amber-900",children:[u,e.installed_tag?s.jsxs("span",{className:"font-mono",children:[" from ",e.installed_tag]}):null]}),s.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[i?s.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:i,children:[s.jsx(Oi,{className:G("h-3.5 w-3.5",n==="refresh"&&"animate-spin"),"aria-hidden":!0}),n==="refresh"?"Checking...":"Check now"]}):null,w?s.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:[s.jsx(mn,{className:"h-3.5 w-3.5","aria-hidden":!0}),n==="apply"?"Applying...":"Apply update"]}):null,y?s.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:[s.jsx(Bn,{className:"h-3.5 w-3.5","aria-hidden":!0}),n==="complete"?"Completing...":"Complete reload"]}):null]})]}),s.jsxs("div",{className:"grid gap-2 text-xs sm:grid-cols-3 lg:min-w-[420px]",children:[s.jsx(Yr,{label:"Impact",value:d}),s.jsx(Yr,{label:"Active jobs",value:String(c)}),s.jsx(Yr,{label:"Admin only",value:"autoupdate"})]})]}),e.blocked_reason||e.executor_reload_pending||m>0||p>0?s.jsxs("div",{className:"mt-3 flex flex-wrap gap-2 text-xs",children:[e.executor_reload_pending?s.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?s.jsx("span",{className:"rounded-sm border border-amber-300 bg-white px-2 py-1 font-mono",children:e.blocked_reason}):null,m>0?s.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?s.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?s.jsxs("div",{className:"mt-3 rounded-md border border-amber-200 bg-white/70 p-2.5",children:[s.jsx("div",{className:"text-[11px] font-semibold uppercase text-amber-800",children:"Changelog preview"}),s.jsx(lf,{markdown:h})]}):null,(O=e.warnings)!=null&&O.length?s.jsx("div",{className:"mt-2 font-mono text-xs text-amber-800",children:e.warnings[0]}):null,r?s.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 Yr({label:e,value:t}){return s.jsxs("div",{className:"min-w-0 rounded-md border border-amber-200 bg-white/80 px-2 py-1.5",children:[s.jsx("div",{className:"text-[11px] font-semibold uppercase text-amber-700",children:e}),s.jsx("div",{className:"mt-0.5 truncate font-mono text-xs text-amber-950",children:t})]})}function sf(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 af(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 of(e){return(e??"").trim()}function lf({markdown:e}){return s.jsx("div",{className:"mt-1 text-sm leading-relaxed text-amber-950",children:s.jsx(Kp,{allowedElements:["a","blockquote","code","em","h1","h2","h3","h4","li","ol","p","strong","ul"],components:{a:({href:t,children:n})=>s.jsx("a",{className:"font-semibold text-amber-800 underline underline-offset-2",href:it(t??""),rel:"noreferrer",target:"_blank",children:n}),blockquote:({children:t})=>s.jsx("blockquote",{className:"mt-2 border-l-2 border-amber-300 pl-2 text-amber-900",children:t}),code:({children:t})=>s.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})=>s.jsx("h3",{className:"mt-2 text-sm font-semibold text-amber-950 first:mt-0",children:t}),h2:({children:t})=>s.jsx("h3",{className:"mt-2 text-sm font-semibold text-amber-950 first:mt-0",children:t}),h3:({children:t})=>s.jsx("h3",{className:"mt-2 text-sm font-semibold text-amber-950 first:mt-0",children:t}),h4:({children:t})=>s.jsx("h4",{className:"mt-2 text-xs font-semibold uppercase text-amber-800 first:mt-0",children:t}),li:({children:t})=>s.jsx("li",{className:"break-words pl-0.5 [overflow-wrap:anywhere]",children:t}),ol:({children:t})=>s.jsx("ol",{className:"mt-1 list-decimal space-y-1 pl-5 first:mt-0",children:t}),p:({children:t})=>s.jsx("p",{className:"mt-1 break-words [overflow-wrap:anywhere] first:mt-0",children:t}),strong:({children:t})=>s.jsx("strong",{className:"font-semibold",children:t}),em:({children:t})=>s.jsx("em",{className:"italic",children:t}),ul:({children:t})=>s.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-5 first:mt-0",children:t})},children:e})})}function uf({isDashboardRoute:e,isSystemRoute:t=!1,isKnowledgeRoute:n,isMcpRoute:r=!1,isWebhooksRoute:i=!1,showWebhooks:a=!1,knowledgeBadgeCount:o=0,onNavigate:l}){return s.jsxs("nav",{className:"flex min-w-0 rounded-lg border border-border bg-panel p-1 shadow-sm","aria-label":"Dashboard sections",children:[s.jsxs(En,{href:"/",active:e,onNavigate:l,children:[s.jsx(vo,{className:"h-4 w-4","aria-hidden":!0}),s.jsx("span",{children:"Jobs"})]}),s.jsxs(En,{href:"/system",active:t,onNavigate:l,children:[s.jsx(Nu,{className:"h-4 w-4","aria-hidden":!0}),s.jsx("span",{children:"System"})]}),a?s.jsxs(En,{href:"/webhooks",active:i,onNavigate:l,children:[s.jsx(Dn,{className:"h-4 w-4","aria-hidden":!0}),s.jsx("span",{children:"Webhooks"})]}):null,s.jsxs(En,{href:"/knowledge",active:n,onNavigate:l,children:[s.jsx(Mi,{className:"h-4 w-4","aria-hidden":!0}),s.jsx("span",{children:"Knowledge"}),o>0?s.jsx("span",{className:G("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]}),s.jsxs(En,{href:"/mcp",active:r,onNavigate:l,children:[s.jsx(xr,{className:"h-4 w-4","aria-hidden":!0}),s.jsx("span",{children:"MCP"})]})]})}function cf({status:e,loading:t,error:n,onRefresh:r}){const i=Object.values((e==null?void 0:e.receipts)??{}).reduce((a,o)=>a+o,0);return s.jsxs("section",{className:"grid gap-4",children:[s.jsx(pl,{icon:s.jsx(Dn,{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:s.jsx(ht,{onClick:r})}),n?s.jsx(Ne,{tone:"error",text:n.message}):null,s.jsxs("div",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Webhook status",children:[s.jsx(He,{title:"Receipts",value:i,icon:s.jsx(Dn,{className:"h-5 w-5"})}),s.jsx(He,{title:"Duplicates",value:(e==null?void 0:e.duplicate_deliveries)??0,icon:s.jsx(Oi,{className:"h-5 w-5"})}),s.jsx(He,{title:"Cross-source matches",value:(e==null?void 0:e.cross_source_matches)??0,icon:s.jsx(Wn,{className:"h-5 w-5"})}),s.jsx(He,{title:"Mode",value:t?"…":(e==null?void 0:e.mode)??"unknown",icon:s.jsx(yo,{className:"h-5 w-5"})})]}),s.jsx(Ee,{title:"Receipt states",children:t?s.jsx(ee,{text:"Loading webhook status..."}):Object.keys((e==null?void 0:e.receipts)??{}).length?s.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:Object.entries((e==null?void 0:e.receipts)??{}).sort(([a],[o])=>a.localeCompare(o)).map(([a,o])=>s.jsx(he,{label:a,value:o},a))}):s.jsx(ee,{text:"No webhook deliveries observed yet."})})]})}function df({processes:e,processesLoading:t,processesError:n,systemd:r,systemdLoading:i,systemdError:a,alerts:o,alertsLoading:l,alertsError:u,now:c,onRefreshProcesses:d,onRefreshSystemd:h,onRefreshAlerts:m}){return s.jsxs("section",{className:"grid gap-4","aria-label":"Bridge system",children:[s.jsxs(Ee,{title:"Systemd",action:s.jsx(ht,{onClick:h}),children:[a?s.jsx(Ne,{tone:"error",text:a.message}):null,s.jsx(Kf,{data:r,loading:i})]}),s.jsxs(Ee,{title:"Process activity",action:s.jsx(ht,{onClick:d}),children:[n?s.jsx(Ne,{tone:"error",text:n.message}):null,s.jsx(Wf,{data:e,loading:t})]}),s.jsxs(Ee,{title:"Monitor alerts",action:s.jsx(ht,{onClick:m}),children:[u?s.jsx(Ne,{tone:"error",text:u.message}):null,s.jsx(Jf,{alerts:o,loading:l,now:c})]})]})}function En({href:e,active:t,children:n,onNavigate:r}){return s.jsx("a",{className:G("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:i=>{!r||i.defaultPrevented||i.button!==0||i.metaKey||i.ctrlKey||i.altKey||i.shiftKey||(i.preventDefault(),r(e))},children:n})}function hf({jobId:e,detail:t,selectedJob:n,user:r,onBackToDashboard:i,onRetry:a,onDismiss:o,onCancel:l,onRefresh:u}){const[c,d]=A.useState(!1),[h,m]=A.useState(!1),[p,y]=A.useState(!1),w=!!(r!=null&&r.is_admin&&n&&Rn(n.status)),v=!!(n&&_i(n,r)),b=c?"Retrying...":"Retry",N=h?"Dismissing...":"Dismiss",_=p?"Cancelling...":"Cancel";return s.jsxs("div",{className:"grid min-w-0 gap-3 sm:gap-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.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:S=>{S.defaultPrevented||S.button!==0||S.metaKey||S.ctrlKey||S.altKey||S.shiftKey||(S.preventDefault(),i())},children:[s.jsx(ju,{className:"h-4 w-4","aria-hidden":!0}),"Dashboard"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[w?s.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:[s.jsx(Bn,{className:"h-4 w-4","aria-hidden":!0}),b]}):null,w?s.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:[s.jsx(mn,{className:"h-4 w-4","aria-hidden":!0}),N]}):null,v?s.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 S=window.prompt(`Cancel job #${e}? Optional reason:`);if(S!==null){y(!0);try{await l(e,S)}finally{y(!1)}}},children:[s.jsx(Ht,{className:"h-4 w-4","aria-hidden":!0}),_]}):null,s.jsx(ht,{onClick:u})]})]}),s.jsx(Ee,{title:`Job #${e}`,className:"p-3 sm:p-4",children:t})]})}function pf({selectedJobId:e,selectedJob:t,loading:n,error:r,session:i,sessionEvents:a,transcript:o,now:l}){return t?s.jsx(zf,{job:t,session:i,sessionEvents:a,transcript:o,now:l}):e!==null&&n?s.jsx(ee,{text:"Loading selected job..."}):e!==null&&r?s.jsx(Ne,{tone:"error",text:`Job #${e}: ${r.message}`}):s.jsx(ee,{text:"Select a job to inspect its timeline, worklog and GitHub links."})}function mf({data:e,loading:t,error:n,repo:r,status:i,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,v]=A.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 s.jsxs("div",{className:"grid min-w-0 gap-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("h2",{className:"flex items-center gap-2 text-base font-semibold",children:[s.jsx(Mi,{className:"h-5 w-5 text-muted","aria-hidden":!0}),"Acquired knowledge"]}),s.jsx("p",{className:"text-xs text-muted",children:"Captured feedback, proposed rules and curated agent memory."})]}),s.jsx(ht,{onClick:p})]}),n?s.jsx(Ne,{tone:"error",text:n.message}):null,s.jsxs("section",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4","aria-label":"Knowledge metrics",children:[s.jsx(He,{title:"Proposed",value:y.proposed??0,icon:s.jsx(bo,{className:"h-5 w-5"})}),s.jsx(He,{title:"Approved",value:y.approved??0,icon:s.jsx(mn,{className:"h-5 w-5"})}),s.jsx(He,{title:"Rules",value:y.rules??0,icon:s.jsx(wo,{className:"h-5 w-5"})}),s.jsx(He,{title:"Events",value:y.events??0,icon:s.jsx(Dn,{className:"h-5 w-5"})})]}),s.jsx(Ee,{title:"Filters",className:"p-3",children:s.jsxs("div",{className:G("grid gap-3",w==="proposals"?"md:grid-cols-[minmax(0,1fr)_220px]":"md:grid-cols-[minmax(0,1fr)]"),children:[s.jsx(Ge,{label:"Repository",children:s.jsxs("select",{className:"control",value:r,onChange:N=>l(N.target.value),children:[s.jsx("option",{value:"",children:"All repositories"}),((e==null?void 0:e.repositories)??[]).map(N=>s.jsx("option",{value:N,children:N},N))]})}),w==="proposals"?s.jsx(Ge,{label:"Proposal status",children:s.jsxs("select",{className:"control",value:i,onChange:N=>u(N.target.value),children:[s.jsx("option",{value:"",children:"All statuses"}),s.jsx("option",{value:"proposed",children:"proposed"}),s.jsx("option",{value:"approved",children:"approved"}),s.jsx("option",{value:"rejected",children:"rejected"}),s.jsx("option",{value:"error",children:"error"})]})}):null]})}),s.jsxs(Ee,{title:"Knowledge records",action:s.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(N=>s.jsxs("button",{className:G("inline-flex h-8 items-center gap-1.5 rounded px-2.5 text-xs font-semibold",w===N.id?"bg-primary text-white":"text-muted hover:bg-slate-50 hover:text-foreground"),type:"button",role:"tab","aria-label":`${N.label} (${N.count})`,"aria-selected":w===N.id,onClick:()=>v(N.id),children:[s.jsx("span",{children:N.label}),s.jsx("span",{className:G("rounded-sm border px-1 font-mono text-[10px]",w===N.id?"border-white/40 text-white":"border-border text-muted"),children:N.count})]},N.id))}),children:[w==="proposals"?s.jsx(ff,{proposals:(e==null?void 0:e.proposals)??[],loading:t,isAdmin:!!(a!=null&&a.is_admin),now:o,onApprove:c,onReject:d}):null,w==="rules"?s.jsx(bf,{rules:(e==null?void 0:e.rules)??[],loading:t,now:o,onUpdateRuleScope:h,onDeleteRule:m}):null,w==="events"?s.jsx(yf,{events:(e==null?void 0:e.events)??[],loading:t,now:o}):null]})]})}function ff({proposals:e,loading:t,isAdmin:n,now:r,onApprove:i,onReject:a}){const[o,l]=A.useState(null);return t&&e.length===0?s.jsx(ee,{text:"Loading proposals..."}):e.length===0?s.jsx(ee,{text:"No proposals match the current filters."}):s.jsx("div",{className:"grid gap-2",children:e.map(u=>s.jsxs("article",{className:"grid min-w-0 gap-2 rounded-md border border-border bg-white p-3",children:[s.jsx(fl,{scope:u.scope,type:u.type,confidence:u.confidence,status:u.status,timestamp:u.updated_at,now:r}),s.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?s.jsx("p",{className:"min-w-0 break-words text-xs text-muted [overflow-wrap:anywhere]",children:u.reason}):null,u.source_event?s.jsx(xf,{event:u.source_event}):s.jsxs("p",{className:"font-mono text-xs text-muted",children:["Source event ",u.event_id]}),u.error?s.jsx(Ne,{tone:"error",text:u.error}):null,n&&u.status==="proposed"?s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.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 i(u.id)}finally{l(null)}},children:[s.jsx(mn,{className:"h-4 w-4","aria-hidden":!0}),"Approve"]}),s.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:[s.jsx(Ht,{className:"h-4 w-4","aria-hidden":!0}),"Reject"]})]}):null]},u.id))})}function xf({event:e}){const t=e.trigger_actor||(e.actor!=="github"?e.actor:null);return s.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:[s.jsx(yn,{actor:t,avatarUrl:e.trigger_actor_avatar_url,framed:!0}),e.source_job_id?s.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:bn(e.source_job_id),children:[s.jsx(Wn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",e.source_job_id]}):null,e.github_urls.length>0?s.jsx(Un,{urls:e.github_urls,compact:!0}):s.jsx("span",{className:"font-mono text-xs text-muted",children:"No GitHub link"})]})}function gf(e){const t=[{value:"global",label:"global"}];if(e.startsWith("repo:")){const n=e.slice(5),[r,i]=n.split("/",2);r&&i&&(t.push({value:`org:${r}`,label:`org:${r}`}),t.push({value:`repo:${r}/${i}`,label:`repo:${r}/${i}`}))}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 bf({rules:e,loading:t,now:n,onUpdateRuleScope:r,onDeleteRule:i}){const[a,o]=A.useState(null),[l,u]=A.useState(null),[c,d]=A.useState("");return t&&e.length===0?s.jsx(ee,{text:"Loading curated rules..."}):e.length===0?s.jsx(ee,{text:"No curated rules match the current filters."}):s.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(S=>S.github_urls??[]),v=gf(h.scope),b=l===h.id,N=a===h.id,_=!!h.can_manage;return s.jsxs("article",{className:"grid min-w-0 gap-2 rounded-md border border-border bg-white p-3",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsx(fl,{scope:h.scope,type:h.type,confidence:h.confidence,status:`${h.observations} observation${h.observations===1?"":"s"}`,timestamp:h.last_seen,now:n}),_?s.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[b?s.jsxs(s.Fragment,{children:[s.jsx(Ge,{label:"Scope",children:s.jsx("select",{className:"control h-8 min-w-[180px] py-1 text-xs",value:c,disabled:N,onChange:S=>d(S.target.value),children:v.map(S=>s.jsx("option",{value:S.value,children:S.label},S.value))})}),s.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:N||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:[s.jsx(Cu,{className:"h-4 w-4","aria-hidden":!0}),"Save"]}),s.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:N,title:"Cancel scope edit",onClick:()=>{u(null),d("")},children:[s.jsx(Ht,{className:"h-4 w-4","aria-hidden":!0}),"Cancel"]})]}):s.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:N,title:"Edit scope",onClick:()=>{u(h.id),d(h.scope)},children:[s.jsx(Su,{className:"h-4 w-4","aria-hidden":!0}),"Edit"]}),s.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:N,onClick:async()=>{if(window.confirm("Delete this curated rule?")){o(h.id);try{await i(h.id)}finally{o(null)}}},children:[s.jsx(mi,{className:"h-4 w-4","aria-hidden":!0}),"Delete"]})]}):null]}),s.jsx("p",{className:"min-w-0 break-words text-sm font-medium [overflow-wrap:anywhere]",children:h.rule}),s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsx(yn,{actor:y,avatarUrl:p==null?void 0:p.trigger_actor_avatar_url,framed:!0}),p!=null&&p.source_job_id?s.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:bn(p.source_job_id),children:[s.jsx(Wn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",p.source_job_id]}):null,w.length>0?s.jsx(Un,{urls:w,compact:!0}):s.jsx("span",{className:"font-mono text-xs text-muted",children:"No GitHub link"})]})]},h.id)})})}function yf({events:e,loading:t,now:n}){return t&&e.length===0?s.jsx(ee,{text:"Loading captured events..."}):e.length===0?s.jsx(ee,{text:"No captured feedback events match the current filters."}):s.jsx("div",{className:"grid gap-2",children:e.map(r=>{const i=r.trigger_actor||(r.actor!=="github"?r.actor:null);return s.jsxs("details",{className:"group rounded-md border border-border bg-white",children:[s.jsxs("summary",{className:"grid cursor-pointer list-none gap-2 px-3 py-2 marker:hidden hover:bg-slate-50",children:[s.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2 font-mono text-xs font-semibold text-muted",children:[s.jsx(pn,{className:"h-3.5 w-3.5 shrink-0 transition-transform group-open:rotate-180","aria-hidden":!0}),s.jsx("span",{className:"truncate",children:hl(r.scope)})]}),s.jsx("span",{className:"shrink-0 font-mono text-xs text-muted",children:s.jsx(_e,{value:r.occurred_at,relative:!0,now:n})})]}),s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsx(yn,{actor:i,avatarUrl:r.trigger_actor_avatar_url,framed:!0}),r.source_job_id?s.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:bn(r.source_job_id),children:[s.jsx(Wn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",r.source_job_id]}):null,r.github_urls.length>0?s.jsx(Un,{urls:r.github_urls,compact:!0}):s.jsx("span",{className:"font-mono text-xs text-muted",children:"No GitHub link"})]}),s.jsx("p",{className:"line-clamp-2 break-words text-sm [overflow-wrap:anywhere]",children:r.comment})]}),s.jsxs("div",{className:"grid gap-2 border-t border-border px-3 py-2",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 text-xs font-semibold text-muted",children:"GitHub links"}),r.github_urls.length>0?s.jsx(Un,{urls:r.github_urls}):s.jsx("p",{className:"text-xs text-muted",children:"No links recorded."})]}),s.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 wf({tokens:e,loading:t,error:n,user:r,ownerOptions:i,dashboardUrl:a,dashboardUrlSource:o,now:l,onCreate:u,onUpdateOwner:c,onRevoke:d,onRefresh:h}){const[m,p]=A.useState(""),[y,w]=A.useState(""),[v,b]=A.useState(!1),[N,_]=A.useState(null),[S,F]=A.useState(null),[j,B]=A.useState(null),[L,C]=A.useState(""),O=e??[],I=i.find(P=>P.login===y);A.useEffect(()=>{var P;r!=null&&r.is_admin&&(y&&i.some(q=>q.login===y)||w((r==null?void 0:r.login)||((P=i[0])==null?void 0:P.login)||""))},[i,r==null?void 0:r.is_admin,r==null?void 0:r.login,y]);const E=(a||(typeof window>"u"?"":window.location.origin)).replace(/\/$/,""),K=`${E}/mcp`,D=`${E}/api/mcp`;return s.jsxs("div",{className:"grid min-w-0 gap-4",children:[s.jsx(pl,{icon:s.jsx(xr,{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:s.jsx(ht,{onClick:h})}),n?s.jsx(Ne,{tone:"error",text:n.message}):null,L?s.jsx(Ne,{tone:"error",text:L}):null,s.jsx(vf,{dashboardUrl:K,endpointUrl:D,dashboardUrlSource:o??"request"}),j?s.jsxs("section",{className:"rounded-md border border-emerald-300 bg-emerald-50 p-3 text-emerald-950","aria-label":"Created MCP token",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-sm font-semibold",children:"Token created"}),s.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."})]}),s.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:[s.jsx(Ht,{className:"h-4 w-4","aria-hidden":!0}),"Hide"]})]}),s.jsx("pre",{className:"mt-3 overflow-auto rounded bg-emerald-950 px-3 py-2 font-mono text-xs text-emerald-50",children:j.token})]}):null,s.jsx(Ee,{title:"Create token",children:s.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 P=>{P.preventDefault();const q=m.trim();if(q){b(!0),C("");try{const W=await u(q,r!=null&&r.is_admin?y:void 0);B(W),p("")}catch(W){C(W instanceof Error?W.message:String(W))}finally{b(!1)}}},children:[s.jsx(Ge,{label:"Token name",children:s.jsx("input",{className:"control",value:m,placeholder:"local agent",disabled:v,onChange:P=>p(P.target.value)})}),r!=null&&r.is_admin?s.jsxs(Ge,{label:"Owner",children:[s.jsx(ml,{ariaLabel:"Owner",value:y,ownerOptions:i,disabled:v||i.length===0,selectedSuffix:P=>P.login===(r==null?void 0:r.login)?" (you)":"",emptyLabel:"No known users",onChange:w}),I?s.jsxs("span",{className:"font-normal text-muted",children:["Token will be linked to @",I.login,"."]}):null]}):null,s.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:v||!m.trim()||!!(r!=null&&r.is_admin&&!y),children:[s.jsx(xr,{className:"h-4 w-4","aria-hidden":!0}),v?"Creating...":"Create token"]})]})}),s.jsx(Ee,{title:"Active tokens",children:s.jsx(jf,{tokens:O,loading:t,now:l,ownerOptions:i,canManageOwners:!!(r!=null&&r.is_admin),revokingId:N,updatingOwnerId:S,onUpdateOwner:async(P,q)=>{F(P),C("");try{await c(P,q)}catch(W){C(W instanceof Error?W.message:String(W))}finally{F(null)}},onRevoke:async P=>{if(window.confirm("Revoke this MCP token?")){_(P),C("");try{await d(P)}catch(q){C(q instanceof Error?q.message:String(q))}finally{_(null)}}}})})]})}function vf({dashboardUrl:e,endpointUrl:t,dashboardUrlSource:n}){const r=n==="configured"?"Configured public URL":n==="forwarded"?"Forwarded public URL":"Needs public URL",i=n==="request",a=i?"Set GITHUB_AGENT_BRIDGE_DASHBOARD_PUBLIC_URL or forward X-Forwarded-* headers":e,o=i?"Public dashboard URL required before connecting remote agents":t,u=`{ - "mcpServers": { - "github-agent-bridge": { - "url": "${i?"https://bridge.example.com/api/mcp":t}", - "headers": { - "Authorization": "Bearer \${GITHUB_AGENT_BRIDGE_MCP_TOKEN}" - } - } - } -}`;return s.jsxs(Ee,{title:"Connect an agent",children:[i?s.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,s.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]",children:[s.jsxs("div",{className:"grid min-w-0 gap-3",children:[s.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm font-semibold",children:[s.jsx(hn,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"Public dashboard URL",s.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})]}),s.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."}),s.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})]}),s.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[s.jsx(hn,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"HTTP MCP endpoint"]}),s.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."}),s.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})]})]}),s.jsxs("div",{className:"grid min-w-0 gap-3",children:[s.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[s.jsx(xr,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"Agent config"]}),s.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."}),s.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})]}),s.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[s.jsx(Mi,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"Agent prompt"]}),s.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."}),s.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 pl({icon:e,title:t,subtitle:n,action:r}){return s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("h2",{className:"flex items-center gap-2 text-base font-semibold",children:[e,t]}),s.jsx("p",{className:"text-xs text-muted",children:n})]}),r]})}function jf({tokens:e,loading:t,now:n,ownerOptions:r,canManageOwners:i,revokingId:a,updatingOwnerId:o,onUpdateOwner:l,onRevoke:u}){return t&&e.length===0?s.jsx(ee,{text:"Loading MCP tokens..."}):e.length===0?s.jsx(ee,{text:"No active MCP tokens."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid gap-2 md:hidden",children:e.map(c=>s.jsxs("article",{className:"grid min-w-0 gap-3 rounded-md border border-border bg-white p-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("h3",{className:"break-words text-sm font-semibold [overflow-wrap:anywhere]",children:c.name}),s.jsx("div",{className:"mt-1 break-all font-mono text-xs text-muted",children:c.id}),i?s.jsx(za,{token:c,ownerOptions:r,disabled:o===c.id,onUpdateOwner:l}):c.user_login?s.jsxs("div",{className:"mt-1 text-xs text-muted",children:["Owner: @",c.user_login]}):null]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[s.jsx(he,{label:"Created",value:s.jsx(_e,{value:c.created_at,relative:!0,now:n})}),s.jsx(he,{label:"Last used",value:c.last_used_at?s.jsx(_e,{value:c.last_used_at,relative:!0,now:n}):"never"})]}),s.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:[s.jsx(mi,{className:"h-4 w-4","aria-hidden":!0}),a===c.id?"Revoking...":"Revoke"]})]},c.id))}),s.jsx("div",{className:"hidden overflow-auto rounded-md border border-border md:block",children:s.jsxs("table",{className:"min-w-full border-collapse text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border bg-slate-50 text-left text-xs text-muted",children:[s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Name"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Owner"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Created"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Last used"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"ID"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Actions"})]})}),s.jsx("tbody",{children:e.map(c=>s.jsxs("tr",{className:"border-b border-border last:border-b-0",children:[s.jsx("td",{className:"px-3 py-3 font-semibold",children:c.name}),s.jsx("td",{className:"px-3 py-3 text-xs text-muted",children:i?s.jsx(za,{token:c,ownerOptions:r,disabled:o===c.id,onUpdateOwner:l}):c.user_login?`@${c.user_login}`:"unassigned"}),s.jsx("td",{className:"px-3 py-3 font-mono text-xs",children:s.jsx(_e,{value:c.created_at,relative:!0,now:n})}),s.jsx("td",{className:"px-3 py-3 font-mono text-xs",children:c.last_used_at?s.jsx(_e,{value:c.last_used_at,relative:!0,now:n}):"never"}),s.jsx("td",{className:"px-3 py-3 font-mono text-xs text-muted",children:c.id}),s.jsx("td",{className:"px-3 py-3 text-right",children:s.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:[s.jsx(mi,{className:"h-4 w-4","aria-hidden":!0}),a===c.id?"Revoking...":"Revoke"]})})]},c.id))})]})})]})}function za({token:e,ownerOptions:t,disabled:n,onUpdateOwner:r}){const i=e.user_login??"";return s.jsx(ml,{ariaLabel:`Owner for ${e.name}`,value:i,ownerOptions:t,disabled:n||t.length===0,emptyLabel:"Select owner",size:"compact",onChange:a=>{!a||a===e.user_login||r(e.id,a)}})}function ml({value:e,ownerOptions:t,disabled:n,onChange:r,ariaLabel:i,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 s.jsxs("div",{className:G("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:[s.jsx("span",{className:G("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?s.jsx("img",{className:"h-full w-full rounded-full bg-slate-100",src:it(u.avatar_url),alt:"",referrerPolicy:"no-referrer"}):s.jsx(zn,{className:G("text-muted",l==="compact"?"h-4 w-4":"h-5 w-5"),"aria-hidden":!0})}),s.jsx("span",{className:G("pointer-events-none min-w-0 flex-1 truncate font-mono",u?"text-foreground":"text-muted",l==="compact"?"text-xs":"text-sm"),children:c}),s.jsxs("select",{className:"absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed","aria-label":i,value:e,disabled:n,onChange:d=>r(d.target.value),children:[t.length===0||!e?s.jsx("option",{value:"",children:o}):null,t.map(d=>s.jsxs("option",{value:d.login,children:["@",d.login,(a==null?void 0:a(d))??""]},d.login))]}),s.jsx(pn,{className:G("pointer-events-none shrink-0 text-muted",l==="compact"?"h-3.5 w-3.5":"h-4 w-4"),"aria-hidden":!0})]})}function Un({urls:e,compact:t=!1}){const n=t?e.slice(0,2):e,r=e.length-n.length;return s.jsxs("div",{className:"flex min-w-0 max-w-full flex-wrap gap-1.5",children:[n.map(i=>s.jsxs("a",{className:G("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:it(i),"aria-label":i,rel:"noreferrer",target:"_blank",children:[s.jsx(hn,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),s.jsx("span",{className:"truncate",children:t?kf(i):i})]},i)),r>0?s.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 kf(e){try{const t=new URL(e);return t.pathname.replace(/^\//,"")+t.hash}catch{return e}}function fl({scope:e,type:t,confidence:n,status:r,timestamp:i,now:a}){return s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-muted",children:[s.jsx("span",{className:"truncate font-mono font-semibold text-foreground",children:hl(e)}),s.jsx("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono",children:t}),s.jsxs("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono",children:[Math.round(n*100),"%"]}),s.jsx("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono",children:r}),s.jsx("span",{className:"font-mono",children:s.jsx(_e,{value:i,relative:!0,now:a})})]})}function Nf({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",i=e!=null&&e.avatar_url?s.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"}):s.jsx("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-full border border-slate-700 bg-slate-900",children:s.jsx(zn,{className:"h-5 w-5","aria-hidden":!0})}),a=e!=null&&e.html_url?s.jsx("a",{className:"truncate font-semibold text-white hover:underline",href:it(e.html_url),rel:"noreferrer",target:"_blank",children:n}):s.jsx("div",{className:"truncate font-semibold text-white",children:n});return s.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:[s.jsx(wo,{className:"hidden h-4 w-4 shrink-0 sm:block","aria-hidden":!0}),s.jsxs("div",{className:"hidden min-w-0 text-right sm:block",children:[a,s.jsxs("div",{className:"text-xs text-slate-400",children:["Signed in · ",r]})]}),i]})}function Sf({config:e,loading:t,onEnable:n,onDisable:r}){const[i,a]=A.useState(!1),[o,l]=A.useState(""),u=!!(e!=null&&e.status.enabled),c=typeof navigator<"u"&&typeof window<"u"&&pr(),d=t||i||!(e!=null&&e.configured)||!c,h=c?e!=null&&e.configured?u?"Disable notifications":"Enable notifications":"Notifications not configured":"Notifications unavailable";return s.jsx("div",{className:"relative",children:s.jsx("button",{className:G("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:s.jsx(go,{className:G("h-4 w-4",i&&"animate-live-pulse"),"aria-hidden":!0})})})}function Cf({notification:e,onDismiss:t,onNavigate:n}){if(!e)return null;const r=e.title||"GitHub Agent Bridge",i=e.body||e.summary||"Bridge job finished",a=e.url||e.job_url||(e.job_id?bn(e.job_id):"/"),o=a.startsWith("/");return s.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:s.jsxs("div",{className:"flex items-start gap-3 p-3",children:[s.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:s.jsx(go,{className:"h-4 w-4","aria-hidden":!0})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("h2",{className:"min-w-0 break-words text-sm font-semibold text-foreground",children:r}),s.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:s.jsx(Ht,{className:"h-4 w-4","aria-hidden":!0})})]}),s.jsx("p",{className:"mt-1 min-w-0 break-words text-sm text-muted",children:i}),e.detail?s.jsx("p",{className:"mt-1 line-clamp-2 min-w-0 break-words text-xs text-muted",children:e.detail}):null,s.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(it(a),"_blank","noopener,noreferrer")},children:[s.jsx(hn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Open"]})]})]})})}function _f({count:e,limit:t,loading:n,onRefresh:r}){return s.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:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("h2",{className:"text-base font-semibold",children:"Jobs"}),s.jsx("p",{className:"text-xs text-muted",children:n?"Refreshing latest jobs...":`Showing ${e} of the latest ${t} requested jobs`})]}),s.jsx(ht,{onClick:r,compactOnMobile:!0})]})}function Ee({title:e,action:t,children:n,className:r,flushHeader:i=!1}){return s.jsxs("section",{className:G("min-w-0 rounded-lg border border-border bg-panel p-4 shadow-sm",r),children:[s.jsxs("div",{className:G("flex flex-wrap items-center justify-between gap-3",!i&&"mb-4"),children:[s.jsx("h2",{className:"text-sm font-semibold",children:e}),t]}),n]})}function He({title:e,value:t,icon:n}){return s.jsxs("div",{className:"rounded-lg border border-border bg-panel p-3 shadow-sm md:p-4",children:[s.jsxs("div",{className:"flex items-center justify-between text-muted",children:[s.jsx("span",{className:"text-sm font-medium",children:e}),n]}),s.jsx("strong",{className:"mt-3 block text-2xl leading-none md:mt-4 md:text-3xl",children:t})]})}function Ef({filters:e,actorOptions:t,onChange:n}){const[r,i]=A.useState(e);A.useEffect(()=>i(e),[e]);const a=ef(e),o=Da(e)||Da(r),l=()=>{i(Ci),n(Ci)};return s.jsxs("details",{className:"my-3 rounded-md border border-border bg-slate-50/70",children:[s.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:[s.jsxs("span",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-2",children:[s.jsx(ku,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"Filters"]}),a.length>0?s.jsx("span",{className:"flex min-w-0 flex-wrap items-center gap-1.5","aria-label":"Applied filters",children:a.map(u=>s.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:[s.jsx("span",{className:"text-blue-700/70",children:u.label}),s.jsx("span",{className:"max-w-40 truncate font-mono",children:u.value.trim()})]},u.key))}):null]}),s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-2",children:[o?s.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:[s.jsx(Bn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Clear filters"]}):null,s.jsx(pn,{className:"h-4 w-4 text-muted","aria-hidden":!0})]})]}),s.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:[s.jsx(Ge,{label:"Status",children:s.jsxs("select",{className:"control",value:r.status,onChange:u=>i({...r,status:u.target.value}),children:[s.jsx("option",{value:"",children:"All"}),s.jsx("option",{value:"pending",children:"pending"}),s.jsx("option",{value:"running",children:"running"}),s.jsx("option",{value:"blocked",children:"blocked"}),s.jsx("option",{value:"done",children:"done"}),s.jsx("option",{value:"denied",children:"denied"}),s.jsx("option",{value:"waiting_approval",children:"waiting_approval"})]})}),s.jsx(Ge,{label:"Repository",children:s.jsx("input",{className:"control",value:r.repo,placeholder:"owner/repo",onChange:u=>i({...r,repo:u.target.value})})}),s.jsx(Ge,{label:"Thread",children:s.jsx("input",{className:"control",value:r.thread,inputMode:"numeric",placeholder:"issue or PR",onChange:u=>i({...r,thread:u.target.value})})}),s.jsx(Ge,{label:"Action",children:s.jsx("input",{className:"control",value:r.action,placeholder:"reply_comment",onChange:u=>i({...r,action:u.target.value})})}),s.jsx(Ge,{label:"Actor",className:"xl:col-span-2",children:s.jsx(Pf,{value:r.actor,options:t,onChange:u=>i({...r,actor:u})})}),s.jsx(Ge,{label:"Intent",children:s.jsxs("select",{className:"control",value:r.intent,onChange:u=>i({...r,intent:u.target.value}),children:[s.jsx("option",{value:"",children:"All"}),s.jsx("option",{value:"review_only",children:"review_only"}),s.jsx("option",{value:"work_allowed",children:"work_allowed"})]})}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 self-end xl:col-span-2",children:[s.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:[s.jsx(Bn,{className:"h-4 w-4","aria-hidden":!0}),"Clear"]}),s.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:[s.jsx(_u,{className:"h-4 w-4","aria-hidden":!0}),"Apply"]})]})]})]})}function Pf({value:e,options:t,onChange:n}){const[r,i]=A.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 s.jsxs("div",{className:"relative min-w-0",children:[s.jsxs("div",{className:"control flex items-center gap-2 px-2",children:[l?s.jsx("img",{className:"h-5 w-5 shrink-0 rounded-full bg-slate-100",src:it(l.avatar_url??""),alt:`${l.login} avatar`,referrerPolicy:"no-referrer"}):s.jsx(zn,{className:"h-4 w-4 shrink-0 text-muted","aria-hidden":!0}),s.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),i(!0)},onFocus:()=>i(!0),onBlur:()=>window.setTimeout(()=>i(!1),100)}),e?s.jsx("button",{className:"rounded-sm p-1 text-muted hover:bg-slate-100",type:"button","aria-label":"Clear actor filter",onClick:()=>n(""),children:s.jsx(Ht,{className:"h-3.5 w-3.5","aria-hidden":!0})}):null]}),r&&o.length>0?s.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=>s.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),i(!1)},children:[u.avatar_url?s.jsx("img",{className:"h-6 w-6 shrink-0 rounded-full bg-slate-100",src:it(u.avatar_url),alt:`${u.login} avatar`,referrerPolicy:"no-referrer"}):s.jsx(zn,{className:"h-5 w-5 shrink-0 text-muted","aria-hidden":!0}),s.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:["@",u.login]}),s.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 Ge({label:e,children:t,className:n}){return s.jsxs("label",{className:G("grid min-w-0 gap-1 text-xs font-semibold text-muted",n),children:[e,t]})}function Rf({jobs:e,loading:t,loadingMore:n=!1,hasMore:r=!1,onLoadMore:i,onViewJob:a,now:o,user:l,onRetry:u,onDismiss:c,onCancel:d}){const[h,m]=A.useState(null),[p,y]=A.useState(null),[w,v]=A.useState(null),b=A.useRef(!1),N=A.useRef(n),_=!!(l!=null&&l.is_admin&&u),S=!!(l!=null&&l.is_admin&&c);A.useEffect(()=>{N.current&&!n&&(b.current=!1),N.current=n},[n]);const F=A.useCallback(()=>{b.current||(b.current=!0,i==null||i())},[i]),j=A.useCallback(async C=>{if(u){m(C);try{await u(C)}finally{m(null)}}},[u]),B=A.useCallback(async C=>{if(c){y(C);try{await c(C)}finally{y(null)}}},[c]),L=A.useCallback(async(C,O)=>{if(d){v(C);try{await d(C,O)}finally{v(null)}}},[d]);return t&&e.length===0?s.jsx(ee,{text:"Loading jobs..."}):e.length===0?s.jsx(ee,{text:"No jobs match the current filters."}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-2 md:hidden",children:[e.map(C=>s.jsx(Lf,{job:C,onViewJob:a,now:o,canRetry:_&&Rn(C.status),retrying:h===C.id,onRetry:j,canDismiss:S&&Rn(C.status),dismissing:p===C.id,onDismiss:B,canCancel:!!(d&&_i(C,l)),cancelling:w===C.id,onCancel:L},C.id)),s.jsx(If,{hasMore:r,loading:n,onLoadMore:F})]}),s.jsxs("div",{className:"hidden max-h-[640px] overflow-auto rounded-md border border-border md:block",children:[s.jsxs("table",{className:"min-w-[1080px] table-fixed border-collapse text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"sticky top-0 z-10 border-b border-border bg-panel text-left text-xs text-muted",children:[s.jsx("th",{className:"w-[42%] px-3 py-2 font-semibold",children:"Job"}),s.jsx("th",{className:"w-32 px-3 py-2 font-semibold",children:"Status"}),s.jsx("th",{className:"w-40 px-3 py-2 font-semibold",children:"Action"}),s.jsx("th",{className:"w-36 px-3 py-2 font-semibold",children:"Actor"}),s.jsx("th",{className:"w-36 px-3 py-2 font-semibold",children:"Timing"}),s.jsx("th",{className:"w-28 px-3 py-2 font-semibold",children:"Updated"}),s.jsx("th",{className:"w-24 px-3 py-2 text-right font-semibold",children:"Actions"})]})}),s.jsx("tbody",{children:e.map(C=>s.jsx(Tf,{job:C,now:o,onViewJob:a,canRetry:_&&Rn(C.status),retrying:h===C.id,onRetry:j,canDismiss:S&&Rn(C.status),dismissing:p===C.id,onDismiss:B,canCancel:!!(d&&_i(C,l)),cancelling:w===C.id,onCancel:L},C.id))})]}),s.jsx(Af,{hasMore:r,loading:n,onLoadMore:F})]})]})}function Tf({job:e,now:t,onViewJob:n,canRetry:r,retrying:i,onRetry:a,canDismiss:o,dismissing:l,onDismiss:u,canCancel:c,cancelling:d,onCancel:h}){return s.jsxs("tr",{className:"cursor-pointer border-b border-border align-top hover:bg-slate-50",onClick:()=>n(e.id),children:[s.jsx("td",{className:"min-w-0 px-3 py-3",children:s.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[s.jsxs("span",{className:"mt-0.5 shrink-0 font-mono text-xs font-semibold text-muted",children:["#",e.id]}),s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("div",{className:"line-clamp-2 text-sm font-semibold leading-snug text-foreground [overflow-wrap:anywhere]",title:e.subject,children:e.subject}),s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted",children:[s.jsx("span",{className:"min-w-0 max-w-full truncate font-mono",children:e.repo??e.work_key}),s.jsxs("span",{className:"shrink-0",children:["thread ",e.thread??"n/a"]})]})]})]})}),s.jsx("td",{className:"px-3 py-3",children:s.jsx(ns,{status:e.status})}),s.jsxs("td",{className:"px-3 py-3",children:[s.jsx("div",{className:"min-w-0 truncate text-sm text-foreground",title:e.action,children:e.action}),s.jsx("div",{className:"mt-1",children:s.jsx(ts,{intent:e.intent,actionMode:e.action_mode,display:"intent",compact:!0})})]}),s.jsx("td",{className:"px-3 py-3",children:s.jsx(yn,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url})}),s.jsxs("td",{className:"px-3 py-3 text-xs text-muted",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{children:"wait"}),s.jsx("span",{className:"font-mono text-foreground",children:Qe(es(e,t))})]}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[s.jsx("span",{children:"run"}),s.jsx("span",{className:"font-mono text-foreground",children:Qe(Zi(e,t))})]}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[s.jsx("span",{children:"tries"}),s.jsx("span",{className:"font-mono text-foreground",children:e.attempts})]})]}),s.jsx("td",{className:"px-3 py-3 font-mono text-xs",children:s.jsx(_e,{value:e.updated_at,compact:!0,relative:!0,now:t})}),s.jsx("td",{className:"px-3 py-3 text-right",children:s.jsxs("div",{className:"inline-flex items-center gap-1",children:[s.jsx(xl,{jobId:e.id,canRetry:r,retrying:i,onRetry:a,compact:!0}),s.jsx(gl,{jobId:e.id,canDismiss:o,dismissing:l,onDismiss:u,compact:!0}),s.jsx(bl,{jobId:e.id,canCancel:c,cancelling:d,onCancel:h,compact:!0})]})})]})}function If({hasMore:e,loading:t,onLoadMore:n}){return!e&&!t?null:s.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:[s.jsx(pn,{className:"h-4 w-4","aria-hidden":!0}),t?"Loading more jobs...":"Load more jobs"]})}function Af({hasMore:e,loading:t,onLoadMore:n}){const r=A.useRef(null);return A.useEffect(()=>{const i=r.current;if(!i||!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(i),()=>a.disconnect()},[e,t,n]),!e&&!t?null:s.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 Lf({job:e,onViewJob:t,now:n,canRetry:r,retrying:i,onRetry:a,canDismiss:o,dismissing:l,onDismiss:u,canCancel:c,cancelling:d,onCancel:h}){return s.jsxs("article",{className:"rounded-md border border-border bg-white shadow-[0_1px_0_rgba(15,23,42,0.03)]",children:[s.jsxs("button",{className:"grid w-full gap-2 p-3 text-left hover:bg-slate-50",type:"button",onClick:()=>t(e.id),children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-2",children:[s.jsxs("span",{className:"shrink-0 font-mono text-xs font-semibold text-muted",children:["#",e.id]}),s.jsx("span",{className:"truncate font-mono text-sm",children:e.repo??e.work_key})]}),s.jsx("div",{className:"line-clamp-2 text-sm leading-snug text-foreground",children:e.subject}),s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted",children:[s.jsxs("span",{children:["thread ",e.thread??"n/a"," · ",e.action]}),s.jsx(ts,{intent:e.intent,actionMode:e.action_mode,compact:!0,display:"intent"}),s.jsx(yn,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url})]})]}),s.jsx(ns,{status:e.status})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[s.jsx(he,{label:"Wait",value:Qe(es(e,n))}),s.jsx(he,{label:"Runtime",value:Qe(Zi(e,n))}),s.jsx(he,{label:"Updated",value:s.jsx(_e,{value:e.updated_at,compact:!0,relative:!0,now:n})})]})]}),r||o||c?s.jsxs("div",{className:"flex flex-wrap gap-2 border-t border-border px-3 py-2",children:[s.jsx(xl,{jobId:e.id,canRetry:r,retrying:i,onRetry:a}),s.jsx(gl,{jobId:e.id,canDismiss:o,dismissing:l,onDismiss:u}),s.jsx(bl,{jobId:e.id,canCancel:c,cancelling:d,onCancel:h})]}):null]})}function xl({jobId:e,canRetry:t,retrying:n,onRetry:r,compact:i=!1}){if(!t)return null;const a=n?"Retrying...":"Retry";return s.jsxs("button",{className:G("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",i?"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:[s.jsx(Bn,{className:"h-4 w-4","aria-hidden":!0}),s.jsx("span",{className:G(i&&"sr-only"),children:a})]})}function gl({jobId:e,canDismiss:t,dismissing:n,onDismiss:r,compact:i=!1}){if(!t)return null;const a=n?"Dismissing...":"Dismiss";return s.jsxs("button",{className:G("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",i?"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:[s.jsx(mn,{className:"h-4 w-4","aria-hidden":!0}),s.jsx("span",{className:G(i&&"sr-only"),children:a})]})}function bl({jobId:e,canCancel:t,cancelling:n,onCancel:r,compact:i=!1}){if(!t)return null;const a=n?"Cancelling...":"Cancel";return s.jsxs("button",{className:G("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",i?"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:[s.jsx(Ht,{className:"h-4 w-4","aria-hidden":!0}),s.jsx("span",{className:G(i&&"sr-only"),children:a})]})}function yn({actor:e,avatarUrl:t,framed:n=!1}){const r=t?s.jsx("img",{className:"h-4 w-4 shrink-0 rounded-full bg-slate-100",src:it(t),alt:e?`${e} avatar`:"",referrerPolicy:"no-referrer"}):s.jsx(zn,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),i=s.jsxs(s.Fragment,{children:[r,s.jsx("span",{className:"min-w-0 truncate",children:e?`@${e}`:"unknown actor"})]});return n?s.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:i}):s.jsx("span",{className:"inline-flex min-w-0 max-w-full items-center gap-1 font-mono text-xs text-muted",children:i})}function Mf(e){return(e==null?void 0:e.model)??"OpenClaw default"}function Of(e){return(e==null?void 0:e.thinking)??"OpenClaw default"}function Ff(e){return e?e.configured?"configured":e.summary:"n/a"}function Df(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 ts({intent:e,actionMode:t,compact:n=!1,display:r="mode"}){const i=Df(e,t),a=i.intentLabel==="work_allowed"?Pu:yo,o=r==="intent"?i.intentLabel:i.mode;return s.jsxs("span",{className:G("inline-flex min-h-6 max-w-full items-center gap-1.5 rounded-md border px-2 text-xs font-semibold",i.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:`${i.title}: ${i.mode}`,"aria-label":`${i.title}: ${o}`,children:[s.jsx(a,{className:G("h-3.5 w-3.5 shrink-0",n&&"h-3 w-3"),"aria-hidden":!0}),s.jsx("span",{className:"truncate font-mono",children:o})]})}function zf({job:e,session:t,sessionEvents:n,transcript:r,now:i,compact:a=!1}){var p;const o=bn(e.id),l=n??[],u=r??[],c=Dm(l),d=zm(u),h=Zi(e,i),m=es(e,i);return s.jsxs("div",{className:"grid min-w-0 gap-4",children:[s.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:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsx(ns,{status:e.status}),s.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:[s.jsx(Wn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",e.id]}),s.jsx(yn,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url,framed:!0}),s.jsx("span",{className:"min-w-0 break-words font-mono text-xs text-muted [overflow-wrap:anywhere]",children:e.work_key})]}),s.jsxs("div",{className:"grid min-w-0 gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(280px,auto)] lg:items-start",children:[s.jsx("p",{className:"min-w-0 break-words text-sm text-muted [overflow-wrap:anywhere]",children:e.subject}),s.jsxs("div",{className:"grid min-w-0 gap-1",children:[s.jsx("h3",{className:"text-xs font-semibold text-muted",children:"GitHub links"}),e.github_urls.length>0?s.jsx(Un,{urls:e.github_urls,compact:!0}):s.jsx("p",{className:"text-xs text-muted",children:"No links recorded."})]})]})]}),s.jsxs("div",{className:G("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-3"),children:[s.jsx(he,{label:"Queue wait",value:Qe(m)}),s.jsx(he,{label:e.status==="running"?"Running for":"Runtime",value:Qe(h)}),s.jsx(he,{label:"Coalesced",value:String(e.coalesced_count)})]}),e.queue_state==="serialized_by_work_key"?s.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,s.jsxs("div",{className:G("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-3"),children:[s.jsx(he,{label:"Model",value:Mf(e.model_route)}),s.jsx(he,{label:"Reasoning",value:Of(e.model_route)}),s.jsx(he,{label:"Route",value:Ff(e.model_route)})]}),s.jsx(Bf,{job:e,compact:a}),s.jsxs("div",{className:G("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-2 xl:grid-cols-4"),children:[s.jsx(he,{label:"Created",value:s.jsx(_e,{value:e.created_at,compact:!0,relative:!0,now:i})}),s.jsx(he,{label:"Started",value:e.started_at?s.jsx(_e,{value:e.started_at,compact:!0,relative:!0,now:i}):"n/a"}),s.jsx(he,{label:"Updated",value:s.jsx(_e,{value:e.updated_at,compact:!0,relative:!0,now:i})}),s.jsx(he,{label:"Finished",value:e.finished_at?s.jsx(_e,{value:e.finished_at,compact:!0,relative:!0,now:i}):"n/a"})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Timeline"}),s.jsx("div",{className:"grid min-w-0 gap-3",children:(e.worklog??[]).length>0?(p=e.worklog)==null?void 0:p.map(y=>s.jsxs("div",{className:"min-w-0 border-l-2 border-primary pl-3",children:[s.jsx("div",{className:"text-sm font-semibold",children:y.phase}),s.jsx("div",{className:"font-mono text-xs text-muted",children:s.jsx(_e,{value:y.ts,relative:!0,now:i})}),s.jsx("div",{className:"break-words text-sm [overflow-wrap:anywhere]",children:y.summary}),y.detail?s.jsx("div",{className:"mt-1 break-words font-mono text-xs text-muted [overflow-wrap:anywhere]",children:y.detail}):null]},y.id)):s.jsx(ee,{text:"No worklog entries."})})]}),s.jsxs("div",{children:[s.jsxs("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[s.jsx(vo,{className:"h-4 w-4","aria-hidden":!0}),"OpenClaw session"]}),t?s.jsxs("div",{className:"grid gap-3",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsx(he,{label:"Session ID",value:t.id}),s.jsx(he,{label:"Source",value:t.source})]}),s.jsx("p",{className:"break-words text-xs text-muted [overflow-wrap:anywhere]",children:t.detail})]}):s.jsx(ee,{text:"Session correlation is loading."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Agent activity"}),s.jsx("div",{className:"grid max-h-[460px] min-w-0 gap-2 overflow-auto pr-1",children:c.length>0?c.map((y,w)=>s.jsx(Uf,{event:y,defaultOpen:Oa(y.eventType,e.status==="running",w,c.length),now:i},y.id)):s.jsx(ee,{text:e.status==="running"?"Waiting for live agent output...":"No agent activity has been recorded for this session."})})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Session transcript"}),s.jsx("div",{className:"grid max-h-[620px] min-w-0 gap-2 overflow-auto pr-1",children:d.length>0?d.map((y,w)=>s.jsx(qf,{entry:y,defaultOpen:Oa(y.kind,e.status==="running",w,d.length),now:i},y.id)):s.jsx(ee,{text:e.status==="running"?"Waiting for live transcript entries...":"No OpenClaw transcript entries are available for this session."})})]})]})}function Bf({job:e,compact:t=!1}){const n=e.intent_classifier??null,r=(n==null?void 0:n.llm)??{},i=(n==null?void 0:n.parser)??{},a=typeof r.confidence=="number"?`${Math.round(r.confidence*100)}%`:"n/a";return s.jsxs("div",{className:"grid gap-2",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Action mode"}),s.jsxs("div",{className:G("grid gap-2 text-sm sm:gap-3",t?"grid-cols-1":"grid-cols-2 xl:grid-cols-4"),children:[s.jsx(he,{label:"Mode",value:s.jsx(ts,{intent:e.intent,actionMode:e.action_mode})}),s.jsx(he,{label:"Intent",value:e.intent}),s.jsx(he,{label:"Addressed",value:n?Ba(r.addressed_to_agent):"n/a"}),s.jsx(he,{label:"Write",value:n?r.write_permission??"none":e.intent==="work_allowed"?"allowed":"none"})]}),n?s.jsxs("div",{className:"grid gap-2 rounded-md border border-border bg-panel p-3 text-xs",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(Xe,{label:"Classifier",value:n.enabled?"enabled":"disabled"}),s.jsx(Xe,{label:"Applied",value:Ba(r.applied)}),s.jsx(Xe,{label:"Confidence",value:a}),s.jsx(Xe,{label:"Parser",value:`${i.action??"n/a"} / ${i.work_intent??"n/a"}`})]}),s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsx(Xe,{label:"LLM",value:`${r.action??"n/a"} / ${r.work_intent??"n/a"}`}),s.jsx(Xe,{label:"Scope",value:r.scope||"n/a"})]}),r.main_request?s.jsx(Xe,{label:"Main request",value:r.main_request}):null,r.subordinate_reason?s.jsx(Xe,{label:"Subordinate reason",value:r.subordinate_reason}):null,r.reason?s.jsx(Xe,{label:"Reason",value:r.reason}):null,n.error?s.jsx(Xe,{label:"Error",value:n.error,tone:"danger"}):null]}):s.jsx("p",{className:"text-xs text-muted",children:"No intent classifier metadata recorded for this job."})]})}function Ba(e){return e===!0?"yes":e===!1?"no":"n/a"}function Xe({label:e,value:t,tone:n="neutral"}){return s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted",children:e}),s.jsx("div",{className:G("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 qf({entry:e,defaultOpen:t,now:n}){return s.jsx(yl,{badge:e.badge,meta:s.jsx(_e,{value:e.meta,relative:!0,now:n}),count:e.count,summary:e.summary,defaultOpen:t,children:s.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 Uf({event:e,defaultOpen:t,now:n}){return s.jsx(yl,{badge:e.badge,meta:s.jsx(_e,{value:e.meta,relative:!0,now:n}),count:e.count,summary:e.summary,defaultOpen:t,children:e.detail?s.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 yl({badge:e,meta:t,count:n,summary:r,defaultOpen:i,children:a}){const[o,l]=A.useState(!!i);return s.jsxs("details",{className:"group min-w-0 rounded border border-border bg-slate-50/60",open:o,onToggle:u=>l(u.currentTarget.open),children:[s.jsxs("summary",{className:"grid cursor-pointer list-none gap-1 px-2 py-1.5 marker:hidden hover:bg-white",children:[s.jsxs("div",{className:"grid min-w-0 gap-1 sm:flex sm:items-center sm:justify-between sm:gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[s.jsx(pn,{className:"h-3.5 w-3.5 shrink-0 text-muted transition-transform group-open:rotate-180","aria-hidden":!0}),s.jsx("span",{className:"truncate font-mono text-[11px] font-semibold text-muted",children:e}),n&&n>1?s.jsx("span",{className:"rounded-sm border border-border px-1 font-mono text-[10px] text-muted",children:n}):null]}),s.jsx("span",{className:"min-w-0 truncate pl-5 font-mono text-[11px] text-muted sm:shrink-0 sm:pl-0",children:t})]}),s.jsx("div",{className:"min-w-0 break-words pl-5 text-xs text-foreground [overflow-wrap:anywhere] sm:truncate",children:r})]}),s.jsx("div",{className:"min-w-0 border-t border-border bg-white px-2 py-2",children:a})]})}function qa({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 s.jsx("div",{className:"h-56",children:s.jsx(jr,{width:"100%",height:"100%",children:s.jsxs(Ri,{data:n,children:[s.jsx(kr,{strokeDasharray:"3 3"}),s.jsx(Nr,{dataKey:"name"}),s.jsx(Sr,{tickFormatter:Qe}),s.jsx(Cr,{formatter:r=>[Qe(Number(r)),e]}),s.jsx(mr,{dataKey:"seconds",fill:"#0969da",radius:[4,4,0,0]})]})})})}function $f({values:e,loading:t,totalJobs:n}){const r=Object.entries(e??{}).map(([i,a])=>({day:i,count:a}));return t&&r.length===0?s.jsx(ee,{text:"Loading job history..."}):r.length===0?s.jsx(ee,{text:n>0?"Job history has no valid creation dates.":"No job history available."}):s.jsx("div",{className:"h-56",children:s.jsx(jr,{width:"100%",height:"100%",children:s.jsxs(Ri,{data:r,children:[s.jsx(kr,{strokeDasharray:"3 3"}),s.jsx(Nr,{dataKey:"day",minTickGap:16}),s.jsx(Sr,{allowDecimals:!1}),s.jsx(Cr,{formatter:i=>[Number(i),"jobs"]}),s.jsx(mr,{dataKey:"count",fill:"#16a34a",radius:[4,4,0,0]})]})})})}function Hf({usage:e,loading:t,totalJobs:n}){const[r,i]=A.useState("day"),a=(e==null?void 0:e[r])??[],o=a.map(u=>({...u,label:Qf(u.bucket,r)})),l=a.reduce((u,c)=>u+c.seconds,0);return t&&o.length===0?s.jsx(ee,{text:"Loading runtime usage..."}):o.length===0?s.jsx(ee,{text:n>0?"No jobs have recorded runtime yet.":"No job history available."}):s.jsxs("div",{className:"grid gap-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted",children:[s.jsx(Eu,{className:"h-4 w-4","aria-hidden":!0}),s.jsxs("span",{children:[ur(l)," consumed across ",a.reduce((u,c)=>u+c.jobs,0)," job",a.reduce((u,c)=>u+c.jobs,0)===1?"":"s"]})]}),s.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=>s.jsx("button",{className:G("rounded px-2.5 text-xs font-semibold capitalize",r===u?"bg-primary text-white":"text-muted hover:bg-slate-50"),type:"button",onClick:()=>i(u),children:u},u))})]}),s.jsx("div",{className:"h-64",children:s.jsx(jr,{width:"100%",height:"100%",children:s.jsxs(Ri,{data:o,children:[s.jsx(kr,{strokeDasharray:"3 3"}),s.jsx(Nr,{dataKey:"label",minTickGap:16,tick:{fontSize:11}}),s.jsx(Sr,{tickFormatter:u=>ur(Number(u))}),s.jsx(Cl,{}),s.jsx(Cr,{formatter:(u,c)=>c==="Work"?[ur(Number(u)),"work"]:c==="Review"?[ur(Number(u)),"review"]:[Number(u),String(c)],labelFormatter:u=>String(u)}),s.jsx(mr,{dataKey:"work_seconds",name:"Work",stackId:"runtime",fill:"#0969da",isAnimationActive:!1}),s.jsx(mr,{dataKey:"review_seconds",name:"Review",stackId:"runtime",fill:"#8250df",radius:[4,4,0,0],isAnimationActive:!1})]})})})]})}function Qf(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,i]=e.split("-").map(Number);return!n||!r||!i?e:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(new Date(n,r-1,i))}function ur(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),i=n%60;return i===0?`${r}h`:`${r}h ${i}m`}function Ua(e){return Object.values(e).reduce((t,n)=>t+n,0)}function Kf({data:e,loading:t}){if(t&&!e)return s.jsx(ee,{text:"Loading systemd units..."});if(!e)return s.jsx(ee,{text:"No systemd snapshot available."});const n=e.units??[],r=n.filter(o=>o.active_state==="active").length,i=n.filter(o=>o.active_state==="failed"||o.result==="failed").length,a=n.filter(o=>o.kind==="timer").length;return s.jsxs("div",{className:"grid min-w-0 gap-3",children:[e.errors.length>0?s.jsx(Ne,{tone:"error",text:e.errors[0]}):null,n.length===0?s.jsx(ee,{text:"No configured bridge units found."}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[s.jsx(cr,{label:"Units",value:String(n.length)}),s.jsx(cr,{label:"Active",value:String(r)}),s.jsx(cr,{label:"Failed",value:String(i),tone:i>0?"bad":"neutral"}),s.jsx(cr,{label:"Timers",value:String(a)})]}),s.jsxs("div",{className:"overflow-hidden rounded-md border border-border bg-white",children:[s.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:[s.jsx("span",{children:"Unit"}),s.jsx("span",{children:"Status"}),s.jsx("span",{children:"State"}),s.jsx("span",{children:"PID"}),s.jsx("span",{children:"Schedule"})]}),s.jsx("div",{className:"divide-y divide-border",children:n.map(o=>s.jsx(Vf,{unit:o},o.unit))})]})]})]})}function cr({label:e,value:t,tone:n="neutral"}){return s.jsxs("div",{className:G("min-w-0 rounded-md border bg-white px-3 py-2",n==="bad"?"border-red-200":"border-border"),children:[s.jsx("div",{className:G("font-mono text-lg font-semibold",n==="bad"?"text-red-700":"text-foreground"),children:t}),s.jsx("div",{className:"mt-0.5 text-[11px] font-semibold uppercase text-muted",children:e})]})}function Vf({unit:e}){const[t,n]=A.useState(!1),r=e.active_state==="active",i=e.active_state==="failed"||e.result==="failed",a=e.next_elapse||e.last_trigger||"n/a";return s.jsxs("details",{className:"group min-w-0",open:t,onToggle:o=>n(o.currentTarget.open),children:[s.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:[s.jsxs("div",{className:"col-span-2 min-w-0 md:col-span-1",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(pn,{className:"h-3.5 w-3.5 shrink-0 text-muted transition-transform group-open:rotate-180","aria-hidden":!0}),s.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",children:e.unit})]}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 pl-5 text-[11px] font-semibold uppercase text-muted",children:[s.jsx("span",{children:e.role}),s.jsx("span",{children:e.kind}),s.jsx("span",{children:e.load_state}),s.jsx("span",{children:t?"following log":"expand log"})]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:block",children:[s.jsx("span",{className:"text-[11px] font-semibold uppercase text-muted md:hidden",children:"Status"}),s.jsx("span",{className:G("inline-flex h-6 items-center rounded-full border px-2 text-xs font-semibold",i?"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})]}),s.jsx($a,{label:"State",value:e.sub_state,detail:e.result||"unknown"}),s.jsx($a,{label:"PID",value:e.main_pid?String(e.main_pid):"n/a",detail:Qe(e.uptime_seconds)}),s.jsxs("div",{className:"col-span-2 min-w-0 md:col-span-1",children:[s.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted md:hidden",children:"Schedule"}),s.jsx("div",{className:"truncate font-mono text-[11px] text-foreground",title:a,children:e.next_elapse?`next ${e.next_elapse}`:a})]})]}),s.jsx("div",{className:"border-t border-border bg-slate-50 px-3 pb-3 pt-2",children:s.jsx(Gf,{unit:e.unit,active:t})})]})}function $a({label:e,value:t,detail:n}){return s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted md:hidden",children:e}),s.jsx("div",{className:"truncate font-mono text-[11px] text-foreground",children:t}),n?s.jsx("div",{className:"truncate font-mono text-[11px] text-muted",children:n}):null]})}function Gf({unit:e,active:t}){const[n,r]=A.useState([]),[i,a]=A.useState(""),o=A.useRef(null);return A.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=vr(u);c&&r(d=>[...d.slice(-199),c])}),l.addEventListener("journal_error",u=>{const c=vr(u);a((c==null?void 0:c.error)??"journal stream failed")}),l.onerror=()=>{},()=>l.close()},[t,e]),A.useEffect(()=>{const l=o.current;l&&(l.scrollTop=l.scrollHeight)},[n]),s.jsxs("div",{className:"grid min-w-0 gap-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted",children:"Live journal"}),s.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"})]}),s.jsx("div",{className:"font-mono text-[11px] text-muted",children:"journalctl -f"})]}),i?s.jsx(Ne,{tone:"error",text:i}):null,s.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)=>s.jsx("div",{className:"break-words [overflow-wrap:anywhere]",children:l.line},`${l.unit}-${u}`)):s.jsx("div",{className:"text-slate-400",children:"No journal lines received yet."})})]})}function Wf({data:e,loading:t}){var h,m,p,y,w,v;if(t&&!e)return s.jsx(ee,{text:"Loading process activity..."});if(!e)return s.jsx(ee,{text:"No process snapshot available."});const n=e.executor.children??[],r=n.flatMap(b=>vl(b)),i=r.reduce((b,N)=>b+N.cpu_ticks,0),a=r.reduce((b,N)=>b+Xf(N),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:Ln(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 s.jsxs("div",{className:"grid gap-4",children:[s.jsx("div",{className:"rounded-md border border-slate-200 bg-slate-50 p-3",children:s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:G("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"}),s.jsxs("span",{className:"font-mono text-xs text-muted",children:["service ",e.executor.service]})]}),s.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?s.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.running_jobs.slice(0,4).map(b=>s.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:[s.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?s.jsxs("p",{className:"mt-1 text-xs text-muted",children:["Last persisted sample ",Ln(d.ts)," · ",d.active_since_last_sample?"activity observed":`quiet ${Qe(d.idle_seconds)}`]}):null,s.jsx("p",{className:"mt-1 text-xs text-muted",children:e.detail})]}),s.jsxs("div",{className:"grid min-w-[190px] grid-cols-3 gap-2 text-center text-xs",children:[s.jsx(Zr,{label:"PID",value:e.executor.pid?String(e.executor.pid):"n/a"}),s.jsx(Zr,{label:"Children",value:String(r.length)}),s.jsx(Zr,{label:"CPU ticks",value:String(i)})]})]})}),s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsx(dr,{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`}),s.jsx(dr,{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 ${Ln(d.ts)}`:"no sample"}),s.jsx(dr,{label:"Semantic progress",value:(w=e.signals)!=null&&w.semantic_progress.length?"recent":"none",detail:Ha(e.running_jobs,"semantic_progress")}),s.jsx(dr,{label:"Visible progress",value:(v=e.signals)!=null&&v.visible_progress.length?"streaming":"none",detail:Ha(e.running_jobs,"visible_progress")})]}),e.alerts.length>0?s.jsx(Ne,{tone:"error",text:e.alerts[0]}):null,s.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)]",children:[s.jsxs("div",{className:"min-w-0 rounded-md border border-border p-3",children:[s.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[s.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold",children:[s.jsx(Gs,{className:"h-4 w-4","aria-hidden":!0}),u.length>0?"CPU history":"CPU ticks"]}),s.jsxs("span",{className:"font-mono text-xs text-muted",children:[jl(a)," I/O"]})]}),c.length>0?s.jsx("div",{className:"h-40",children:s.jsx(jr,{width:"100%",height:"100%",children:s.jsxs(El,{data:c,children:[s.jsx(kr,{strokeDasharray:"3 3"}),s.jsx(Nr,{dataKey:"label",tick:!1}),s.jsx(Sr,{allowDecimals:!1,tick:{fontSize:11}}),s.jsx(Cr,{formatter:b=>[Number(b),"cpu ticks"]}),s.jsx(Pl,{type:"monotone",dataKey:"ticks",stroke:"#0f766e",strokeWidth:2,dot:{r:3},activeDot:{r:5},isAnimationActive:!1})]})})}):s.jsx(ee,{text:"No executor CPU samples available."})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[s.jsx(Gs,{className:"h-4 w-4","aria-hidden":!0}),"Executor children"]}),n.length>0?s.jsx("div",{className:"grid gap-2",children:n.map(b=>s.jsx(wl,{process:b},b.pid))}):s.jsx(ee,{text:"No child process detected for the executor."})]})]})]})}function Jf({alerts:e,loading:t,now:n}){if(t&&!e)return s.jsx(ee,{text:"Loading monitor alerts..."});const r=e??[];return r.length===0?s.jsx(ee,{text:"No active monitor alerts."}):s.jsx("div",{className:"grid gap-2",children:r.slice(0,5).map(i=>s.jsxs("div",{className:"rounded-md border border-red-200 bg-red-50 p-2.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs font-semibold text-red-700",children:[s.jsx(Fi,{className:"h-3.5 w-3.5","aria-hidden":!0}),s.jsx("span",{children:i.severity}),s.jsx("span",{className:"font-normal text-red-600",children:ul(i.last_seen,n)}),i.observations>1?s.jsxs("span",{className:"rounded-full border border-red-200 bg-white px-1.5",children:[i.observations,"x"]}):null]}),s.jsx("p",{className:"mt-1 break-words text-sm font-medium text-red-950 [overflow-wrap:anywhere]",children:i.message})]},i.fingerprint))})}function wl({process:e}){var r,i;const t=((r=e.io_bytes)==null?void 0:r.read_bytes)??0,n=((i=e.io_bytes)==null?void 0:i.write_bytes)??0;return s.jsxs("div",{className:"rounded-md border border-border bg-white p-2.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[s.jsxs("span",{className:"font-mono",children:["pid ",e.pid]}),s.jsxs("span",{className:"rounded-full border border-border px-2 text-xs text-muted",children:["state ",e.state]}),s.jsxs("span",{className:"rounded-full border border-border px-2 text-xs text-muted",children:["cpu ",e.cpu_ticks]}),s.jsxs("span",{className:"rounded-full border border-border px-2 text-xs text-muted",children:["I/O ",jl(t+n)]})]}),s.jsx("div",{className:"mt-2 break-words font-mono text-xs text-muted",children:e.cmd||"unknown command"}),e.children&&e.children.length>0?s.jsx("div",{className:"mt-3 border-l-2 border-border pl-3",children:e.children.map(a=>s.jsx(wl,{process:a},a.pid))}):null]})}function Zr({label:e,value:t}){return s.jsxs("div",{className:"rounded-md border border-border bg-white px-2 py-2",children:[s.jsx("div",{className:"font-mono text-sm font-semibold text-foreground",children:t}),s.jsx("div",{className:"mt-0.5 text-[11px] font-semibold uppercase text-muted",children:e})]})}function dr({label:e,value:t,detail:n}){return s.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-2.5",children:[s.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted",children:e}),s.jsx("div",{className:"mt-1 truncate text-sm font-semibold text-foreground",children:t}),s.jsx("div",{className:"mt-1 truncate font-mono text-[11px] text-muted",children:n})]})}function Ha(e,t){const n=e.find(i=>i[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 Xf(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 jl(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function he({label:e,value:t}){return s.jsxs("div",{className:"min-w-0 rounded-md border border-border p-3",children:[s.jsx("div",{className:"text-xs font-semibold text-muted",children:e}),s.jsx("div",{className:"mt-1 min-w-0 break-words text-sm [overflow-wrap:anywhere]",children:t})]})}function ns({status:e}){const t=Bm(e),n=e==="running"||e==="pending";return s.jsxs("span",{className:G("inline-flex min-h-6 items-center gap-1.5 rounded-full border px-2 text-xs font-semibold",t.badge),children:[s.jsx("span",{className:G("h-2.5 w-2.5 rounded-full",t.dot,n&&"animate-live-pulse"),"aria-hidden":!0}),e]})}function ee({text:e}){return s.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 s.jsx("div",{className:G("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 ht({onClick:e,compactOnMobile:t=!1}){return s.jsxs("button",{className:G("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:[s.jsx(Oi,{className:"h-4 w-4","aria-hidden":!0}),s.jsx("span",{className:G(t&&"hidden sm:inline"),children:"Refresh"})]})}const Qa=document.getElementById("root");Qa&&Ll.createRoot(Qa).render(s.jsx(A.StrictMode,{children:s.jsx(ou,{client:Pm,children:s.jsx(tf,{})})})); diff --git a/src/github_agent_bridge/dashboard_static/assets/index-lIzCm8Xd.js b/src/github_agent_bridge/dashboard_static/assets/index-lIzCm8Xd.js new file mode 100644 index 0000000..05ebcd0 --- /dev/null +++ b/src/github_agent_bridge/dashboard_static/assets/index-lIzCm8Xd.js @@ -0,0 +1,187 @@ +var Ls=e=>{throw TypeError(e)};var Dr=(e,t,n)=>t.has(e)||Ls("Cannot "+n);var g=(e,t,n)=>(Dr(e,t,"read from private field"),n?n.call(e):t.get(e)),U=(e,t,n)=>t.has(e)?Ls("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),M=(e,t,n,r)=>(Dr(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),X=(e,t,n)=>(Dr(e,t,"access private method"),n);var ur=(e,t,n,r)=>({set _(s){M(e,t,s,n)},get _(){return g(e,t,r)}});import{f as So,h as Co,g as Ri,r as ve,R as A,d as Wn,a as _r,C as Jn,X as Xn,Y as Yn,T as Zn,L as nl,B as $t,e as _o,c as Eo,b as Po}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 l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).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 Fr={exports:{}},jn={};/** + * @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 Ms;function Ro(){if(Ms)return jn;Ms=1;var e=So(),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 l(o,u,c){var d,p={},m=null,h=null;c!==void 0&&(m=""+c),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(h=u.ref);for(d in u)r.call(u,d)&&!a.hasOwnProperty(d)&&(p[d]=u[d]);if(o&&o.defaultProps)for(d in u=o.defaultProps,u)p[d]===void 0&&(p[d]=u[d]);return{$$typeof:t,type:o,key:m,ref:h,props:p,_owner:s.current}}return jn.Fragment=n,jn.jsx=l,jn.jsxs=l,jn}var Os;function Io(){return Os||(Os=1,Fr.exports=Ro()),Fr.exports}var i=Io(),cr={},Ds;function To(){if(Ds)return cr;Ds=1;var e=Co();return cr.createRoot=e.createRoot,cr.hydrateRoot=e.hydrateRoot,cr}var Ao=To();const Lo=Ri(Ao);var er=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(){}},Lt,jt,Zt,Qa,Mo=(Qa=class extends er{constructor(){super();U(this,Lt);U(this,jt);U(this,Zt);M(this,Zt,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){g(this,jt)||this.setEventListener(g(this,Zt))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,jt))==null||t.call(this),M(this,jt,void 0))}setEventListener(t){var n;M(this,Zt,t),(n=g(this,jt))==null||n.call(this),M(this,jt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){g(this,Lt)!==t&&(M(this,Lt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof g(this,Lt)=="boolean"?g(this,Lt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Lt=new WeakMap,jt=new WeakMap,Zt=new WeakMap,Qa),Ii=new Mo,Oo={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},kt,Pi,Va,Do=(Va=class{constructor(){U(this,kt,Oo);U(this,Pi,!1)}setTimeoutProvider(e){M(this,kt,e)}setTimeout(e,t){return g(this,kt).setTimeout(e,t)}clearTimeout(e){g(this,kt).clearTimeout(e)}setInterval(e,t){return g(this,kt).setInterval(e,t)}clearInterval(e){g(this,kt).clearInterval(e)}},kt=new WeakMap,Pi=new WeakMap,Va),At=new Do;function Fo(e){setTimeout(e,0)}var zo=typeof window>"u"||"Deno"in globalThis;function Ae(){}function Bo(e,t){return typeof e=="function"?e(t):e}function ti(e){return typeof e=="number"&&e>=0&&e!==1/0}function rl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rt(e,t){return typeof e=="function"?e(t):e}function Fe(e,t){return typeof e=="function"?e(t):e}function Fs(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:l,stale:o}=e;if(l){if(r){if(t.queryHash!==Ti(l,t.options))return!1}else if(!Dn(t.queryKey,l))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||s&&s!==t.state.fetchStatus||a&&!a(t))}function zs(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(On(t.options.mutationKey)!==On(a))return!1}else if(!Dn(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Ti(e,t){return((t==null?void 0:t.queryKeyHashFn)||On)(e)}function On(e){return JSON.stringify(e,(t,n)=>ri(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Dn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Dn(e[n],t[n])):!1}var qo=Object.prototype.hasOwnProperty;function il(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Bs(e)&&Bs(t);if(!r&&!(ri(e)&&ri(t)))return t;const a=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),o=l.length,u=r?new Array(o):{};let c=0;for(let d=0;d{At.setTimeout(t,e)})}function ii(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?il(e,t):t}function $o(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ho(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ai=Symbol();function sl(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ai?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function al(e,t){return typeof e=="function"?e(...t):!!e}function Ko(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 Fn=(()=>{let e=()=>zo;return{isServer(){return e()},setIsServer(t){e=t}}})();function si(){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 Qo=Fo;function Vo(){let e=[],t=0,n=o=>{o()},r=o=>{o()},s=Qo;const a=o=>{t?e.push(o):s(()=>{n(o)})},l=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(u=>{n(u)})})})};return{batch:o=>{let u;t++;try{u=o()}finally{t--,t||l()}return u},batchCalls:o=>(...u)=>{a(()=>{o(...u)})},schedule:a,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}var we=Vo(),en,Nt,tn,Ga,Go=(Ga=class extends er{constructor(){super();U(this,en,!0);U(this,Nt);U(this,tn);M(this,tn,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,Nt)||this.setEventListener(g(this,tn))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,Nt))==null||t.call(this),M(this,Nt,void 0))}setEventListener(t){var n;M(this,tn,t),(n=g(this,Nt))==null||n.call(this),M(this,Nt,t(this.setOnline.bind(this)))}setOnline(t){g(this,en)!==t&&(M(this,en,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return g(this,en)}},en=new WeakMap,Nt=new WeakMap,tn=new WeakMap,Ga),wr=new Go;function Wo(e){return Math.min(1e3*2**e,3e4)}function ll(e){return(e??"online")==="online"?wr.isOnline():!0}var ai=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ol(e){let t=!1,n=0,r;const s=si(),a=()=>s.status!=="pending",l=w=>{var v;if(!a()){const b=new ai(w);m(b),(v=e.onCancel)==null||v.call(e,b)}},o=()=>{t=!0},u=()=>{t=!1},c=()=>Ii.isFocused()&&(e.networkMode==="always"||wr.isOnline())&&e.canRun(),d=()=>ll(e.networkMode)&&e.canRun(),p=w=>{a()||(r==null||r(),s.resolve(w))},m=w=>{a()||(r==null||r(),s.reject(w))},h=()=>new Promise(w=>{var v;r=b=>{(a()||c())&&w(b)},(v=e.onPause)==null||v.call(e)}).then(()=>{var w;r=void 0,a()||(w=e.onContinue)==null||w.call(e)}),y=()=>{if(a())return;let w;const v=n===0?e.initialPromise:void 0;try{w=v??e.fn()}catch(b){w=Promise.reject(b)}Promise.resolve(w).then(p).catch(b=>{var j;if(a())return;const N=e.retry??(Fn.isServer()?0:3),_=e.retryDelay??Wo,S=typeof _=="function"?_(n,b):_,D=N===!0||typeof N=="number"&&nc()?void 0:h()).then(()=>{t?m(b):y()})})};return{promise:s,status:()=>s.status,cancel:l,continue:()=>(r==null||r(),s),cancelRetry:o,continueRetry:u,canStart:d,start:()=>(d()?y():h().then(y),s)}}var Mt,Wa,ul=(Wa=class{constructor(){U(this,Mt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ti(this.gcTime)&&M(this,Mt,At.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fn.isServer()?1/0:300*1e3))}clearGcTimeout(){g(this,Mt)!==void 0&&(At.clearTimeout(g(this,Mt)),M(this,Mt,void 0))}},Mt=new WeakMap,Wa);function Jo(e){return{onFetch:(t,n)=>{var d,p,m,h,y;const r=t.options,s=(m=(p=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,a=((h=t.state.data)==null?void 0:h.pages)||[],l=((y=t.state.data)==null?void 0:y.pageParams)||[];let o={pages:[],pageParams:[]},u=0;const c=async()=>{let w=!1;const v=_=>{Ko(_,()=>t.signal,()=>w=!0)},b=sl(t.options,t.fetchOptions),N=async(_,S,D)=>{if(w)return Promise.reject(t.signal.reason);if(S==null&&_.pages.length)return Promise.resolve(_);const B=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:S,direction:D?"backward":"forward",meta:t.options.meta};return v(T),T})(),L=await b(B),{maxPages:C}=t.options,O=D?Ho:$o;return{pages:O(_.pages,L,C),pageParams:O(_.pageParams,S,C)}};if(s&&a.length){const _=s==="backward",S=_?Xo:Us,D={pages:a,pageParams:l},j=S(r,D);o=await N(D,j,_)}else{const _=e??a.length;do{const S=u===0?l[0]??r.initialPageParam:Us(r,o);if(u>0&&S==null)break;o=await N(o,S),u++}while(u<_)}return o};t.options.persister?t.fetchFn=()=>{var w,v;return(v=(w=t.options).persister)==null?void 0:v.call(w,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Us(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 Xo(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}var nn,Ot,rn,Ue,Dt,be,Hn,Ft,De,cl,ut,Ja,Yo=(Ja=class extends ul{constructor(t){super();U(this,De);U(this,nn);U(this,Ot);U(this,rn);U(this,Ue);U(this,Dt);U(this,be);U(this,Hn);U(this,Ft);M(this,Ft,!1),M(this,Hn,t.defaultOptions),this.setOptions(t.options),this.observers=[],M(this,Dt,t.client),M(this,Ue,g(this,Dt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,M(this,Ot,Hs(this.options)),this.state=t.state??g(this,Ot),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return g(this,nn)}get promise(){var t;return(t=g(this,be))==null?void 0:t.promise}setOptions(t){if(this.options={...g(this,Hn),...t},t!=null&&t._type&&M(this,nn,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Hs(this.options);n.data!==void 0&&(this.setState($s(n.data,n.dataUpdatedAt)),M(this,Ot,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&g(this,Ue).remove(this)}setData(t,n){const r=ii(this.state.data,t,this.options);return X(this,De,ut).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,De,ut).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=g(this,be))==null?void 0:r.promise;return(s=g(this,be))==null||s.cancel(t),n?n.then(Ae).catch(Ae):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return g(this,Ot)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Fe(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ai||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Rt(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:!rl(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=g(this,be))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=g(this,be))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),g(this,Ue).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,be)&&(g(this,Ft)||X(this,De,cl).call(this)?g(this,be).cancel({revert:!0}):g(this,be).cancelRetry()),this.scheduleGc()),g(this,Ue).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||X(this,De,ut).call(this,{type:"invalidate"})}async fetch(t,n){var c,d,p,m,h,y,w,v,b,N,_;if(this.state.fetchStatus!=="idle"&&((c=g(this,be))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(g(this,be))return g(this,be).continueRetry(),g(this,be).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(D=>D.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,s=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(M(this,Ft,!0),r.signal)})},a=()=>{const S=sl(this.options,n),j=(()=>{const B={client:g(this,Dt),queryKey:this.queryKey,meta:this.meta};return s(B),B})();return M(this,Ft,!1),this.options.persister?this.options.persister(S,j,this):S(j)},o=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:g(this,Dt),state:this.state,fetchFn:a};return s(S),S})(),u=g(this,nn)==="infinite"?Jo(this.options.pages):this.options.behavior;u==null||u.onFetch(o,this),M(this,rn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&X(this,De,ut).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta}),M(this,be,ol({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:S=>{S instanceof ai&&S.revert&&this.setState({...g(this,rn),fetchStatus:"idle"}),r.abort()},onFail:(S,D)=>{X(this,De,ut).call(this,{type:"failed",failureCount:S,error:D})},onPause:()=>{X(this,De,ut).call(this,{type:"pause"})},onContinue:()=>{X(this,De,ut).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const S=await g(this,be).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(h=(m=g(this,Ue).config).onSuccess)==null||h.call(m,S,this),(w=(y=g(this,Ue).config).onSettled)==null||w.call(y,S,this.state.error,this),S}catch(S){if(S instanceof ai){if(S.silent)return g(this,be).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw X(this,De,ut).call(this,{type:"error",error:S}),(b=(v=g(this,Ue).config).onError)==null||b.call(v,S,this),(_=(N=g(this,Ue).config).onSettled)==null||_.call(N,this.state.data,S,this),S}finally{this.scheduleGc()}}},nn=new WeakMap,Ot=new WeakMap,rn=new WeakMap,Ue=new WeakMap,Dt=new WeakMap,be=new WeakMap,Hn=new WeakMap,Ft=new WeakMap,De=new WeakSet,cl=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ut=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,...dl(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...$s(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return M(this,rn,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),we.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),g(this,Ue).notify({query:this,type:"updated",action:t})})},Ja);function dl(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ll(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $s(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Hs(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,Kn,_e,zt,sn,ct,St,Qn,an,ln,Bt,qt,Ct,on,re,Rn,li,oi,ui,ci,di,hi,pi,hl,Xa,Zo=(Xa=class extends er{constructor(t,n){super();U(this,re);U(this,Te);U(this,Y);U(this,Kn);U(this,_e);U(this,zt);U(this,sn);U(this,ct);U(this,St);U(this,Qn);U(this,an);U(this,ln);U(this,Bt);U(this,qt);U(this,Ct);U(this,on,new Set);this.options=n,M(this,Te,t),M(this,St,null),M(this,ct,si()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(g(this,Y).addObserver(this),Ks(g(this,Y),this.options)?X(this,re,Rn).call(this):this.updateResult(),X(this,re,ci).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return mi(g(this,Y),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return mi(g(this,Y),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,X(this,re,di).call(this),X(this,re,hi).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 Fe(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,re,pi).call(this),g(this,Y).setOptions(this.options),n._defaulted&&!ni(this.options,n)&&g(this,Te).getQueryCache().notify({type:"observerOptionsUpdated",query:g(this,Y),observer:this});const s=this.hasListeners();s&&Qs(g(this,Y),r,this.options,n)&&X(this,re,Rn).call(this),this.updateResult(),s&&(g(this,Y)!==r||Fe(this.options.enabled,g(this,Y))!==Fe(n.enabled,g(this,Y))||Rt(this.options.staleTime,g(this,Y))!==Rt(n.staleTime,g(this,Y)))&&X(this,re,li).call(this);const a=X(this,re,oi).call(this);s&&(g(this,Y)!==r||Fe(this.options.enabled,g(this,Y))!==Fe(n.enabled,g(this,Y))||a!==g(this,Ct))&&X(this,re,ui).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)&&(M(this,_e,r),M(this,sn,this.options),M(this,zt,g(this,Y).state)),r}getCurrentResult(){return g(this,_e)}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,ct).status==="pending"&&g(this,ct).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){g(this,on).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,re,Rn).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),g(this,_e)))}createResult(t,n){var C;const r=g(this,Y),s=this.options,a=g(this,_e),l=g(this,zt),o=g(this,sn),c=t!==r?t.state:g(this,Kn),{state:d}=t;let p={...d},m=!1,h;if(n._optimisticResults){const O=this.hasListeners(),T=!O&&Ks(t,n),E=O&&Qs(t,r,n,s);(T||E)&&(p={...p,...dl(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:y,errorUpdatedAt:w,status:v}=p;h=p.data;let b=!1;if(n.placeholderData!==void 0&&h===void 0&&v==="pending"){let O;a!=null&&a.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(O=a.data,b=!0):O=typeof n.placeholderData=="function"?n.placeholderData((C=g(this,ln))==null?void 0:C.state.data,g(this,ln)):n.placeholderData,O!==void 0&&(v="success",h=ii(a==null?void 0:a.data,O,n),m=!0)}if(n.select&&h!==void 0&&!b)if(a&&h===(l==null?void 0:l.data)&&n.select===g(this,Qn))h=g(this,an);else try{M(this,Qn,n.select),h=n.select(h),h=ii(a==null?void 0:a.data,h,n),M(this,an,h),M(this,St,null)}catch(O){M(this,St,O)}g(this,St)&&(y=g(this,St),h=g(this,an),w=Date.now(),v="error");const N=p.fetchStatus==="fetching",_=v==="pending",S=v==="error",D=_&&N,j=h!==void 0,L={status:v,fetchStatus:p.fetchStatus,isPending:_,isSuccess:v==="success",isError:S,isInitialLoading:D,isLoading:D,data:h,dataUpdatedAt:p.dataUpdatedAt,error:y,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>c.dataUpdateCount||p.errorUpdateCount>c.errorUpdateCount,isFetching:N,isRefetching:N&&!_,isLoadingError:S&&!j,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:S&&j,isStale:Li(t,n),refetch:this.refetch,promise:g(this,ct),isEnabled:Fe(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const O=L.data!==void 0,T=L.status==="error"&&!O,E=P=>{T?P.reject(L.error):O&&P.resolve(L.data)},V=()=>{const P=M(this,ct,L.promise=si());E(P)},F=g(this,ct);switch(F.status){case"pending":t.queryHash===r.queryHash&&E(F);break;case"fulfilled":(T||L.data!==F.value)&&V();break;case"rejected":(!T||L.error!==F.reason)&&V();break}}return L}updateResult(){const t=g(this,_e),n=this.createResult(g(this,Y),this.options);if(M(this,zt,g(this,Y).state),M(this,sn,this.options),g(this,zt).data!==void 0&&M(this,ln,g(this,Y)),ni(n,t))return;M(this,_e,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!g(this,on).size)return!0;const l=new Set(a??g(this,on));return this.options.throwOnError&&l.add("error"),Object.keys(g(this,_e)).some(o=>{const u=o;return g(this,_e)[u]!==t[u]&&l.has(u)})};X(this,re,hl).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&X(this,re,ci).call(this)}},Te=new WeakMap,Y=new WeakMap,Kn=new WeakMap,_e=new WeakMap,zt=new WeakMap,sn=new WeakMap,ct=new WeakMap,St=new WeakMap,Qn=new WeakMap,an=new WeakMap,ln=new WeakMap,Bt=new WeakMap,qt=new WeakMap,Ct=new WeakMap,on=new WeakMap,re=new WeakSet,Rn=function(t){X(this,re,pi).call(this);let n=g(this,Y).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ae)),n},li=function(){X(this,re,di).call(this);const t=Rt(this.options.staleTime,g(this,Y));if(Fn.isServer()||g(this,_e).isStale||!ti(t))return;const r=rl(g(this,_e).dataUpdatedAt,t)+1;M(this,Bt,At.setTimeout(()=>{g(this,_e).isStale||this.updateResult()},r))},oi=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(g(this,Y)):this.options.refetchInterval)??!1},ui=function(t){X(this,re,hi).call(this),M(this,Ct,t),!(Fn.isServer()||Fe(this.options.enabled,g(this,Y))===!1||!ti(g(this,Ct))||g(this,Ct)===0)&&M(this,qt,At.setInterval(()=>{(this.options.refetchIntervalInBackground||Ii.isFocused())&&X(this,re,Rn).call(this)},g(this,Ct)))},ci=function(){X(this,re,li).call(this),X(this,re,ui).call(this,X(this,re,oi).call(this))},di=function(){g(this,Bt)!==void 0&&(At.clearTimeout(g(this,Bt)),M(this,Bt,void 0))},hi=function(){g(this,qt)!==void 0&&(At.clearInterval(g(this,qt)),M(this,qt,void 0))},pi=function(){const t=g(this,Te).getQueryCache().build(g(this,Te),this.options);if(t===g(this,Y))return;const n=g(this,Y);M(this,Y,t),M(this,Kn,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},hl=function(t){we.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(g(this,_e))}),g(this,Te).getQueryCache().notify({query:g(this,Y),type:"observerResultsUpdated"})})},Xa);function eu(e,t){return Fe(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Fe(t.retryOnMount,e)===!1)}function Ks(e,t){return eu(e,t)||e.state.data!==void 0&&mi(e,t,t.refetchOnMount)}function mi(e,t,n){if(Fe(t.enabled,e)!==!1&&Rt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Li(e,t)}return!1}function Qs(e,t,n,r){return(e!==t||Fe(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Li(e,n)}function Li(e,t){return Fe(t.enabled,e)!==!1&&e.isStaleByTime(Rt(t.staleTime,e))}function tu(e,t){return!ni(e.getCurrentResult(),t)}var Vn,Ze,Ne,Ut,et,vt,Ya,nu=(Ya=class extends ul{constructor(t){super();U(this,et);U(this,Vn);U(this,Ze);U(this,Ne);U(this,Ut);M(this,Vn,t.client),this.mutationId=t.mutationId,M(this,Ne,t.mutationCache),M(this,Ze,[]),this.state=t.state||ru(),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,Ze).includes(t)||(g(this,Ze).push(t),this.clearGcTimeout(),g(this,Ne).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){M(this,Ze,g(this,Ze).filter(n=>n!==t)),this.scheduleGc(),g(this,Ne).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){g(this,Ze).length||(this.state.status==="pending"?this.scheduleGc():g(this,Ne).remove(this))}continue(){var t;return((t=g(this,Ut))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,o,u,c,d,p,m,h,y,w,v,b,N,_,S,D,j,B;const n=()=>{X(this,et,vt).call(this,{type:"continue"})},r={client:g(this,Vn),meta:this.options.meta,mutationKey:this.options.mutationKey};M(this,Ut,ol({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,C)=>{X(this,et,vt).call(this,{type:"failed",failureCount:L,error:C})},onPause:()=>{X(this,et,vt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>g(this,Ne).canRun(this)}));const s=this.state.status==="pending",a=!g(this,Ut).canStart();try{if(s)n();else{X(this,et,vt).call(this,{type:"pending",variables:t,isPaused:a}),g(this,Ne).config.onMutate&&await g(this,Ne).config.onMutate(t,this,r);const C=await((o=(l=this.options).onMutate)==null?void 0:o.call(l,t,r));C!==this.state.context&&X(this,et,vt).call(this,{type:"pending",context:C,variables:t,isPaused:a})}const L=await g(this,Ut).start();return await((c=(u=g(this,Ne).config).onSuccess)==null?void 0:c.call(u,L,t,this.state.context,this,r)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,L,t,this.state.context,r)),await((h=(m=g(this,Ne).config).onSettled)==null?void 0:h.call(m,L,null,this.state.variables,this.state.context,this,r)),await((w=(y=this.options).onSettled)==null?void 0:w.call(y,L,null,t,this.state.context,r)),X(this,et,vt).call(this,{type:"success",data:L}),L}catch(L){try{await((b=(v=g(this,Ne).config).onError)==null?void 0:b.call(v,L,t,this.state.context,this,r))}catch(C){Promise.reject(C)}try{await((_=(N=this.options).onError)==null?void 0:_.call(N,L,t,this.state.context,r))}catch(C){Promise.reject(C)}try{await((D=(S=g(this,Ne).config).onSettled)==null?void 0:D.call(S,void 0,L,this.state.variables,this.state.context,this,r))}catch(C){Promise.reject(C)}try{await((B=(j=this.options).onSettled)==null?void 0:B.call(j,void 0,L,t,this.state.context,r))}catch(C){Promise.reject(C)}throw X(this,et,vt).call(this,{type:"error",error:L}),L}finally{g(this,Ne).runNext(this)}}},Vn=new WeakMap,Ze=new WeakMap,Ne=new WeakMap,Ut=new WeakMap,et=new WeakSet,vt=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),we.batch(()=>{g(this,Ze).forEach(r=>{r.onMutationUpdate(t)}),g(this,Ne).notify({mutation:this,type:"updated",action:t})})},Ya);function ru(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var dt,Ve,Gn,Za,iu=(Za=class extends er{constructor(t={}){super();U(this,dt);U(this,Ve);U(this,Gn);this.config=t,M(this,dt,new Set),M(this,Ve,new Map),M(this,Gn,0)}build(t,n,r){const s=new nu({client:t,mutationCache:this,mutationId:++ur(this,Gn)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){g(this,dt).add(t);const n=dr(t);if(typeof n=="string"){const r=g(this,Ve).get(n);r?r.push(t):g(this,Ve).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(g(this,dt).delete(t)){const n=dr(t);if(typeof n=="string"){const r=g(this,Ve).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,Ve).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=dr(t);if(typeof n=="string"){const r=g(this,Ve).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=dr(t);if(typeof n=="string"){const s=(r=g(this,Ve).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(){we.batch(()=>{g(this,dt).forEach(t=>{this.notify({type:"removed",mutation:t})}),g(this,dt).clear(),g(this,Ve).clear()})}getAll(){return Array.from(g(this,dt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>zs(n,r))}findAll(t={}){return this.getAll().filter(n=>zs(t,n))}notify(t){we.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return we.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ae))))}},dt=new WeakMap,Ve=new WeakMap,Gn=new WeakMap,Za);function dr(e){var t;return(t=e.options.scope)==null?void 0:t.id}var tt,el,su=(el=class extends er{constructor(t={}){super();U(this,tt);this.config=t,M(this,tt,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??Ti(s,n);let l=this.get(a);return l||(l=new Yo({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){g(this,tt).has(t.queryHash)||(g(this,tt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=g(this,tt).get(t.queryHash);n&&(t.destroy(),n===t&&g(this,tt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){we.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return g(this,tt).get(t)}getAll(){return[...g(this,tt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Fs(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Fs(t,r)):n}notify(t){we.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){we.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){we.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},tt=new WeakMap,el),de,_t,Et,un,cn,Pt,dn,hn,tl,au=(tl=class{constructor(e={}){U(this,de);U(this,_t);U(this,Et);U(this,un);U(this,cn);U(this,Pt);U(this,dn);U(this,hn);M(this,de,e.queryCache||new su),M(this,_t,e.mutationCache||new iu),M(this,Et,e.defaultOptions||{}),M(this,un,new Map),M(this,cn,new Map),M(this,Pt,0)}mount(){ur(this,Pt)._++,g(this,Pt)===1&&(M(this,dn,Ii.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,de).onFocus())})),M(this,hn,wr.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,de).onOnline())})))}unmount(){var e,t;ur(this,Pt)._--,g(this,Pt)===0&&((e=g(this,dn))==null||e.call(this),M(this,dn,void 0),(t=g(this,hn))==null||t.call(this),M(this,hn,void 0))}isFetching(e){return g(this,de).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return g(this,_t).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=g(this,de).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=g(this,de).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Rt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return g(this,de).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,de).get(r.queryHash),a=s==null?void 0:s.state.data,l=Bo(t,a);if(l!==void 0)return g(this,de).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return we.batch(()=>g(this,de).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,de).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=g(this,de);we.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=g(this,de);return we.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=we.batch(()=>g(this,de).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Ae).catch(Ae)}invalidateQueries(e,t={}){return we.batch(()=>(g(this,de).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=we.batch(()=>g(this,de).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,de).build(this,t);return n.isStaleByTime(Rt(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 wr.isOnline()?g(this,_t).resumePausedMutations():Promise.resolve()}getQueryCache(){return g(this,de)}getMutationCache(){return g(this,_t)}getDefaultOptions(){return g(this,Et)}setDefaultOptions(e){M(this,Et,e)}setQueryDefaults(e,t){g(this,un).set(On(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...g(this,un).values()],n={};return t.forEach(r=>{Dn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){g(this,cn).set(On(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...g(this,cn).values()],n={};return t.forEach(r=>{Dn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...g(this,Et).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ti(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===Ai&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...g(this,Et).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){g(this,de).clear(),g(this,_t).clear()}},de=new WeakMap,_t=new WeakMap,Et=new WeakMap,un=new WeakMap,cn=new WeakMap,Pt=new WeakMap,dn=new WeakMap,hn=new WeakMap,tl),pl=ve.createContext(void 0),ml=e=>{const t=ve.useContext(pl);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},lu=({client:e,children:t})=>(ve.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(pl.Provider,{value:e,children:t})),fl=ve.createContext(!1),ou=()=>ve.useContext(fl);fl.Provider;function uu(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var cu=ve.createContext(uu()),du=()=>ve.useContext(cu),hu=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?al(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},pu=e=>{ve.useEffect(()=>{e.clearReset()},[e])},mu=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||al(n,[e.error,r])),fu=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))}},xu=(e,t)=>e.isLoading&&e.isFetching&&!t,gu=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Vs=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function bu(e,t,n){var m,h,y,w;const r=ou(),s=du(),a=ml(),l=a.defaultQueryOptions(e);(h=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||h.call(m,l);const o=a.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",fu(l),hu(l,s,o),pu(s);const u=!a.getQueryCache().get(l.queryHash),[c]=ve.useState(()=>new t(a,l)),d=c.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(ve.useSyncExternalStore(ve.useCallback(v=>{const b=p?c.subscribe(we.batchCalls(v)):Ae;return c.updateResult(),b},[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),ve.useEffect(()=>{c.setOptions(l)},[l,c]),gu(l,d))throw Vs(l,c,s);if(mu({result:d,errorResetBoundary:s,throwOnError:l.throwOnError,query:o,suspense:l.suspense}))throw d.error;if((w=(y=a.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||w.call(y,l,d),l.experimental_prefetchInRender&&!Fn.isServer()&&xu(d,r)){const v=u?Vs(l,c,s):o==null?void 0:o.promise;v==null||v.catch(Ae).finally(()=>{c.updateResult()})}return l.notifyOnChangeProps?d:c.trackResult(d)}function ge(e,t){return bu(e,Zo)}/** + * @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(),xl=(...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 wu={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 vu=ve.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:l,...o},u)=>ve.createElement("svg",{ref:u,...wu,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:xl("lucide",s),...o},[...l.map(([c,d])=>ve.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 ae=(e,t)=>{const n=ve.forwardRef(({className:r,...s},a)=>ve.createElement(vu,{ref:a,iconNode:t,className:xl(`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 zn=ae("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 ju=ae("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 gl=ae("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 Mi=ae("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 mn=ae("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 fn=ae("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 Bn=ae("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 bl=ae("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 Gs=ae("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 pn=ae("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 yl=ae("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 ku=ae("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 Nu=ae("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 vr=ae("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 tr=ae("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 Su=ae("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 Oi=ae("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 qn=ae("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 Cu=ae("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 _u=ae("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 wl=ae("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 vl=ae("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 Eu=ae("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 fi=ae("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 Di=ae("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 Pu=ae("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 Kt=ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Ru(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Iu=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Tu=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Au={};function Ws(e,t){return(Au.jsx?Tu:Iu).test(e)}const Lu=/[ \t\n\f\r]/g;function Mu(e){return typeof e=="object"?e.type==="text"?Js(e.value):!1:Js(e)}function Js(e){return e.replace(Lu,"")===""}class nr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}nr.prototype.normal={};nr.prototype.property={};nr.prototype.space=void 0;function jl(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new nr(n,r,t)}function xi(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 Ou=0;const K=Qt(),xe=Qt(),gi=Qt(),R=Qt(),se=Qt(),Ht=Qt(),Oe=Qt();function Qt(){return 2**++Ou}const bi=Object.freeze(Object.defineProperty({__proto__:null,boolean:K,booleanish:xe,commaOrSpaceSeparated:Oe,commaSeparated:Ht,number:R,overloadedBoolean:gi,spaceSeparated:se},Symbol.toStringTag,{value:"Module"})),zr=Object.keys(bi);class Fi extends Me{constructor(t,n,r,s){let a=-1;if(super(t,n),Xs(this,"space",s),typeof r=="number")for(;++a4&&n.slice(0,4)==="data"&&qu.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Ys,Hu);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Ys.test(a)){let l=a.replace(Bu,$u);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=Fi}return new s(r,t)}function $u(e){return"-"+e.toLowerCase()}function Hu(e){return e.charAt(1).toUpperCase()}const Ku=jl([kl,Du,Cl,_l,El],"html"),zi=jl([kl,Fu,Cl,_l,El],"svg");function Qu(e){return e.join(" ").trim()}var Wt={},Br,Zs;function Vu(){if(Zs)return Br;Zs=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,o=/^\s+|\s+$/g,u=` +`,c="/",d="*",p="",m="comment",h="declaration";function y(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var N=1,_=1;function S(F){var P=F.match(t);P&&(N+=P.length);var q=F.lastIndexOf(u);_=~q?F.length-q:_+F.length}function D(){var F={line:N,column:_};return function(P){return P.position=new j(F),C(),P}}function j(F){this.start=F,this.end={line:N,column:_},this.source=b.source}j.prototype.content=v;function B(F){var P=new Error(b.source+":"+N+":"+_+": "+F);if(P.reason=F,P.filename=b.source,P.line=N,P.column=_,P.source=v,!b.silent)throw P}function L(F){var P=F.exec(v);if(P){var q=P[0];return S(q),v=v.slice(q.length),P}}function C(){L(n)}function O(F){var P;for(F=F||[];P=T();)P!==!1&&F.push(P);return F}function T(){var F=D();if(!(c!=v.charAt(0)||d!=v.charAt(1))){for(var P=2;p!=v.charAt(P)&&(d!=v.charAt(P)||c!=v.charAt(P+1));)++P;if(P+=2,p===v.charAt(P-1))return B("End of comment missing");var q=v.slice(2,P-2);return _+=2,S(q),v=v.slice(P),_+=2,F({type:m,comment:q})}}function E(){var F=D(),P=L(r);if(P){if(T(),!L(s))return B("property missing ':'");var q=L(a),W=F({type:h,property:w(P[0].replace(e,p)),value:q?w(q[0].replace(e,p)):p});return L(l),W}}function V(){var F=[];O(F);for(var P;P=E();)P!==!1&&(F.push(P),O(F));return F}return C(),V()}function w(v){return v?v.replace(o,p):p}return Br=y,Br}var ea;function Gu(){if(ea)return Wt;ea=1;var e=Wt&&Wt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.default=n;const t=e(Vu());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),o=typeof s=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:c,value:d}=u;o?s(c,d,u):d&&(a=a||{},a[c]=d)}),a}return Wt}var kn={},ta;function Wu(){if(ta)return kn;ta=1,Object.defineProperty(kn,"__esModule",{value:!0}),kn.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)},l=function(c,d){return d.toUpperCase()},o=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,o):c=c.replace(r,o),c.replace(t,l))};return kn.camelCase=u,kn}var Nn,na;function Ju(){if(na)return Nn;na=1;var e=Nn&&Nn.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(Gu()),n=Wu();function r(s,a){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(o,u){o&&u&&(l[(0,n.camelCase)(o,a)]=u)}),l}return r.default=r,Nn=r,Nn}var Xu=Ju();const Yu=Ri(Xu),Pl=Rl("end"),Bi=Rl("start");function Rl(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 Zu(e){const t=Bi(e),n=Pl(e);if(t&&n)return{start:t,end:n}}function Tn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ra(e.position):"start"in e||"end"in e?ra(e):"line"in e||"column"in e?yi(e):""}function yi(e){return ia(e&&e.line)+":"+ia(e&&e.column)}function ra(e){return yi(e&&e.start)+"-"+yi(e&&e.end)}function ia(e){return e&&typeof e=="number"?e:1}class Ce extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},l=!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&&(l=!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 o=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=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=Tn(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=l&&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}}Ce.prototype.file="";Ce.prototype.name="";Ce.prototype.reason="";Ce.prototype.message="";Ce.prototype.stack="";Ce.prototype.column=void 0;Ce.prototype.line=void 0;Ce.prototype.ancestors=void 0;Ce.prototype.cause=void 0;Ce.prototype.fatal=void 0;Ce.prototype.place=void 0;Ce.prototype.ruleId=void 0;Ce.prototype.source=void 0;const qi={}.hasOwnProperty,ec=new Map,tc=/[A-Z]/g,nc=new Set(["table","tbody","thead","tfoot","tr"]),rc=new Set(["td","th"]),Il="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ic(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=dc(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"?zi:Ku,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Tl(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function Tl(e,t,n){if(t.type==="element")return sc(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ac(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return oc(e,t,n);if(t.type==="mdxjsEsm")return lc(e,t);if(t.type==="root")return uc(e,t,n);if(t.type==="text")return cc(e,t)}function sc(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=zi,e.schema=s),e.ancestors.push(t);const a=Ll(e,t.tagName,!1),l=pc(e,t);let o=$i(e,t);return nc.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!Mu(u):!0})),Al(e,l,a,t),Ui(l,o),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function ac(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)}Un(e,t.position)}function lc(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Un(e,t.position)}function oc(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=zi,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:Ll(e,t.name,!0),l=mc(e,t),o=$i(e,t);return Al(e,l,a,t),Ui(l,o),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function uc(e,t,n){const r={};return Ui(r,$i(e,t)),e.create(t,e.Fragment,r,n)}function cc(e,t){return t.value}function Al(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ui(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function dc(e,t,n){return r;function r(s,a,l,o){const c=Array.isArray(l.children)?n:t;return o?c(a,l,o):c(a,l)}}function hc(e,t){return n;function n(r,s,a,l){const o=Array.isArray(a.children),u=Bi(r);return t(s,a,l,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function pc(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&qi.call(t.properties,s)){const a=fc(e,s,t.properties[s]);if(a){const[l,o]=a;e.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&rc.has(t.tagName)?r=o:n[l]=o}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function mc(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 l=a.expression;l.type;const o=l.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Un(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 o=r.value.data.estree.body[0];o.type,a=e.evaluater.evaluateExpression(o.expression)}else Un(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function $i(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:ec;for(;++rs?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a0?(rt(e,e.length,0,t),e):t}const la={}.hasOwnProperty;function kc(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 Xt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const nt=It(/[A-Za-z]/),ze=It(/[\dA-Za-z]/),Cc=It(/[#-'*+\--9=?A-Z^-~]/);function wi(e){return e!==null&&(e<32||e===127)}const vi=It(/\d/),_c=It(/[\dA-Fa-f]/),Ec=It(/[!-/:-@[-`{-~]/);function H(e){return e!==null&&e<-2}function Le(e){return e!==null&&(e<0||e===32)}function ee(e){return e===-2||e===-1||e===32}const Pc=It(new RegExp("\\p{P}|\\p{S}","u")),Rc=It(/\s/);function It(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function gn(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&a<57344){const o=e.charCodeAt(n+1);a<56320&&o>56319&&o<57344?(l=String.fromCharCode(a,o),s=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function oe(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(u){return ee(u)?(e.enter(n),o(u)):t(u)}function o(u){return ee(u)&&a++l))return;const B=t.events.length;let L=B,C,O;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(C){O=t.events[L][1].end;break}C=!0}for(b(r),j=B;j_;){const D=n[S];t.containerState=D[1],D[0].exit.call(t,e)}n.length=_}function N(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function Mc(e,t,n){return oe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ua(e){if(e===null||Le(e)||Rc(e))return 1;if(Pc(e))return 2}function Ki(e,t,n){const r=[];let s=-1;for(;++s1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},m={...e[n][1].start};ca(p,-u),ca(m,u),l={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},o={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:{...l.start},end:{...o.end}},e[r][1].end={...l.start},e[n][1].start={...o.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=$e(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=$e(c,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",a,t]]),c=$e(c,Ki(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=$e(c,[["exit",a,t],["enter",o,t],["exit",o,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=$e(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,rt(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&ee(j)?oe(e,N,"linePrefix",a+1)(j):N(j)}function N(j){return j===null||H(j)?e.check(da,w,S)(j):(e.enter("codeFlowValue"),_(j))}function _(j){return j===null||H(j)?(e.exit("codeFlowValue"),N(j)):(e.consume(j),_)}function S(j){return e.exit("codeFenced"),t(j)}function D(j,B,L){let C=0;return O;function O(P){return j.enter("lineEnding"),j.consume(P),j.exit("lineEnding"),T}function T(P){return j.enter("codeFencedFence"),ee(P)?oe(j,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):E(P)}function E(P){return P===o?(j.enter("codeFencedFenceSequence"),V(P)):L(P)}function V(P){return P===o?(C++,j.consume(P),V):C>=l?(j.exit("codeFencedFenceSequence"),ee(P)?oe(j,F,"whitespace")(P):F(P)):L(P)}function F(P){return P===null||H(P)?(j.exit("codeFencedFence"),B(P)):L(P)}}}function Vc(e,t,n){const r=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Ur={name:"codeIndented",tokenize:Wc},Gc={partial:!0,tokenize:Jc};function Wc(e,t,n){const r=this;return s;function s(c){return e.enter("codeIndented"),oe(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?l(c):n(c)}function l(c){return c===null?u(c):H(c)?e.attempt(Gc,l,u)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||H(c)?(e.exit("codeFlowValue"),l(c)):(e.consume(c),o)}function u(c){return e.exit("codeIndented"),t(c)}}function Jc(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):H(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):oe(e,a,"linePrefix",5)(l)}function a(l){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):H(l)?s(l):n(l)}}const Xc={name:"codeText",previous:Zc,resolve:Yc,tokenize:ed};function Yc(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&&Sn(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),Sn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Sn(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(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function ql(e,t,n,r,s,a,l,o,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return p;function p(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||wi(b)?n(b):(e.enter(r),e.enter(l),e.enter(o),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(o),e.enter("chunkString",{contentType:"string"}),h(b))}function h(b){return b===62?(e.exit("chunkString"),e.exit(o),m(b)):b===null||b===60||H(b)?n(b):(e.consume(b),b===92?y:h)}function y(b){return b===60||b===62||b===92?(e.consume(b),h):h(b)}function w(b){return!d&&(b===null||b===41||Le(b))?(e.exit("chunkString"),e.exit(o),e.exit(l),e.exit(r),t(b)):d999||h===null||h===91||h===93&&!u||h===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(a),e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):H(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(h))}function p(h){return h===null||h===91||h===93||H(h)||o++>999?(e.exit("chunkString"),d(h)):(e.consume(h),u||(u=!ee(h)),h===92?m:p)}function m(h){return h===91||h===92||h===93?(e.consume(h),o++,p):p(h)}}function $l(e,t,n,r,s,a){let l;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(s),e.consume(m),e.exit(s),l=m===40?41:m,u):n(m)}function u(m){return m===l?(e.enter(s),e.consume(m),e.exit(s),e.exit(r),t):(e.enter(a),c(m))}function c(m){return m===l?(e.exit(a),u(l)):m===null?n(m):H(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),oe(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===l||m===null||H(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?p:d)}function p(m){return m===l||m===92?(e.consume(m),d):d(m)}}function An(e,t){let n;return r;function r(s){return H(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):ee(s)?oe(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const od={name:"definition",tokenize:cd},ud={partial:!0,tokenize:dd};function cd(e,t,n){const r=this;let s;return a;function a(h){return e.enter("definition"),l(h)}function l(h){return Ul.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function o(h){return s=Xt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):n(h)}function u(h){return Le(h)?An(e,c)(h):c(h)}function c(h){return ql(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return e.attempt(ud,p,p)(h)}function p(h){return ee(h)?oe(e,m,"whitespace")(h):m(h)}function m(h){return h===null||H(h)?(e.exit("definition"),r.parser.defined.push(s),t(h)):n(h)}}function dd(e,t,n){return r;function r(o){return Le(o)?An(e,s)(o):n(o)}function s(o){return $l(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return ee(o)?oe(e,l,"whitespace")(o):l(o)}function l(o){return o===null||H(o)?t(o):n(o)}}const hd={name:"hardBreakEscape",tokenize:pd};function pd(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return H(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const md={name:"headingAtx",resolve:fd,tokenize:xd};function fd(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"},rt(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function xd(e,t,n){let r=0;return s;function s(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),l(d)}function l(d){return d===35&&r++<6?(e.consume(d),l):d===null||Le(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||H(d)?(e.exit("atxHeading"),t(d)):ee(d)?oe(e,o,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),o(d))}function c(d){return d===null||d===35||Le(d)?(e.exit("atxHeadingText"),o(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"],pa=["pre","script","style","textarea"],bd={concrete:!0,name:"htmlFlow",resolveTo:vd,tokenize:jd},yd={partial:!0,tokenize:Nd},wd={partial:!0,tokenize:kd};function vd(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 jd(e,t,n){const r=this;let s,a,l,o,u;return c;function c(x){return d(x)}function d(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),p}function p(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):nt(x)?(e.consume(x),l=String.fromCharCode(x),v):n(x)}function m(x){return x===45?(e.consume(x),s=2,h):x===91?(e.consume(x),s=5,o=0,y):nt(x)?(e.consume(x),s=4,r.interrupt?t:f):n(x)}function h(x){return x===45?(e.consume(x),r.interrupt?t:f):n(x)}function y(x){const je="CDATA[";return x===je.charCodeAt(o++)?(e.consume(x),o===je.length?r.interrupt?t:E:y):n(x)}function w(x){return nt(x)?(e.consume(x),l=String.fromCharCode(x),v):n(x)}function v(x){if(x===null||x===47||x===62||Le(x)){const je=x===47,We=l.toLowerCase();return!je&&!a&&pa.includes(We)?(s=1,r.interrupt?t(x):E(x)):gd.includes(l.toLowerCase())?(s=6,je?(e.consume(x),b):r.interrupt?t(x):E(x)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):a?N(x):_(x))}return x===45||ze(x)?(e.consume(x),l+=String.fromCharCode(x),v):n(x)}function b(x){return x===62?(e.consume(x),r.interrupt?t:E):n(x)}function N(x){return ee(x)?(e.consume(x),N):O(x)}function _(x){return x===47?(e.consume(x),O):x===58||x===95||nt(x)?(e.consume(x),S):ee(x)?(e.consume(x),_):O(x)}function S(x){return x===45||x===46||x===58||x===95||ze(x)?(e.consume(x),S):D(x)}function D(x){return x===61?(e.consume(x),j):ee(x)?(e.consume(x),D):_(x)}function j(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),u=x,B):ee(x)?(e.consume(x),j):L(x)}function B(x){return x===u?(e.consume(x),u=null,C):x===null||H(x)?n(x):(e.consume(x),B)}function L(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||Le(x)?D(x):(e.consume(x),L)}function C(x){return x===47||x===62||ee(x)?_(x):n(x)}function O(x){return x===62?(e.consume(x),T):n(x)}function T(x){return x===null||H(x)?E(x):ee(x)?(e.consume(x),T):n(x)}function E(x){return x===45&&s===2?(e.consume(x),q):x===60&&s===1?(e.consume(x),W):x===62&&s===4?(e.consume(x),le):x===63&&s===3?(e.consume(x),f):x===93&&s===5?(e.consume(x),me):H(x)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(yd,Pe,V)(x)):x===null||H(x)?(e.exit("htmlFlowData"),V(x)):(e.consume(x),E)}function V(x){return e.check(wd,F,Pe)(x)}function F(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),P}function P(x){return x===null||H(x)?V(x):(e.enter("htmlFlowData"),E(x))}function q(x){return x===45?(e.consume(x),f):E(x)}function W(x){return x===47?(e.consume(x),l="",pe):E(x)}function pe(x){if(x===62){const je=l.toLowerCase();return pa.includes(je)?(e.consume(x),le):E(x)}return nt(x)&&l.length<8?(e.consume(x),l+=String.fromCharCode(x),pe):E(x)}function me(x){return x===93?(e.consume(x),f):E(x)}function f(x){return x===62?(e.consume(x),le):x===45&&s===2?(e.consume(x),f):E(x)}function le(x){return x===null||H(x)?(e.exit("htmlFlowData"),Pe(x)):(e.consume(x),le)}function Pe(x){return e.exit("htmlFlow"),t(x)}}function kd(e,t,n){const r=this;return s;function s(l){return H(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function Nd(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Er,t,n)}}const Sd={name:"htmlText",tokenize:Cd};function Cd(e,t,n){const r=this;let s,a,l;return o;function o(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),D):f===63?(e.consume(f),_):nt(f)?(e.consume(f),L):n(f)}function c(f){return f===45?(e.consume(f),d):f===91?(e.consume(f),a=0,y):nt(f)?(e.consume(f),N):n(f)}function d(f){return f===45?(e.consume(f),h):n(f)}function p(f){return f===null?n(f):f===45?(e.consume(f),m):H(f)?(l=p,W(f)):(e.consume(f),p)}function m(f){return f===45?(e.consume(f),h):p(f)}function h(f){return f===62?q(f):f===45?m(f):p(f)}function y(f){const le="CDATA[";return f===le.charCodeAt(a++)?(e.consume(f),a===le.length?w:y):n(f)}function w(f){return f===null?n(f):f===93?(e.consume(f),v):H(f)?(l=w,W(f)):(e.consume(f),w)}function v(f){return f===93?(e.consume(f),b):w(f)}function b(f){return f===62?q(f):f===93?(e.consume(f),b):w(f)}function N(f){return f===null||f===62?q(f):H(f)?(l=N,W(f)):(e.consume(f),N)}function _(f){return f===null?n(f):f===63?(e.consume(f),S):H(f)?(l=_,W(f)):(e.consume(f),_)}function S(f){return f===62?q(f):_(f)}function D(f){return nt(f)?(e.consume(f),j):n(f)}function j(f){return f===45||ze(f)?(e.consume(f),j):B(f)}function B(f){return H(f)?(l=B,W(f)):ee(f)?(e.consume(f),B):q(f)}function L(f){return f===45||ze(f)?(e.consume(f),L):f===47||f===62||Le(f)?C(f):n(f)}function C(f){return f===47?(e.consume(f),q):f===58||f===95||nt(f)?(e.consume(f),O):H(f)?(l=C,W(f)):ee(f)?(e.consume(f),C):q(f)}function O(f){return f===45||f===46||f===58||f===95||ze(f)?(e.consume(f),O):T(f)}function T(f){return f===61?(e.consume(f),E):H(f)?(l=T,W(f)):ee(f)?(e.consume(f),T):C(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,V):H(f)?(l=E,W(f)):ee(f)?(e.consume(f),E):(e.consume(f),F)}function V(f){return f===s?(e.consume(f),s=void 0,P):f===null?n(f):H(f)?(l=V,W(f)):(e.consume(f),V)}function F(f){return f===null||f===34||f===39||f===60||f===61||f===96?n(f):f===47||f===62||Le(f)?C(f):(e.consume(f),F)}function P(f){return f===47||f===62||Le(f)?C(f):n(f)}function q(f){return f===62?(e.consume(f),e.exit("htmlTextData"),e.exit("htmlText"),t):n(f)}function W(f){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),pe}function pe(f){return ee(f)?oe(e,me,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):me(f)}function me(f){return e.enter("htmlTextData"),l(f)}}const Qi={name:"labelEnd",resolveAll:Rd,resolveTo:Id,tokenize:Td},_d={tokenize:Ad},Ed={tokenize:Ld},Pd={tokenize:Md};function Rd(e){let t=-1;const n=[];for(;++t=3&&(c===null||H(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===s?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),ee(c)?oe(e,o,"whitespace")(c):o(c))}}const Ie={continuation:{tokenize:Kd},exit:Vd,name:"list",tokenize:Hd},Ud={partial:!0,tokenize:Gd},$d={partial:!0,tokenize:Qd};function Hd(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,l=0;return o;function o(h){const y=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:vi(h)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(br,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return n(h)}function u(h){return vi(h)&&++l<10?(e.consume(h),u):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Er,r.interrupt?n:d,e.attempt(Ud,m,p))}function d(h){return r.containerState.initialBlankLine=!0,a++,m(h)}function p(h){return ee(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),m):n(h)}function m(h){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function Kd(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Er,s,a);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,oe(e,t,"listItemIndent",r.containerState.size+1)(o)}function a(o){return r.containerState.furtherBlankLines||!ee(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt($d,t,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,oe(e,e.attempt(Ie,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Qd(e,t,n){const r=this;return oe(e,s,"listItemIndent",r.containerState.size+1);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function Vd(e){e.exit(this.containerState.type)}function Gd(e,t,n){const r=this;return oe(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const l=r.events[r.events.length-1];return!ee(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const ma={name:"setextUnderline",resolveTo:Wd,tokenize:Jd};function Wd(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 l={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",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Jd(e,t,n){const r=this;let s;return a;function a(c){let d=r.events.length,p;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){p=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),s=c,l(c)):n(c)}function l(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===s?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),ee(c)?oe(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||H(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Xd={tokenize:Yd};function Yd(e){const t=this,n=e.attempt(Er,r,e.attempt(this.parser.constructs.flowInitial,s,oe(e,e.attempt(this.parser.constructs.flow,s,e.attempt(rd,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 Zd={resolveAll:Kl()},eh=Hl("string"),th=Hl("text");function Hl(e){return{resolveAll:Kl(e==="text"?nh:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,l,o);return l;function l(d){return c(d)?a(d):o(d)}function o(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 p=s[d];let m=-1;if(p)for(;++m-1){const o=l[0];typeof o=="string"?l[0]=o.slice(r):l.shift()}a>0&&l.push(e[s].slice(0,a))}return l}function fh(e,t){let n=-1;const r=[];let s;for(;++n0){const Re=$.tokenStack[$.tokenStack.length-1];(Re[1]||xa).call($,void 0,Re[0])}for(I.position={start:bt(k.length>0?k[0][1].start:{line:1,column:1,offset:0}),end:bt(k.length>0?k[k.length-2][1].end:{line:1,column:1,offset:0})},te=-1;++te0&&(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 Ph(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rh(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ih(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=gn(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,o+=1,e.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function Th(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 Ah(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Gl(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 l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function Lh(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gl(e,t);const s={src:gn(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 Mh(e,t){const n={src:gn(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 Oh(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 Dh(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gl(e,t);const s={href:gn(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 Fh(e,t){const n={href:gn(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 zh(e,t,n){const r=e.all(t),s=n?Bh(n):Wl(t),a={},l=[];if(typeof t.checked=="boolean"){const d=r[0];let p;d&&d.type==="element"&&d.tagName==="p"?p=d:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o1}function qh(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 l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Bi(t.children[1]),u=Pl(t.children[t.children.length-1]);o&&u&&(l.position={start:o,end:u}),s.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function Qh(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,o=l?l.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(ya(t.slice(s),s>0,!1)),a.join("")}function ya(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===ga||a===ba;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===ga||a===ba;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function Wh(e,t){const n={type:"text",value:Gh(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Jh(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Xh={blockquote:Ch,break:_h,code:Eh,delete:Ph,emphasis:Rh,footnoteReference:Ih,heading:Th,html:Ah,imageReference:Lh,image:Mh,inlineCode:Oh,linkReference:Dh,link:Fh,listItem:zh,list:qh,paragraph:Uh,root:$h,strong:Hh,table:Kh,tableCell:Vh,tableRow:Qh,text:Wh,thematicBreak:Jh,toml:hr,yaml:hr,definition:hr,footnoteDefinition:hr};function hr(){}const Jl=-1,Pr=0,Ln=1,jr=2,Vi=3,Gi=4,Wi=5,Ji=6,Xl=7,Yl=8,Yh=typeof self=="object"?self:globalThis,wa=(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 Yh[e](t)},Zh=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,l]=t[s];switch(a){case Pr:case Jl:return n(l,s);case Ln:{const o=n([],s);for(const u of l)o.push(r(u));return o}case jr:{const o=n({},s);for(const[u,c]of l)o[r(u)]=r(c);return o}case Vi:return n(new Date(l),s);case Gi:{const{source:o,flags:u}=l;return n(new RegExp(o,u),s)}case Wi:{const o=n(new Map,s);for(const[u,c]of l)o.set(r(u),r(c));return o}case Ji:{const o=n(new Set,s);for(const u of l)o.add(r(u));return o}case Xl:{const{name:o,message:u}=l;return n(wa(o,u),s)}case Yl:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:o}=new Uint8Array(l);return n(new DataView(o),l)}}return n(wa(a,l),s)};return r},va=e=>Zh(new Map,e)(0),Jt="",{toString:ep}={},{keys:tp}=Object,Cn=e=>{const t=typeof e;if(t!=="object"||!e)return[Pr,t];const n=ep.call(e).slice(8,-1);switch(n){case"Array":return[Ln,Jt];case"Object":return[jr,Jt];case"Date":return[Vi,Jt];case"RegExp":return[Gi,Jt];case"Map":return[Wi,Jt];case"Set":return[Ji,Jt];case"DataView":return[Ln,n]}return n.includes("Array")?[Ln,n]:n.includes("Error")?[Xl,n]:[jr,n]},pr=([e,t])=>e===Pr&&(t==="function"||t==="symbol"),np=(e,t,n,r)=>{const s=(l,o)=>{const u=r.push(l)-1;return n.set(o,u),u},a=l=>{if(n.has(l))return n.get(l);let[o,u]=Cn(l);switch(o){case Pr:{let d=l;switch(u){case"bigint":o=Yl,d=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return s([Jl],l)}return s([o,d],l)}case Ln:{if(u){let m=l;return u==="DataView"?m=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(l)),s([u,[...m]],l)}const d=[],p=s([o,d],l);for(const m of l)d.push(a(m));return p}case jr:{if(u)switch(u){case"BigInt":return s([u,l.toString()],l);case"Boolean":case"Number":case"String":return s([u,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const d=[],p=s([o,d],l);for(const m of tp(l))(e||!pr(Cn(l[m])))&&d.push([a(m),a(l[m])]);return p}case Vi:return s([o,l.toISOString()],l);case Gi:{const{source:d,flags:p}=l;return s([o,{source:d,flags:p}],l)}case Wi:{const d=[],p=s([o,d],l);for(const[m,h]of l)(e||!(pr(Cn(m))||pr(Cn(h))))&&d.push([a(m),a(h)]);return p}case Ji:{const d=[],p=s([o,d],l);for(const m of l)(e||!pr(Cn(m)))&&d.push(a(m));return p}}const{message:c}=l;return s([o,{name:u,message:c}],l)};return a},ja=(e,{json:t,lossy:n}={})=>{const r=[];return np(!(t||n),!!t,new Map,r)(e),r},kr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?va(ja(e,t)):structuredClone(e):(e,t)=>va(ja(e,t));function rp(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 ip(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function sp(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||rp,r=e.options.footnoteBackLabel||ip,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u0&&y.push({type:"text",value:" "});let N=typeof n=="string"?n:n(u,h);typeof N=="string"&&(N={type:"text",value:N}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,h),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const N=v.children[v.children.length-1];N&&N.type==="text"?N.value+=" ":v.children.push({type:"text",value:" "}),v.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),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...kr(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` +`}]}}const Zl=(function(e){if(e==null)return up;if(typeof e=="function")return Rr(e);if(typeof e=="object")return Array.isArray(e)?ap(e):lp(e);if(typeof e=="string")return op(e);throw new Error("Expected function, string, or object as test")});function ap(e){const t=[];let n=-1;for(;++n":""))+")"})}return m;function m(){let h=eo,y,w,v;if((!t||a(u,c,d[d.length-1]||void 0))&&(h=mp(n(u,d)),h[0]===ka))return h;if("children"in u&&u.children){const b=u;if(b.children&&h[0]!==hp)for(w=(r?b.children.length:-1)+l,v=d.concat(b);w>-1&&w0&&n.push({type:"text",value:` +`}),n}function Na(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Sa(e,t){const n=xp(e,t),r=n.one(e,void 0),s=sp(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:` +`},s),a}function vp(e,t){return e&&"run"in e?async function(n,r){const s=Sa(n,{file:r,...t});await e.run(s,r)}:function(n,r){return Sa(n,{file:r,...e||t})}}function Ca(e){if(e)throw e}var Hr,_a;function jp(){if(_a)return Hr;_a=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"),p=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!p)return!1;var m;for(m in c);return typeof m>"u"||e.call(c,m)},l=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},o=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return Hr=function u(){var c,d,p,m,h,y,w=arguments[0],v=1,b=arguments.length,N=!1;for(typeof w=="boolean"&&(N=w,w=arguments[1]||{},v=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});vl.length;let u;o&&l.push(s);try{u=e.apply(this,l)}catch(c){const d=c;if(o&&n)throw d;return s(d)}o||(u&&u.then&&typeof u.then=="function"?u.then(a,s):u instanceof Error?s(u):a(u))}function s(l,...o){n||(n=!0,t(l,...o))}function a(l){s(null,l)}}const Ye={basename:Cp,dirname:_p,extname:Ep,join:Pp,sep:"/"};function Cp(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');rr(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 l=-1,o=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else l<0&&(a=!0,l=s+1),o>-1&&(e.codePointAt(s)===t.codePointAt(o--)?o<0&&(r=s):(o=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function _p(e){if(rr(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 Ep(e){rr(e);let t=e.length,n=-1,r=0,s=-1,a=0,l;for(;t--;){const o=e.codePointAt(t);if(o===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),o===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 Pp(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Ip(e,t){let n="",r=0,s=-1,a=0,l=-1,o,u;for(;++l<=e.length;){if(l2){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=l,a=0;continue}}else if(n.length>0){n="",r=0,s=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),r=l-s-1;s=l,a=0}else o===46&&a>-1?a++:a=-1}return n}function rr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Tp={cwd:Ap};function Ap(){return"/"}function Si(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Lp(e){if(typeof e=="string")e=new URL(e);else if(!Si(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 Mp(e)}function Mp(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[h,...y]=d;const w=r[m][1];Ni(w)&&Ni(h)&&(h=Kr(!0,w,h)),r[m]=[c,h,...y]}}}}const zp=new Xi().freeze();function Wr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Jr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Xr(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 Pa(e){if(!Ni(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ra(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function mr(e){return Bp(e)?e:new no(e)}function Bp(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function qp(e){return typeof e=="string"||Up(e)}function Up(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $p="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ia=[],Ta={allowDangerousHtml:!0},Hp=/^(https?|ircs?|mailto|xmpp)$/i,Kp=[{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 Qp(e){const t=Vp(e),n=Gp(e);return Wp(t.runSync(t.parse(n),n),e)}function Vp(e){const t=e.rehypePlugins||Ia,n=e.remarkPlugins||Ia,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ta}:Ta;return zp().use(Sh).use(n).use(vp,r).use(t)}function Gp(e){const t=e.children||"",n=new no;return typeof t=="string"&&(n.value=t),n}function Wp(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,l=t.skipHtml,o=t.unwrapDisallowed,u=t.urlTransform||Jp;for(const d of Kp)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+$p+d.id,void 0);return to(e,c),ic(e,{Fragment:i.Fragment,components:s,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function c(d,p,m){if(d.type==="raw"&&m&&typeof p=="number")return l?m.children.splice(p,1):m.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let h;for(h in qr)if(Object.hasOwn(qr,h)&&Object.hasOwn(d.properties,h)){const y=d.properties[h],w=qr[h];(w===null||w.includes(d.tagName))&&(d.properties[h]=u(String(y||""),h,d))}}if(d.type==="element"){let h=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!h&&r&&typeof p=="number"&&(h=!r(d,p,m)),h&&m&&typeof p=="number")return o&&d.children?m.children.splice(p,1,...d.children):m.children.splice(p,1),p}}}function Jp(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||Hp.test(e.slice(0,t))?e:""}const Yi="-",Xp=e=>{const t=Zp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const o=l.split(Yi);return o[0]===""&&o.length!==1&&o.shift(),ro(o,t)||Yp(l)},getConflictingClassGroupIds:(l,o)=>{const u=n[l]||[];return o&&r[l]?[...u,...r[l]]:u}}},ro=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?ro(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(Yi);return(l=t.validators.find(({validator:o})=>o(a)))==null?void 0:l.classGroupId},Aa=/^\[(.+)\]$/,Yp=e=>{if(Aa.test(e)){const t=Aa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Zp=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return tm(Object.entries(e.classGroups),n).forEach(([a,l])=>{Ci(l,r,a,t)}),r},Ci=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:La(t,s);a.classGroupId=n;return}if(typeof s=="function"){if(em(s)){Ci(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([a,l])=>{Ci(l,La(t,a),n,r)})})},La=(e,t)=>{let n=e;return t.split(Yi).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},em=e=>e.isThemeGetter,tm=(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(([l,o])=>[t+l,o])):a);return[n,s]}):e,nm=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(a,l)=>{n.set(a,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let l=n.get(a);if(l!==void 0)return l;if((l=r.get(a))!==void 0)return s(a,l),l},set(a,l){n.has(a)?n.set(a,l):s(a,l)}}},io="!",rm=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],a=t.length,l=o=>{const u=[];let c=0,d=0,p;for(let v=0;vd?p-d:void 0;return{modifiers:u,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:w}};return n?o=>n({className:o,parseClassName:l}):l},im=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},sm=e=>({cache:nm(e.cacheSize),parseClassName:rm(e),...Xp(e)}),am=/\s+/,lm=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,a=[],l=e.trim().split(am);let o="";for(let u=l.length-1;u>=0;u-=1){const c=l[u],{modifiers:d,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:h}=n(c);let y=!!h,w=r(y?m.substring(0,h):m);if(!w){if(!y){o=c+(o.length>0?" "+o:o);continue}if(w=r(m),!w){o=c+(o.length>0?" "+o:o);continue}y=!1}const v=im(d).join(":"),b=p?v+io:v,N=b+w;if(a.includes(N))continue;a.push(N);const _=s(w,y);for(let S=0;S<_.length;++S){const D=_[S];a.push(b+D)}o=c+(o.length>0?" "+o:o)}return o};function om(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rp(d),e());return n=sm(c),r=n.cache.get,s=n.cache.set,a=o,o(u)}function o(u){const c=r(u);if(c)return c;const d=lm(u,n);return s(u,d),d}return function(){return a(om.apply(null,arguments))}}const ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ao=/^\[(?:([a-z-]+):)?(.+)\]$/i,cm=/^\d+\/\d+$/,dm=new Set(["px","full","screen"]),hm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pm=/\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$/,mm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ot=e=>Yt(e)||dm.has(e)||cm.test(e),yt=e=>bn(e,"length",Nm),Yt=e=>!!e&&!Number.isNaN(Number(e)),Yr=e=>bn(e,"number",Yt),_n=e=>!!e&&Number.isInteger(Number(e)),gm=e=>e.endsWith("%")&&Yt(e.slice(0,-1)),G=e=>ao.test(e),wt=e=>hm.test(e),bm=new Set(["length","size","percentage"]),ym=e=>bn(e,bm,lo),wm=e=>bn(e,"position",lo),vm=new Set(["image","url"]),jm=e=>bn(e,vm,Cm),km=e=>bn(e,"",Sm),En=()=>!0,bn=(e,t,n)=>{const r=ao.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Nm=e=>pm.test(e)&&!mm.test(e),lo=()=>!1,Sm=e=>fm.test(e),Cm=e=>xm.test(e),_m=()=>{const e=ue("colors"),t=ue("spacing"),n=ue("blur"),r=ue("brightness"),s=ue("borderColor"),a=ue("borderRadius"),l=ue("borderSpacing"),o=ue("borderWidth"),u=ue("contrast"),c=ue("grayscale"),d=ue("hueRotate"),p=ue("invert"),m=ue("gap"),h=ue("gradientColorStops"),y=ue("gradientColorStopPositions"),w=ue("inset"),v=ue("margin"),b=ue("opacity"),N=ue("padding"),_=ue("saturate"),S=ue("scale"),D=ue("sepia"),j=ue("skew"),B=ue("space"),L=ue("translate"),C=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",G,t],E=()=>[G,t],V=()=>["",ot,yt],F=()=>["auto",Yt,G],P=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>["start","end","center","between","around","evenly","stretch"],me=()=>["","0",G],f=()=>["auto","avoid","all","avoid-page","page","left","right","column"],le=()=>[Yt,G];return{cacheSize:500,separator:":",theme:{colors:[En],spacing:[ot,yt],blur:["none","",wt,G],brightness:le(),borderColor:[e],borderRadius:["none","","full",wt,G],borderSpacing:E(),borderWidth:V(),contrast:le(),grayscale:me(),hueRotate:le(),invert:me(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[gm,yt],inset:T(),margin:T(),opacity:le(),padding:E(),saturate:le(),scale:le(),sepia:me(),skew:le(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",G]}],container:["container"],columns:[{columns:[wt]}],"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:[...P(),G]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],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",_n,G]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",G]}],grow:[{grow:me()}],shrink:[{shrink:me()}],order:[{order:["first","last","none",_n,G]}],"grid-cols":[{"grid-cols":[En]}],"col-start-end":[{col:["auto",{span:["full",_n,G]},G]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[En]}],"row-start-end":[{row:["auto",{span:[_n,G]},G]}],"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",G]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",G]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...pe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...pe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...pe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"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",G,t]}],"min-w":[{"min-w":[G,t,"min","max","fit"]}],"max-w":[{"max-w":[G,t,"none","full","min","max","fit","prose",{screen:[wt]},wt]}],h:[{h:[G,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[G,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[G,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[G,t,"auto","min","max","fit"]}],"font-size":[{text:["base",wt,yt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yr]}],"font-family":[{font:[En]}],"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",G]}],"line-clamp":[{"line-clamp":["none",Yt,Yr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ot,G]}],"list-image":[{"list-image":["none",G]}],"list-style-type":[{list:["none","disc","decimal",G]}],"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:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ot,yt]}],"underline-offset":[{"underline-offset":["auto",ot,G]}],"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",G]}],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",G]}],"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:[...P(),wm]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ym]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jm]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...q(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:q()}],"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:["",...q()]}],"outline-offset":[{"outline-offset":[ot,G]}],"outline-w":[{outline:[ot,yt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[ot,yt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",wt,km]}],"shadow-color":[{shadow:[En]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",wt,G]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[p]}],saturate:[{saturate:[_]}],sepia:[{sepia:[D]}],"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":[p]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",G]}],duration:[{duration:le()}],ease:[{ease:["linear","in","out","in-out",G]}],delay:[{delay:le()}],animate:[{animate:["none","spin","ping","pulse","bounce",G]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[_n,G]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",G]}],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",G]}],"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",G]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ot,yt,Yr]}],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"]}}},Em=um(_m),_i={status:"",repo:"",thread:"",action:"",intent:"",actor:""},Pm=new au({defaultOptions:{queries:{retry:1}}}),Ma=12,Rm=12,Im=10080*60*1e3,Tm=1e3,oo=Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function Q(...e){return Em(_o(e))}async function ne(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 Ke(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 Am=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}),Lm=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});function ir(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Mm(e){const t=ir(e);return t?Am.format(t):e??""}function Mn(e){const t=ir(e);return t?Lm.format(t):e??""}function uo(e,t){const n=ir(e);if(!n)return e??"";const r=t-n.getTime(),s=Math.abs(r);if(s>Im)return Mn(e);const a=r>=0?"ago":"from now",l=Math.round(s/1e3);if(l<45)return r>=0?"just now":"soon";if(l<90)return`1m ${a}`;const o=Math.round(l/60);if(o<60)return`${o}m ${a}`;if(o<90)return`1h ${a}`;const u=Math.round(o/60);return u<24?`${u}h ${a}`:u<36?`1d ${a}`:`${Math.round(u/24)}d ${a}`}function Ee({value:e,compact:t=!1,relative:n=!1,now:r=Date.now()}){const s=ir(e);return s?i.jsx("time",{dateTime:s.toISOString(),title:`UTC: ${s.toISOString()}`,children:n?uo(e,r):t?Mn(e):Mm(e)}):i.jsx(i.Fragment,{children:e??""})}function co(e,t){const n=ir(e);return n?Math.max(0,Math.floor((t-n.getTime())/1e3)):null}function Zi(e,t){return e.status==="running"?co(e.started_at,t)??e.runtime_seconds:e.runtime_seconds}function es(e,t){return e.status==="pending"?co(e.created_at,t)??e.queue_wait_seconds:e.queue_wait_seconds}function Om(e){const[t,n]=A.useState(()=>Date.now());return A.useEffect(()=>{if(!e)return;n(Date.now());const r=window.setInterval(()=>n(Date.now()),Tm);return()=>window.clearInterval(r)},[e]),t}function Dm(e){return(e??"").split(/\r?\n/).map(n=>n.trim()).find(Boolean)??""}function Nr(e,t,n=1){const r=Dm(t),s=n>1?` (${n})`:"";return r?`${e}${s}: ${r}`:`${e}${s}`}function Sr(e){return e==="openclaw_stdout"||e==="openclaw_stderr"}function ho(e){return e.map(t=>t==null?void 0:t.trim()).filter(Boolean).join(` +`)}function Fm(e){const t=[];for(const n of e){const r=t[t.length-1];if(r&&Sr(n.event_type)&&r.eventType===n.event_type){r.count+=1,r.meta=n.ts,r.detail=ho([r.detail,n.detail]),r.summary=Nr(n.summary,r.detail,r.count);continue}t.push({id:String(n.id),badge:n.event_type,meta:n.ts,summary:Sr(n.event_type)?Nr(n.summary,n.detail):n.summary,detail:n.detail,eventType:n.event_type,count:1})}return t}function zm(e){const t=[];return e.forEach((n,r)=>{const s=t[t.length-1];if(s&&Sr(n.kind)&&s.kind===n.kind){s.count+=1,s.meta=n.timestamp,s.text=ho([s.text,n.text]),s.summary=Nr(`${n.role} · ${n.kind}`,s.text,s.count);return}t.push({id:`${n.timestamp??"entry"}-${r}`,badge:n.title,meta:n.timestamp,summary:Sr(n.kind)?Nr(`${n.role} · ${n.kind}`,n.text):`${n.role} · ${n.kind}`,text:n.text,kind:n.kind,count:1})}),t}function Oa(e,t,n,r){return e==="openclaw_stdout"?!1:t||n>=r-2}function Bm(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 qm(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 Um(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 $m(e=oo){return`/api/metrics/summary?timezone=${encodeURIComponent(e)}`}function it(e){try{const t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"?t.href:"#"}catch{return"#"}}function yr(){return"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}function Hm(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="github-agent-bridge:push")}function Km(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 Vm(e,t){const n=Da(t);return e.some(r=>Da(r)===n)?e:[...e,t]}function Da(e){return`${e.timestamp??""}:${e.role}:${e.kind}:${e.title}:${e.text}`}function Gm(e){return["claimed","dispatch_started","dispatch_finished","done","blocked","denied","waiting_approval"].includes(e)}function In(e){return["blocked","denied","waiting_approval"].includes(e)}function Ei(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 Wm(e=window.location.pathname){const t=e.match(/^\/jobs\/(\d+)\/?$/);return t?Number(t[1]):null}function Jm(e=window.location.pathname){return/^\/knowledge\/?$/.test(e)}function Xm(e=window.location.pathname){return/^\/mcp\/?$/.test(e)}function Ym(e=window.location.pathname){return/^\/system\/?$/.test(e)}function Zm(e=window.location.pathname){return/^\/webhooks\/?$/.test(e)}function po(e){return e.startsWith("repo:")?e.slice(5):e}function Fa(e){return Object.values(e).some(t=>t.trim()!=="")}function ef(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 tf(){var te,Re,Je,Be,ft,xt,ke,lt,qe,rs,is,ss,as,ls,os,us,cs,ds,hs,ps,ms,fs,xs,gs,bs,ys,ws,vs,js,ks,Ns,Ss,Cs,_s,Es,Ps,Rs,Is,Ts;const e=ml(),[t,n]=A.useState(_i),[r,s]=A.useState(Ma),a=A.useRef(!1),[l,o]=A.useState(""),[u,c]=A.useState("proposed"),[d,p]=A.useState(null),[m,h]=A.useState(""),[y,w]=A.useState(()=>window.location.pathname),[v,b]=A.useState(null),N=Wm(y),_=N!==null,S=Jm(y),D=Xm(y),j=Ym(y),B=Zm(y),L=!_&&!S&&!D&&!j&&!B,C=N,O=ge({queryKey:["metrics",oo],queryFn:()=>ne($m()),enabled:L||j}),T=ge({queryKey:["dashboard-status"],queryFn:()=>ne("/api/status")}),E=ge({queryKey:["me"],queryFn:()=>ne("/api/me"),refetchInterval:!1}),V=ge({queryKey:["web-push-config"],queryFn:()=>ne("/api/web-push/config"),enabled:!!((te=E.data)!=null&&te.user)}),F=ge({queryKey:["about"],queryFn:()=>ne("/api/about")}),P=ge({queryKey:["job-actors"],queryFn:()=>ne("/api/jobs/actors"),enabled:L}),q=ge({queryKey:["jobs",t,r],queryFn:()=>ne(qm(t,r)),enabled:L,placeholderData:z=>z}),W=ge({queryKey:["processes"],queryFn:()=>ne("/api/processes"),enabled:j}),pe=ge({queryKey:["systemd"],queryFn:()=>ne("/api/systemd"),enabled:j}),me=ge({queryKey:["alerts"],queryFn:()=>ne("/api/alerts"),enabled:j}),f=ge({queryKey:["webhook-status"],queryFn:()=>ne("/api/webhooks/github/status"),enabled:B&&!!((Je=(Re=E.data)==null?void 0:Re.user)!=null&&Je.is_admin&&((Be=T.data)!=null&&Be.webhook_configured))}),le=ge({queryKey:["knowledge",l,u],queryFn:()=>ne(Um(l,u)),enabled:S}),Pe=ge({queryKey:["mcp-tokens"],queryFn:()=>ne("/api/mcp/tokens"),enabled:D&&!!((ft=E.data)!=null&&ft.user)}),x=ge({queryKey:["mcp-users"],queryFn:()=>ne("/api/mcp/users"),enabled:D&&!!((xt=E.data)!=null&&xt.user)}),je=ge({queryKey:["job",C],queryFn:()=>ne(`/api/jobs/${C}`),enabled:C!==null}),We=ge({queryKey:["job-session",C],queryFn:()=>ne(`/api/jobs/${C}/session`),enabled:C!==null}),fe=ge({queryKey:["job-session-events",C],queryFn:()=>ne(`/api/jobs/${C}/session/events`),enabled:C!==null}),pt=ge({queryKey:["job-session-transcript",C],queryFn:()=>ne(`/api/jobs/${C}/session/transcript`),enabled:C!==null}),Qe=A.useCallback(async z=>{const ie=await ne(`/api/jobs/${z}/retry`,{method:"POST"});e.setQueryData(["job",z],{job:ie.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]})},[e]),st=A.useCallback(async z=>{const ie=await ne(`/api/jobs/${z}/dismiss`,{method:"POST"});e.setQueryData(["job",z],{job:ie.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]})},[e]),at=A.useCallback(async(z,ie)=>{const ce=await ne(`/api/jobs/${z}/cancel`,{method:"POST",body:JSON.stringify({reason:ie||""})});e.setQueryData(["job",z],{job:ce.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]}),e.invalidateQueries({queryKey:["dashboard-status"]})},[e]),Tt=A.useCallback(async(z,ie)=>{await ne(`/api/knowledge/proposals/${encodeURIComponent(z)}/${ie}`,{method:"POST"}),e.invalidateQueries({queryKey:["knowledge"]}),e.invalidateQueries({queryKey:["dashboard-status"]})},[e]),Ir=A.useCallback(async z=>{await ne(`/api/knowledge/rules/${encodeURIComponent(z)}`,{method:"DELETE"}),e.invalidateQueries({queryKey:["knowledge"]})},[e]),Tr=A.useCallback(async(z,ie)=>{await ne(`/api/knowledge/rules/${encodeURIComponent(z)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:ie})}),e.invalidateQueries({queryKey:["knowledge"]})},[e]),Ar=A.useCallback(async(z,ie)=>{const ce=await ne("/api/mcp/tokens",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:z,user_login:ie||void 0})});return e.invalidateQueries({queryKey:["mcp-tokens"]}),ce},[e]),sr=A.useCallback(async(z,ie)=>{await ne(`/api/mcp/tokens/${encodeURIComponent(z)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_login:ie})}),e.invalidateQueries({queryKey:["mcp-tokens"]}),e.invalidateQueries({queryKey:["mcp-users"]})},[e]),ar=A.useCallback(async z=>{await ne(`/api/mcp/tokens/${encodeURIComponent(z)}`,{method:"DELETE"}),e.invalidateQueries({queryKey:["mcp-tokens"]})},[e]),Vt=A.useCallback(async z=>{const ie={refresh:"/api/autoupdate/refresh",apply:"/api/autoupdate/apply",complete:"/api/autoupdate/complete-pending"}[z];p(z),h("");try{await ne(ie,{method:"POST"}),e.invalidateQueries({queryKey:["dashboard-status"]})}catch(ce){e.invalidateQueries({queryKey:["dashboard-status"]}),h(ce instanceof Error?ce.message:String(ce))}finally{p(null)}},[e]),Lr=A.useCallback(async()=>{var As;const z=(As=V.data)==null?void 0:As.public_key;if(!z)throw new Error("web_push_not_configured");if(!yr())throw new Error("web_push_not_supported");if(await window.Notification.requestPermission()!=="granted")throw new Error("notification_permission_denied");const ce=await navigator.serviceWorker.register("/service-worker.js"),No=await ce.pushManager.getSubscription()??await ce.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Km(z)});await ne("/api/web-push/subscriptions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(No.toJSON())}),e.invalidateQueries({queryKey:["web-push-config"]})},[e,(ke=V.data)==null?void 0:ke.public_key]),lr=A.useCallback(async()=>{if(!yr())return;const ie=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(!ie)return;const ce=ie.endpoint;await ie.unsubscribe(),await ne("/api/web-push/subscriptions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:ce})}),e.invalidateQueries({queryKey:["web-push-config"]})},[e]);A.useEffect(()=>{var z;!((z=V.data)!=null&&z.status.enabled)||!yr()||navigator.serviceWorker.register("/service-worker.js").catch(()=>{})},[(lt=V.data)==null?void 0:lt.status.enabled]),A.useEffect(()=>{if(C===null)return;const z=new EventSource(`/api/jobs/${C}/session/stream`);return z.addEventListener("session_event",ie=>{const ce=Cr(ie);ce&&(e.setQueryData(["job-session-events",C],gt=>({events:Qm((gt==null?void 0:gt.events)??[],ce)})),Gm(ce.event_type)&&(e.invalidateQueries({queryKey:["job",C]}),e.invalidateQueries({queryKey:["jobs"]})))}),z.addEventListener("transcript_entry",ie=>{const ce=Cr(ie);!ce||ce.job_id!==C||e.setQueryData(["job-session-transcript",C],gt=>({entries:Vm((gt==null?void 0:gt.entries)??[],ce.entry)}))}),z.onerror=()=>{e.invalidateQueries({queryKey:["job",C]}),e.invalidateQueries({queryKey:["job-session-events",C]}),e.invalidateQueries({queryKey:["job-session-transcript",C]})},()=>z.close()},[C,e]),A.useEffect(()=>{const z=()=>{w(window.location.pathname)};return window.addEventListener("popstate",z),()=>window.removeEventListener("popstate",z)},[]),A.useEffect(()=>{if(!("serviceWorker"in navigator))return;const z=ie=>{if(!Hm(ie.data))return;const ce={...ie.data.payload,id:Date.now(),receivedAt:Date.now()};b(ce),ce.job_id&&(e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["job",ce.job_id]}),e.invalidateQueries({queryKey:["metrics"]}))};return navigator.serviceWorker.addEventListener("message",z),()=>navigator.serviceWorker.removeEventListener("message",z)},[e]),A.useEffect(()=>{if(!v)return;const z=window.setTimeout(()=>b(null),12e3);return()=>window.clearTimeout(z)},[v]);const or=A.useCallback(z=>{window.history.pushState({},"",yn(z)),w(window.location.pathname)},[]),vn=A.useCallback(z=>{window.history.pushState({},"",z),w(window.location.pathname)},[]),mt=((qe=O.data)==null?void 0:qe.metrics.status_counts)??{},Gt=((rs=q.data)==null?void 0:rs.jobs)??[],Mr=A.useCallback(z=>{n(z),s(Ma),a.current=!1},[]);A.useEffect(()=>{q.isFetching||(a.current=!1)},[q.isFetching]);const Or=A.useCallback(()=>{a.current||(a.current=!0,s(z=>z+Rm))},[]),k=C?((is=je.data)==null?void 0:is.job)??null:null,I=Gt.some(z=>z.status==="running"||z.status==="pending")||(k==null?void 0:k.status)==="running"||(k==null?void 0:k.status)==="pending"||!!((ss=W.data)!=null&&ss.running_jobs.length),$=Om(I),J=i.jsx(pf,{selectedJobId:C,selectedJob:k,loading:je.isLoading,error:je.error,session:(as=We.data)==null?void 0:as.session,sessionEvents:(ls=fe.data)==null?void 0:ls.events,transcript:(os=pt.data)==null?void 0:os.entries,now:$});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(nf,{about:F.data})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[i.jsx(Sf,{config:V.data,loading:V.isLoading,onEnable:Lr,onDisable:lr}),i.jsx(Nf,{user:(us=E.data)==null?void 0:us.user,loading:E.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(uf,{isDashboardRoute:L,isSystemRoute:j,isKnowledgeRoute:S,isMcpRoute:D,isWebhooksRoute:B,showWebhooks:!!((ds=(cs=E.data)==null?void 0:cs.user)!=null&&ds.is_admin&&((hs=T.data)!=null&&hs.webhook_configured)),knowledgeBadgeCount:((fs=(ms=(ps=T.data)==null?void 0:ps.metrics)==null?void 0:ms.knowledge)==null?void 0:fs.proposed)??0,onNavigate:vn}),i.jsx(Cf,{notification:v,onDismiss:()=>b(null),onNavigate:vn}),N!==null?i.jsx(hf,{jobId:N,detail:J,selectedJob:k,user:(xs=E.data)==null?void 0:xs.user,onBackToDashboard:()=>vn("/"),onRetry:Qe,onDismiss:st,onCancel:at,onRefresh:()=>{je.refetch(),We.refetch(),fe.refetch(),pt.refetch()}}):S?i.jsx(mf,{data:le.data,loading:le.isLoading,error:le.error,repo:l,status:u,user:(gs=E.data)==null?void 0:gs.user,now:$,onRepoChange:o,onStatusChange:c,onApprove:z=>Tt(z,"approve"),onReject:z=>Tt(z,"reject"),onUpdateRuleScope:Tr,onDeleteRule:Ir,onRefresh:()=>le.refetch()}):D?i.jsx(wf,{tokens:(bs=Pe.data)==null?void 0:bs.tokens,loading:Pe.isLoading,error:Pe.error,user:(ys=E.data)==null?void 0:ys.user,ownerOptions:((ws=x.data)==null?void 0:ws.users)??[],dashboardUrl:(vs=T.data)==null?void 0:vs.dashboard_url,dashboardUrlSource:(js=T.data)==null?void 0:js.dashboard_url_source,now:$,onCreate:Ar,onUpdateOwner:sr,onRevoke:ar,onRefresh:()=>Pe.refetch()}):B?i.jsx(cf,{status:f.data,loading:f.isLoading,error:f.error,onRefresh:()=>f.refetch()}):j?i.jsx(df,{processes:W.data,processesLoading:W.isLoading,processesError:W.error,systemd:pe.data,systemdLoading:pe.isLoading,systemdError:pe.error,alerts:(ks=me.data)==null?void 0:ks.alerts,alertsLoading:me.isLoading,alertsError:me.error,now:$,onRefreshProcesses:()=>W.refetch(),onRefreshSystemd:()=>pe.refetch(),onRefreshAlerts:()=>me.refetch()}):i.jsxs(i.Fragment,{children:[O.error?i.jsx(Se,{tone:"error",text:O.error.message}):null,T.error?i.jsx(Se,{tone:"error",text:T.error.message}):null,i.jsx(rf,{state:(Ns=T.data)==null?void 0:Ns.autoupdate,isAdmin:!!((Cs=(Ss=E.data)==null?void 0:Ss.user)!=null&&Cs.is_admin),runningAction:d,actionError:m,onRefresh:()=>Vt("refresh"),onApply:()=>Vt("apply"),onCompletePending:()=>Vt("complete")}),i.jsxs("section",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Summary metrics",children:[i.jsx(He,{title:"Pending",value:mt.pending??0,icon:i.jsx(bl,{className:"h-5 w-5"})}),i.jsx(He,{title:"Running",value:mt.running??0,icon:i.jsx(zn,{className:"h-5 w-5"})}),i.jsx(He,{title:"Blocked",value:mt.blocked??0,icon:i.jsx(Di,{className:"h-5 w-5"})}),i.jsx(He,{title:"Done",value:mt.done??0,icon:i.jsx(fn,{className:"h-5 w-5"})})]}),i.jsxs("section",{className:"grid gap-3",children:[i.jsx(_f,{count:Gt.length,limit:r,loading:q.isLoading,onRefresh:()=>q.refetch()}),i.jsxs(ye,{title:"Recent jobs",flushHeader:!0,children:[i.jsx(Ef,{filters:t,actorOptions:((_s=P.data)==null?void 0:_s.actors)??[],onChange:Mr}),q.error?i.jsx(Se,{tone:"error",text:q.error.message}):null,i.jsx(Rf,{jobs:Gt,loading:q.isLoading,loadingMore:q.isFetching&&!q.isLoading,hasMore:Gt.length>=r,onLoadMore:Or,onViewJob:or,now:$,user:(Es=E.data)==null?void 0:Es.user,onRetry:Qe,onDismiss:st,onCancel:at})]}),i.jsx(ye,{title:"Runtime usage",action:i.jsx(ht,{onClick:()=>O.refetch()}),children:i.jsx(Hf,{usage:(Ps=O.data)==null?void 0:Ps.metrics.runtime_usage,loading:O.isLoading,totalJobs:Ua(mt)})})]}),i.jsxs("section",{className:"grid gap-4 xl:grid-cols-3",children:[i.jsx(ye,{title:"Runtime percentiles",children:i.jsx(qa,{label:"runtime",values:(Rs=O.data)==null?void 0:Rs.metrics.runtime_seconds})}),i.jsx(ye,{title:"Jobs per day",children:i.jsx($f,{values:(Is=O.data)==null?void 0:Is.metrics.by_created_day,loading:O.isLoading,totalJobs:Ua(mt)})}),i.jsx(ye,{title:"Queue wait percentiles",children:i.jsx(qa,{label:"queue wait",values:(Ts=O.data)==null?void 0:Ts.metrics.queue_wait_seconds})})]})]})]})]})}function nf({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:it(e.repository_url),rel:"noreferrer",target:"_blank",children:[i.jsx(pn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"GitHub"]}):null]})}function rf({state:e,isAdmin:t,runningAction:n=null,actionError:r="",onRefresh:s,onApply:a,onCompletePending:l}){var v,b,N,_,S,D,j,B,L,C,O;if(!e)return null;const o=(b=(v=e==null?void 0:e.target)==null?void 0:v.tag_name)==null?void 0:b.trim();if(!t||!o||(e==null?void 0:e.decision)==="noop")return null;const u=sf(e.decision),c=((N=e.queue)==null?void 0:N.active_total)??0,d=af((_=e.classification)==null?void 0:_.risk),p=lf((S=e.target)==null?void 0:S.body),m=((j=(D=e.classification)==null?void 0:D.migration_files)==null?void 0:j.length)??0,h=((L=(B=e.classification)==null?void 0:B.risky_files)==null?void 0:L.length)??0,y=!!(e.executor_reload_pending&&e.dashboard_applied_at&&l),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(Di,{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:o}),(C=e.target)!=null&&C.url?i.jsxs("a",{className:"inline-flex items-center gap-1 text-xs font-semibold text-amber-800 hover:underline",href:it(e.target.url),rel:"noreferrer",target:"_blank",children:[i.jsx(pn,{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(Oi,{className:Q("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 ${o}? This can restart bridge services according to the recorded safe plan.`)&&(a==null||a())},children:[i.jsx(fn,{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:l,children:[i.jsx(qn,{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(Zr,{label:"Impact",value:d}),i.jsx(Zr,{label:"Active jobs",value:String(c)}),i.jsx(Zr,{label:"Admin only",value:"autoupdate"})]})]}),e.blocked_reason||e.executor_reload_pending||m>0||h>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,h>0?i.jsxs("span",{className:"rounded-sm border border-amber-300 bg-white px-2 py-1",children:[h," executor/shared file",h===1?"":"s"]}):null]}):null,p?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(of,{markdown:p})]}):null,(O=e.warnings)!=null&&O.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 Zr({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 sf(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 af(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 lf(e){return(e??"").trim()}function of({markdown:e}){return i.jsx("div",{className:"mt-1 text-sm leading-relaxed text-amber-950",children:i.jsx(Qp,{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:it(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 uf({isDashboardRoute:e,isSystemRoute:t=!1,isKnowledgeRoute:n,isMcpRoute:r=!1,isWebhooksRoute:s=!1,showWebhooks:a=!1,knowledgeBadgeCount:l=0,onNavigate:o}){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(Pn,{href:"/",active:e,onNavigate:o,children:[i.jsx(vl,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"Jobs"})]}),i.jsxs(Pn,{href:"/system",active:t,onNavigate:o,children:[i.jsx(Nu,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"System"})]}),a?i.jsxs(Pn,{href:"/webhooks",active:s,onNavigate:o,children:[i.jsx(zn,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"Webhooks"})]}):null,i.jsxs(Pn,{href:"/knowledge",active:n,onNavigate:o,children:[i.jsx(Mi,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"Knowledge"}),l>0?i.jsx("span",{className:Q("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":`${l} proposed knowledge ${l===1?"item":"items"}`,children:l}):null]}),i.jsxs(Pn,{href:"/mcp",active:r,onNavigate:o,children:[i.jsx(vr,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"MCP"})]})]})}function cf({status:e,loading:t,error:n,onRefresh:r}){var u,c,d,p,m;const s=Object.values((e==null?void 0:e.receipts)??{}).reduce((h,y)=>h+y,0),[a,l]=A.useState("overview"),o=[{id:"overview",label:"Overview"},{id:"hooks",label:"Hooks",count:(u=e==null?void 0:e.hooks)==null?void 0:u.length},{id:"deliveries",label:"Deliveries",count:(c=e==null?void 0:e.recent_deliveries)==null?void 0:c.length}];return i.jsxs("section",{className:"grid gap-4",children:[i.jsx(mo,{icon:i.jsx(zn,{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(ht,{onClick:r})}),n?i.jsx(Se,{tone:"error",text:n.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:o.map(h=>i.jsxs("button",{type:"button",role:"tab","aria-selected":a===h.id,className:Q("inline-flex h-8 items-center gap-2 rounded px-3 text-sm font-semibold",a===h.id?"bg-primary text-white":"text-muted hover:bg-slate-50 hover:text-foreground"),onClick:()=>l(h.id),children:[h.label,h.count!==void 0?i.jsx("span",{className:"rounded border border-current/30 px-1 font-mono text-[10px]",children:h.count}):null]},h.id))}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Webhook status",children:[i.jsx(He,{title:"Receipts",value:s,icon:i.jsx(zn,{className:"h-5 w-5"})}),i.jsx(He,{title:"Duplicates",value:(e==null?void 0:e.duplicate_deliveries)??0,icon:i.jsx(Oi,{className:"h-5 w-5"})}),i.jsx(He,{title:"Cross-source matches",value:(e==null?void 0:e.cross_source_matches)??0,icon:i.jsx(tr,{className:"h-5 w-5"})}),i.jsx(He,{title:"Mode",value:t?"…":(e==null?void 0:e.mode)??"unknown",icon:i.jsx(yl,{className:"h-5 w-5"})})]}),a==="overview"?i.jsxs(i.Fragment,{children:[i.jsx(ye,{title:"Delivery activity",children:(d=e==null?void 0:e.timeseries)!=null&&d.length?i.jsx("div",{className:"h-72","aria-label":"Webhook deliveries over time",children:i.jsx(Wn,{width:"100%",height:"100%",children:i.jsxs(_r,{data:e.timeseries,children:[i.jsx(Jn,{strokeDasharray:"3 3"}),i.jsx(Xn,{dataKey:"bucket"}),i.jsx(Yn,{allowDecimals:!1}),i.jsx(Zn,{}),i.jsx(nl,{}),i.jsx($t,{dataKey:"observed",stackId:"deliveries",fill:"#2563eb"}),i.jsx($t,{dataKey:"duplicate",stackId:"deliveries",fill:"#f59e0b"}),i.jsx($t,{dataKey:"unsupported",stackId:"deliveries",fill:"#94a3b8"})]})})}):i.jsx(Z,{text:"Time-series data is not available yet. Receipt totals remain visible below."})}),i.jsx(ye,{title:"Receipt states",children:t?i.jsx(Z,{text:"Loading webhook status..."}):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(([h],[y])=>h.localeCompare(y)).map(([h,y])=>i.jsx(he,{label:h,value:y},h))}):i.jsx(Z,{text:"No webhook deliveries observed yet."})})]}):null,a==="hooks"?i.jsx(ye,{title:"Hook inventory",children:(p=e==null?void 0:e.hooks)!=null&&p.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:"Target"}),i.jsx("th",{className:"px-3 py-2",children:"State"}),i.jsx("th",{className:"px-3 py-2",children:"Events"}),i.jsx("th",{className:"px-3 py-2",children:"Last ping"}),i.jsx("th",{className:"px-3 py-2",children:"Last delivery"})]})}),i.jsx("tbody",{children:e.hooks.map(h=>i.jsxs("tr",{className:"border-b border-border/70 last:border-0",children:[i.jsxs("td",{className:"px-3 py-3",children:[i.jsx("div",{className:"font-semibold",children:h.target}),i.jsxs("div",{className:"font-mono text-xs text-muted",children:[h.target_type," · #",h.id]})]}),i.jsx("td",{className:"px-3 py-3",children:i.jsx("span",{className:Q("rounded border px-2 py-1 text-xs font-semibold",h.status==="receiving"?"border-emerald-200 bg-emerald-50 text-emerald-700":h.status==="inactive"?"border-red-200 bg-red-50 text-red-700":"border-slate-200 bg-slate-50 text-slate-600"),children:h.status})}),i.jsx("td",{className:"max-w-xs px-3 py-3 text-xs text-muted",children:h.events.join(", ")||"All events"}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs text-muted",children:h.last_ping_at??"Never"}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs text-muted",children:h.last_event_at??"Never"})]},h.id))})]})}):i.jsx(Z,{text:"No hook inventory is available. A signed ping is required before a hook can appear here."})}):null,a==="deliveries"?i.jsx(ye,{title:"Recent deliveries",children:(m=e==null?void 0:e.recent_deliveries)!=null&&m.length?i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full min-w-[760px] 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:"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.recent_deliveries.map(h=>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:h.created_at}),i.jsxs("td",{className:"px-3 py-3 font-semibold",children:[h.event_name,h.action?` · ${h.action}`:""]}),i.jsx("td",{className:"px-3 py-3",children:h.repository??"—"}),i.jsx("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:h.status})}),i.jsx("td",{className:"max-w-[14rem] truncate px-3 py-3 font-mono text-xs text-muted",title:h.delivery_id,children:h.delivery_id})]},h.delivery_id))})]})}):i.jsx(Z,{text:"No delivery details are available for this window."})}):null]})}function df({processes:e,processesLoading:t,processesError:n,systemd:r,systemdLoading:s,systemdError:a,alerts:l,alertsLoading:o,alertsError:u,now:c,onRefreshProcesses:d,onRefreshSystemd:p,onRefreshAlerts:m}){return i.jsxs("section",{className:"grid gap-4","aria-label":"Bridge system",children:[i.jsxs(ye,{title:"Systemd",action:i.jsx(ht,{onClick:p}),children:[a?i.jsx(Se,{tone:"error",text:a.message}):null,i.jsx(Qf,{data:r,loading:s})]}),i.jsxs(ye,{title:"Process activity",action:i.jsx(ht,{onClick:d}),children:[n?i.jsx(Se,{tone:"error",text:n.message}):null,i.jsx(Wf,{data:e,loading:t})]}),i.jsxs(ye,{title:"Monitor alerts",action:i.jsx(ht,{onClick:m}),children:[u?i.jsx(Se,{tone:"error",text:u.message}):null,i.jsx(Jf,{alerts:l,loading:o,now:c})]})]})}function Pn({href:e,active:t,children:n,onNavigate:r}){return i.jsx("a",{className:Q("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 hf({jobId:e,detail:t,selectedJob:n,user:r,onBackToDashboard:s,onRetry:a,onDismiss:l,onCancel:o,onRefresh:u}){const[c,d]=A.useState(!1),[p,m]=A.useState(!1),[h,y]=A.useState(!1),w=!!(r!=null&&r.is_admin&&n&&In(n.status)),v=!!(n&&Ei(n,r)),b=c?"Retrying...":"Retry",N=p?"Dismissing...":"Dismiss",_=h?"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:S=>{S.defaultPrevented||S.button!==0||S.metaKey||S.ctrlKey||S.altKey||S.shiftKey||(S.preventDefault(),s())},children:[i.jsx(ju,{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(qn,{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:p,onClick:async()=>{if(window.confirm(`Dismiss job #${e}?`)){m(!0);try{await l(e)}finally{m(!1)}}},children:[i.jsx(fn,{className:"h-4 w-4","aria-hidden":!0}),N]}):null,v?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:h,onClick:async()=>{const S=window.prompt(`Cancel job #${e}? Optional reason:`);if(S!==null){y(!0);try{await o(e,S)}finally{y(!1)}}},children:[i.jsx(Kt,{className:"h-4 w-4","aria-hidden":!0}),_]}):null,i.jsx(ht,{onClick:u})]})]}),i.jsx(ye,{title:`Job #${e}`,className:"p-3 sm:p-4",children:t})]})}function pf({selectedJobId:e,selectedJob:t,loading:n,error:r,session:s,sessionEvents:a,transcript:l,now:o}){return t?i.jsx(zf,{job:t,session:s,sessionEvents:a,transcript:l,now:o}):e!==null&&n?i.jsx(Z,{text:"Loading selected job..."}):e!==null&&r?i.jsx(Se,{tone:"error",text:`Job #${e}: ${r.message}`}):i.jsx(Z,{text:"Select a job to inspect its timeline, worklog and GitHub links."})}function mf({data:e,loading:t,error:n,repo:r,status:s,user:a,now:l,onRepoChange:o,onStatusChange:u,onApprove:c,onReject:d,onUpdateRuleScope:p,onDeleteRule:m,onRefresh:h}){const y=(e==null?void 0:e.summary)??{},[w,v]=A.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(Mi,{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(ht,{onClick:h})]}),n?i.jsx(Se,{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(He,{title:"Proposed",value:y.proposed??0,icon:i.jsx(bl,{className:"h-5 w-5"})}),i.jsx(He,{title:"Approved",value:y.approved??0,icon:i.jsx(fn,{className:"h-5 w-5"})}),i.jsx(He,{title:"Rules",value:y.rules??0,icon:i.jsx(wl,{className:"h-5 w-5"})}),i.jsx(He,{title:"Events",value:y.events??0,icon:i.jsx(zn,{className:"h-5 w-5"})})]}),i.jsx(ye,{title:"Filters",className:"p-3",children:i.jsxs("div",{className:Q("grid gap-3",w==="proposals"?"md:grid-cols-[minmax(0,1fr)_220px]":"md:grid-cols-[minmax(0,1fr)]"),children:[i.jsx(Ge,{label:"Repository",children:i.jsxs("select",{className:"control",value:r,onChange:N=>o(N.target.value),children:[i.jsx("option",{value:"",children:"All repositories"}),((e==null?void 0:e.repositories)??[]).map(N=>i.jsx("option",{value:N,children:N},N))]})}),w==="proposals"?i.jsx(Ge,{label:"Proposal status",children:i.jsxs("select",{className:"control",value:s,onChange:N=>u(N.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(ye,{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(N=>i.jsxs("button",{className:Q("inline-flex h-8 items-center gap-1.5 rounded px-2.5 text-xs font-semibold",w===N.id?"bg-primary text-white":"text-muted hover:bg-slate-50 hover:text-foreground"),type:"button",role:"tab","aria-label":`${N.label} (${N.count})`,"aria-selected":w===N.id,onClick:()=>v(N.id),children:[i.jsx("span",{children:N.label}),i.jsx("span",{className:Q("rounded-sm border px-1 font-mono text-[10px]",w===N.id?"border-white/40 text-white":"border-border text-muted"),children:N.count})]},N.id))}),children:[w==="proposals"?i.jsx(ff,{proposals:(e==null?void 0:e.proposals)??[],loading:t,isAdmin:!!(a!=null&&a.is_admin),now:l,onApprove:c,onReject:d}):null,w==="rules"?i.jsx(bf,{rules:(e==null?void 0:e.rules)??[],loading:t,now:l,onUpdateRuleScope:p,onDeleteRule:m}):null,w==="events"?i.jsx(yf,{events:(e==null?void 0:e.events)??[],loading:t,now:l}):null]})]})}function ff({proposals:e,loading:t,isAdmin:n,now:r,onApprove:s,onReject:a}){const[l,o]=A.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(xo,{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(xf,{event:u.source_event}):i.jsxs("p",{className:"font-mono text-xs text-muted",children:["Source event ",u.event_id]}),u.error?i.jsx(Se,{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:l===u.id,onClick:async()=>{o(u.id);try{await s(u.id)}finally{o(null)}},children:[i.jsx(fn,{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:l===u.id,onClick:async()=>{o(u.id);try{await a(u.id)}finally{o(null)}},children:[i.jsx(Kt,{className:"h-4 w-4","aria-hidden":!0}),"Reject"]})]}):null]},u.id))})}function xf({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(wn,{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:yn(e.source_job_id),children:[i.jsx(tr,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",e.source_job_id]}):null,e.github_urls.length>0?i.jsx($n,{urls:e.github_urls,compact:!0}):i.jsx("span",{className:"font-mono text-xs text-muted",children:"No GitHub link"})]})}function gf(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 bf({rules:e,loading:t,now:n,onUpdateRuleScope:r,onDeleteRule:s}){const[a,l]=A.useState(null),[o,u]=A.useState(null),[c,d]=A.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(p=>{const m=p.source_event_details??[],h=m[0],y=h?h.trigger_actor||(h.actor!=="github"?h.actor:null):null,w=m.flatMap(S=>S.github_urls??[]),v=gf(p.scope),b=o===p.id,N=a===p.id,_=!!p.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(xo,{scope:p.scope,type:p.type,confidence:p.confidence,status:`${p.observations} observation${p.observations===1?"":"s"}`,timestamp:p.last_seen,now:n}),_?i.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[b?i.jsxs(i.Fragment,{children:[i.jsx(Ge,{label:"Scope",children:i.jsx("select",{className:"control h-8 min-w-[180px] py-1 text-xs",value:c,disabled:N,onChange:S=>d(S.target.value),children:v.map(S=>i.jsx("option",{value:S.value,children:S.label},S.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:N||c===p.scope,title:"Save scope",onClick:async()=>{if(c!==p.scope){l(p.id);try{await r(p.id,c),u(null)}finally{l(null)}}},children:[i.jsx(Cu,{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:N,title:"Cancel scope edit",onClick:()=>{u(null),d("")},children:[i.jsx(Kt,{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:N,title:"Edit scope",onClick:()=>{u(p.id),d(p.scope)},children:[i.jsx(Su,{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:N,onClick:async()=>{if(window.confirm("Delete this curated rule?")){l(p.id);try{await s(p.id)}finally{l(null)}}},children:[i.jsx(fi,{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:p.rule}),i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[i.jsx(wn,{actor:y,avatarUrl:h==null?void 0:h.trigger_actor_avatar_url,framed:!0}),h!=null&&h.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:yn(h.source_job_id),children:[i.jsx(tr,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",h.source_job_id]}):null,w.length>0?i.jsx($n,{urls:w,compact:!0}):i.jsx("span",{className:"font-mono text-xs text-muted",children:"No GitHub link"})]})]},p.id)})})}function yf({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(mn,{className:"h-3.5 w-3.5 shrink-0 transition-transform group-open:rotate-180","aria-hidden":!0}),i.jsx("span",{className:"truncate",children:po(r.scope)})]}),i.jsx("span",{className:"shrink-0 font-mono text-xs text-muted",children:i.jsx(Ee,{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(wn,{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:yn(r.source_job_id),children:[i.jsx(tr,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",r.source_job_id]}):null,r.github_urls.length>0?i.jsx($n,{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($n,{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 wf({tokens:e,loading:t,error:n,user:r,ownerOptions:s,dashboardUrl:a,dashboardUrlSource:l,now:o,onCreate:u,onUpdateOwner:c,onRevoke:d,onRefresh:p}){const[m,h]=A.useState(""),[y,w]=A.useState(""),[v,b]=A.useState(!1),[N,_]=A.useState(null),[S,D]=A.useState(null),[j,B]=A.useState(null),[L,C]=A.useState(""),O=e??[],T=s.find(P=>P.login===y);A.useEffect(()=>{var P;r!=null&&r.is_admin&&(y&&s.some(q=>q.login===y)||w((r==null?void 0:r.login)||((P=s[0])==null?void 0:P.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(/\/$/,""),V=`${E}/mcp`,F=`${E}/api/mcp`;return i.jsxs("div",{className:"grid min-w-0 gap-4",children:[i.jsx(mo,{icon:i.jsx(vr,{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(ht,{onClick:p})}),n?i.jsx(Se,{tone:"error",text:n.message}):null,L?i.jsx(Se,{tone:"error",text:L}):null,i.jsx(vf,{dashboardUrl:V,endpointUrl:F,dashboardUrlSource:l??"request"}),j?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(Kt,{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:j.token})]}):null,i.jsx(ye,{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 P=>{P.preventDefault();const q=m.trim();if(q){b(!0),C("");try{const W=await u(q,r!=null&&r.is_admin?y:void 0);B(W),h("")}catch(W){C(W instanceof Error?W.message:String(W))}finally{b(!1)}}},children:[i.jsx(Ge,{label:"Token name",children:i.jsx("input",{className:"control",value:m,placeholder:"local agent",disabled:v,onChange:P=>h(P.target.value)})}),r!=null&&r.is_admin?i.jsxs(Ge,{label:"Owner",children:[i.jsx(fo,{ariaLabel:"Owner",value:y,ownerOptions:s,disabled:v||s.length===0,selectedSuffix:P=>P.login===(r==null?void 0:r.login)?" (you)":"",emptyLabel:"No known users",onChange:w}),T?i.jsxs("span",{className:"font-normal text-muted",children:["Token will be linked to @",T.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:v||!m.trim()||!!(r!=null&&r.is_admin&&!y),children:[i.jsx(vr,{className:"h-4 w-4","aria-hidden":!0}),v?"Creating...":"Create token"]})]})}),i.jsx(ye,{title:"Active tokens",children:i.jsx(jf,{tokens:O,loading:t,now:o,ownerOptions:s,canManageOwners:!!(r!=null&&r.is_admin),revokingId:N,updatingOwnerId:S,onUpdateOwner:async(P,q)=>{D(P),C("");try{await c(P,q)}catch(W){C(W instanceof Error?W.message:String(W))}finally{D(null)}},onRevoke:async P=>{if(window.confirm("Revoke this MCP token?")){_(P),C("");try{await d(P)}catch(q){C(q instanceof Error?q.message:String(q))}finally{_(null)}}}})})]})}function vf({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,l=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(ye,{title:"Connect an agent",children:[s?i.jsx(Se,{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(pn,{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(pn,{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:l})]})]}),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(vr,{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(Mi,{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 mo({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 jf({tokens:e,loading:t,now:n,ownerOptions:r,canManageOwners:s,revokingId:a,updatingOwnerId:l,onUpdateOwner:o,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(za,{token:c,ownerOptions:r,disabled:l===c.id,onUpdateOwner:o}):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(he,{label:"Created",value:i.jsx(Ee,{value:c.created_at,relative:!0,now:n})}),i.jsx(he,{label:"Last used",value:c.last_used_at?i.jsx(Ee,{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(fi,{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(za,{token:c,ownerOptions:r,disabled:l===c.id,onUpdateOwner:o}):c.user_login?`@${c.user_login}`:"unassigned"}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs",children:i.jsx(Ee,{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(Ee,{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(fi,{className:"h-4 w-4","aria-hidden":!0}),a===c.id?"Revoking...":"Revoke"]})})]},c.id))})]})})]})}function za({token:e,ownerOptions:t,disabled:n,onUpdateOwner:r}){const s=e.user_login??"";return i.jsx(fo,{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 fo({value:e,ownerOptions:t,disabled:n,onChange:r,ariaLabel:s,selectedSuffix:a,emptyLabel:l,size:o="default"}){const u=t.find(d=>d.login===e),c=u?`@${u.login}${(a==null?void 0:a(u))??""}`:l;return i.jsxs("div",{className:Q("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":"",o==="compact"?"h-8 w-44 max-w-full px-2":"h-9 w-full px-2.5"),children:[i.jsx("span",{className:Q("pointer-events-none flex shrink-0 items-center justify-center",o==="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:it(u.avatar_url),alt:"",referrerPolicy:"no-referrer"}):i.jsx(Bn,{className:Q("text-muted",o==="compact"?"h-4 w-4":"h-5 w-5"),"aria-hidden":!0})}),i.jsx("span",{className:Q("pointer-events-none min-w-0 flex-1 truncate font-mono",u?"text-foreground":"text-muted",o==="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:l}):null,t.map(d=>i.jsxs("option",{value:d.login,children:["@",d.login,(a==null?void 0:a(d))??""]},d.login))]}),i.jsx(mn,{className:Q("pointer-events-none shrink-0 text-muted",o==="compact"?"h-3.5 w-3.5":"h-4 w-4"),"aria-hidden":!0})]})}function $n({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:Q("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:it(s),"aria-label":s,rel:"noreferrer",target:"_blank",children:[i.jsx(pn,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),i.jsx("span",{className:"truncate",children:t?kf(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 kf(e){try{const t=new URL(e);return t.pathname.replace(/^\//,"")+t.hash}catch{return e}}function xo({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:po(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(Ee,{value:s,relative:!0,now:a})})]})}function Nf({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(Bn,{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:it(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(wl,{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 Sf({config:e,loading:t,onEnable:n,onDisable:r}){const[s,a]=A.useState(!1),[l,o]=A.useState(""),u=!!(e!=null&&e.status.enabled),c=typeof navigator<"u"&&typeof window<"u"&&yr(),d=t||s||!(e!=null&&e.configured)||!c,p=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:Q("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":p,title:l||p,disabled:d,onClick:async()=>{a(!0),o("");try{u?await r():await n()}catch(m){o(m instanceof Error?m.message:String(m))}finally{a(!1)}},children:i.jsx(gl,{className:Q("h-4 w-4",s&&"animate-live-pulse"),"aria-hidden":!0})})})}function Cf({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?yn(e.job_id):"/"),l=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(gl,{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(Kt,{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(),l?n(a):window.open(it(a),"_blank","noopener,noreferrer")},children:[i.jsx(pn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Open"]})]})]})})}function _f({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(ht,{onClick:r,compactOnMobile:!0})]})}function ye({title:e,action:t,children:n,className:r,flushHeader:s=!1}){return i.jsxs("section",{className:Q("min-w-0 rounded-lg border border-border bg-panel p-4 shadow-sm",r),children:[i.jsxs("div",{className:Q("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 He({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 Ef({filters:e,actorOptions:t,onChange:n}){const[r,s]=A.useState(e);A.useEffect(()=>s(e),[e]);const a=ef(e),l=Fa(e)||Fa(r),o=()=>{s(_i),n(_i)};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(ku,{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:[l?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(),o()},children:[i.jsx(qn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Clear filters"]}):null,i.jsx(mn,{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(Ge,{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(Ge,{label:"Repository",children:i.jsx("input",{className:"control",value:r.repo,placeholder:"owner/repo",onChange:u=>s({...r,repo:u.target.value})})}),i.jsx(Ge,{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(Ge,{label:"Action",children:i.jsx("input",{className:"control",value:r.action,placeholder:"reply_comment",onChange:u=>s({...r,action:u.target.value})})}),i.jsx(Ge,{label:"Actor",className:"xl:col-span-2",children:i.jsx(Pf,{value:r.actor,options:t,onChange:u=>s({...r,actor:u})})}),i.jsx(Ge,{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:!l,onClick:o,children:[i.jsx(qn,{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(_u,{className:"h-4 w-4","aria-hidden":!0}),"Apply"]})]})]})]})}function Pf({value:e,options:t,onChange:n}){const[r,s]=A.useState(!1),a=e.trim().replace(/^@/,"").toLowerCase(),l=t.filter(u=>!a||u.login.toLowerCase().includes(a)).slice(0,8),o=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:[o?i.jsx("img",{className:"h-5 w-5 shrink-0 rounded-full bg-slate-100",src:it(o.avatar_url??""),alt:`${o.login} avatar`,referrerPolicy:"no-referrer"}):i.jsx(Bn,{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(Kt,{className:"h-3.5 w-3.5","aria-hidden":!0})}):null]}),r&&l.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:l.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:it(u.avatar_url),alt:`${u.login} avatar`,referrerPolicy:"no-referrer"}):i.jsx(Bn,{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 Ge({label:e,children:t,className:n}){return i.jsxs("label",{className:Q("grid min-w-0 gap-1 text-xs font-semibold text-muted",n),children:[e,t]})}function Rf({jobs:e,loading:t,loadingMore:n=!1,hasMore:r=!1,onLoadMore:s,onViewJob:a,now:l,user:o,onRetry:u,onDismiss:c,onCancel:d}){const[p,m]=A.useState(null),[h,y]=A.useState(null),[w,v]=A.useState(null),b=A.useRef(!1),N=A.useRef(n),_=!!(o!=null&&o.is_admin&&u),S=!!(o!=null&&o.is_admin&&c);A.useEffect(()=>{N.current&&!n&&(b.current=!1),N.current=n},[n]);const D=A.useCallback(()=>{b.current||(b.current=!0,s==null||s())},[s]),j=A.useCallback(async C=>{if(u){m(C);try{await u(C)}finally{m(null)}}},[u]),B=A.useCallback(async C=>{if(c){y(C);try{await c(C)}finally{y(null)}}},[c]),L=A.useCallback(async(C,O)=>{if(d){v(C);try{await d(C,O)}finally{v(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(C=>i.jsx(Lf,{job:C,onViewJob:a,now:l,canRetry:_&&In(C.status),retrying:p===C.id,onRetry:j,canDismiss:S&&In(C.status),dismissing:h===C.id,onDismiss:B,canCancel:!!(d&&Ei(C,o)),cancelling:w===C.id,onCancel:L},C.id)),i.jsx(Tf,{hasMore:r,loading:n,onLoadMore:D})]}),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(C=>i.jsx(If,{job:C,now:l,onViewJob:a,canRetry:_&&In(C.status),retrying:p===C.id,onRetry:j,canDismiss:S&&In(C.status),dismissing:h===C.id,onDismiss:B,canCancel:!!(d&&Ei(C,o)),cancelling:w===C.id,onCancel:L},C.id))})]}),i.jsx(Af,{hasMore:r,loading:n,onLoadMore:D})]})]})}function If({job:e,now:t,onViewJob:n,canRetry:r,retrying:s,onRetry:a,canDismiss:l,dismissing:o,onDismiss:u,canCancel:c,cancelling:d,onCancel:p}){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(ns,{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(ts,{intent:e.intent,actionMode:e.action_mode,display:"intent",compact:!0})})]}),i.jsx("td",{className:"px-3 py-3",children:i.jsx(wn,{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:Ke(es(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:Ke(Zi(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(Ee,{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(go,{jobId:e.id,canRetry:r,retrying:s,onRetry:a,compact:!0}),i.jsx(bo,{jobId:e.id,canDismiss:l,dismissing:o,onDismiss:u,compact:!0}),i.jsx(yo,{jobId:e.id,canCancel:c,cancelling:d,onCancel:p,compact:!0})]})})]})}function Tf({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(mn,{className:"h-4 w-4","aria-hidden":!0}),t?"Loading more jobs...":"Load more jobs"]})}function Af({hasMore:e,loading:t,onLoadMore:n}){const r=A.useRef(null);return A.useEffect(()=>{const s=r.current;if(!s||!e||t||!n)return;if(!("IntersectionObserver"in window)){n();return}const a=new IntersectionObserver(l=>{l.some(o=>o.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 Lf({job:e,onViewJob:t,now:n,canRetry:r,retrying:s,onRetry:a,canDismiss:l,dismissing:o,onDismiss:u,canCancel:c,cancelling:d,onCancel:p}){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(ts,{intent:e.intent,actionMode:e.action_mode,compact:!0,display:"intent"}),i.jsx(wn,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url})]})]}),i.jsx(ns,{status:e.status})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[i.jsx(he,{label:"Wait",value:Ke(es(e,n))}),i.jsx(he,{label:"Runtime",value:Ke(Zi(e,n))}),i.jsx(he,{label:"Updated",value:i.jsx(Ee,{value:e.updated_at,compact:!0,relative:!0,now:n})})]})]}),r||l||c?i.jsxs("div",{className:"flex flex-wrap gap-2 border-t border-border px-3 py-2",children:[i.jsx(go,{jobId:e.id,canRetry:r,retrying:s,onRetry:a}),i.jsx(bo,{jobId:e.id,canDismiss:l,dismissing:o,onDismiss:u}),i.jsx(yo,{jobId:e.id,canCancel:c,cancelling:d,onCancel:p})]}):null]})}function go({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:Q("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 l=>{l.stopPropagation(),window.confirm(`Retry job #${e}?`)&&await r(e)},children:[i.jsx(qn,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:Q(s&&"sr-only"),children:a})]})}function bo({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:Q("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 l=>{l.stopPropagation(),window.confirm(`Dismiss job #${e}?`)&&await r(e)},children:[i.jsx(fn,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:Q(s&&"sr-only"),children:a})]})}function yo({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:Q("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 l=>{l.stopPropagation();const o=window.prompt(`Cancel job #${e}? Optional reason:`);o!==null&&await r(e,o)},children:[i.jsx(Kt,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:Q(s&&"sr-only"),children:a})]})}function wn({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:it(t),alt:e?`${e} avatar`:"",referrerPolicy:"no-referrer"}):i.jsx(Bn,{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 Mf(e){return(e==null?void 0:e.model)??"OpenClaw default"}function Of(e){return(e==null?void 0:e.thinking)??"OpenClaw default"}function Df(e){return e?e.configured?"configured":e.summary:"n/a"}function Ff(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 ts({intent:e,actionMode:t,compact:n=!1,display:r="mode"}){const s=Ff(e,t),a=s.intentLabel==="work_allowed"?Pu:yl,l=r==="intent"?s.intentLabel:s.mode;return i.jsxs("span",{className:Q("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}: ${l}`,children:[i.jsx(a,{className:Q("h-3.5 w-3.5 shrink-0",n&&"h-3 w-3"),"aria-hidden":!0}),i.jsx("span",{className:"truncate font-mono",children:l})]})}function zf({job:e,session:t,sessionEvents:n,transcript:r,now:s,compact:a=!1}){var h;const l=yn(e.id),o=n??[],u=r??[],c=Fm(o),d=zm(u),p=Zi(e,s),m=es(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(ns,{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:l,children:[i.jsx(tr,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",e.id]}),i.jsx(wn,{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($n,{urls:e.github_urls,compact:!0}):i.jsx("p",{className:"text-xs text-muted",children:"No links recorded."})]})]})]}),i.jsxs("div",{className:Q("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-3"),children:[i.jsx(he,{label:"Queue wait",value:Ke(m)}),i.jsx(he,{label:e.status==="running"?"Running for":"Runtime",value:Ke(p)}),i.jsx(he,{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:Q("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-3"),children:[i.jsx(he,{label:"Model",value:Mf(e.model_route)}),i.jsx(he,{label:"Reasoning",value:Of(e.model_route)}),i.jsx(he,{label:"Route",value:Df(e.model_route)})]}),i.jsx(Bf,{job:e,compact:a}),i.jsxs("div",{className:Q("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-2 xl:grid-cols-4"),children:[i.jsx(he,{label:"Created",value:i.jsx(Ee,{value:e.created_at,compact:!0,relative:!0,now:s})}),i.jsx(he,{label:"Started",value:e.started_at?i.jsx(Ee,{value:e.started_at,compact:!0,relative:!0,now:s}):"n/a"}),i.jsx(he,{label:"Updated",value:i.jsx(Ee,{value:e.updated_at,compact:!0,relative:!0,now:s})}),i.jsx(he,{label:"Finished",value:e.finished_at?i.jsx(Ee,{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?(h=e.worklog)==null?void 0:h.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(Ee,{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(vl,{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(he,{label:"Session ID",value:t.id}),i.jsx(he,{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(Uf,{event:y,defaultOpen:Oa(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(qf,{entry:y,defaultOpen:Oa(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 Bf({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:Q("grid gap-2 text-sm sm:gap-3",t?"grid-cols-1":"grid-cols-2 xl:grid-cols-4"),children:[i.jsx(he,{label:"Mode",value:i.jsx(ts,{intent:e.intent,actionMode:e.action_mode})}),i.jsx(he,{label:"Intent",value:e.intent}),i.jsx(he,{label:"Addressed",value:n?Ba(r.addressed_to_agent):"n/a"}),i.jsx(he,{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(Xe,{label:"Classifier",value:n.enabled?"enabled":"disabled"}),i.jsx(Xe,{label:"Applied",value:Ba(r.applied)}),i.jsx(Xe,{label:"Confidence",value:a}),i.jsx(Xe,{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(Xe,{label:"LLM",value:`${r.action??"n/a"} / ${r.work_intent??"n/a"}`}),i.jsx(Xe,{label:"Scope",value:r.scope||"n/a"})]}),r.main_request?i.jsx(Xe,{label:"Main request",value:r.main_request}):null,r.subordinate_reason?i.jsx(Xe,{label:"Subordinate reason",value:r.subordinate_reason}):null,r.reason?i.jsx(Xe,{label:"Reason",value:r.reason}):null,n.error?i.jsx(Xe,{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 Ba(e){return e===!0?"yes":e===!1?"no":"n/a"}function Xe({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:Q("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 qf({entry:e,defaultOpen:t,now:n}){return i.jsx(wo,{badge:e.badge,meta:i.jsx(Ee,{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 Uf({event:e,defaultOpen:t,now:n}){return i.jsx(wo,{badge:e.badge,meta:i.jsx(Ee,{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 wo({badge:e,meta:t,count:n,summary:r,defaultOpen:s,children:a}){const[l,o]=A.useState(!!s);return i.jsxs("details",{className:"group min-w-0 rounded border border-border bg-slate-50/60",open:l,onToggle:u=>o(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(mn,{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 qa({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(Wn,{width:"100%",height:"100%",children:i.jsxs(_r,{data:n,children:[i.jsx(Jn,{strokeDasharray:"3 3"}),i.jsx(Xn,{dataKey:"name"}),i.jsx(Yn,{tickFormatter:Ke}),i.jsx(Zn,{formatter:r=>[Ke(Number(r)),e]}),i.jsx($t,{dataKey:"seconds",fill:"#0969da",radius:[4,4,0,0]})]})})})}function $f({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(Wn,{width:"100%",height:"100%",children:i.jsxs(_r,{data:r,children:[i.jsx(Jn,{strokeDasharray:"3 3"}),i.jsx(Xn,{dataKey:"day",minTickGap:16}),i.jsx(Yn,{allowDecimals:!1}),i.jsx(Zn,{formatter:s=>[Number(s),"jobs"]}),i.jsx($t,{dataKey:"count",fill:"#16a34a",radius:[4,4,0,0]})]})})})}function Hf({usage:e,loading:t,totalJobs:n}){const[r,s]=A.useState("day"),a=(e==null?void 0:e[r])??[],l=a.map(u=>({...u,label:Kf(u.bucket,r)})),o=a.reduce((u,c)=>u+c.seconds,0);return t&&l.length===0?i.jsx(Z,{text:"Loading runtime usage..."}):l.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(Eu,{className:"h-4 w-4","aria-hidden":!0}),i.jsxs("span",{children:[fr(o)," 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:Q("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(Wn,{width:"100%",height:"100%",children:i.jsxs(_r,{data:l,children:[i.jsx(Jn,{strokeDasharray:"3 3"}),i.jsx(Xn,{dataKey:"label",minTickGap:16,tick:{fontSize:11}}),i.jsx(Yn,{tickFormatter:u=>fr(Number(u))}),i.jsx(nl,{}),i.jsx(Zn,{formatter:(u,c)=>c==="Work"?[fr(Number(u)),"work"]:c==="Review"?[fr(Number(u)),"review"]:[Number(u),String(c)],labelFormatter:u=>String(u)}),i.jsx($t,{dataKey:"work_seconds",name:"Work",stackId:"runtime",fill:"#0969da",isAnimationActive:!1}),i.jsx($t,{dataKey:"review_seconds",name:"Review",stackId:"runtime",fill:"#8250df",radius:[4,4,0,0],isAnimationActive:!1})]})})})]})}function Kf(e,t){if(t==="month"){const[a,l]=e.split("-").map(Number);return!a||!l?e:new Intl.DateTimeFormat(void 0,{month:"short",year:"numeric"}).format(new Date(a,l-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 fr(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 Ua(e){return Object.values(e).reduce((t,n)=>t+n,0)}function Qf({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(l=>l.active_state==="active").length,s=n.filter(l=>l.active_state==="failed"||l.result==="failed").length,a=n.filter(l=>l.kind==="timer").length;return i.jsxs("div",{className:"grid min-w-0 gap-3",children:[e.errors.length>0?i.jsx(Se,{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(xr,{label:"Units",value:String(n.length)}),i.jsx(xr,{label:"Active",value:String(r)}),i.jsx(xr,{label:"Failed",value:String(s),tone:s>0?"bad":"neutral"}),i.jsx(xr,{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(l=>i.jsx(Vf,{unit:l},l.unit))})]})]})]})}function xr({label:e,value:t,tone:n="neutral"}){return i.jsxs("div",{className:Q("min-w-0 rounded-md border bg-white px-3 py-2",n==="bad"?"border-red-200":"border-border"),children:[i.jsx("div",{className:Q("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 Vf({unit:e}){const[t,n]=A.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:l=>n(l.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(mn,{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:Q("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($a,{label:"State",value:e.sub_state,detail:e.result||"unknown"}),i.jsx($a,{label:"PID",value:e.main_pid?String(e.main_pid):"n/a",detail:Ke(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(Gf,{unit:e.unit,active:t})})]})}function $a({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 Gf({unit:e,active:t}){const[n,r]=A.useState([]),[s,a]=A.useState(""),l=A.useRef(null);return A.useEffect(()=>{if(!t){r([]),a("");return}r([]),a("");const o=new EventSource(`/api/systemd/journal/stream?unit=${encodeURIComponent(e)}`);return o.addEventListener("journal_line",u=>{const c=Cr(u);c&&r(d=>[...d.slice(-199),c])}),o.addEventListener("journal_error",u=>{const c=Cr(u);a((c==null?void 0:c.error)??"journal stream failed")}),o.onerror=()=>{},()=>o.close()},[t,e]),A.useEffect(()=>{const o=l.current;o&&(o.scrollTop=o.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(Se,{tone:"error",text:s}):null,i.jsx("div",{ref:l,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((o,u)=>i.jsx("div",{className:"break-words [overflow-wrap:anywhere]",children:o.line},`${o.unit}-${u}`)):i.jsx("div",{className:"text-slate-400",children:"No journal lines received yet."})})]})}function Wf({data:e,loading:t}){var p,m,h,y,w,v;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=>jo(b)),s=r.reduce((b,N)=>b+N.cpu_ticks,0),a=r.reduce((b,N)=>b+Xf(N),0),l=e.executor.service==="active",o=r.slice(0,8).map(b=>({label:`pid ${b.pid}`,ticks:b.cpu_ticks})),u=(e.samples??[]).map(b=>({label:Mn(b.ts),ticks:b.cpu_ticks,io:b.io_bytes,active:b.active_since_last_sample?"active":"quiet"})),c=u.length>0?u:o,d=(p=e.samples)==null?void 0:p[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:Q("inline-flex h-6 items-center rounded-full border px-2 text-xs font-semibold",l?"border-emerald-300 bg-emerald-50 text-emerald-700":"border-slate-300 bg-white text-slate-600"),children:l?"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," ",Ke(b.age_seconds)]},b.id))}):null,d?i.jsxs("p",{className:"mt-1 text-xs text-muted",children:["Last persisted sample ",Mn(d.ts)," · ",d.active_since_last_sample?"activity observed":`quiet ${Ke(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(ei,{label:"PID",value:e.executor.pid?String(e.executor.pid):"n/a"}),i.jsx(ei,{label:"Children",value:String(r.length)}),i.jsx(ei,{label:"CPU ticks",value:String(s)})]})]})}),i.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[i.jsx(gr,{label:"Live process",value:((m=e.signals)==null?void 0:m.live_process.state)??(r.length>0?"live":"no_child_process"),detail:`${((h=e.signals)==null?void 0:h.live_process.child_count)??r.length} children`}),i.jsx(gr,{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 ${Mn(d.ts)}`:"no sample"}),i.jsx(gr,{label:"Semantic progress",value:(w=e.signals)!=null&&w.semantic_progress.length?"recent":"none",detail:Ha(e.running_jobs,"semantic_progress")}),i.jsx(gr,{label:"Visible progress",value:(v=e.signals)!=null&&v.visible_progress.length?"streaming":"none",detail:Ha(e.running_jobs,"visible_progress")})]}),e.alerts.length>0?i.jsx(Se,{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(Gs,{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:[ko(a)," I/O"]})]}),c.length>0?i.jsx("div",{className:"h-40",children:i.jsx(Wn,{width:"100%",height:"100%",children:i.jsxs(Eo,{data:c,children:[i.jsx(Jn,{strokeDasharray:"3 3"}),i.jsx(Xn,{dataKey:"label",tick:!1}),i.jsx(Yn,{allowDecimals:!1,tick:{fontSize:11}}),i.jsx(Zn,{formatter:b=>[Number(b),"cpu ticks"]}),i.jsx(Po,{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(Gs,{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(vo,{process:b},b.pid))}):i.jsx(Z,{text:"No child process detected for the executor."})]})]})]})}function Jf({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(Di,{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:uo(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 vo({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 ",ko(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(vo,{process:a},a.pid))}):null]})}function ei({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 gr({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 Ha(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} ${Ke(r.age_seconds??null)}`}function jo(e){return[e,...(e.children??[]).flatMap(t=>jo(t))]}function Xf(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 ko(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function he({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 ns({status:e}){const t=Bm(e),n=e==="running"||e==="pending";return i.jsxs("span",{className:Q("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:Q("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 Se({tone:e,text:t}){return i.jsx("div",{className:Q("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 ht({onClick:e,compactOnMobile:t=!1}){return i.jsxs("button",{className:Q("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(Oi,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:Q(t&&"hidden sm:inline"),children:"Refresh"})]})}const Ka=document.getElementById("root");Ka&&Lo.createRoot(Ka).render(i.jsx(A.StrictMode,{children:i.jsx(lu,{client:Pm,children:i.jsx(tf,{})})})); diff --git a/src/github_agent_bridge/dashboard_static/index.html b/src/github_agent_bridge/dashboard_static/index.html index 1b45abc..3854573 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 - + - +
From a4be314862b57ac815cf387b1eefe9424f5164bc Mon Sep 17 00:00:00 2001 From: GISCE Bot Date: Fri, 2 Oct 2026 14:17:23 +0200 Subject: [PATCH 2/3] feat(webhooks): expose monitoring data Persist per-hook metadata, serve real delivery activity to the admin dashboard, and bound receipt history with configurable retention. Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com> --- docs/ingestion.md | 11 +++-- src/github_agent_bridge/backend.py | 34 +++++++++++++ src/github_agent_bridge/queue.py | 5 +- src/github_agent_bridge/sql/schema.sql | 11 +++++ src/github_agent_bridge/webhook.py | 33 ++++++++++++- tests/test_webhook.py | 68 ++++++++++++++++++++++++++ 6 files changed, 156 insertions(+), 6 deletions(-) diff --git a/docs/ingestion.md b/docs/ingestion.md index aa3170e..5ecdc2b 100644 --- a/docs/ingestion.md +++ b/docs/ingestion.md @@ -78,17 +78,22 @@ organization webhook under **Organization settings → Webhooks**: A repository webhook covers only that repository. An organization webhook covers repositories in that organization and is the recommended deployment. -Multiple organizations may use the same endpoint when each owner has its own -entry in `GITHUB_AGENT_BRIDGE_WEBHOOK_SECRETS_BY_OWNER`. +Multiple organizations and multiple hooks may use the same endpoint when each +owner has its own entry in `GITHUB_AGENT_BRIDGE_WEBHOOK_SECRETS_BY_OWNER`. +GitHub's `X-GitHub-Hook-ID` header keeps their inventory and activity separate. The endpoint stores only routing metadata, a SHA-256 payload hash, and the canonical event key in `webhook_shadow_receipts`; it deliberately stores no raw payload and never creates a queue job. Authenticated operators can inspect -counts, duplicate deliveries, and cross-source event-key matches at +counts, a daily activity series, hook inventory, recent deliveries, duplicate +deliveries, and cross-source event-key matches at `GET /api/webhooks/github/status`. Here “operators” means users authorized as dashboard administrators through `GITHUB_AGENT_BRIDGE_DASHBOARD_ADMIN_USERS` or `GITHUB_AGENT_BRIDGE_DASHBOARD_ADMIN_TEAMS`; other authenticated dashboard users receive HTTP 403 and unauthenticated requests receive HTTP 401. +Receipt details are retained for 30 days by default and pruned during ingestion; +set `GITHUB_AGENT_BRIDGE_WEBHOOK_RETENTION_DAYS` to change that window. Raw +payloads are never retained. The maintained event inventory and support levels are in [`webhook-events.md`](webhook-events.md). diff --git a/src/github_agent_bridge/backend.py b/src/github_agent_bridge/backend.py index 57b2dff..bdd22b3 100644 --- a/src/github_agent_bridge/backend.py +++ b/src/github_agent_bridge/backend.py @@ -118,6 +118,7 @@ def __init__( webhook_secrets: tuple[str, ...] | None = None, webhook_secrets_by_owner: dict[str, tuple[str, ...]] | None = None, webhook_max_bytes: int | None = None, + webhook_retention_days: int | None = None, ) -> None: self.db = Path(db).expanduser() self.secret_key = secret_key or os.getenv("GITHUB_AGENT_BRIDGE_DASHBOARD_SECRET_KEY", "") @@ -140,6 +141,7 @@ def __init__( ) self.webhook_secrets_by_owner = webhook_secrets_by_owner if webhook_secrets_by_owner is not None else _webhook_secrets_by_owner_env() self.webhook_max_bytes = webhook_max_bytes or int(os.getenv("GITHUB_AGENT_BRIDGE_WEBHOOK_MAX_BYTES", "1048576")) + self.webhook_retention_days = webhook_retention_days or int(os.getenv("GITHUB_AGENT_BRIDGE_WEBHOOK_RETENTION_DAYS", "30")) @property def oauth_ready(self) -> bool: @@ -605,6 +607,7 @@ async def github_webhook_shadow(request: Request) -> dict[str, Any]: raise HTTPException(status_code=status.HTTP_415_UNSUPPORTED_MEDIA_TYPE, detail="application_json_required") delivery_id = request.headers.get("x-github-delivery", "").strip() event_name = request.headers.get("x-github-event", "").strip() + hook_id = request.headers.get("x-github-hook-id", "").strip() or None signature = request.headers.get("x-hub-signature-256", "").strip() if not delivery_id or not event_name: raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="github_headers_required") @@ -639,6 +642,8 @@ async def github_webhook_shadow(request: Request) -> dict[str, Any]: delivery_id=delivery_id, event_name=event_name, raw_payload=raw_payload, + hook_id=hook_id, + retention_days=config.webhook_retention_days, ) return {"mode": "shadow", "status": receipt.status, "event_key": receipt.event_key} @@ -656,6 +661,20 @@ def github_webhook_shadow_status(_: dict[str, Any] = Depends(current_admin_profi duplicate_deliveries = con.execute( "SELECT COALESCE(SUM(duplicate_count),0) FROM webhook_shadow_receipts" ).fetchone()[0] + timeseries_rows = con.execute( + "SELECT substr(created_at,1,10), " + "SUM(CASE WHEN status='observed' THEN 1 ELSE 0 END), " + "SUM(duplicate_count), SUM(CASE WHEN status='unsupported' THEN 1 ELSE 0 END) " + "FROM webhook_shadow_receipts GROUP BY substr(created_at,1,10) ORDER BY 1" + ).fetchall() + delivery_rows = con.execute( + "SELECT delivery_id,hook_id,event_name,action,event_key,repository,status,created_at " + "FROM webhook_shadow_receipts ORDER BY created_at DESC LIMIT 100" + ).fetchall() + hook_rows = con.execute( + "SELECT hook_id,target,target_type,active,events_json,last_ping_at,last_event_at,updated_at " + "FROM webhook_hooks ORDER BY target_type,target,hook_id" + ).fetchall() counts = {row[0]: row[1] for row in rows} return { "mode": "shadow", @@ -663,6 +682,21 @@ def github_webhook_shadow_status(_: dict[str, Any] = Depends(current_admin_profi "receipts": counts, "duplicate_deliveries": duplicate_deliveries, "cross_source_matches": cross_source, + "timeseries": [ + {"bucket": row[0], "observed": row[1], "duplicate": row[2], "unsupported": row[3]} + for row in timeseries_rows + ], + "hooks": [ + {"id": row[0], "target": row[1], "target_type": row[2], "active": bool(row[3]), + "events": json.loads(row[4]), "last_ping_at": row[5], "last_event_at": row[6], + "status": ("inactive" if not row[3] else "receiving" if row[6] else "never_seen")} + for row in hook_rows + ], + "recent_deliveries": [ + {"delivery_id": row[0], "hook_id": row[1], "event_name": row[2], "action": row[3], + "event_key": row[4], "repository": row[5], "status": row[6], "created_at": row[7]} + for row in delivery_rows + ], } def dashboard_index() -> FileResponse: diff --git a/src/github_agent_bridge/queue.py b/src/github_agent_bridge/queue.py index 9b48d26..84f5aa6 100644 --- a/src/github_agent_bridge/queue.py +++ b/src/github_agent_bridge/queue.py @@ -801,7 +801,10 @@ def _ensure_columns(self, con: sqlite3.Connection) -> None: "jobs": {"trigger_actor": "TEXT", "trigger_actor_avatar_url": "TEXT"}, "coalesced_notifications": {"trigger_actor": "TEXT", "trigger_actor_avatar_url": "TEXT"}, "mcp_tokens": {"user_login": "TEXT", "created_by": "TEXT"}, - "webhook_shadow_receipts": {"duplicate_count": "INTEGER NOT NULL DEFAULT 0"}, + "webhook_shadow_receipts": { + "duplicate_count": "INTEGER NOT NULL DEFAULT 0", + "hook_id": "TEXT", + }, } for table, columns in tables.items(): if con.execute("SELECT 1 FROM sqlite_master WHERE type='table' AND name=?", (table,)).fetchone() is None: diff --git a/src/github_agent_bridge/sql/schema.sql b/src/github_agent_bridge/sql/schema.sql index 4d9184f..814c608 100644 --- a/src/github_agent_bridge/sql/schema.sql +++ b/src/github_agent_bridge/sql/schema.sql @@ -64,6 +64,7 @@ CREATE TABLE IF NOT EXISTS github_events ( CREATE INDEX IF NOT EXISTS idx_github_events_job_id ON github_events(job_id); CREATE TABLE IF NOT EXISTS webhook_shadow_receipts ( delivery_id TEXT PRIMARY KEY, + hook_id TEXT, event_name TEXT NOT NULL, action TEXT, event_key TEXT, @@ -75,6 +76,16 @@ CREATE TABLE IF NOT EXISTS webhook_shadow_receipts ( ); CREATE INDEX IF NOT EXISTS idx_webhook_shadow_event_key ON webhook_shadow_receipts(event_key); CREATE INDEX IF NOT EXISTS idx_webhook_shadow_created ON webhook_shadow_receipts(created_at); +CREATE TABLE IF NOT EXISTS webhook_hooks ( + hook_id TEXT PRIMARY KEY, + target TEXT NOT NULL, + target_type TEXT NOT NULL CHECK(target_type IN ('organization','repository')), + active INTEGER NOT NULL DEFAULT 1, + events_json TEXT NOT NULL DEFAULT '[]', + last_ping_at TEXT, + last_event_at TEXT, + updated_at TEXT NOT NULL +); CREATE TABLE IF NOT EXISTS coalesced_notifications ( id INTEGER PRIMARY KEY AUTOINCREMENT, job_id INTEGER NOT NULL REFERENCES jobs(id) ON DELETE CASCADE, diff --git a/src/github_agent_bridge/webhook.py b/src/github_agent_bridge/webhook.py index cbdb73a..2d52083 100644 --- a/src/github_agent_bridge/webhook.py +++ b/src/github_agent_bridge/webhook.py @@ -66,6 +66,8 @@ def persist_shadow_delivery( delivery_id: str, event_name: str, raw_payload: bytes, + hook_id: str | None = None, + retention_days: int = 30, ) -> ShadowReceipt: payload = json.loads(raw_payload) action = str(payload.get("action") or "") or None @@ -77,10 +79,37 @@ def persist_shadow_delivery( now = utc_now() con = sqlite3.connect(Path(db).expanduser(), timeout=30) try: + con.execute( + "DELETE FROM webhook_shadow_receipts WHERE julianday(created_at) < julianday('now', ?)", + (f"-{retention_days} days",), + ) + if hook_id: + hook = payload.get("hook") if isinstance(payload, dict) else None + organization = payload.get("organization") if isinstance(payload, dict) else None + target_type = "organization" if isinstance(organization, dict) else "repository" + target = ( + organization.get("login") if isinstance(organization, dict) + else repository.get("full_name") if isinstance(repository, dict) + else None + ) or "unknown" + active = bool(hook.get("active", True)) if isinstance(hook, dict) else True + events = hook.get("events", []) if isinstance(hook, dict) else [] + con.execute( + "INSERT INTO webhook_hooks(hook_id,target,target_type,active,events_json,last_ping_at,last_event_at,updated_at) " + "VALUES(?,?,?,?,?,?,?,?) ON CONFLICT(hook_id) DO UPDATE SET " + "target=CASE WHEN excluded.events_json='[]' THEN webhook_hooks.target ELSE excluded.target END," + "target_type=CASE WHEN excluded.events_json='[]' THEN webhook_hooks.target_type ELSE excluded.target_type END," + "active=CASE WHEN excluded.events_json='[]' THEN webhook_hooks.active ELSE excluded.active END," + "events_json=CASE WHEN excluded.events_json='[]' THEN webhook_hooks.events_json ELSE excluded.events_json END," + "last_ping_at=COALESCE(excluded.last_ping_at,webhook_hooks.last_ping_at)," + "last_event_at=COALESCE(excluded.last_event_at,webhook_hooks.last_event_at),updated_at=excluded.updated_at", + (hook_id, target, target_type, int(active), json.dumps(events), now if event_name == "ping" else None, + now if event_name != "ping" else None, now), + ) try: con.execute( - "INSERT INTO webhook_shadow_receipts(delivery_id,event_name,action,event_key,repository,payload_hash,status,created_at) VALUES(?,?,?,?,?,?,?,?)", - (delivery_id, event_name, action, event_key, repo, payload_hash, status, now), + "INSERT INTO webhook_shadow_receipts(delivery_id,hook_id,event_name,action,event_key,repository,payload_hash,status,created_at) VALUES(?,?,?,?,?,?,?,?,?)", + (delivery_id, hook_id, event_name, action, event_key, repo, payload_hash, status, now), ) con.commit() except sqlite3.IntegrityError: diff --git a/tests/test_webhook.py b/tests/test_webhook.py index 73a628e..6812d02 100644 --- a/tests/test_webhook.py +++ b/tests/test_webhook.py @@ -23,6 +23,10 @@ def signed_headers(payload: bytes, *, delivery: str = "delivery-1", event: str = } +def hook_headers(payload: bytes, *, delivery: str, event: str, hook_id: str) -> dict[str, str]: + return {**signed_headers(payload, delivery=delivery, event=event), "x-github-hook-id": hook_id} + + def issue_comment_payload(*, action: str = "created") -> bytes: return json.dumps({ "action": action, @@ -152,6 +156,70 @@ def test_dashboard_status_hides_webhook_tab_when_not_configured(tmp_path): assert client.get("/api/status").json()["webhook_configured"] is False +def test_webhook_status_exposes_real_hook_inventory_deliveries_and_timeseries(tmp_path): + db = tmp_path / "bridge.sqlite3" + client = TestClient(create_app(DashboardConfig(db=db, require_auth=False, webhook_secrets=(SECRET,)))) + ping = json.dumps({ + "zen": "Keep it logically awesome.", + "hook": {"id": 42, "active": True, "events": ["issue_comment", "pull_request_review"]}, + "organization": {"login": "gisce"}, + }).encode() + delivery = issue_comment_payload() + + assert client.post("/api/webhooks/github", content=ping, headers=hook_headers(ping, delivery="ping-1", event="ping", hook_id="42")).status_code == 200 + assert client.post("/api/webhooks/github", content=delivery, headers=hook_headers(delivery, delivery="delivery-1", event="issue_comment", hook_id="42")).status_code == 200 + response = client.get("/api/webhooks/github/status") + + assert response.status_code == 200 + status = response.json() + assert status["hooks"] == [{ + "id": "42", "target": "gisce", "target_type": "organization", + "active": True, "events": ["issue_comment", "pull_request_review"], + "last_ping_at": status["hooks"][0]["last_ping_at"], + "last_event_at": status["hooks"][0]["last_event_at"], "status": "receiving", + }] + assert status["hooks"][0]["last_ping_at"] + assert status["hooks"][0]["last_event_at"] + assert status["recent_deliveries"][0]["delivery_id"] == "delivery-1" + assert status["recent_deliveries"][0]["hook_id"] == "42" + assert status["timeseries"][0]["observed"] == 1 + assert status["timeseries"][0]["unsupported"] == 1 + + +def test_webhook_receipt_retention_removes_expired_delivery_details(tmp_path): + db = tmp_path / "bridge.sqlite3" + client = TestClient(create_app(DashboardConfig( + db=db, require_auth=False, webhook_secrets=(SECRET,), webhook_retention_days=7, + ))) + payload = issue_comment_payload() + client.post("/api/webhooks/github", content=payload, headers=signed_headers(payload, delivery="old")) + with sqlite3.connect(db) as con: + con.execute("UPDATE webhook_shadow_receipts SET created_at='2020-01-01T00:00:00+00:00'") + client.post("/api/webhooks/github", content=payload, headers=signed_headers(payload, delivery="new")) + + assert [item["delivery_id"] for item in client.get("/api/webhooks/github/status").json()["recent_deliveries"]] == ["new"] + + +def test_existing_webhook_receipt_schema_is_migrated_for_hook_inventory(tmp_path): + db = tmp_path / "bridge.sqlite3" + with sqlite3.connect(db) as con: + con.execute( + "CREATE TABLE webhook_shadow_receipts (delivery_id TEXT PRIMARY KEY,event_name TEXT NOT NULL," + "action TEXT,event_key TEXT,repository TEXT,payload_hash TEXT NOT NULL,status TEXT NOT NULL," + "duplicate_count INTEGER NOT NULL DEFAULT 0,created_at TEXT NOT NULL)" + ) + payload = issue_comment_payload() + client = TestClient(create_app(DashboardConfig(db=db, require_auth=False, webhook_secrets=(SECRET,)))) + + response = client.post( + "/api/webhooks/github", content=payload, + headers=hook_headers(payload, delivery="migrated", event="issue_comment", hook_id="84"), + ) + + assert response.status_code == 200 + assert client.get("/api/webhooks/github/status").json()["hooks"][0]["id"] == "84" + + def test_submitted_review_uses_same_canonical_key_as_email_ingestion(tmp_path): payload = json.dumps({ "action": "submitted", From d13698ead46a81f65832f486a6c1c58cd19d9ab9 Mon Sep 17 00:00:00 2001 From: GISCE Bot Date: Fri, 2 Oct 2026 18:07:49 +0200 Subject: [PATCH 3/3] perf(webhooks): split dashboard monitoring queries Separate summary, bounded time-series, hook inventory, and cursor-paginated deliveries so each dashboard tab loads only its own data. Add the delivery ordering index and preserve the status endpoint as a lightweight compatibility alias. Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com> --- dashboard/src/main.test.tsx | 26 ++- dashboard/src/main.tsx | 166 +++++++++++++--- docs/ingestion.md | 26 ++- src/github_agent_bridge/backend.py | 186 ++++++++++++++--- .../assets/index-CU4liAj_.css | 1 + .../assets/index-D2uz4i7l.css | 1 - .../dashboard_static/assets/index-DQsWONBl.js | 187 ++++++++++++++++++ .../dashboard_static/assets/index-lIzCm8Xd.js | 187 ------------------ .../dashboard_static/index.html | 4 +- src/github_agent_bridge/queue.py | 4 + src/github_agent_bridge/sql/schema.sql | 1 + tests/test_webhook.py | 111 +++++++++-- 12 files changed, 629 insertions(+), 271 deletions(-) create mode 100644 src/github_agent_bridge/dashboard_static/assets/index-CU4liAj_.css delete mode 100644 src/github_agent_bridge/dashboard_static/assets/index-D2uz4i7l.css create mode 100644 src/github_agent_bridge/dashboard_static/assets/index-DQsWONBl.js delete mode 100644 src/github_agent_bridge/dashboard_static/assets/index-lIzCm8Xd.js diff --git a/dashboard/src/main.test.tsx b/dashboard/src/main.test.tsx index bd1e6f0..8ec315a 100644 --- a/dashboard/src/main.test.tsx +++ b/dashboard/src/main.test.tsx @@ -35,6 +35,9 @@ import { selectedJobIdFromPath, shouldRefreshJobForSessionEvent, urlBase64ToUint8Array, + webhookDeliveriesPath, + webhookQuerySelection, + webhookTimeseriesPath, } from "./main"; describe("dashboard routing and API query helpers", () => { @@ -79,6 +82,16 @@ describe("dashboard routing and API query helpers", () => { expect(isWebhooksPath("/webhooks/github")).toBe(false); }); + it("loads only the active webhook dataset and builds bounded queries", () => { + expect(webhookQuerySelection("overview")).toEqual({ timeseries: true, hooks: false, deliveries: false }); + expect(webhookQuerySelection("hooks")).toEqual({ timeseries: false, hooks: true, deliveries: false }); + expect(webhookQuerySelection("deliveries")).toEqual({ timeseries: false, hooks: false, deliveries: true }); + expect(webhookTimeseriesPath("2026-09-01T00:00:00Z", "2026-10-01T00:00:00Z")) + .toBe("/api/webhooks/github/timeseries?from=2026-09-01T00%3A00%3A00Z&to=2026-10-01T00%3A00%3A00Z&bucket=day"); + expect(webhookDeliveriesPath(50, "next page")) + .toBe("/api/webhooks/github/deliveries?limit=50&cursor=next+page"); + }); + it("recognizes only canonical job detail routes", () => { expect(selectedJobIdFromPath("/jobs/45")).toBe(45); expect(selectedJobIdFromPath("/jobs/45/")).toBe(45); @@ -114,7 +127,7 @@ 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(); @@ -124,13 +137,22 @@ describe("dashboard routing and API query helpers", () => { it("navigates webhook hook inventory and delivery details", async () => { const user = userEvent.setup(); - render(); + const onSectionChange = vi.fn(); + const summary = { mode: "shadow", configured: true, receipts: { observed: 7 }, duplicate_deliveries: 2, cross_source_matches: 3 }; + 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", event_name: "issue_comment", action: "created", repository: "gisce/github-agent-bridge", status: "observed" }]; + const common = { summary, summaryLoading: false, sectionLoading: false, error: null, onSectionChange, onOlderDeliveries: vi.fn(), onNewestDeliveries: vi.fn(), onRefresh: vi.fn() }; + const { rerender } = render(); await user.click(screen.getByRole("tab", { name: /Hooks/ })); + expect(onSectionChange).toHaveBeenCalledWith("hooks"); + rerender(); expect(screen.getByText("organization · #42")).toBeInTheDocument(); expect(screen.getByText("receiving")).toBeInTheDocument(); await user.click(screen.getByRole("tab", { name: /Deliveries/ })); + expect(onSectionChange).toHaveBeenCalledWith("deliveries"); + rerender(); expect(screen.getByText("issue_comment · created")).toBeInTheDocument(); expect(screen.getByText("gisce/github-agent-bridge")).toBeInTheDocument(); }); diff --git a/dashboard/src/main.tsx b/dashboard/src/main.tsx index 1560d38..5829c07 100644 --- a/dashboard/src/main.tsx +++ b/dashboard/src/main.tsx @@ -69,15 +69,28 @@ type DashboardStatus = { }; }; -type WebhookStatus = { +type WebhookSummary = { mode: string; configured: boolean; receipts: Record; duplicate_deliveries: number; cross_source_matches: number; - timeseries?: WebhookTimeseriesPoint[]; - hooks?: WebhookHook[]; - recent_deliveries?: WebhookDelivery[]; +}; + +type WebhookSection = "overview" | "hooks" | "deliveries"; + +type WebhookTimeseriesResponse = { + from: string; + to: string; + bucket: "hour" | "day"; + points: WebhookTimeseriesPoint[]; +}; + +type WebhookHooksResponse = { hooks: WebhookHook[] }; + +type WebhookDeliveriesResponse = { + deliveries: WebhookDelivery[]; + next_cursor?: string | null; }; type WebhookTimeseriesPoint = { @@ -737,6 +750,32 @@ function buildKnowledgeQuery(repo: string, status: string, limit = 50) { return `/api/knowledge?${params.toString()}`; } +function webhookQuerySelection(section: WebhookSection) { + return { + timeseries: section === "overview", + hooks: section === "hooks", + deliveries: section === "deliveries", + }; +} + +function webhookTimeseriesPath(from: string, to: string, bucket: "hour" | "day" = "day") { + const params = new URLSearchParams({ from, to, bucket }); + return `/api/webhooks/github/timeseries?${params.toString()}`; +} + +function webhookDeliveriesPath(limit = 50, cursor?: string | null) { + const params = new URLSearchParams({ limit: String(limit) }); + if (cursor) params.set("cursor", cursor); + return `/api/webhooks/github/deliveries?${params.toString()}`; +} + +function webhookMonitoringWindow(now = new Date()) { + return { + from: new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000).toISOString(), + to: now.toISOString(), + }; +} + function metricsSummaryPath(timezone = dashboardTimeZone) { return `/api/metrics/summary?timezone=${encodeURIComponent(timezone)}`; } @@ -857,6 +896,9 @@ function App() { const jobLoadPendingRef = React.useRef(false); const [knowledgeRepo, setKnowledgeRepo] = React.useState(""); const [knowledgeStatus, setKnowledgeStatus] = React.useState("proposed"); + const [webhookSection, setWebhookSection] = React.useState("overview"); + const [webhookDeliveryCursor, setWebhookDeliveryCursor] = React.useState(null); + const [webhookWindow, setWebhookWindow] = React.useState(() => webhookMonitoringWindow()); const [autoupdateAction, setAutoupdateAction] = React.useState<"refresh" | "apply" | "complete" | null>(null); const [autoupdateError, setAutoupdateError] = React.useState(""); const [pathname, setPathname] = React.useState(() => window.location.pathname); @@ -872,6 +914,8 @@ function App() { const metrics = useQuery({ queryKey: ["metrics", dashboardTimeZone], queryFn: () => api<{ metrics: MetricsSummary }>(metricsSummaryPath()), enabled: isDashboardRoute || isSystemRoute }); const dashboardStatus = useQuery({ queryKey: ["dashboard-status"], queryFn: () => api("/api/status") }); const me = useQuery({ queryKey: ["me"], queryFn: () => api<{ user: UserProfile }>("/api/me"), refetchInterval: false }); + const webhookEnabled = isWebhooksRoute && Boolean(me.data?.user?.is_admin && dashboardStatus.data?.webhook_configured); + const webhookQuery = webhookQuerySelection(webhookSection); const webPush = useQuery({ queryKey: ["web-push-config"], queryFn: () => api("/api/web-push/config"), enabled: Boolean(me.data?.user) }); const about = useQuery({ queryKey: ["about"], queryFn: () => api("/api/about") }); const actorOptions = useQuery({ queryKey: ["job-actors"], queryFn: () => api<{ actors: JobActor[] }>("/api/jobs/actors"), enabled: isDashboardRoute }); @@ -884,10 +928,25 @@ function App() { const processes = useQuery({ queryKey: ["processes"], queryFn: () => api("/api/processes"), enabled: isSystemRoute }); const systemd = useQuery({ queryKey: ["systemd"], queryFn: () => api("/api/systemd"), enabled: isSystemRoute }); const alerts = useQuery({ queryKey: ["alerts"], queryFn: () => api<{ alerts: AlertRecord[] }>("/api/alerts"), enabled: isSystemRoute }); - const webhookStatus = useQuery({ - queryKey: ["webhook-status"], - queryFn: () => api("/api/webhooks/github/status"), - enabled: isWebhooksRoute && Boolean(me.data?.user?.is_admin && dashboardStatus.data?.webhook_configured), + const webhookSummary = useQuery({ + queryKey: ["webhook-summary"], + queryFn: () => api("/api/webhooks/github/summary"), + enabled: webhookEnabled, + }); + const webhookTimeseries = useQuery({ + queryKey: ["webhook-timeseries", webhookWindow.from, webhookWindow.to, "day"], + queryFn: () => api(webhookTimeseriesPath(webhookWindow.from, webhookWindow.to)), + enabled: webhookEnabled && webhookQuery.timeseries, + }); + const webhookHooks = useQuery({ + queryKey: ["webhook-hooks"], + queryFn: () => api("/api/webhooks/github/hooks"), + enabled: webhookEnabled && webhookQuery.hooks, + }); + const webhookDeliveries = useQuery({ + queryKey: ["webhook-deliveries", webhookDeliveryCursor], + queryFn: () => api(webhookDeliveriesPath(50, webhookDeliveryCursor)), + enabled: webhookEnabled && webhookQuery.deliveries, }); const knowledge = useQuery({ queryKey: ["knowledge", knowledgeRepo, knowledgeStatus], @@ -1071,6 +1130,7 @@ function App() { React.useEffect(() => { const syncFromPath = () => { + if (isWebhooksPath(window.location.pathname)) setWebhookWindow(webhookMonitoringWindow()); setPathname(window.location.pathname); }; window.addEventListener("popstate", syncFromPath); @@ -1105,6 +1165,7 @@ function App() { }, []); const navigateDashboard = React.useCallback((path: string) => { window.history.pushState({}, "", path); + if (isWebhooksPath(path)) setWebhookWindow(webhookMonitoringWindow()); setPathname(window.location.pathname); }, []); @@ -1127,6 +1188,14 @@ function App() { const hasLiveJob = jobRows.some((job) => job.status === "running" || job.status === "pending") || selectedJob?.status === "running" || selectedJob?.status === "pending" || Boolean(processes.data?.running_jobs.length); const now = useNow(hasLiveJob); const detailStatus = ; + const webhookSectionLoading = webhookSection === "overview" ? webhookTimeseries.isLoading : webhookSection === "hooks" ? webhookHooks.isLoading : webhookDeliveries.isLoading; + const webhookSectionError = webhookSection === "overview" ? webhookTimeseries.error : webhookSection === "hooks" ? webhookHooks.error : webhookDeliveries.error; + const refreshWebhooks = () => { + webhookSummary.refetch(); + if (webhookSection === "overview") setWebhookWindow(webhookMonitoringWindow()); + if (webhookSection === "hooks") webhookHooks.refetch(); + if (webhookSection === "deliveries") webhookDeliveries.refetch(); + }; return (
@@ -1196,7 +1265,22 @@ function App() { onRefresh={() => mcpTokens.refetch()} /> ) : isWebhooksRoute ? ( - webhookStatus.refetch()} /> + setWebhookDeliveryCursor(null)} + onRefresh={refreshWebhooks} + /> ) : isSystemRoute ? ( void }) { - const observed = Object.values(status?.receipts ?? {}).reduce((total, count) => total + count, 0); - const [section, setSection] = React.useState<"overview" | "hooks" | "deliveries">("overview"); +type WebhookPageProps = { + summary?: WebhookSummary; + timeseries?: WebhookTimeseriesPoint[]; + hooks?: WebhookHook[]; + deliveries?: WebhookDelivery[]; + nextDeliveryCursor?: string | null; + deliveryCursor?: string | null; + section: WebhookSection; + summaryLoading: boolean; + sectionLoading: boolean; + error: Error | null; + onSectionChange: (section: WebhookSection) => void; + onOlderDeliveries: (cursor: string) => void; + onNewestDeliveries: () => void; + onRefresh: () => void; +}; + +function WebhookLoadingState({ text }: { text: string }) { + return
{text}
; +} + +function WebhookPage({ + summary, + timeseries, + hooks, + deliveries, + nextDeliveryCursor, + deliveryCursor, + section, + summaryLoading, + sectionLoading, + error, + onSectionChange, + onOlderDeliveries, + onNewestDeliveries, + onRefresh, +}: WebhookPageProps) { + const observed = Object.values(summary?.receipts ?? {}).reduce((total, count) => total + count, 0); const sections = [ { id: "overview" as const, label: "Overview" }, - { id: "hooks" as const, label: "Hooks", count: status?.hooks?.length }, - { id: "deliveries" as const, label: "Deliveries", count: status?.recent_deliveries?.length }, + { id: "hooks" as const, label: "Hooks", count: hooks?.length }, + { id: "deliveries" as const, label: "Deliveries", count: deliveries?.length }, ]; 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) => )}
} /> - } /> - } /> - } /> + } /> + } /> + } />
{section === "overview" ? <> - {status?.timeseries?.length ?
: } + {sectionLoading ? : timeseries?.length ?
: }
- {loading ? : Object.keys(status?.receipts ?? {}).length ?
{Object.entries(status?.receipts ?? {}).sort(([left], [right]) => left.localeCompare(right)).map(([state, count]) => )}
: } + {summaryLoading ? : Object.keys(summary?.receipts ?? {}).length ?
{Object.entries(summary?.receipts ?? {}).sort(([left], [right]) => left.localeCompare(right)).map(([state, count]) => )}
: }
: null} {section === "hooks" ? - {status?.hooks?.length ?
{status.hooks.map((hook) => )}
TargetStateEventsLast pingLast delivery
{hook.target}
{hook.target_type} · #{hook.id}
{hook.status}{hook.events.join(", ") || "All events"}{hook.last_ping_at ?? "Never"}{hook.last_event_at ?? "Never"}
: } + {sectionLoading ? : hooks?.length ?
{hooks.map((hook) => )}
TargetStateEventsLast pingLast delivery
{hook.target}
{hook.target_type} · #{hook.id}
{hook.status}{hook.events.join(", ") || "All events"}{hook.last_ping_at ?? "Never"}{hook.last_event_at ?? "Never"}
: }
: null} {section === "deliveries" ? - {status?.recent_deliveries?.length ?
{status.recent_deliveries.map((delivery) => )}
ReceivedEventRepositoryResultDelivery
{delivery.created_at}{delivery.event_name}{delivery.action ? ` · ${delivery.action}` : ""}{delivery.repository ?? "—"}{delivery.status}{delivery.delivery_id}
: } + {sectionLoading ? : deliveries?.length ? <>
{deliveries.map((delivery) => )}
ReceivedEventRepositoryResultDelivery
{delivery.created_at}{delivery.event_name}{delivery.action ? ` · ${delivery.action}` : ""}{delivery.repository ?? "—"}{delivery.status}{delivery.delivery_id}
{deliveryCursor ? : null}{nextDeliveryCursor ? : null}
: }
: null}
); @@ -4172,6 +4291,9 @@ export { selectedJobIdFromPath, shouldRefreshJobForSessionEvent, urlBase64ToUint8Array, + webhookDeliveriesPath, + webhookQuerySelection, + webhookTimeseriesPath, WebhookPage, }; diff --git a/docs/ingestion.md b/docs/ingestion.md index 5ecdc2b..56215df 100644 --- a/docs/ingestion.md +++ b/docs/ingestion.md @@ -84,13 +84,25 @@ GitHub's `X-GitHub-Hook-ID` header keeps their inventory and activity separate. The endpoint stores only routing metadata, a SHA-256 payload hash, and the canonical event key in `webhook_shadow_receipts`; it deliberately stores no raw -payload and never creates a queue job. Authenticated operators can inspect -counts, a daily activity series, hook inventory, recent deliveries, duplicate -deliveries, and cross-source event-key matches at -`GET /api/webhooks/github/status`. Here “operators” means users authorized as -dashboard administrators through `GITHUB_AGENT_BRIDGE_DASHBOARD_ADMIN_USERS` -or `GITHUB_AGENT_BRIDGE_DASHBOARD_ADMIN_TEAMS`; other authenticated dashboard -users receive HTTP 403 and unauthenticated requests receive HTTP 401. +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. +- `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 + window ending now, capped at the daily maximum. +- `GET /api/webhooks/github/hooks` returns the per-hook inventory. +- `GET /api/webhooks/github/deliveries?limit=<1-100>&cursor=` returns a + cursor-paginated delivery page. + +The dashboard loads these resources lazily per tab and caches them separately. +Here “operators” means users authorized as dashboard administrators through +`GITHUB_AGENT_BRIDGE_DASHBOARD_ADMIN_USERS` or +`GITHUB_AGENT_BRIDGE_DASHBOARD_ADMIN_TEAMS`; every monitoring endpoint returns +HTTP 403 to other authenticated users and HTTP 401 to unauthenticated users. Receipt details are retained for 30 days by default and pruned during ingestion; set `GITHUB_AGENT_BRIDGE_WEBHOOK_RETENTION_DAYS` to change that window. Raw payloads are never retained. diff --git a/src/github_agent_bridge/backend.py b/src/github_agent_bridge/backend.py index bdd22b3..4b61840 100644 --- a/src/github_agent_bridge/backend.py +++ b/src/github_agent_bridge/backend.py @@ -4,12 +4,14 @@ import asyncio import base64 from contextlib import asynccontextmanager, suppress +from datetime import UTC, datetime, timedelta import json import os import secrets import shlex import sqlite3 import sys +import threading import urllib.error import urllib.parse import urllib.request @@ -68,6 +70,8 @@ GITHUB_TEAMS_URL = "https://api.github.com/user/teams" PROJECT_REPOSITORY_URL = "https://github.com/gisce/github-agent-bridge" SESSION_VERSION = 1 +WEBHOOK_TIMESERIES_MAX_DAYS = 366 +WEBHOOK_TIMESERIES_MAX_HOURLY_DAYS = 31 def _knowledge_actor(item: dict[str, Any]) -> str: @@ -98,6 +102,43 @@ def _mark_manageable_knowledge(items: list[dict[str, Any]], profile: dict[str, A return [{**item, "can_manage": _knowledge_item_owned_by(item, login)} for item in items] +def _parse_webhook_datetime(value: str, parameter: str) -> datetime: + try: + parsed = datetime.fromisoformat(value.replace("Z", "+00:00")) + except ValueError as exc: + raise HTTPException( + status_code=status.HTTP_400_BAD_REQUEST, + detail=f"invalid_{parameter}_datetime", + ) from exc + if parsed.tzinfo is None: + parsed = parsed.replace(tzinfo=UTC) + return parsed.astimezone(UTC) + + +def _webhook_datetime_value(value: datetime) -> str: + return value.replace(microsecond=0).isoformat().replace("+00:00", "Z") + + +def _encode_webhook_delivery_cursor(created_at: str, delivery_id: str) -> str: + payload = json.dumps([created_at, delivery_id], separators=(",", ":")).encode("utf-8") + return base64.urlsafe_b64encode(payload).decode("ascii").rstrip("=") + + +def _decode_webhook_delivery_cursor(cursor: str) -> tuple[str, str]: + try: + padded = cursor + "=" * (-len(cursor) % 4) + payload = json.loads(base64.urlsafe_b64decode(padded).decode("utf-8")) + except (ValueError, UnicodeDecodeError, json.JSONDecodeError) as exc: + raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="invalid_cursor") from exc + if not ( + isinstance(payload, list) + and len(payload) == 2 + and all(isinstance(value, str) and value for value in payload) + ): + raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="invalid_cursor") + return payload[0], payload[1] + + class DashboardConfig: def __init__( self, @@ -537,6 +578,18 @@ async def lifespan(app: FastAPI): app = FastAPI(title="GitHub Agent Bridge Dashboard API", lifespan=lifespan) app.state.dashboard_config = config app.state.dashboard_shutdown_event = shutdown_event + webhook_schema_lock = threading.Lock() + webhook_schema_ready = False + + def ensure_webhook_schema() -> None: + nonlocal webhook_schema_ready + if webhook_schema_ready: + return + with webhook_schema_lock: + if not webhook_schema_ready: + JobQueue(config.db) + webhook_schema_ready = True + assets_dir = config.static_dir / "assets" if assets_dir.exists(): app.mount("/assets", StaticFiles(directory=assets_dir), name="dashboard-assets") @@ -636,7 +689,7 @@ async def github_webhook_shadow(request: Request) -> dict[str, Any]: webhook_secrets = config.webhook_secrets if not verify_signature(raw_payload, signature, webhook_secrets): raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="invalid_signature") - JobQueue(config.db) + ensure_webhook_schema() receipt = persist_shadow_delivery( config.db, delivery_id=delivery_id, @@ -648,55 +701,124 @@ async def github_webhook_shadow(request: Request) -> dict[str, Any]: return {"mode": "shadow", "status": receipt.status, "event_key": receipt.event_key} @app.get("/api/webhooks/github/status") - def github_webhook_shadow_status(_: dict[str, Any] = Depends(current_admin_profile)) -> dict[str, Any]: - JobQueue(config.db) + @app.get("/api/webhooks/github/summary") + def github_webhook_shadow_summary(_: dict[str, Any] = Depends(current_admin_profile)) -> dict[str, Any]: + ensure_webhook_schema() + with sqlite3.connect(config.db) as con: + row = con.execute( + "WITH receipt_summary AS (" + " SELECT SUM(CASE WHEN status='observed' THEN 1 ELSE 0 END) observed," + " SUM(CASE WHEN status='unsupported' THEN 1 ELSE 0 END) unsupported," + " COALESCE(SUM(duplicate_count),0) duplicate_deliveries" + " FROM webhook_shadow_receipts" + "), cross_source AS (" + " SELECT COUNT(DISTINCT w.event_key) matches FROM webhook_shadow_receipts w" + " WHERE w.event_key IS NOT NULL AND EXISTS (" + " SELECT 1 FROM ingest_receipts i WHERE i.event_key=w.event_key" + " )" + ") SELECT COALESCE(observed,0),COALESCE(unsupported,0)," + "duplicate_deliveries,matches FROM receipt_summary CROSS JOIN cross_source" + ).fetchone() + counts = { + name: count + for name, count in (("observed", row[0]), ("unsupported", row[1])) + if count + } + return { + "mode": "shadow", + "configured": bool(config.webhook_secrets or config.webhook_secrets_by_owner), + "receipts": counts, + "duplicate_deliveries": row[2], + "cross_source_matches": row[3], + } + + @app.get("/api/webhooks/github/timeseries") + def github_webhook_shadow_timeseries( + from_value: str | None = Query(None, alias="from"), + to_value: str | None = Query(None, alias="to"), + bucket: str = Query("day", pattern="^(hour|day)$"), + _: dict[str, Any] = Depends(current_admin_profile), + ) -> dict[str, Any]: + ensure_webhook_schema() + end = _parse_webhook_datetime(to_value, "to") if to_value else datetime.now(UTC) + default_days = min(config.webhook_retention_days, WEBHOOK_TIMESERIES_MAX_DAYS) + start = _parse_webhook_datetime(from_value, "from") if from_value else end - timedelta(days=default_days) + maximum = WEBHOOK_TIMESERIES_MAX_HOURLY_DAYS if bucket == "hour" else WEBHOOK_TIMESERIES_MAX_DAYS + if start >= end: + raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="invalid_time_range") + if end - start > timedelta(days=maximum): + raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="time_range_too_large") + start_value = _webhook_datetime_value(start) + end_value = _webhook_datetime_value(end) + bucket_expression = "substr(created_at,1,13) || ':00:00Z'" if bucket == "hour" else "substr(created_at,1,10)" with sqlite3.connect(config.db) as con: rows = con.execute( - "SELECT status,COUNT(*) FROM webhook_shadow_receipts GROUP BY status" - ).fetchall() - cross_source = con.execute( - "SELECT COUNT(DISTINCT w.event_key) FROM webhook_shadow_receipts w " - "JOIN ingest_receipts i ON i.event_key=w.event_key WHERE w.event_key IS NOT NULL" - ).fetchone()[0] - duplicate_deliveries = con.execute( - "SELECT COALESCE(SUM(duplicate_count),0) FROM webhook_shadow_receipts" - ).fetchone()[0] - timeseries_rows = con.execute( - "SELECT substr(created_at,1,10), " + f"SELECT {bucket_expression}, " "SUM(CASE WHEN status='observed' THEN 1 ELSE 0 END), " "SUM(duplicate_count), SUM(CASE WHEN status='unsupported' THEN 1 ELSE 0 END) " - "FROM webhook_shadow_receipts GROUP BY substr(created_at,1,10) ORDER BY 1" - ).fetchall() - delivery_rows = con.execute( - "SELECT delivery_id,hook_id,event_name,action,event_key,repository,status,created_at " - "FROM webhook_shadow_receipts ORDER BY created_at DESC LIMIT 100" + "FROM webhook_shadow_receipts WHERE created_at>=? AND created_at dict[str, Any]: + ensure_webhook_schema() + with sqlite3.connect(config.db) as con: hook_rows = con.execute( - "SELECT hook_id,target,target_type,active,events_json,last_ping_at,last_event_at,updated_at " + "SELECT hook_id,target,target_type,active,events_json,last_ping_at,last_event_at " "FROM webhook_hooks ORDER BY target_type,target,hook_id" ).fetchall() - counts = {row[0]: row[1] for row in rows} return { - "mode": "shadow", - "configured": bool(config.webhook_secrets or config.webhook_secrets_by_owner), - "receipts": counts, - "duplicate_deliveries": duplicate_deliveries, - "cross_source_matches": cross_source, - "timeseries": [ - {"bucket": row[0], "observed": row[1], "duplicate": row[2], "unsupported": row[3]} - for row in timeseries_rows - ], "hooks": [ {"id": row[0], "target": row[1], "target_type": row[2], "active": bool(row[3]), "events": json.loads(row[4]), "last_ping_at": row[5], "last_event_at": row[6], "status": ("inactive" if not row[3] else "receiving" if row[6] else "never_seen")} for row in hook_rows ], - "recent_deliveries": [ + } + + @app.get("/api/webhooks/github/deliveries") + def github_webhook_shadow_deliveries( + limit: int = Query(50, ge=1, le=100), + cursor: str | None = Query(None), + _: dict[str, Any] = Depends(current_admin_profile), + ) -> dict[str, Any]: + ensure_webhook_schema() + where = "" + parameters: list[Any] = [] + if cursor: + cursor_created_at, cursor_delivery_id = _decode_webhook_delivery_cursor(cursor) + where = "WHERE created_at limit and page: + next_cursor = _encode_webhook_delivery_cursor(page[-1][7], page[-1][0]) + return { + "deliveries": [ {"delivery_id": row[0], "hook_id": row[1], "event_name": row[2], "action": row[3], "event_key": row[4], "repository": row[5], "status": row[6], "created_at": row[7]} - for row in delivery_rows + for row in page ], + "next_cursor": next_cursor, } def dashboard_index() -> FileResponse: diff --git a/src/github_agent_bridge/dashboard_static/assets/index-CU4liAj_.css b/src/github_agent_bridge/dashboard_static/assets/index-CU4liAj_.css new file mode 100644 index 0000000..4510a2b --- /dev/null +++ b/src/github_agent_bridge/dashboard_static/assets/index-CU4liAj_.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}.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-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-\[760px\]{min-width:760px}.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-xs{max-width:20rem}.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-end{justify-content:flex-end}.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-D2uz4i7l.css b/src/github_agent_bridge/dashboard_static/assets/index-D2uz4i7l.css deleted file mode 100644 index df7f6b4..0000000 --- a/src/github_agent_bridge/dashboard_static/assets/index-D2uz4i7l.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}.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-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-\[760px\]{min-width:760px}.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-xs{max-width:20rem}.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-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-DQsWONBl.js b/src/github_agent_bridge/dashboard_static/assets/index-DQsWONBl.js new file mode 100644 index 0000000..9102afa --- /dev/null +++ b/src/github_agent_bridge/dashboard_static/assets/index-DQsWONBl.js @@ -0,0 +1,187 @@ +var Xs=e=>{throw TypeError(e)};var qr=(e,t,n)=>t.has(e)||Xs("Cannot "+n);var g=(e,t,n)=>(qr(e,t,"read from private field"),n?n.call(e):t.get(e)),U=(e,t,n)=>t.has(e)?Xs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),M=(e,t,n,r)=>(qr(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),X=(e,t,n)=>(qr(e,t,"access private method"),n);var hr=(e,t,n,r)=>({set _(s){M(e,t,s,n)},get _(){return g(e,t,r)}});import{f as Ql,h as Vl,g as Mi,r as je,R as T,d as Zn,a as Tr,C as er,X as tr,Y as nr,T as rr,L as wo,B as $t,e as Wl,c as Gl,b as Jl}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 Ur={exports:{}},Cn={};/** + * @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 Ys;function Xl(){if(Ys)return Cn;Ys=1;var e=Ql(),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 Cn.Fragment=n,Cn.jsx=o,Cn.jsxs=o,Cn}var Zs;function Yl(){return Zs||(Zs=1,Ur.exports=Xl()),Ur.exports}var i=Yl(),pr={},ea;function Zl(){if(ea)return pr;ea=1;var e=Vl();return pr.createRoot=e.createRoot,pr.hydrateRoot=e.hydrateRoot,pr}var eu=Zl();const tu=Mi(eu);var ir=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(){}},Lt,vt,Zt,uo,nu=(uo=class extends ir{constructor(){super();U(this,Lt);U(this,vt);U(this,Zt);M(this,Zt,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){g(this,vt)||this.setEventListener(g(this,Zt))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,vt))==null||t.call(this),M(this,vt,void 0))}setEventListener(t){var n;M(this,Zt,t),(n=g(this,vt))==null||n.call(this),M(this,vt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){g(this,Lt)!==t&&(M(this,Lt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof g(this,Lt)=="boolean"?g(this,Lt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Lt=new WeakMap,vt=new WeakMap,Zt=new WeakMap,uo),Oi=new nu,ru={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},jt,Li,co,iu=(co=class{constructor(){U(this,jt,ru);U(this,Li,!1)}setTimeoutProvider(e){M(this,jt,e)}setTimeout(e,t){return g(this,jt).setTimeout(e,t)}clearTimeout(e){g(this,jt).clearTimeout(e)}setInterval(e,t){return g(this,jt).setInterval(e,t)}clearInterval(e){g(this,jt).clearInterval(e)}},jt=new WeakMap,Li=new WeakMap,co),At=new iu;function su(e){setTimeout(e,0)}var au=typeof window>"u"||"Deno"in globalThis;function Ae(){}function ou(e,t){return typeof e=="function"?e(t):e}function ai(e){return typeof e=="number"&&e>=0&&e!==1/0}function vo(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Pt(e,t){return typeof e=="function"?e(t):e}function qe(e,t){return typeof e=="function"?e(t):e}function ta(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Di(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 na(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Bn(t.options.mutationKey)!==Bn(a))return!1}else if(!qn(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Di(e,t){return((t==null?void 0:t.queryKeyHashFn)||Bn)(e)}function Bn(e){return JSON.stringify(e,(t,n)=>li(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 lu=Object.prototype.hasOwnProperty;function jo(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=ra(e)&&ra(t);if(!r&&!(li(e)&&li(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{At.setTimeout(t,e)})}function ui(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?jo(e,t):t}function cu(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function du(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Fi=Symbol();function ko(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Fi?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function No(e,t){return typeof e=="function"?e(...t):!!e}function hu(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 Un=(()=>{let e=()=>au;return{isServer(){return e()},setIsServer(t){e=t}}})();function ci(){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 pu=su;function mu(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=pu;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 ve=mu(),en,kt,tn,ho,fu=(ho=class extends ir{constructor(){super();U(this,en,!0);U(this,kt);U(this,tn);M(this,tn,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,kt)||this.setEventListener(g(this,tn))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,kt))==null||t.call(this),M(this,kt,void 0))}setEventListener(t){var n;M(this,tn,t),(n=g(this,kt))==null||n.call(this),M(this,kt,t(this.setOnline.bind(this)))}setOnline(t){g(this,en)!==t&&(M(this,en,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return g(this,en)}},en=new WeakMap,kt=new WeakMap,tn=new WeakMap,ho),Sr=new fu;function xu(e){return Math.min(1e3*2**e,3e4)}function So(e){return(e??"online")==="online"?Sr.isOnline():!0}var di=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Co(e){let t=!1,n=0,r;const s=ci(),a=()=>s.status!=="pending",o=v=>{var y;if(!a()){const b=new di(v);m(b),(y=e.onCancel)==null||y.call(e,b)}},l=()=>{t=!0},u=()=>{t=!1},c=()=>Oi.isFocused()&&(e.networkMode==="always"||Sr.isOnline())&&e.canRun(),d=()=>So(e.networkMode)&&e.canRun(),h=v=>{a()||(r==null||r(),s.resolve(v))},m=v=>{a()||(r==null||r(),s.reject(v))},p=()=>new Promise(v=>{var y;r=b=>{(a()||c())&&v(b)},(y=e.onPause)==null||y.call(e)}).then(()=>{var v;r=void 0,a()||(v=e.onContinue)==null||v.call(e)}),w=()=>{if(a())return;let v;const y=n===0?e.initialPromise:void 0;try{v=y??e.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(h).catch(b=>{var j;if(a())return;const S=e.retry??(Un.isServer()?0:3),_=e.retryDelay??xu,C=typeof _=="function"?_(n,b):_,D=S===!0||typeof S=="number"&&nc()?void 0:p()).then(()=>{t?m(b):w()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:l,continueRetry:u,canStart:d,start:()=>(d()?w():p().then(w),s)}}var Mt,po,_o=(po=class{constructor(){U(this,Mt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ai(this.gcTime)&&M(this,Mt,At.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Un.isServer()?1/0:300*1e3))}clearGcTimeout(){g(this,Mt)!==void 0&&(At.clearTimeout(g(this,Mt)),M(this,Mt,void 0))}},Mt=new WeakMap,po);function gu(e){return{onFetch:(t,n)=>{var d,h,m,p,w;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=((w=t.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const c=async()=>{let v=!1;const y=_=>{hu(_,()=>t.signal,()=>v=!0)},b=ko(t.options,t.fetchOptions),S=async(_,C,D)=>{if(v)return Promise.reject(t.signal.reason);if(C==null&&_.pages.length)return Promise.resolve(_);const B=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:C,direction:D?"backward":"forward",meta:t.options.meta};return y(A),A})(),L=await b(B),{maxPages:P}=t.options,z=D?du:cu;return{pages:z(_.pages,L,P),pageParams:z(_.pageParams,C,P)}};if(s&&a.length){const _=s==="backward",C=_?bu:sa,D={pages:a,pageParams:o},j=C(r,D);l=await S(D,j,_)}else{const _=e??a.length;do{const C=u===0?o[0]??r.initialPageParam:sa(r,l);if(u>0&&C==null)break;l=await S(l,C),u++}while(u<_)}return l};t.options.persister?t.fetchFn=()=>{var v,y;return(y=(v=t.options).persister)==null?void 0:y.call(v,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function sa(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 bu(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}var nn,Ot,rn,$e,Dt,ye,Wn,Ft,Be,Eo,ht,mo,yu=(mo=class extends _o{constructor(t){super();U(this,Be);U(this,nn);U(this,Ot);U(this,rn);U(this,$e);U(this,Dt);U(this,ye);U(this,Wn);U(this,Ft);M(this,Ft,!1),M(this,Wn,t.defaultOptions),this.setOptions(t.options),this.observers=[],M(this,Dt,t.client),M(this,$e,g(this,Dt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,M(this,Ot,oa(this.options)),this.state=t.state??g(this,Ot),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return g(this,nn)}get promise(){var t;return(t=g(this,ye))==null?void 0:t.promise}setOptions(t){if(this.options={...g(this,Wn),...t},t!=null&&t._type&&M(this,nn,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)),M(this,Ot,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&g(this,$e).remove(this)}setData(t,n){const r=ui(this.state.data,t,this.options);return X(this,Be,ht).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,ht).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=g(this,ye))==null?void 0:r.promise;return(s=g(this,ye))==null||s.cancel(t),n?n.then(Ae).catch(Ae):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return g(this,Ot)}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===Fi||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Pt(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:!vo(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=g(this,ye))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=g(this,ye))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),g(this,$e).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,ye)&&(g(this,Ft)||X(this,Be,Eo).call(this)?g(this,ye).cancel({revert:!0}):g(this,ye).cancelRetry()),this.scheduleGc()),g(this,$e).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||X(this,Be,ht).call(this,{type:"invalidate"})}async fetch(t,n){var c,d,h,m,p,w,v,y,b,S,_;if(this.state.fetchStatus!=="idle"&&((c=g(this,ye))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(g(this,ye))return g(this,ye).continueRetry(),g(this,ye).promise}if(t&&this.setOptions(t),!this.options.queryFn){const C=this.observers.find(D=>D.options.queryFn);C&&this.setOptions(C.options)}const r=new AbortController,s=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(M(this,Ft,!0),r.signal)})},a=()=>{const C=ko(this.options,n),j=(()=>{const B={client:g(this,Dt),queryKey:this.queryKey,meta:this.meta};return s(B),B})();return M(this,Ft,!1),this.options.persister?this.options.persister(C,j,this):C(j)},l=(()=>{const C={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:g(this,Dt),state:this.state,fetchFn:a};return s(C),C})(),u=g(this,nn)==="infinite"?gu(this.options.pages):this.options.behavior;u==null||u.onFetch(l,this),M(this,rn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&X(this,Be,ht).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta}),M(this,ye,Co({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:C=>{C instanceof di&&C.revert&&this.setState({...g(this,rn),fetchStatus:"idle"}),r.abort()},onFail:(C,D)=>{X(this,Be,ht).call(this,{type:"failed",failureCount:C,error:D})},onPause:()=>{X(this,Be,ht).call(this,{type:"pause"})},onContinue:()=>{X(this,Be,ht).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const C=await g(this,ye).start();if(C===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(C),(p=(m=g(this,$e).config).onSuccess)==null||p.call(m,C,this),(v=(w=g(this,$e).config).onSettled)==null||v.call(w,C,this.state.error,this),C}catch(C){if(C instanceof di){if(C.silent)return g(this,ye).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw X(this,Be,ht).call(this,{type:"error",error:C}),(b=(y=g(this,$e).config).onError)==null||b.call(y,C,this),(_=(S=g(this,$e).config).onSettled)==null||_.call(S,this.state.data,C,this),C}finally{this.scheduleGc()}}},nn=new WeakMap,Ot=new WeakMap,rn=new WeakMap,$e=new WeakMap,Dt=new WeakMap,ye=new WeakMap,Wn=new WeakMap,Ft=new WeakMap,Be=new WeakSet,Eo=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ht=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,...Po(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 M(this,rn,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),ve.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),g(this,$e).notify({query:this,type:"updated",action:t})})},mo);function Po(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:So(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,Gn,Pe,zt,sn,pt,Nt,Jn,an,on,Bt,qt,St,ln,ne,Ln,hi,pi,mi,fi,xi,gi,bi,Ro,fo,wu=(fo=class extends ir{constructor(t,n){super();U(this,ne);U(this,Te);U(this,Y);U(this,Gn);U(this,Pe);U(this,zt);U(this,sn);U(this,pt);U(this,Nt);U(this,Jn);U(this,an);U(this,on);U(this,Bt);U(this,qt);U(this,St);U(this,ln,new Set);this.options=n,M(this,Te,t),M(this,Nt,null),M(this,pt,ci()),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,ne,Ln).call(this):this.updateResult(),X(this,ne,fi).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yi(g(this,Y),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yi(g(this,Y),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,X(this,ne,xi).call(this),X(this,ne,gi).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,ne,bi).call(this),g(this,Y).setOptions(this.options),n._defaulted&&!oi(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,ne,Ln).call(this),this.updateResult(),s&&(g(this,Y)!==r||qe(this.options.enabled,g(this,Y))!==qe(n.enabled,g(this,Y))||Pt(this.options.staleTime,g(this,Y))!==Pt(n.staleTime,g(this,Y)))&&X(this,ne,hi).call(this);const a=X(this,ne,pi).call(this);s&&(g(this,Y)!==r||qe(this.options.enabled,g(this,Y))!==qe(n.enabled,g(this,Y))||a!==g(this,St))&&X(this,ne,mi).call(this,a)}getOptimisticResult(t){const n=g(this,Te).getQueryCache().build(g(this,Te),t),r=this.createResult(n,t);return ju(this,r)&&(M(this,Pe,r),M(this,sn,this.options),M(this,zt,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,pt).status==="pending"&&g(this,pt).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){g(this,ln).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,ne,Ln).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,zt),l=g(this,sn),c=t!==r?t.state:g(this,Gn),{state:d}=t;let h={...d},m=!1,p;if(n._optimisticResults){const z=this.hasListeners(),A=!z&&la(t,n),E=z&&ua(t,r,n,s);(A||E)&&(h={...h,...Po(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:w,errorUpdatedAt:v,status:y}=h;p=h.data;let b=!1;if(n.placeholderData!==void 0&&p===void 0&&y==="pending"){let z;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(z=a.data,b=!0):z=typeof n.placeholderData=="function"?n.placeholderData((P=g(this,on))==null?void 0:P.state.data,g(this,on)):n.placeholderData,z!==void 0&&(y="success",p=ui(a==null?void 0:a.data,z,n),m=!0)}if(n.select&&p!==void 0&&!b)if(a&&p===(o==null?void 0:o.data)&&n.select===g(this,Jn))p=g(this,an);else try{M(this,Jn,n.select),p=n.select(p),p=ui(a==null?void 0:a.data,p,n),M(this,an,p),M(this,Nt,null)}catch(z){M(this,Nt,z)}g(this,Nt)&&(w=g(this,Nt),p=g(this,an),v=Date.now(),y="error");const S=h.fetchStatus==="fetching",_=y==="pending",C=y==="error",D=_&&S,j=p!==void 0,L={status:y,fetchStatus:h.fetchStatus,isPending:_,isSuccess:y==="success",isError:C,isInitialLoading:D,isLoading:D,data:p,dataUpdatedAt:h.dataUpdatedAt,error:w,errorUpdatedAt:v,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:C&&!j,isPaused:h.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:C&&j,isStale:zi(t,n),refetch:this.refetch,promise:g(this,pt),isEnabled:qe(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const z=L.data!==void 0,A=L.status==="error"&&!z,E=k=>{A?k.reject(L.error):z&&k.resolve(L.data)},G=()=>{const k=M(this,pt,L.promise=ci());E(k)},O=g(this,pt);switch(O.status){case"pending":t.queryHash===r.queryHash&&E(O);break;case"fulfilled":(A||L.data!==O.value)&&G();break;case"rejected":(!A||L.error!==O.reason)&&G();break}}return L}updateResult(){const t=g(this,Pe),n=this.createResult(g(this,Y),this.options);if(M(this,zt,g(this,Y).state),M(this,sn,this.options),g(this,zt).data!==void 0&&M(this,on,g(this,Y)),oi(n,t))return;M(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,ln).size)return!0;const o=new Set(a??g(this,ln));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,ne,Ro).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&X(this,ne,fi).call(this)}},Te=new WeakMap,Y=new WeakMap,Gn=new WeakMap,Pe=new WeakMap,zt=new WeakMap,sn=new WeakMap,pt=new WeakMap,Nt=new WeakMap,Jn=new WeakMap,an=new WeakMap,on=new WeakMap,Bt=new WeakMap,qt=new WeakMap,St=new WeakMap,ln=new WeakMap,ne=new WeakSet,Ln=function(t){X(this,ne,bi).call(this);let n=g(this,Y).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ae)),n},hi=function(){X(this,ne,xi).call(this);const t=Pt(this.options.staleTime,g(this,Y));if(Un.isServer()||g(this,Pe).isStale||!ai(t))return;const r=vo(g(this,Pe).dataUpdatedAt,t)+1;M(this,Bt,At.setTimeout(()=>{g(this,Pe).isStale||this.updateResult()},r))},pi=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(g(this,Y)):this.options.refetchInterval)??!1},mi=function(t){X(this,ne,gi).call(this),M(this,St,t),!(Un.isServer()||qe(this.options.enabled,g(this,Y))===!1||!ai(g(this,St))||g(this,St)===0)&&M(this,qt,At.setInterval(()=>{(this.options.refetchIntervalInBackground||Oi.isFocused())&&X(this,ne,Ln).call(this)},g(this,St)))},fi=function(){X(this,ne,hi).call(this),X(this,ne,mi).call(this,X(this,ne,pi).call(this))},xi=function(){g(this,Bt)!==void 0&&(At.clearTimeout(g(this,Bt)),M(this,Bt,void 0))},gi=function(){g(this,qt)!==void 0&&(At.clearInterval(g(this,qt)),M(this,qt,void 0))},bi=function(){const t=g(this,Te).getQueryCache().build(g(this,Te),this.options);if(t===g(this,Y))return;const n=g(this,Y);M(this,Y,t),M(this,Gn,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Ro=function(t){ve.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(g(this,Pe))}),g(this,Te).getQueryCache().notify({query:g(this,Y),type:"observerResultsUpdated"})})},fo);function vu(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 vu(e,t)||e.state.data!==void 0&&yi(e,t,t.refetchOnMount)}function yi(e,t,n){if(qe(t.enabled,e)!==!1&&Pt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&zi(e,t)}return!1}function ua(e,t,n,r){return(e!==t||qe(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&zi(e,n)}function zi(e,t){return qe(t.enabled,e)!==!1&&e.isStaleByTime(Pt(t.staleTime,e))}function ju(e,t){return!oi(e.getCurrentResult(),t)}var Xn,st,Ne,Ut,at,wt,xo,ku=(xo=class extends _o{constructor(t){super();U(this,at);U(this,Xn);U(this,st);U(this,Ne);U(this,Ut);M(this,Xn,t.client),this.mutationId=t.mutationId,M(this,Ne,t.mutationCache),M(this,st,[]),this.state=t.state||Nu(),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,Ne).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){M(this,st,g(this,st).filter(n=>n!==t)),this.scheduleGc(),g(this,Ne).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){g(this,st).length||(this.state.status==="pending"?this.scheduleGc():g(this,Ne).remove(this))}continue(){var t;return((t=g(this,Ut))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,u,c,d,h,m,p,w,v,y,b,S,_,C,D,j,B;const n=()=>{X(this,at,wt).call(this,{type:"continue"})},r={client:g(this,Xn),meta:this.options.meta,mutationKey:this.options.mutationKey};M(this,Ut,Co({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,P)=>{X(this,at,wt).call(this,{type:"failed",failureCount:L,error:P})},onPause:()=>{X(this,at,wt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>g(this,Ne).canRun(this)}));const s=this.state.status==="pending",a=!g(this,Ut).canStart();try{if(s)n();else{X(this,at,wt).call(this,{type:"pending",variables:t,isPaused:a}),g(this,Ne).config.onMutate&&await g(this,Ne).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,wt).call(this,{type:"pending",context:P,variables:t,isPaused:a})}const L=await g(this,Ut).start();return await((c=(u=g(this,Ne).config).onSuccess)==null?void 0:c.call(u,L,t,this.state.context,this,r)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,L,t,this.state.context,r)),await((p=(m=g(this,Ne).config).onSettled)==null?void 0:p.call(m,L,null,this.state.variables,this.state.context,this,r)),await((v=(w=this.options).onSettled)==null?void 0:v.call(w,L,null,t,this.state.context,r)),X(this,at,wt).call(this,{type:"success",data:L}),L}catch(L){try{await((b=(y=g(this,Ne).config).onError)==null?void 0:b.call(y,L,t,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((_=(S=this.options).onError)==null?void 0:_.call(S,L,t,this.state.context,r))}catch(P){Promise.reject(P)}try{await((D=(C=g(this,Ne).config).onSettled)==null?void 0:D.call(C,void 0,L,this.state.variables,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((B=(j=this.options).onSettled)==null?void 0:B.call(j,void 0,L,t,this.state.context,r))}catch(P){Promise.reject(P)}throw X(this,at,wt).call(this,{type:"error",error:L}),L}finally{g(this,Ne).runNext(this)}}},Xn=new WeakMap,st=new WeakMap,Ne=new WeakMap,Ut=new WeakMap,at=new WeakSet,wt=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),ve.batch(()=>{g(this,st).forEach(r=>{r.onMutationUpdate(t)}),g(this,Ne).notify({mutation:this,type:"updated",action:t})})},xo);function Nu(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mt,Xe,Yn,go,Su=(go=class extends ir{constructor(t={}){super();U(this,mt);U(this,Xe);U(this,Yn);this.config=t,M(this,mt,new Set),M(this,Xe,new Map),M(this,Yn,0)}build(t,n,r){const s=new ku({client:t,mutationCache:this,mutationId:++hr(this,Yn)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){g(this,mt).add(t);const n=mr(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,mt).delete(t)){const n=mr(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=mr(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=mr(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(){ve.batch(()=>{g(this,mt).forEach(t=>{this.notify({type:"removed",mutation:t})}),g(this,mt).clear(),g(this,Xe).clear()})}getAll(){return Array.from(g(this,mt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>na(n,r))}findAll(t={}){return this.getAll().filter(n=>na(t,n))}notify(t){ve.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ve.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ae))))}},mt=new WeakMap,Xe=new WeakMap,Yn=new WeakMap,go);function mr(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ot,bo,Cu=(bo=class extends ir{constructor(t={}){super();U(this,ot);this.config=t,M(this,ot,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??Di(s,n);let o=this.get(a);return o||(o=new yu({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(){ve.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=>ta(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>ta(t,r)):n}notify(t){ve.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ve.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ve.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ot=new WeakMap,bo),me,Ct,_t,un,cn,Et,dn,hn,yo,_u=(yo=class{constructor(e={}){U(this,me);U(this,Ct);U(this,_t);U(this,un);U(this,cn);U(this,Et);U(this,dn);U(this,hn);M(this,me,e.queryCache||new Cu),M(this,Ct,e.mutationCache||new Su),M(this,_t,e.defaultOptions||{}),M(this,un,new Map),M(this,cn,new Map),M(this,Et,0)}mount(){hr(this,Et)._++,g(this,Et)===1&&(M(this,dn,Oi.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,me).onFocus())})),M(this,hn,Sr.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,me).onOnline())})))}unmount(){var e,t;hr(this,Et)._--,g(this,Et)===0&&((e=g(this,dn))==null||e.call(this),M(this,dn,void 0),(t=g(this,hn))==null||t.call(this),M(this,hn,void 0))}isFetching(e){return g(this,me).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return g(this,Ct).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=g(this,me).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=g(this,me).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Pt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return g(this,me).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,me).get(r.queryHash),a=s==null?void 0:s.state.data,o=ou(t,a);if(o!==void 0)return g(this,me).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ve.batch(()=>g(this,me).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,me).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=g(this,me);ve.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=g(this,me);return ve.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ve.batch(()=>g(this,me).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Ae).catch(Ae)}invalidateQueries(e,t={}){return ve.batch(()=>(g(this,me).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=ve.batch(()=>g(this,me).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,me).build(this,t);return n.isStaleByTime(Pt(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 Sr.isOnline()?g(this,Ct).resumePausedMutations():Promise.resolve()}getQueryCache(){return g(this,me)}getMutationCache(){return g(this,Ct)}getDefaultOptions(){return g(this,_t)}setDefaultOptions(e){M(this,_t,e)}setQueryDefaults(e,t){g(this,un).set(Bn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...g(this,un).values()],n={};return t.forEach(r=>{qn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){g(this,cn).set(Bn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...g(this,cn).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,_t).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Di(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===Fi&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...g(this,_t).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){g(this,me).clear(),g(this,Ct).clear()}},me=new WeakMap,Ct=new WeakMap,_t=new WeakMap,un=new WeakMap,cn=new WeakMap,Et=new WeakMap,dn=new WeakMap,hn=new WeakMap,yo),Io=je.createContext(void 0),To=e=>{const t=je.useContext(Io);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Eu=({client:e,children:t})=>(je.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(Io.Provider,{value:e,children:t})),Ao=je.createContext(!1),Pu=()=>je.useContext(Ao);Ao.Provider;function Ru(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Iu=je.createContext(Ru()),Tu=()=>je.useContext(Iu),Au=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?No(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Lu=e=>{je.useEffect(()=>{e.clearReset()},[e])},Mu=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||No(n,[e.error,r])),Ou=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))}},Du=(e,t)=>e.isLoading&&e.isFetching&&!t,Fu=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ca=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function zu(e,t,n){var m,p,w,v;const r=Pu(),s=Tu(),a=To(),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",Ou(o),Au(o,s,l),Lu(s);const u=!a.getQueryCache().get(o.queryHash),[c]=je.useState(()=>new t(a,o)),d=c.getOptimisticResult(o),h=!r&&e.subscribed!==!1;if(je.useSyncExternalStore(je.useCallback(y=>{const b=h?c.subscribe(ve.batchCalls(y)):Ae;return c.updateResult(),b},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),je.useEffect(()=>{c.setOptions(o)},[o,c]),Fu(o,d))throw ca(o,c,s);if(Mu({result:d,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw d.error;if((v=(w=a.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||v.call(w,o,d),o.experimental_prefetchInRender&&!Un.isServer()&&Du(d,r)){const y=u?ca(o,c,s):l==null?void 0:l.promise;y==null||y.catch(Ae).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?d:c.trackResult(d)}function xe(e,t){return zu(e,wu)}/** + * @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 Bu=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Lo=(...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 qu={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 Uu=je.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:o,...l},u)=>je.createElement("svg",{ref:u,...qu,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Lo("lucide",s),...l},[...o.map(([c,d])=>je.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=je.forwardRef(({className:r,...s},a)=>je.createElement(Uu,{ref:a,iconNode:t,className:Lo(`lucide-${Bu(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 $n=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 $u=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 Mo=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 Bi=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 mn=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 fn=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 Hn=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 Oo=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 da=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 pn=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 Do=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 Hu=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 Ku=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 Cr=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 sr=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 Qu=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 Ar=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 Kn=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 Vu=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 Wu=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 Fo=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 zo=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 Gu=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 wi=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 qi=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 Ju=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 Kt=le("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Xu(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Yu=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Zu=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ec={};function ha(e,t){return(ec.jsx?Zu:Yu).test(e)}const tc=/[ \t\n\f\r]/g;function nc(e){return typeof e=="object"?e.type==="text"?pa(e.value):!1:pa(e)}function pa(e){return e.replace(tc,"")===""}class ar{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ar.prototype.normal={};ar.prototype.property={};ar.prototype.space=void 0;function Bo(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new ar(n,r,t)}function vi(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 rc=0;const K=Qt(),be=Qt(),ji=Qt(),R=Qt(),oe=Qt(),Ht=Qt(),ze=Qt();function Qt(){return 2**++rc}const ki=Object.freeze(Object.defineProperty({__proto__:null,boolean:K,booleanish:be,commaOrSpaceSeparated:ze,commaSeparated:Ht,number:R,overloadedBoolean:ji,spaceSeparated:oe},Symbol.toStringTag,{value:"Module"})),$r=Object.keys(ki);class Ui extends Me{constructor(t,n,r,s){let a=-1;if(super(t,n),ma(this,"space",s),typeof r=="number")for(;++a<$r.length;){const o=$r[a];ma(this,$r[a],(r&ki[o])===ki[o])}}}Ui.prototype.defined=!0;function ma(e,t,n){n&&(e[t]=n)}function xn(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new Ui(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[vi(r)]=r,n[vi(a.attribute)]=r}return new ar(t,n,e.space)}const qo=xn({properties:{ariaActiveDescendant:null,ariaAtomic:be,ariaAutoComplete:null,ariaBusy:be,ariaChecked:be,ariaColCount:R,ariaColIndex:R,ariaColSpan:R,ariaControls:oe,ariaCurrent:null,ariaDescribedBy:oe,ariaDetails:null,ariaDisabled:be,ariaDropEffect:oe,ariaErrorMessage:null,ariaExpanded:be,ariaFlowTo:oe,ariaGrabbed:be,ariaHasPopup:null,ariaHidden:be,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:oe,ariaLevel:R,ariaLive:null,ariaModal:be,ariaMultiLine:be,ariaMultiSelectable:be,ariaOrientation:null,ariaOwns:oe,ariaPlaceholder:null,ariaPosInSet:R,ariaPressed:be,ariaReadOnly:be,ariaRelevant:null,ariaRequired:be,ariaRoleDescription:oe,ariaRowCount:R,ariaRowIndex:R,ariaRowSpan:R,ariaSelected:be,ariaSetSize:R,ariaSort:null,ariaValueMax:R,ariaValueMin:R,ariaValueNow:R,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Uo(e,t){return t in e?e[t]:t}function $o(e,t){return Uo(e,t.toLowerCase())}const ic=xn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ht,acceptCharset:oe,accessKey:oe,action:null,allow:null,allowFullScreen:K,allowPaymentRequest:K,allowUserMedia:K,alpha:K,alt:null,as:null,async:K,autoCapitalize:null,autoComplete:oe,autoFocus:K,autoPlay:K,blocking:oe,capture:null,charSet:null,checked:K,cite:null,className:oe,closedBy:null,colorSpace:null,cols:R,colSpan:R,command:null,commandFor:null,content:null,contentEditable:be,controls:K,controlsList:oe,coords:R|Ht,crossOrigin:null,data:null,dateTime:null,decoding:null,default:K,defer:K,dir:null,dirName:null,disabled:K,download:ji,draggable:be,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:K,formTarget:null,headers:oe,height:R,hidden:ji,high:R,href:null,hrefLang:null,htmlFor:oe,httpEquiv:oe,id:null,imageSizes:null,imageSrcSet:null,inert:K,inputMode:null,integrity:null,is:null,isMap:K,itemId:null,itemProp:oe,itemRef:oe,itemScope:K,itemType:oe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:K,low:R,manifest:null,max:null,maxLength:R,media:null,method:null,min:null,minLength:R,multiple:K,muted:K,name:null,nonce:null,noModule:K,noValidate:K,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:K,optimum:R,pattern:null,ping:oe,placeholder:null,playsInline:K,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:K,referrerPolicy:null,rel:oe,required:K,reversed:K,rows:R,rowSpan:R,sandbox:oe,scope:null,scoped:K,seamless:K,selected:K,shadowRootClonable:K,shadowRootCustomElementRegistry:K,shadowRootDelegatesFocus:K,shadowRootMode:null,shadowRootSerializable:K,shape:null,size:R,sizes:null,slot:null,span:R,spellCheck:be,src:null,srcDoc:null,srcLang:null,srcSet:null,start:R,step:null,style:null,tabIndex:R,target:null,title:null,translate:null,type:null,typeMustMatch:K,useMap:null,value:be,width:R,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:oe,axis:null,background:null,bgColor:null,border:R,borderColor:null,bottomMargin:R,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:K,declare:K,event:null,face:null,frame:null,frameBorder:null,hSpace:R,leftMargin:R,link:null,longDesc:null,lowSrc:null,marginHeight:R,marginWidth:R,noResize:K,noHref:K,noShade:K,noWrap:K,object:null,profile:null,prompt:null,rev:null,rightMargin:R,rules:null,scheme:null,scrolling:be,standby:null,summary:null,text:null,topMargin:R,valueType:null,version:null,vAlign:null,vLink:null,vSpace:R,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:K,disablePictureInPicture:K,disableRemotePlayback:K,exportParts:Ht,part:oe,prefix:null,property:null,results:R,security:null,unselectable:null},space:"html",transform:$o}),sc=xn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ze,accentHeight:R,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:R,amplitude:R,arabicForm:null,ascent:R,attributeName:null,attributeType:null,azimuth:R,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:R,by:null,calcMode:null,capHeight:R,className:oe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:R,diffuseConstant:R,direction:null,display:null,dur:null,divisor:R,dominantBaseline:null,download:K,dx:null,dy:null,edgeMode:null,editable:null,elevation:R,enableBackground:null,end:null,event:null,exponent:R,externalResourcesRequired:null,fill:null,fillOpacity:R,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ht,g2:Ht,glyphName:Ht,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:R,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:R,horizOriginX:R,horizOriginY:R,id:null,ideographic:R,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:R,k:R,k1:R,k2:R,k3:R,k4:R,kernelMatrix:ze,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:R,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:R,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:R,overlineThickness:R,paintOrder:null,panose1:null,path:null,pathLength:R,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:oe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:R,pointsAtY:R,pointsAtZ:R,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ze,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ze,rev:ze,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ze,requiredFeatures:ze,requiredFonts:ze,requiredFormats:ze,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:R,specularExponent:R,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:R,strikethroughThickness:R,string:null,stroke:null,strokeDashArray:ze,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:R,strokeOpacity:R,strokeWidth:null,style:null,surfaceScale:R,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ze,tabIndex:R,tableValues:null,target:null,targetX:R,targetY:R,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ze,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:R,underlineThickness:R,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:R,values:null,vAlphabetic:R,vMathematical:R,vectorEffect:null,vHanging:R,vIdeographic:R,version:null,vertAdvY:R,vertOriginX:R,vertOriginY:R,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:R,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Uo}),Ho=xn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Ko=xn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$o}),Qo=xn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ac={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},oc=/[A-Z]/g,fa=/-[a-z]/g,lc=/^data[-\w.:]+$/i;function uc(e,t){const n=vi(t);let r=t,s=Me;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&lc.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(fa,dc);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!fa.test(a)){let o=a.replace(oc,cc);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=Ui}return new s(r,t)}function cc(e){return"-"+e.toLowerCase()}function dc(e){return e.charAt(1).toUpperCase()}const hc=Bo([qo,ic,Ho,Ko,Qo],"html"),$i=Bo([qo,sc,Ho,Ko,Qo],"svg");function pc(e){return e.join(" ").trim()}var Gt={},Hr,xa;function mc(){if(xa)return Hr;xa=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 w(y,b){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];b=b||{};var S=1,_=1;function C(O){var k=O.match(t);k&&(S+=k.length);var q=O.lastIndexOf(u);_=~q?O.length-q:_+O.length}function D(){var O={line:S,column:_};return function(k){return k.position=new j(O),P(),k}}function j(O){this.start=O,this.end={line:S,column:_},this.source=b.source}j.prototype.content=y;function B(O){var k=new Error(b.source+":"+S+":"+_+": "+O);if(k.reason=O,k.filename=b.source,k.line=S,k.column=_,k.source=y,!b.silent)throw k}function L(O){var k=O.exec(y);if(k){var q=k[0];return C(q),y=y.slice(q.length),k}}function P(){L(n)}function z(O){var k;for(O=O||[];k=A();)k!==!1&&O.push(k);return O}function A(){var O=D();if(!(c!=y.charAt(0)||d!=y.charAt(1))){for(var k=2;h!=y.charAt(k)&&(d!=y.charAt(k)||c!=y.charAt(k+1));)++k;if(k+=2,h===y.charAt(k-1))return B("End of comment missing");var q=y.slice(2,k-2);return _+=2,C(q),y=y.slice(k),_+=2,O({type:m,comment:q})}}function E(){var O=D(),k=L(r);if(k){if(A(),!L(s))return B("property missing ':'");var q=L(a),V=O({type:p,property:v(k[0].replace(e,h)),value:q?v(q[0].replace(e,h)):h});return L(o),V}}function G(){var O=[];z(O);for(var k;k=E();)k!==!1&&(O.push(k),z(O));return O}return P(),G()}function v(y){return y?y.replace(l,h):h}return Hr=w,Hr}var ga;function fc(){if(ga)return Gt;ga=1;var e=Gt&&Gt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.default=n;const t=e(mc());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 Gt}var _n={},ba;function xc(){if(ba)return _n;ba=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.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 _n.camelCase=u,_n}var En,ya;function gc(){if(ya)return En;ya=1;var e=En&&En.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(fc()),n=xc();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,En=r,En}var bc=gc();const yc=Mi(bc),Vo=Wo("end"),Hi=Wo("start");function Wo(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 wc(e){const t=Hi(e),n=Vo(e);if(t&&n)return{start:t,end:n}}function On(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?wa(e.position):"start"in e||"end"in e?wa(e):"line"in e||"column"in e?Ni(e):""}function Ni(e){return va(e&&e.line)+":"+va(e&&e.column)}function wa(e){return Ni(e&&e.start)+"-"+Ni(e&&e.end)}function va(e){return e&&typeof e=="number"?e:1}class Ce 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=On(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}}Ce.prototype.file="";Ce.prototype.name="";Ce.prototype.reason="";Ce.prototype.message="";Ce.prototype.stack="";Ce.prototype.column=void 0;Ce.prototype.line=void 0;Ce.prototype.ancestors=void 0;Ce.prototype.cause=void 0;Ce.prototype.fatal=void 0;Ce.prototype.place=void 0;Ce.prototype.ruleId=void 0;Ce.prototype.source=void 0;const Ki={}.hasOwnProperty,vc=new Map,jc=/[A-Z]/g,kc=new Set(["table","tbody","thead","tfoot","tr"]),Nc=new Set(["td","th"]),Go="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Sc(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=Ac(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=Tc(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"?$i:hc,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Jo(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function Jo(e,t,n){if(t.type==="element")return Cc(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return _c(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Pc(e,t,n);if(t.type==="mdxjsEsm")return Ec(e,t);if(t.type==="root")return Rc(e,t,n);if(t.type==="text")return Ic(e,t)}function Cc(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=$i,e.schema=s),e.ancestors.push(t);const a=Yo(e,t.tagName,!1),o=Lc(e,t);let l=Vi(e,t);return kc.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!nc(u):!0})),Xo(e,o,a,t),Qi(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function _c(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)}Qn(e,t.position)}function Ec(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Qn(e,t.position)}function Pc(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=$i,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:Yo(e,t.name,!0),o=Mc(e,t),l=Vi(e,t);return Xo(e,o,a,t),Qi(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Rc(e,t,n){const r={};return Qi(r,Vi(e,t)),e.create(t,e.Fragment,r,n)}function Ic(e,t){return t.value}function Xo(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Qi(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Tc(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 Ac(e,t){return n;function n(r,s,a,o){const l=Array.isArray(a.children),u=Hi(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 Lc(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Ki.call(t.properties,s)){const a=Oc(e,s,t.properties[s]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Nc.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 Mc(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 Qn(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 Qn(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function Vi(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:vc;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 Na={}.hasOwnProperty;function Hc(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 Xt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lt=Rt(/[A-Za-z]/),Ue=Rt(/[\dA-Za-z]/),Vc=Rt(/[#-'*+\--9=?A-Z^-~]/);function Si(e){return e!==null&&(e<32||e===127)}const Ci=Rt(/\d/),Wc=Rt(/[\dA-Fa-f]/),Gc=Rt(/[!-/:-@[-`{-~]/);function H(e){return e!==null&&e<-2}function Le(e){return e!==null&&(e<0||e===32)}function te(e){return e===-2||e===-1||e===32}const Jc=Rt(new RegExp("\\p{P}|\\p{S}","u")),Xc=Rt(/\s/);function Rt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function gn(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 te(u)?(e.enter(n),l(u)):t(u)}function l(u){return te(u)&&a++o))return;const B=t.events.length;let L=B,P,z;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(P){z=t.events[L][1].end;break}P=!0}for(b(r),j=B;j_;){const D=n[C];t.containerState=D[1],D[0].exit.call(t,e)}n.length=_}function S(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function nd(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 Ca(e){if(e===null||Le(e)||Xc(e))return 1;if(Jc(e))return 2}function Gi(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};_a(h,-u),_a(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=He(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=He(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",a,t]]),c=He(c,Gi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=He(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=He(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&&te(j)?ue(e,S,"linePrefix",a+1)(j):S(j)}function S(j){return j===null||H(j)?e.check(Ea,v,C)(j):(e.enter("codeFlowValue"),_(j))}function _(j){return j===null||H(j)?(e.exit("codeFlowValue"),S(j)):(e.consume(j),_)}function C(j){return e.exit("codeFenced"),t(j)}function D(j,B,L){let P=0;return z;function z(k){return j.enter("lineEnding"),j.consume(k),j.exit("lineEnding"),A}function A(k){return j.enter("codeFencedFence"),te(k)?ue(j,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):E(k)}function E(k){return k===l?(j.enter("codeFencedFenceSequence"),G(k)):L(k)}function G(k){return k===l?(P++,j.consume(k),G):P>=o?(j.exit("codeFencedFenceSequence"),te(k)?ue(j,O,"whitespace")(k):O(k)):L(k)}function O(k){return k===null||H(k)?(j.exit("codeFencedFence"),B(k)):L(k)}}}function md(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 Qr={name:"codeIndented",tokenize:xd},fd={partial:!0,tokenize:gd};function xd(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):H(c)?e.attempt(fd,o,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||H(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function gd(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):H(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):H(o)?s(o):n(o)}}const bd={name:"codeText",previous:wd,resolve:yd,tokenize:vd};function yd(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&&Pn(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),Pn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Pn(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 sl(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||Si(b)?n(b):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),v(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||H(b)?n(b):(e.consume(b),b===92?w:p)}function w(b){return b===60||b===62||b===92?(e.consume(b),p):p(b)}function v(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):H(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||H(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),u||(u=!te(p)),p===92?m:h)}function m(p){return p===91||p===92||p===93?(e.consume(p),l++,h):h(p)}}function ol(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):H(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||H(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 Dn(e,t){let n;return r;function r(s){return H(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):te(s)?ue(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const Pd={name:"definition",tokenize:Id},Rd={partial:!0,tokenize:Td};function Id(e,t,n){const r=this;let s;return a;function a(p){return e.enter("definition"),o(p)}function o(p){return al.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return s=Xt(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)?Dn(e,c)(p):c(p)}function c(p){return sl(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(Rd,h,h)(p)}function h(p){return te(p)?ue(e,m,"whitespace")(p):m(p)}function m(p){return p===null||H(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function Td(e,t,n){return r;function r(l){return Le(l)?Dn(e,s)(l):n(l)}function s(l){return ol(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return te(l)?ue(e,o,"whitespace")(l):o(l)}function o(l){return l===null||H(l)?t(l):n(l)}}const Ad={name:"hardBreakEscape",tokenize:Ld};function Ld(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return H(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Md={name:"headingAtx",resolve:Od,tokenize:Dd};function Od(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 Dd(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||H(d)?(e.exit("atxHeading"),t(d)):te(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 Fd=["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"],Ra=["pre","script","style","textarea"],zd={concrete:!0,name:"htmlFlow",resolveTo:Ud,tokenize:$d},Bd={partial:!0,tokenize:Kd},qd={partial:!0,tokenize:Hd};function Ud(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 $d(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,v):x===63?(e.consume(x),s=3,r.interrupt?t:f):lt(x)?(e.consume(x),o=String.fromCharCode(x),y):n(x)}function m(x){return x===45?(e.consume(x),s=2,p):x===91?(e.consume(x),s=5,l=0,w):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 w(x){const he="CDATA[";return x===he.charCodeAt(l++)?(e.consume(x),l===he.length?r.interrupt?t:E:w):n(x)}function v(x){return lt(x)?(e.consume(x),o=String.fromCharCode(x),y):n(x)}function y(x){if(x===null||x===47||x===62||Le(x)){const he=x===47,Oe=o.toLowerCase();return!he&&!a&&Ra.includes(Oe)?(s=1,r.interrupt?t(x):E(x)):Fd.includes(o.toLowerCase())?(s=6,he?(e.consume(x),b):r.interrupt?t(x):E(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),y):n(x)}function b(x){return x===62?(e.consume(x),r.interrupt?t:E):n(x)}function S(x){return te(x)?(e.consume(x),S):z(x)}function _(x){return x===47?(e.consume(x),z):x===58||x===95||lt(x)?(e.consume(x),C):te(x)?(e.consume(x),_):z(x)}function C(x){return x===45||x===46||x===58||x===95||Ue(x)?(e.consume(x),C):D(x)}function D(x){return x===61?(e.consume(x),j):te(x)?(e.consume(x),D):_(x)}function j(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),u=x,B):te(x)?(e.consume(x),j):L(x)}function B(x){return x===u?(e.consume(x),u=null,P):x===null||H(x)?n(x):(e.consume(x),B)}function L(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||Le(x)?D(x):(e.consume(x),L)}function P(x){return x===47||x===62||te(x)?_(x):n(x)}function z(x){return x===62?(e.consume(x),A):n(x)}function A(x){return x===null||H(x)?E(x):te(x)?(e.consume(x),A):n(x)}function E(x){return x===45&&s===2?(e.consume(x),q):x===60&&s===1?(e.consume(x),V):x===62&&s===4?(e.consume(x),se):x===63&&s===3?(e.consume(x),f):x===93&&s===5?(e.consume(x),ge):H(x)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(Bd,Ve,G)(x)):x===null||H(x)?(e.exit("htmlFlowData"),G(x)):(e.consume(x),E)}function G(x){return e.check(qd,O,Ve)(x)}function O(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),k}function k(x){return x===null||H(x)?G(x):(e.enter("htmlFlowData"),E(x))}function q(x){return x===45?(e.consume(x),f):E(x)}function V(x){return x===47?(e.consume(x),o="",ie):E(x)}function ie(x){if(x===62){const he=o.toLowerCase();return Ra.includes(he)?(e.consume(x),se):E(x)}return lt(x)&&o.length<8?(e.consume(x),o+=String.fromCharCode(x),ie):E(x)}function ge(x){return x===93?(e.consume(x),f):E(x)}function f(x){return x===62?(e.consume(x),se):x===45&&s===2?(e.consume(x),f):E(x)}function se(x){return x===null||H(x)?(e.exit("htmlFlowData"),Ve(x)):(e.consume(x),se)}function Ve(x){return e.exit("htmlFlow"),t(x)}}function Hd(e,t,n){const r=this;return s;function s(o){return H(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 Kd(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Lr,t,n)}}const Qd={name:"htmlText",tokenize:Vd};function Vd(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),D):f===63?(e.consume(f),_):lt(f)?(e.consume(f),L):n(f)}function c(f){return f===45?(e.consume(f),d):f===91?(e.consume(f),a=0,w):lt(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):H(f)?(o=h,V(f)):(e.consume(f),h)}function m(f){return f===45?(e.consume(f),p):h(f)}function p(f){return f===62?q(f):f===45?m(f):h(f)}function w(f){const se="CDATA[";return f===se.charCodeAt(a++)?(e.consume(f),a===se.length?v:w):n(f)}function v(f){return f===null?n(f):f===93?(e.consume(f),y):H(f)?(o=v,V(f)):(e.consume(f),v)}function y(f){return f===93?(e.consume(f),b):v(f)}function b(f){return f===62?q(f):f===93?(e.consume(f),b):v(f)}function S(f){return f===null||f===62?q(f):H(f)?(o=S,V(f)):(e.consume(f),S)}function _(f){return f===null?n(f):f===63?(e.consume(f),C):H(f)?(o=_,V(f)):(e.consume(f),_)}function C(f){return f===62?q(f):_(f)}function D(f){return lt(f)?(e.consume(f),j):n(f)}function j(f){return f===45||Ue(f)?(e.consume(f),j):B(f)}function B(f){return H(f)?(o=B,V(f)):te(f)?(e.consume(f),B):q(f)}function L(f){return f===45||Ue(f)?(e.consume(f),L):f===47||f===62||Le(f)?P(f):n(f)}function P(f){return f===47?(e.consume(f),q):f===58||f===95||lt(f)?(e.consume(f),z):H(f)?(o=P,V(f)):te(f)?(e.consume(f),P):q(f)}function z(f){return f===45||f===46||f===58||f===95||Ue(f)?(e.consume(f),z):A(f)}function A(f){return f===61?(e.consume(f),E):H(f)?(o=A,V(f)):te(f)?(e.consume(f),A):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):H(f)?(o=E,V(f)):te(f)?(e.consume(f),E):(e.consume(f),O)}function G(f){return f===s?(e.consume(f),s=void 0,k):f===null?n(f):H(f)?(o=G,V(f)):(e.consume(f),G)}function O(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),O)}function k(f){return f===47||f===62||Le(f)?P(f):n(f)}function q(f){return f===62?(e.consume(f),e.exit("htmlTextData"),e.exit("htmlText"),t):n(f)}function V(f){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ie}function ie(f){return te(f)?ue(e,ge,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):ge(f)}function ge(f){return e.enter("htmlTextData"),o(f)}}const Ji={name:"labelEnd",resolveAll:Xd,resolveTo:Yd,tokenize:Zd},Wd={tokenize:eh},Gd={tokenize:th},Jd={tokenize:nh};function Xd(e){let t=-1;const n=[];for(;++t=3&&(c===null||H(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===s?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),te(c)?ue(e,l,"whitespace")(c):l(c))}}const Ie={continuation:{tokenize:hh},exit:mh,name:"list",tokenize:dh},uh={partial:!0,tokenize:fh},ch={partial:!0,tokenize:ph};function dh(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 w=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Ci(p)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(kr,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 Ci(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(Lr,r.interrupt?n:d,e.attempt(uh,m,h))}function d(p){return r.containerState.initialBlankLine=!0,a++,m(p)}function h(p){return te(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 hh(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Lr,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||!te(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(ch,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 ph(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 mh(e){e.exit(this.containerState.type)}function fh(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!te(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Ia={name:"setextUnderline",resolveTo:xh,tokenize:gh};function xh(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 gh(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"),te(c)?ue(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||H(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const bh={tokenize:yh};function yh(e){const t=this,n=e.attempt(Lr,r,e.attempt(this.parser.constructs.flowInitial,s,ue(e,e.attempt(this.parser.constructs.flow,s,e.attempt(Nd,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 wh={resolveAll:ul()},vh=ll("string"),jh=ll("text");function ll(e){return{resolveAll:ul(e==="text"?kh: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 Oh(e,t){let n=-1;const r=[];let s;for(;++n0){const Fe=$.tokenStack[$.tokenStack.length-1];(Fe[1]||Aa).call($,void 0,Fe[0])}for(I.position={start:gt(N.length>0?N[0][1].start:{line:1,column:1,offset:0}),end:gt(N.length>0?N[N.length-2][1].end:{line:1,column:1,offset:0})},re=-1;++re0&&(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 Jh(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Xh(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yh(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=gn(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 Zh(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 ep(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function hl(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 tp(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hl(e,t);const s={src:gn(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 np(e,t){const n={src:gn(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 rp(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 ip(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hl(e,t);const s={href:gn(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 sp(e,t){const n={href:gn(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 ap(e,t,n){const r=e.all(t),s=n?op(n):pl(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 lp(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=Hi(t.children[1]),u=Vo(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 pp(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(Oa(t.slice(s),s>0,!1)),a.join("")}function Oa(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===La||a===Ma;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===La||a===Ma;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function xp(e,t){const n={type:"text",value:fp(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function gp(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const bp={blockquote:Vh,break:Wh,code:Gh,delete:Jh,emphasis:Xh,footnoteReference:Yh,heading:Zh,html:ep,imageReference:tp,image:np,inlineCode:rp,linkReference:ip,link:sp,listItem:ap,list:lp,paragraph:up,root:cp,strong:dp,table:hp,tableCell:mp,tableRow:pp,text:xp,thematicBreak:gp,toml:fr,yaml:fr,definition:fr,footnoteDefinition:fr};function fr(){}const ml=-1,Mr=0,Fn=1,_r=2,Xi=3,Yi=4,Zi=5,es=6,fl=7,xl=8,yp=typeof self=="object"?self:globalThis,Da=(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 yp[e](t)},wp=(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 Mr:case ml:return n(o,s);case Fn:{const l=n([],s);for(const u of o)l.push(r(u));return l}case _r:{const l=n({},s);for(const[u,c]of o)l[r(u)]=r(c);return l}case Xi:return n(new Date(o),s);case Yi:{const{source:l,flags:u}=o;return n(new RegExp(l,u),s)}case Zi:{const l=n(new Map,s);for(const[u,c]of o)l.set(r(u),r(c));return l}case es:{const l=n(new Set,s);for(const u of o)l.add(r(u));return l}case fl:{const{name:l,message:u}=o;return n(Da(l,u),s)}case xl: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(Da(a,o),s)};return r},Fa=e=>wp(new Map,e)(0),Jt="",{toString:vp}={},{keys:jp}=Object,Rn=e=>{const t=typeof e;if(t!=="object"||!e)return[Mr,t];const n=vp.call(e).slice(8,-1);switch(n){case"Array":return[Fn,Jt];case"Object":return[_r,Jt];case"Date":return[Xi,Jt];case"RegExp":return[Yi,Jt];case"Map":return[Zi,Jt];case"Set":return[es,Jt];case"DataView":return[Fn,n]}return n.includes("Array")?[Fn,n]:n.includes("Error")?[fl,n]:[_r,n]},xr=([e,t])=>e===Mr&&(t==="function"||t==="symbol"),kp=(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]=Rn(o);switch(l){case Mr:{let d=o;switch(u){case"bigint":l=xl,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return s([ml],o)}return s([l,d],o)}case Fn:{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 _r:{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 jp(o))(e||!xr(Rn(o[m])))&&d.push([a(m),a(o[m])]);return h}case Xi:return s([l,o.toISOString()],o);case Yi:{const{source:d,flags:h}=o;return s([l,{source:d,flags:h}],o)}case Zi:{const d=[],h=s([l,d],o);for(const[m,p]of o)(e||!(xr(Rn(m))||xr(Rn(p))))&&d.push([a(m),a(p)]);return h}case es:{const d=[],h=s([l,d],o);for(const m of o)(e||!xr(Rn(m)))&&d.push(a(m));return h}}const{message:c}=o;return s([l,{name:u,message:c}],o)};return a},za=(e,{json:t,lossy:n}={})=>{const r=[];return kp(!(t||n),!!t,new Map,r)(e),r},Er=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Fa(za(e,t)):structuredClone(e):(e,t)=>Fa(za(e,t));function Np(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 Sp(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Cp(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Np,r=e.options.footnoteBackLabel||Sp,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u0&&w.push({type:"text",value:" "});let S=typeof n=="string"?n:n(u,p);typeof S=="string"&&(S={type:"text",value:S}),w.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 y=d[d.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const S=y.children[y.children.length-1];S&&S.type==="text"?S.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...w)}else d.push(...w);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:{...Er(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 gl=(function(e){if(e==null)return Rp;if(typeof e=="function")return Or(e);if(typeof e=="object")return Array.isArray(e)?_p(e):Ep(e);if(typeof e=="string")return Pp(e);throw new Error("Expected function, string, or object as test")});function _p(e){const t=[];let n=-1;for(;++n":""))+")"})}return m;function m(){let p=bl,w,v,y;if((!t||a(u,c,d[d.length-1]||void 0))&&(p=Mp(n(u,d)),p[0]===Ba))return p;if("children"in u&&u.children){const b=u;if(b.children&&p[0]!==Ap)for(v=(r?b.children.length:-1)+o,y=d.concat(b);v>-1&&v0&&n.push({type:"text",value:` +`}),n}function qa(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ua(e,t){const n=Dp(e,t),r=n.one(e,void 0),s=Cp(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:` +`},s),a}function Up(e,t){return e&&"run"in e?async function(n,r){const s=Ua(n,{file:r,...t});await e.run(s,r)}:function(n,r){return Ua(n,{file:r,...e||t})}}function $a(e){if(e)throw e}var Wr,Ha;function $p(){if(Ha)return Wr;Ha=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 Wr=function u(){var c,d,h,m,p,w,v=arguments[0],y=1,b=arguments.length,S=!1;for(typeof v=="boolean"&&(S=v,v=arguments[1]||{},y=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});yo.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:Vp,dirname:Wp,extname:Gp,join:Jp,sep:"/"};function Vp(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');or(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 Wp(e){if(or(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 Gp(e){or(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 Jp(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Yp(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 or(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Zp={cwd:em};function em(){return"/"}function Ri(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function tm(e){if(typeof e=="string")e=new URL(e);else if(!Ri(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 nm(e)}function nm(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,...w]=d;const v=r[m][1];Pi(v)&&Pi(p)&&(p=Gr(!0,v,p)),r[m]=[c,p,...w]}}}}const am=new ts().freeze();function Zr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ei(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ti(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 Qa(e){if(!Pi(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Va(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function gr(e){return om(e)?e:new wl(e)}function om(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lm(e){return typeof e=="string"||um(e)}function um(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cm="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Wa=[],Ga={allowDangerousHtml:!0},dm=/^(https?|ircs?|mailto|xmpp)$/i,hm=[{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 pm(e){const t=mm(e),n=fm(e);return xm(t.runSync(t.parse(n),n),e)}function mm(e){const t=e.rehypePlugins||Wa,n=e.remarkPlugins||Wa,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ga}:Ga;return am().use(Qh).use(n).use(Up,r).use(t)}function fm(e){const t=e.children||"",n=new wl;return typeof t=="string"&&(n.value=t),n}function xm(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||gm;for(const d of hm)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+cm+d.id,void 0);return yl(e,c),Sc(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 Kr)if(Object.hasOwn(Kr,p)&&Object.hasOwn(d.properties,p)){const w=d.properties[p],v=Kr[p];(v===null||v.includes(d.tagName))&&(d.properties[p]=u(String(w||""),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 gm(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||dm.test(e.slice(0,t))?e:""}const ns="-",bm=e=>{const t=wm(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(ns);return l[0]===""&&l.length!==1&&l.shift(),vl(l,t)||ym(o)},getConflictingClassGroupIds:(o,l)=>{const u=n[o]||[];return l&&r[o]?[...u,...r[o]]:u}}},vl=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?vl(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(ns);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},Ja=/^\[(.+)\]$/,ym=e=>{if(Ja.test(e)){const t=Ja.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},wm=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return jm(Object.entries(e.classGroups),n).forEach(([a,o])=>{Ii(o,r,a,t)}),r},Ii=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:Xa(t,s);a.classGroupId=n;return}if(typeof s=="function"){if(vm(s)){Ii(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([a,o])=>{Ii(o,Xa(t,a),n,r)})})},Xa=(e,t)=>{let n=e;return t.split(ns).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},vm=e=>e.isThemeGetter,jm=(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,km=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)}}},jl="!",Nm=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 y=0;yd?h-d:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:w,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:o}):o},Sm=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},Cm=e=>({cache:km(e.cacheSize),parseClassName:Nm(e),...bm(e)}),_m=/\s+/,Em=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,a=[],o=e.trim().split(_m);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 w=!!p,v=r(w?m.substring(0,p):m);if(!v){if(!w){l=c+(l.length>0?" "+l:l);continue}if(v=r(m),!v){l=c+(l.length>0?" "+l:l);continue}w=!1}const y=Sm(d).join(":"),b=h?y+jl:y,S=b+v;if(a.includes(S))continue;a.push(S);const _=s(v,w);for(let C=0;C<_.length;++C){const D=_[C];a.push(b+D)}l=c+(l.length>0?" "+l:l)}return l};function Pm(){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=Cm(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=Em(u,n);return s(u,d),d}return function(){return a(Pm.apply(null,arguments))}}const ce=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Nl=/^\[(?:([a-z-]+):)?(.+)\]$/i,Im=/^\d+\/\d+$/,Tm=new Set(["px","full","screen"]),Am=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Lm=/\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$/,Mm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Om=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dt=e=>Yt(e)||Tm.has(e)||Im.test(e),bt=e=>bn(e,"length",Km),Yt=e=>!!e&&!Number.isNaN(Number(e)),ni=e=>bn(e,"number",Yt),In=e=>!!e&&Number.isInteger(Number(e)),Fm=e=>e.endsWith("%")&&Yt(e.slice(0,-1)),W=e=>Nl.test(e),yt=e=>Am.test(e),zm=new Set(["length","size","percentage"]),Bm=e=>bn(e,zm,Sl),qm=e=>bn(e,"position",Sl),Um=new Set(["image","url"]),$m=e=>bn(e,Um,Vm),Hm=e=>bn(e,"",Qm),Tn=()=>!0,bn=(e,t,n)=>{const r=Nl.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Km=e=>Lm.test(e)&&!Mm.test(e),Sl=()=>!1,Qm=e=>Om.test(e),Vm=e=>Dm.test(e),Wm=()=>{const e=ce("colors"),t=ce("spacing"),n=ce("blur"),r=ce("brightness"),s=ce("borderColor"),a=ce("borderRadius"),o=ce("borderSpacing"),l=ce("borderWidth"),u=ce("contrast"),c=ce("grayscale"),d=ce("hueRotate"),h=ce("invert"),m=ce("gap"),p=ce("gradientColorStops"),w=ce("gradientColorStopPositions"),v=ce("inset"),y=ce("margin"),b=ce("opacity"),S=ce("padding"),_=ce("saturate"),C=ce("scale"),D=ce("sepia"),j=ce("skew"),B=ce("space"),L=ce("translate"),P=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",W,t],E=()=>[W,t],G=()=>["",dt,bt],O=()=>["auto",Yt,W],k=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>["start","end","center","between","around","evenly","stretch"],ge=()=>["","0",W],f=()=>["auto","avoid","all","avoid-page","page","left","right","column"],se=()=>[Yt,W];return{cacheSize:500,separator:":",theme:{colors:[Tn],spacing:[dt,bt],blur:["none","",yt,W],brightness:se(),borderColor:[e],borderRadius:["none","","full",yt,W],borderSpacing:E(),borderWidth:G(),contrast:se(),grayscale:ge(),hueRotate:se(),invert:ge(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[Fm,bt],inset:A(),margin:A(),opacity:se(),padding:E(),saturate:se(),scale:se(),sepia:ge(),skew:se(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",W]}],container:["container"],columns:[{columns:[yt]}],"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:[...k(),W]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",In,W]}],basis:[{basis:A()}],"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:ge()}],shrink:[{shrink:ge()}],order:[{order:["first","last","none",In,W]}],"grid-cols":[{"grid-cols":[Tn]}],"col-start-end":[{col:["auto",{span:["full",In,W]},W]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[Tn]}],"row-start-end":[{row:["auto",{span:[In,W]},W]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"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",...ie()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ie(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ie(),"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:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"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:[yt]},yt]}],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",yt,bt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ni]}],"font-family":[{font:[Tn]}],"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",Yt,ni]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",dt,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:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",dt,bt]}],"underline-offset":[{"underline-offset":["auto",dt,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:[...k(),qm]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Bm]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$m]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"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:[...q(),"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:q()}],"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:["",...q()]}],"outline-offset":[{"outline-offset":[dt,W]}],"outline-w":[{outline:[dt,bt]}],"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":[dt,bt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",yt,Hm]}],"shadow-color":[{shadow:[Tn]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",yt,W]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[_]}],sepia:[{sepia:[D]}],"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":[D]}],"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:se()}],ease:[{ease:["linear","in","out","in-out",W]}],delay:[{delay:se()}],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:[In,W]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"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:[dt,bt,ni]}],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"]}}},Gm=Rm(Wm),Ti={status:"",repo:"",thread:"",action:"",intent:"",actor:""},Jm=new _u({defaultOptions:{queries:{retry:1}}}),Ya=12,Xm=12,Ym=10080*60*1e3,Zm=1e3,Cl=Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function Q(...e){return Gm(Wl(e))}async function Z(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 ef=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}),tf=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});function lr(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function nf(e){const t=lr(e);return t?ef.format(t):e??""}function zn(e){const t=lr(e);return t?tf.format(t):e??""}function _l(e,t){const n=lr(e);if(!n)return e??"";const r=t-n.getTime(),s=Math.abs(r);if(s>Ym)return zn(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=lr(e);return s?i.jsx("time",{dateTime:s.toISOString(),title:`UTC: ${s.toISOString()}`,children:n?_l(e,r):t?zn(e):nf(e)}):i.jsx(i.Fragment,{children:e??""})}function El(e,t){const n=lr(e);return n?Math.max(0,Math.floor((t-n.getTime())/1e3)):null}function rs(e,t){return e.status==="running"?El(e.started_at,t)??e.runtime_seconds:e.runtime_seconds}function is(e,t){return e.status==="pending"?El(e.created_at,t)??e.queue_wait_seconds:e.queue_wait_seconds}function rf(e){const[t,n]=T.useState(()=>Date.now());return T.useEffect(()=>{if(!e)return;n(Date.now());const r=window.setInterval(()=>n(Date.now()),Zm);return()=>window.clearInterval(r)},[e]),t}function sf(e){return(e??"").split(/\r?\n/).map(n=>n.trim()).find(Boolean)??""}function Pr(e,t,n=1){const r=sf(t),s=n>1?` (${n})`:"";return r?`${e}${s}: ${r}`:`${e}${s}`}function Rr(e){return e==="openclaw_stdout"||e==="openclaw_stderr"}function Pl(e){return e.map(t=>t==null?void 0:t.trim()).filter(Boolean).join(` +`)}function af(e){const t=[];for(const n of e){const r=t[t.length-1];if(r&&Rr(n.event_type)&&r.eventType===n.event_type){r.count+=1,r.meta=n.ts,r.detail=Pl([r.detail,n.detail]),r.summary=Pr(n.summary,r.detail,r.count);continue}t.push({id:String(n.id),badge:n.event_type,meta:n.ts,summary:Rr(n.event_type)?Pr(n.summary,n.detail):n.summary,detail:n.detail,eventType:n.event_type,count:1})}return t}function of(e){const t=[];return e.forEach((n,r)=>{const s=t[t.length-1];if(s&&Rr(n.kind)&&s.kind===n.kind){s.count+=1,s.meta=n.timestamp,s.text=Pl([s.text,n.text]),s.summary=Pr(`${n.role} · ${n.kind}`,s.text,s.count);return}t.push({id:`${n.timestamp??"entry"}-${r}`,badge:n.title,meta:n.timestamp,summary:Rr(n.kind)?Pr(`${n.role} · ${n.kind}`,n.text):`${n.role} · ${n.kind}`,text:n.text,kind:n.kind,count:1})}),t}function Za(e,t,n,r){return e==="openclaw_stdout"?!1:t||n>=r-2}function lf(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 uf(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 cf(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 df(e){return{timeseries:e==="overview",hooks:e==="hooks",deliveries:e==="deliveries"}}function hf(e,t,n="day"){return`/api/webhooks/github/timeseries?${new URLSearchParams({from:e,to:t,bucket:n}).toString()}`}function pf(e=50,t){const n=new URLSearchParams({limit:String(e)});return t&&n.set("cursor",t),`/api/webhooks/github/deliveries?${n.toString()}`}function br(e=new Date){return{from:new Date(e.getTime()-720*60*60*1e3).toISOString(),to:e.toISOString()}}function mf(e=Cl){return`/api/metrics/summary?timezone=${encodeURIComponent(e)}`}function ct(e){try{const t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"?t.href:"#"}catch{return"#"}}function Nr(){return"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}function ff(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="github-agent-bridge:push")}function xf(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 bf(e,t){const n=eo(t);return e.some(r=>eo(r)===n)?e:[...e,t]}function eo(e){return`${e.timestamp??""}:${e.role}:${e.kind}:${e.title}:${e.text}`}function yf(e){return["claimed","dispatch_started","dispatch_finished","done","blocked","denied","waiting_approval"].includes(e)}function Mn(e){return["blocked","denied","waiting_approval"].includes(e)}function Ai(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 wf(e=window.location.pathname){const t=e.match(/^\/jobs\/(\d+)\/?$/);return t?Number(t[1]):null}function vf(e=window.location.pathname){return/^\/knowledge\/?$/.test(e)}function jf(e=window.location.pathname){return/^\/mcp\/?$/.test(e)}function kf(e=window.location.pathname){return/^\/system\/?$/.test(e)}function ri(e=window.location.pathname){return/^\/webhooks\/?$/.test(e)}function Rl(e){return e.startsWith("repo:")?e.slice(5):e}function to(e){return Object.values(e).some(t=>t.trim()!=="")}function Nf(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 Sf(){var os,ls,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;const e=To(),[t,n]=T.useState(Ti),[r,s]=T.useState(Ya),a=T.useRef(!1),[o,l]=T.useState(""),[u,c]=T.useState("proposed"),[d,h]=T.useState("overview"),[m,p]=T.useState(null),[w,v]=T.useState(()=>br()),[y,b]=T.useState(null),[S,_]=T.useState(""),[C,D]=T.useState(()=>window.location.pathname),[j,B]=T.useState(null),L=wf(C),P=L!==null,z=vf(C),A=jf(C),E=kf(C),G=ri(C),O=!P&&!z&&!A&&!E&&!G,k=L,q=xe({queryKey:["metrics",Cl],queryFn:()=>Z(mf()),enabled:O||E}),V=xe({queryKey:["dashboard-status"],queryFn:()=>Z("/api/status")}),ie=xe({queryKey:["me"],queryFn:()=>Z("/api/me"),refetchInterval:!1}),ge=G&&!!((ls=(os=ie.data)==null?void 0:os.user)!=null&&ls.is_admin&&((us=V.data)!=null&&us.webhook_configured)),f=df(d),se=xe({queryKey:["web-push-config"],queryFn:()=>Z("/api/web-push/config"),enabled:!!((cs=ie.data)!=null&&cs.user)}),Ve=xe({queryKey:["about"],queryFn:()=>Z("/api/about")}),x=xe({queryKey:["job-actors"],queryFn:()=>Z("/api/jobs/actors"),enabled:O}),he=xe({queryKey:["jobs",t,r],queryFn:()=>Z(uf(t,r)),enabled:O,placeholderData:F=>F}),Oe=xe({queryKey:["processes"],queryFn:()=>Z("/api/processes"),enabled:E}),pe=xe({queryKey:["systemd"],queryFn:()=>Z("/api/systemd"),enabled:E}),Ze=xe({queryKey:["alerts"],queryFn:()=>Z("/api/alerts"),enabled:E}),De=xe({queryKey:["webhook-summary"],queryFn:()=>Z("/api/webhooks/github/summary"),enabled:ge}),et=xe({queryKey:["webhook-timeseries",w.from,w.to,"day"],queryFn:()=>Z(hf(w.from,w.to)),enabled:ge&&f.timeseries}),We=xe({queryKey:["webhook-hooks"],queryFn:()=>Z("/api/webhooks/github/hooks"),enabled:ge&&f.hooks}),tt=xe({queryKey:["webhook-deliveries",m],queryFn:()=>Z(pf(50,m)),enabled:ge&&f.deliveries}),Vt=xe({queryKey:["knowledge",o,u],queryFn:()=>Z(cf(o,u)),enabled:z}),Wt=xe({queryKey:["mcp-tokens"],queryFn:()=>Z("/api/mcp/tokens"),enabled:A&&!!((ds=ie.data)!=null&&ds.user)}),Dr=xe({queryKey:["mcp-users"],queryFn:()=>Z("/api/mcp/users"),enabled:A&&!!((hs=ie.data)!=null&&hs.user)}),It=xe({queryKey:["job",k],queryFn:()=>Z(`/api/jobs/${k}`),enabled:k!==null}),vn=xe({queryKey:["job-session",k],queryFn:()=>Z(`/api/jobs/${k}/session`),enabled:k!==null}),jn=xe({queryKey:["job-session-events",k],queryFn:()=>Z(`/api/jobs/${k}/session/events`),enabled:k!==null}),ur=xe({queryKey:["job-session-transcript",k],queryFn:()=>Z(`/api/jobs/${k}/session/transcript`),enabled:k!==null}),kn=T.useCallback(async F=>{const ae=await Z(`/api/jobs/${F}/retry`,{method:"POST"});e.setQueryData(["job",F],{job:ae.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]})},[e]),Nn=T.useCallback(async F=>{const ae=await Z(`/api/jobs/${F}/dismiss`,{method:"POST"});e.setQueryData(["job",F],{job:ae.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]})},[e]),cr=T.useCallback(async(F,ae)=>{const de=await Z(`/api/jobs/${F}/cancel`,{method:"POST",body:JSON.stringify({reason:ae||""})});e.setQueryData(["job",F],{job:de.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]}),e.invalidateQueries({queryKey:["dashboard-status"]})},[e]),dr=T.useCallback(async(F,ae)=>{await Z(`/api/knowledge/proposals/${encodeURIComponent(F)}/${ae}`,{method:"POST"}),e.invalidateQueries({queryKey:["knowledge"]}),e.invalidateQueries({queryKey:["dashboard-status"]})},[e]),Fr=T.useCallback(async F=>{await Z(`/api/knowledge/rules/${encodeURIComponent(F)}`,{method:"DELETE"}),e.invalidateQueries({queryKey:["knowledge"]})},[e]),zr=T.useCallback(async(F,ae)=>{await Z(`/api/knowledge/rules/${encodeURIComponent(F)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:ae})}),e.invalidateQueries({queryKey:["knowledge"]})},[e]),Br=T.useCallback(async(F,ae)=>{const de=await Z("/api/mcp/tokens",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:F,user_login:ae||void 0})});return e.invalidateQueries({queryKey:["mcp-tokens"]}),de},[e]),N=T.useCallback(async(F,ae)=>{await Z(`/api/mcp/tokens/${encodeURIComponent(F)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_login:ae})}),e.invalidateQueries({queryKey:["mcp-tokens"]}),e.invalidateQueries({queryKey:["mcp-users"]})},[e]),I=T.useCallback(async F=>{await Z(`/api/mcp/tokens/${encodeURIComponent(F)}`,{method:"DELETE"}),e.invalidateQueries({queryKey:["mcp-tokens"]})},[e]),$=T.useCallback(async F=>{const ae={refresh:"/api/autoupdate/refresh",apply:"/api/autoupdate/apply",complete:"/api/autoupdate/complete-pending"}[F];b(F),_("");try{await Z(ae,{method:"POST"}),e.invalidateQueries({queryKey:["dashboard-status"]})}catch(de){e.invalidateQueries({queryKey:["dashboard-status"]}),_(de instanceof Error?de.message:String(de))}finally{b(null)}},[e]),J=T.useCallback(async()=>{var Js;const F=(Js=se.data)==null?void 0:Js.public_key;if(!F)throw new Error("web_push_not_configured");if(!Nr())throw new Error("web_push_not_supported");if(await window.Notification.requestPermission()!=="granted")throw new Error("notification_permission_denied");const de=await navigator.serviceWorker.register("/service-worker.js"),Kl=await de.pushManager.getSubscription()??await de.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:xf(F)});await Z("/api/web-push/subscriptions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Kl.toJSON())}),e.invalidateQueries({queryKey:["web-push-config"]})},[e,(ps=se.data)==null?void 0:ps.public_key]),re=T.useCallback(async()=>{if(!Nr())return;const ae=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(!ae)return;const de=ae.endpoint;await ae.unsubscribe(),await Z("/api/web-push/subscriptions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:de})}),e.invalidateQueries({queryKey:["web-push-config"]})},[e]);T.useEffect(()=>{var F;!((F=se.data)!=null&&F.status.enabled)||!Nr()||navigator.serviceWorker.register("/service-worker.js").catch(()=>{})},[(ms=se.data)==null?void 0:ms.status.enabled]),T.useEffect(()=>{if(k===null)return;const F=new EventSource(`/api/jobs/${k}/session/stream`);return F.addEventListener("session_event",ae=>{const de=Ir(ae);de&&(e.setQueryData(["job-session-events",k],xt=>({events:gf((xt==null?void 0:xt.events)??[],de)})),yf(de.event_type)&&(e.invalidateQueries({queryKey:["job",k]}),e.invalidateQueries({queryKey:["jobs"]})))}),F.addEventListener("transcript_entry",ae=>{const de=Ir(ae);!de||de.job_id!==k||e.setQueryData(["job-session-transcript",k],xt=>({entries:bf((xt==null?void 0:xt.entries)??[],de.entry)}))}),F.onerror=()=>{e.invalidateQueries({queryKey:["job",k]}),e.invalidateQueries({queryKey:["job-session-events",k]}),e.invalidateQueries({queryKey:["job-session-transcript",k]})},()=>F.close()},[k,e]),T.useEffect(()=>{const F=()=>{ri(window.location.pathname)&&v(br()),D(window.location.pathname)};return window.addEventListener("popstate",F),()=>window.removeEventListener("popstate",F)},[]),T.useEffect(()=>{if(!("serviceWorker"in navigator))return;const F=ae=>{if(!ff(ae.data))return;const de={...ae.data.payload,id:Date.now(),receivedAt:Date.now()};B(de),de.job_id&&(e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["job",de.job_id]}),e.invalidateQueries({queryKey:["metrics"]}))};return navigator.serviceWorker.addEventListener("message",F),()=>navigator.serviceWorker.removeEventListener("message",F)},[e]),T.useEffect(()=>{if(!j)return;const F=window.setTimeout(()=>B(null),12e3);return()=>window.clearTimeout(F)},[j]);const Fe=T.useCallback(F=>{window.history.pushState({},"",yn(F)),D(window.location.pathname)},[]),Ge=T.useCallback(F=>{window.history.pushState({},"",F),ri(F)&&v(br()),D(window.location.pathname)},[]),ke=((fs=q.data)==null?void 0:fs.metrics.status_counts)??{},nt=((xs=he.data)==null?void 0:xs.jobs)??[],Tt=T.useCallback(F=>{n(F),s(Ya),a.current=!1},[]);T.useEffect(()=>{he.isFetching||(a.current=!1)},[he.isFetching]);const _e=T.useCallback(()=>{a.current||(a.current=!0,s(F=>F+Xm))},[]),Ee=k?((gs=It.data)==null?void 0:gs.job)??null:null,Je=nt.some(F=>F.status==="running"||F.status==="pending")||(Ee==null?void 0:Ee.status)==="running"||(Ee==null?void 0:Ee.status)==="pending"||!!((bs=Oe.data)!=null&&bs.running_jobs.length),Sn=rf(Je),ql=i.jsx(Of,{selectedJobId:k,selectedJob:Ee,loading:It.isLoading,error:It.error,session:(ys=vn.data)==null?void 0:ys.session,sessionEvents:(ws=jn.data)==null?void 0:ws.events,transcript:(vs=ur.data)==null?void 0:vs.entries,now:Sn}),Ul=d==="overview"?et.isLoading:d==="hooks"?We.isLoading:tt.isLoading,$l=d==="overview"?et.error:d==="hooks"?We.error:tt.error,Hl=()=>{De.refetch(),d==="overview"&&v(br()),d==="hooks"&&We.refetch(),d==="deliveries"&&tt.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(Cf,{about:Ve.data})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[i.jsx(Wf,{config:se.data,loading:se.isLoading,onEnable:J,onDisable:re}),i.jsx(Vf,{user:(js=ie.data)==null?void 0:js.user,loading:ie.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(Tf,{isDashboardRoute:O,isSystemRoute:E,isKnowledgeRoute:z,isMcpRoute:A,isWebhooksRoute:G,showWebhooks:!!((Ns=(ks=ie.data)==null?void 0:ks.user)!=null&&Ns.is_admin&&((Ss=V.data)!=null&&Ss.webhook_configured)),knowledgeBadgeCount:((Es=(_s=(Cs=V.data)==null?void 0:Cs.metrics)==null?void 0:_s.knowledge)==null?void 0:Es.proposed)??0,onNavigate:Ge}),i.jsx(Gf,{notification:j,onDismiss:()=>B(null),onNavigate:Ge}),L!==null?i.jsx(Mf,{jobId:L,detail:ql,selectedJob:Ee,user:(Ps=ie.data)==null?void 0:Ps.user,onBackToDashboard:()=>Ge("/"),onRetry:kn,onDismiss:Nn,onCancel:cr,onRefresh:()=>{It.refetch(),vn.refetch(),jn.refetch(),ur.refetch()}}):z?i.jsx(Df,{data:Vt.data,loading:Vt.isLoading,error:Vt.error,repo:o,status:u,user:(Rs=ie.data)==null?void 0:Rs.user,now:Sn,onRepoChange:l,onStatusChange:c,onApprove:F=>dr(F,"approve"),onReject:F=>dr(F,"reject"),onUpdateRuleScope:zr,onDeleteRule:Fr,onRefresh:()=>Vt.refetch()}):A?i.jsx($f,{tokens:(Is=Wt.data)==null?void 0:Is.tokens,loading:Wt.isLoading,error:Wt.error,user:(Ts=ie.data)==null?void 0:Ts.user,ownerOptions:((As=Dr.data)==null?void 0:As.users)??[],dashboardUrl:(Ls=V.data)==null?void 0:Ls.dashboard_url,dashboardUrlSource:(Ms=V.data)==null?void 0:Ms.dashboard_url_source,now:Sn,onCreate:Br,onUpdateOwner:N,onRevoke:I,onRefresh:()=>Wt.refetch()}):G?i.jsx(Af,{summary:De.data,timeseries:(Os=et.data)==null?void 0:Os.points,hooks:(Ds=We.data)==null?void 0:Ds.hooks,deliveries:(Fs=tt.data)==null?void 0:Fs.deliveries,nextDeliveryCursor:(zs=tt.data)==null?void 0:zs.next_cursor,deliveryCursor:m,section:d,summaryLoading:De.isLoading,sectionLoading:Ul,error:De.error??$l,onSectionChange:h,onOlderDeliveries:p,onNewestDeliveries:()=>p(null),onRefresh:Hl}):E?i.jsx(Lf,{processes:Oe.data,processesLoading:Oe.isLoading,processesError:Oe.error,systemd:pe.data,systemdLoading:pe.isLoading,systemdError:pe.error,alerts:(Bs=Ze.data)==null?void 0:Bs.alerts,alertsLoading:Ze.isLoading,alertsError:Ze.error,now:Sn,onRefreshProcesses:()=>Oe.refetch(),onRefreshSystemd:()=>pe.refetch(),onRefreshAlerts:()=>Ze.refetch()}):i.jsxs(i.Fragment,{children:[q.error?i.jsx(Se,{tone:"error",text:q.error.message}):null,V.error?i.jsx(Se,{tone:"error",text:V.error.message}):null,i.jsx(_f,{state:(qs=V.data)==null?void 0:qs.autoupdate,isAdmin:!!(($s=(Us=ie.data)==null?void 0:Us.user)!=null&&$s.is_admin),runningAction:y,actionError:S,onRefresh:()=>$("refresh"),onApply:()=>$("apply"),onCompletePending:()=>$("complete")}),i.jsxs("section",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Summary metrics",children:[i.jsx(Ke,{title:"Pending",value:ke.pending??0,icon:i.jsx(Oo,{className:"h-5 w-5"})}),i.jsx(Ke,{title:"Running",value:ke.running??0,icon:i.jsx($n,{className:"h-5 w-5"})}),i.jsx(Ke,{title:"Blocked",value:ke.blocked??0,icon:i.jsx(qi,{className:"h-5 w-5"})}),i.jsx(Ke,{title:"Done",value:ke.done??0,icon:i.jsx(fn,{className:"h-5 w-5"})})]}),i.jsxs("section",{className:"grid gap-3",children:[i.jsx(Jf,{count:nt.length,limit:r,loading:he.isLoading,onRefresh:()=>he.refetch()}),i.jsxs(we,{title:"Recent jobs",flushHeader:!0,children:[i.jsx(Xf,{filters:t,actorOptions:((Hs=x.data)==null?void 0:Hs.actors)??[],onChange:Tt}),he.error?i.jsx(Se,{tone:"error",text:he.error.message}):null,i.jsx(Zf,{jobs:nt,loading:he.isLoading,loadingMore:he.isFetching&&!he.isLoading,hasMore:nt.length>=r,onLoadMore:_e,onViewJob:Fe,now:Sn,user:(Ks=ie.data)==null?void 0:Ks.user,onRetry:kn,onDismiss:Nn,onCancel:cr})]}),i.jsx(we,{title:"Runtime usage",action:i.jsx(ft,{onClick:()=>q.refetch()}),children:i.jsx(px,{usage:(Qs=q.data)==null?void 0:Qs.metrics.runtime_usage,loading:q.isLoading,totalJobs:so(ke)})})]}),i.jsxs("section",{className:"grid gap-4 xl:grid-cols-3",children:[i.jsx(we,{title:"Runtime percentiles",children:i.jsx(io,{label:"runtime",values:(Vs=q.data)==null?void 0:Vs.metrics.runtime_seconds})}),i.jsx(we,{title:"Jobs per day",children:i.jsx(hx,{values:(Ws=q.data)==null?void 0:Ws.metrics.by_created_day,loading:q.isLoading,totalJobs:so(ke)})}),i.jsx(we,{title:"Queue wait percentiles",children:i.jsx(io,{label:"queue wait",values:(Gs=q.data)==null?void 0:Gs.metrics.queue_wait_seconds})})]})]})]})]})}function Cf({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:ct(e.repository_url),rel:"noreferrer",target:"_blank",children:[i.jsx(pn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"GitHub"]}):null]})}function _f({state:e,isAdmin:t,runningAction:n=null,actionError:r="",onRefresh:s,onApply:a,onCompletePending:o}){var y,b,S,_,C,D,j,B,L,P,z;if(!e)return null;const l=(b=(y=e==null?void 0:e.target)==null?void 0:y.tag_name)==null?void 0:b.trim();if(!t||!l||(e==null?void 0:e.decision)==="noop")return null;const u=Ef(e.decision),c=((S=e.queue)==null?void 0:S.active_total)??0,d=Pf((_=e.classification)==null?void 0:_.risk),h=Rf((C=e.target)==null?void 0:C.body),m=((j=(D=e.classification)==null?void 0:D.migration_files)==null?void 0:j.length)??0,p=((L=(B=e.classification)==null?void 0:B.risky_files)==null?void 0:L.length)??0,w=!!(e.executor_reload_pending&&e.dashboard_applied_at&&o),v=!!(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(qi,{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:ct(e.target.url),rel:"noreferrer",target:"_blank",children:[i.jsx(pn,{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(Ar,{className:Q("h-3.5 w-3.5",n==="refresh"&&"animate-spin"),"aria-hidden":!0}),n==="refresh"?"Checking...":"Check now"]}):null,v?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(fn,{className:"h-3.5 w-3.5","aria-hidden":!0}),n==="apply"?"Applying...":"Apply update"]}):null,w?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(Kn,{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(ii,{label:"Impact",value:d}),i.jsx(ii,{label:"Active jobs",value:String(c)}),i.jsx(ii,{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(If,{markdown:h})]}):null,(z=e.warnings)!=null&&z.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 ii({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 Ef(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 Pf(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 Rf(e){return(e??"").trim()}function If({markdown:e}){return i.jsx("div",{className:"mt-1 text-sm leading-relaxed text-amber-950",children:i.jsx(pm,{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:ct(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 Tf({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(An,{href:"/",active:e,onNavigate:l,children:[i.jsx(zo,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"Jobs"})]}),i.jsxs(An,{href:"/system",active:t,onNavigate:l,children:[i.jsx(Ku,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"System"})]}),a?i.jsxs(An,{href:"/webhooks",active:s,onNavigate:l,children:[i.jsx($n,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"Webhooks"})]}):null,i.jsxs(An,{href:"/knowledge",active:n,onNavigate:l,children:[i.jsx(Bi,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"Knowledge"}),o>0?i.jsx("span",{className:Q("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(An,{href:"/mcp",active:r,onNavigate:l,children:[i.jsx(Cr,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"MCP"})]})]})}function yr({text:e}){return i.jsxs("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted",children:[i.jsx(Ar,{className:"h-4 w-4 animate-spin","aria-hidden":!0}),e]})}function Af({summary:e,timeseries:t,hooks:n,deliveries:r,nextDeliveryCursor:s,deliveryCursor:a,section:o,summaryLoading:l,sectionLoading:u,error:c,onSectionChange:d,onOlderDeliveries:h,onNewestDeliveries:m,onRefresh:p}){const w=Object.values((e==null?void 0:e.receipts)??{}).reduce((y,b)=>y+b,0),v=[{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(Il,{icon:i.jsx($n,{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(ft,{onClick:p})}),c?i.jsx(Se,{tone:"error",text:c.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:v.map(y=>i.jsxs("button",{type:"button",role:"tab","aria-selected":o===y.id,className:Q("inline-flex h-8 items-center gap-2 rounded px-3 text-sm font-semibold",o===y.id?"bg-primary text-white":"text-muted hover:bg-slate-50 hover:text-foreground"),onClick:()=>d(y.id),children:[y.label,y.count!==void 0?i.jsx("span",{className:"rounded border border-current/30 px-1 font-mono text-[10px]",children:y.count}):null]},y.id))}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Webhook status",children:[i.jsx(Ke,{title:"Receipts",value:w,icon:i.jsx($n,{className:"h-5 w-5"})}),i.jsx(Ke,{title:"Duplicates",value:(e==null?void 0:e.duplicate_deliveries)??0,icon:i.jsx(Ar,{className:"h-5 w-5"})}),i.jsx(Ke,{title:"Cross-source matches",value:(e==null?void 0:e.cross_source_matches)??0,icon:i.jsx(sr,{className:"h-5 w-5"})}),i.jsx(Ke,{title:"Mode",value:l?"…":(e==null?void 0:e.mode)??"unknown",icon:i.jsx(Do,{className:"h-5 w-5"})})]}),o==="overview"?i.jsxs(i.Fragment,{children:[i.jsx(we,{title:"Delivery activity",children:u?i.jsx(yr,{text:"Loading delivery activity…"}):t!=null&&t.length?i.jsx("div",{className:"h-72","aria-label":"Webhook deliveries over time",children:i.jsx(Zn,{width:"100%",height:"100%",children:i.jsxs(Tr,{data:t,children:[i.jsx(er,{strokeDasharray:"3 3"}),i.jsx(tr,{dataKey:"bucket"}),i.jsx(nr,{allowDecimals:!1}),i.jsx(rr,{}),i.jsx(wo,{}),i.jsx($t,{dataKey:"observed",stackId:"deliveries",fill:"#2563eb"}),i.jsx($t,{dataKey:"duplicate",stackId:"deliveries",fill:"#f59e0b"}),i.jsx($t,{dataKey:"unsupported",stackId:"deliveries",fill:"#94a3b8"})]})})}):i.jsx(ee,{text:"No webhook activity in the selected 30-day window."})}),i.jsx(we,{title:"Receipt states",children:l?i.jsx(yr,{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(([y],[b])=>y.localeCompare(b)).map(([y,b])=>i.jsx(fe,{label:y,value:b},y))}):i.jsx(ee,{text:"No webhook deliveries observed yet."})})]}):null,o==="hooks"?i.jsx(we,{title:"Hook inventory",children:u?i.jsx(yr,{text:"Loading hook inventory…"}):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:"Target"}),i.jsx("th",{className:"px-3 py-2",children:"State"}),i.jsx("th",{className:"px-3 py-2",children:"Events"}),i.jsx("th",{className:"px-3 py-2",children:"Last ping"}),i.jsx("th",{className:"px-3 py-2",children:"Last delivery"})]})}),i.jsx("tbody",{children:n.map(y=>i.jsxs("tr",{className:"border-b border-border/70 last:border-0",children:[i.jsxs("td",{className:"px-3 py-3",children:[i.jsx("div",{className:"font-semibold",children:y.target}),i.jsxs("div",{className:"font-mono text-xs text-muted",children:[y.target_type," · #",y.id]})]}),i.jsx("td",{className:"px-3 py-3",children:i.jsx("span",{className:Q("rounded border px-2 py-1 text-xs font-semibold",y.status==="receiving"?"border-emerald-200 bg-emerald-50 text-emerald-700":y.status==="inactive"?"border-red-200 bg-red-50 text-red-700":"border-slate-200 bg-slate-50 text-slate-600"),children:y.status})}),i.jsx("td",{className:"max-w-xs px-3 py-3 text-xs text-muted",children:y.events.join(", ")||"All events"}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs text-muted",children:y.last_ping_at??"Never"}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs text-muted",children:y.last_event_at??"Never"})]},y.id))})]})}):i.jsx(ee,{text:"No hook inventory is available. A signed ping is required before a hook can appear here."})}):null,o==="deliveries"?i.jsx(we,{title:"Recent deliveries",children:u?i.jsx(yr,{text:"Loading deliveries…"}):r!=null&&r.length?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full min-w-[760px] 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:"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:r.map(y=>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:y.created_at}),i.jsxs("td",{className:"px-3 py-3 font-semibold",children:[y.event_name,y.action?` · ${y.action}`:""]}),i.jsx("td",{className:"px-3 py-3",children:y.repository??"—"}),i.jsx("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:y.status})}),i.jsx("td",{className:"max-w-[14rem] truncate px-3 py-3 font-mono text-xs text-muted",title:y.delivery_id,children:y.delivery_id})]},y.delivery_id))})]})}),i.jsxs("div",{className:"flex justify-end gap-2 border-t border-border px-3 py-3",children:[a?i.jsx("button",{type:"button",className:"rounded border border-border px-3 py-1.5 text-sm font-semibold hover:bg-slate-50",onClick:m,children:"Newest"}):null,s?i.jsx("button",{type:"button",className:"rounded border border-border px-3 py-1.5 text-sm font-semibold hover:bg-slate-50",onClick:()=>h(s),children:"Older deliveries"}):null]})]}):i.jsx(ee,{text:"No delivery details are available for this window."})}):null]})}function Lf({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(we,{title:"Systemd",action:i.jsx(ft,{onClick:h}),children:[a?i.jsx(Se,{tone:"error",text:a.message}):null,i.jsx(fx,{data:r,loading:s})]}),i.jsxs(we,{title:"Process activity",action:i.jsx(ft,{onClick:d}),children:[n?i.jsx(Se,{tone:"error",text:n.message}):null,i.jsx(bx,{data:e,loading:t})]}),i.jsxs(we,{title:"Monitor alerts",action:i.jsx(ft,{onClick:m}),children:[u?i.jsx(Se,{tone:"error",text:u.message}):null,i.jsx(yx,{alerts:o,loading:l,now:c})]})]})}function An({href:e,active:t,children:n,onNavigate:r}){return i.jsx("a",{className:Q("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 Mf({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,w]=T.useState(!1),v=!!(r!=null&&r.is_admin&&n&&Mn(n.status)),y=!!(n&&Ai(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:C=>{C.defaultPrevented||C.button!==0||C.metaKey||C.ctrlKey||C.altKey||C.shiftKey||(C.preventDefault(),s())},children:[i.jsx($u,{className:"h-4 w-4","aria-hidden":!0}),"Dashboard"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[v?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(Kn,{className:"h-4 w-4","aria-hidden":!0}),b]}):null,v?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(fn,{className:"h-4 w-4","aria-hidden":!0}),S]}):null,y?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){w(!0);try{await l(e,C)}finally{w(!1)}}},children:[i.jsx(Kt,{className:"h-4 w-4","aria-hidden":!0}),_]}):null,i.jsx(ft,{onClick:u})]})]}),i.jsx(we,{title:`Job #${e}`,className:"p-3 sm:p-4",children:t})]})}function Of({selectedJobId:e,selectedJob:t,loading:n,error:r,session:s,sessionEvents:a,transcript:o,now:l}){return t?i.jsx(lx,{job:t,session:s,sessionEvents:a,transcript:o,now:l}):e!==null&&n?i.jsx(ee,{text:"Loading selected job..."}):e!==null&&r?i.jsx(Se,{tone:"error",text:`Job #${e}: ${r.message}`}):i.jsx(ee,{text:"Select a job to inspect its timeline, worklog and GitHub links."})}function Df({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 w=(e==null?void 0:e.summary)??{},[v,y]=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(Bi,{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(ft,{onClick:p})]}),n?i.jsx(Se,{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(Ke,{title:"Proposed",value:w.proposed??0,icon:i.jsx(Oo,{className:"h-5 w-5"})}),i.jsx(Ke,{title:"Approved",value:w.approved??0,icon:i.jsx(fn,{className:"h-5 w-5"})}),i.jsx(Ke,{title:"Rules",value:w.rules??0,icon:i.jsx(Fo,{className:"h-5 w-5"})}),i.jsx(Ke,{title:"Events",value:w.events??0,icon:i.jsx($n,{className:"h-5 w-5"})})]}),i.jsx(we,{title:"Filters",className:"p-3",children:i.jsxs("div",{className:Q("grid gap-3",v==="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))]})}),v==="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(we,{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:Q("inline-flex h-8 items-center gap-1.5 rounded px-2.5 text-xs font-semibold",v===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":v===S.id,onClick:()=>y(S.id),children:[i.jsx("span",{children:S.label}),i.jsx("span",{className:Q("rounded-sm border px-1 font-mono text-[10px]",v===S.id?"border-white/40 text-white":"border-border text-muted"),children:S.count})]},S.id))}),children:[v==="proposals"?i.jsx(Ff,{proposals:(e==null?void 0:e.proposals)??[],loading:t,isAdmin:!!(a!=null&&a.is_admin),now:o,onApprove:c,onReject:d}):null,v==="rules"?i.jsx(qf,{rules:(e==null?void 0:e.rules)??[],loading:t,now:o,onUpdateRuleScope:h,onDeleteRule:m}):null,v==="events"?i.jsx(Uf,{events:(e==null?void 0:e.events)??[],loading:t,now:o}):null]})]})}function Ff({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(ee,{text:"Loading proposals..."}):e.length===0?i.jsx(ee,{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(Al,{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(zf,{event:u.source_event}):i.jsxs("p",{className:"font-mono text-xs text-muted",children:["Source event ",u.event_id]}),u.error?i.jsx(Se,{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(fn,{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(Kt,{className:"h-4 w-4","aria-hidden":!0}),"Reject"]})]}):null]},u.id))})}function zf({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(wn,{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:yn(e.source_job_id),children:[i.jsx(sr,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",e.source_job_id]}):null,e.github_urls.length>0?i.jsx(Vn,{urls:e.github_urls,compact:!0}):i.jsx("span",{className:"font-mono text-xs text-muted",children:"No GitHub link"})]})}function Bf(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 qf({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(ee,{text:"Loading curated rules..."}):e.length===0?i.jsx(ee,{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],w=p?p.trigger_actor||(p.actor!=="github"?p.actor:null):null,v=m.flatMap(C=>C.github_urls??[]),y=Bf(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(Al,{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:C=>d(C.target.value),children:y.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: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(Vu,{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(Kt,{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(Qu,{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(wi,{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(wn,{actor:w,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:yn(p.source_job_id),children:[i.jsx(sr,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",p.source_job_id]}):null,v.length>0?i.jsx(Vn,{urls:v,compact:!0}):i.jsx("span",{className:"font-mono text-xs text-muted",children:"No GitHub link"})]})]},h.id)})})}function Uf({events:e,loading:t,now:n}){return t&&e.length===0?i.jsx(ee,{text:"Loading captured events..."}):e.length===0?i.jsx(ee,{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(mn,{className:"h-3.5 w-3.5 shrink-0 transition-transform group-open:rotate-180","aria-hidden":!0}),i.jsx("span",{className:"truncate",children:Rl(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(wn,{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:yn(r.source_job_id),children:[i.jsx(sr,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",r.source_job_id]}):null,r.github_urls.length>0?i.jsx(Vn,{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(Vn,{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 $f({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(""),[w,v]=T.useState(""),[y,b]=T.useState(!1),[S,_]=T.useState(null),[C,D]=T.useState(null),[j,B]=T.useState(null),[L,P]=T.useState(""),z=e??[],A=s.find(k=>k.login===w);T.useEffect(()=>{var k;r!=null&&r.is_admin&&(w&&s.some(q=>q.login===w)||v((r==null?void 0:r.login)||((k=s[0])==null?void 0:k.login)||""))},[s,r==null?void 0:r.is_admin,r==null?void 0:r.login,w]);const E=(a||(typeof window>"u"?"":window.location.origin)).replace(/\/$/,""),G=`${E}/mcp`,O=`${E}/api/mcp`;return i.jsxs("div",{className:"grid min-w-0 gap-4",children:[i.jsx(Il,{icon:i.jsx(Cr,{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(ft,{onClick:h})}),n?i.jsx(Se,{tone:"error",text:n.message}):null,L?i.jsx(Se,{tone:"error",text:L}):null,i.jsx(Hf,{dashboardUrl:G,endpointUrl:O,dashboardUrlSource:o??"request"}),j?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(Kt,{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:j.token})]}):null,i.jsx(we,{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 k=>{k.preventDefault();const q=m.trim();if(q){b(!0),P("");try{const V=await u(q,r!=null&&r.is_admin?w:void 0);B(V),p("")}catch(V){P(V instanceof Error?V.message:String(V))}finally{b(!1)}}},children:[i.jsx(Ye,{label:"Token name",children:i.jsx("input",{className:"control",value:m,placeholder:"local agent",disabled:y,onChange:k=>p(k.target.value)})}),r!=null&&r.is_admin?i.jsxs(Ye,{label:"Owner",children:[i.jsx(Tl,{ariaLabel:"Owner",value:w,ownerOptions:s,disabled:y||s.length===0,selectedSuffix:k=>k.login===(r==null?void 0:r.login)?" (you)":"",emptyLabel:"No known users",onChange:v}),A?i.jsxs("span",{className:"font-normal text-muted",children:["Token will be linked to @",A.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:y||!m.trim()||!!(r!=null&&r.is_admin&&!w),children:[i.jsx(Cr,{className:"h-4 w-4","aria-hidden":!0}),y?"Creating...":"Create token"]})]})}),i.jsx(we,{title:"Active tokens",children:i.jsx(Kf,{tokens:z,loading:t,now:l,ownerOptions:s,canManageOwners:!!(r!=null&&r.is_admin),revokingId:S,updatingOwnerId:C,onUpdateOwner:async(k,q)=>{D(k),P("");try{await c(k,q)}catch(V){P(V instanceof Error?V.message:String(V))}finally{D(null)}},onRevoke:async k=>{if(window.confirm("Revoke this MCP token?")){_(k),P("");try{await d(k)}catch(q){P(q instanceof Error?q.message:String(q))}finally{_(null)}}}})})]})}function Hf({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(we,{title:"Connect an agent",children:[s?i.jsx(Se,{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(pn,{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(pn,{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(Cr,{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(Bi,{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 Il({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 Kf({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(ee,{text:"Loading MCP tokens..."}):e.length===0?i.jsx(ee,{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(no,{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(fe,{label:"Created",value:i.jsx(Re,{value:c.created_at,relative:!0,now:n})}),i.jsx(fe,{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(wi,{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(no,{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(wi,{className:"h-4 w-4","aria-hidden":!0}),a===c.id?"Revoking...":"Revoke"]})})]},c.id))})]})})]})}function no({token:e,ownerOptions:t,disabled:n,onUpdateOwner:r}){const s=e.user_login??"";return i.jsx(Tl,{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 Tl({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:Q("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:Q("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:ct(u.avatar_url),alt:"",referrerPolicy:"no-referrer"}):i.jsx(Hn,{className:Q("text-muted",l==="compact"?"h-4 w-4":"h-5 w-5"),"aria-hidden":!0})}),i.jsx("span",{className:Q("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(mn,{className:Q("pointer-events-none shrink-0 text-muted",l==="compact"?"h-3.5 w-3.5":"h-4 w-4"),"aria-hidden":!0})]})}function Vn({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:Q("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:ct(s),"aria-label":s,rel:"noreferrer",target:"_blank",children:[i.jsx(pn,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),i.jsx("span",{className:"truncate",children:t?Qf(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 Qf(e){try{const t=new URL(e);return t.pathname.replace(/^\//,"")+t.hash}catch{return e}}function Al({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:Rl(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 Vf({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(Hn,{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:ct(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(Fo,{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 Wf({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"&&Nr(),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:Q("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(Mo,{className:Q("h-4 w-4",s&&"animate-live-pulse"),"aria-hidden":!0})})})}function Gf({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?yn(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(Mo,{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(Kt,{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(ct(a),"_blank","noopener,noreferrer")},children:[i.jsx(pn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Open"]})]})]})})}function Jf({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(ft,{onClick:r,compactOnMobile:!0})]})}function we({title:e,action:t,children:n,className:r,flushHeader:s=!1}){return i.jsxs("section",{className:Q("min-w-0 rounded-lg border border-border bg-panel p-4 shadow-sm",r),children:[i.jsxs("div",{className:Q("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 Ke({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 Xf({filters:e,actorOptions:t,onChange:n}){const[r,s]=T.useState(e);T.useEffect(()=>s(e),[e]);const a=Nf(e),o=to(e)||to(r),l=()=>{s(Ti),n(Ti)};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(Hu,{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(Kn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Clear filters"]}):null,i.jsx(mn,{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(Yf,{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(Kn,{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(Wu,{className:"h-4 w-4","aria-hidden":!0}),"Apply"]})]})]})]})}function Yf({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:ct(l.avatar_url??""),alt:`${l.login} avatar`,referrerPolicy:"no-referrer"}):i.jsx(Hn,{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(Kt,{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:ct(u.avatar_url),alt:`${u.login} avatar`,referrerPolicy:"no-referrer"}):i.jsx(Hn,{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:Q("grid min-w-0 gap-1 text-xs font-semibold text-muted",n),children:[e,t]})}function Zf({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,w]=T.useState(null),[v,y]=T.useState(null),b=T.useRef(!1),S=T.useRef(n),_=!!(l!=null&&l.is_admin&&u),C=!!(l!=null&&l.is_admin&&c);T.useEffect(()=>{S.current&&!n&&(b.current=!1),S.current=n},[n]);const D=T.useCallback(()=>{b.current||(b.current=!0,s==null||s())},[s]),j=T.useCallback(async P=>{if(u){m(P);try{await u(P)}finally{m(null)}}},[u]),B=T.useCallback(async P=>{if(c){w(P);try{await c(P)}finally{w(null)}}},[c]),L=T.useCallback(async(P,z)=>{if(d){y(P);try{await d(P,z)}finally{y(null)}}},[d]);return t&&e.length===0?i.jsx(ee,{text:"Loading jobs..."}):e.length===0?i.jsx(ee,{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(rx,{job:P,onViewJob:a,now:o,canRetry:_&&Mn(P.status),retrying:h===P.id,onRetry:j,canDismiss:C&&Mn(P.status),dismissing:p===P.id,onDismiss:B,canCancel:!!(d&&Ai(P,l)),cancelling:v===P.id,onCancel:L},P.id)),i.jsx(tx,{hasMore:r,loading:n,onLoadMore:D})]}),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(ex,{job:P,now:o,onViewJob:a,canRetry:_&&Mn(P.status),retrying:h===P.id,onRetry:j,canDismiss:C&&Mn(P.status),dismissing:p===P.id,onDismiss:B,canCancel:!!(d&&Ai(P,l)),cancelling:v===P.id,onCancel:L},P.id))})]}),i.jsx(nx,{hasMore:r,loading:n,onLoadMore:D})]})]})}function ex({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(as,{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(ss,{intent:e.intent,actionMode:e.action_mode,display:"intent",compact:!0})})]}),i.jsx("td",{className:"px-3 py-3",children:i.jsx(wn,{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(is(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(rs(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(Ll,{jobId:e.id,canRetry:r,retrying:s,onRetry:a,compact:!0}),i.jsx(Ml,{jobId:e.id,canDismiss:o,dismissing:l,onDismiss:u,compact:!0}),i.jsx(Ol,{jobId:e.id,canCancel:c,cancelling:d,onCancel:h,compact:!0})]})})]})}function tx({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(mn,{className:"h-4 w-4","aria-hidden":!0}),t?"Loading more jobs...":"Load more jobs"]})}function nx({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 rx({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(ss,{intent:e.intent,actionMode:e.action_mode,compact:!0,display:"intent"}),i.jsx(wn,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url})]})]}),i.jsx(as,{status:e.status})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[i.jsx(fe,{label:"Wait",value:Qe(is(e,n))}),i.jsx(fe,{label:"Runtime",value:Qe(rs(e,n))}),i.jsx(fe,{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(Ll,{jobId:e.id,canRetry:r,retrying:s,onRetry:a}),i.jsx(Ml,{jobId:e.id,canDismiss:o,dismissing:l,onDismiss:u}),i.jsx(Ol,{jobId:e.id,canCancel:c,cancelling:d,onCancel:h})]}):null]})}function Ll({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:Q("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(Kn,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:Q(s&&"sr-only"),children:a})]})}function Ml({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:Q("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(fn,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:Q(s&&"sr-only"),children:a})]})}function Ol({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:Q("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(Kt,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:Q(s&&"sr-only"),children:a})]})}function wn({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:ct(t),alt:e?`${e} avatar`:"",referrerPolicy:"no-referrer"}):i.jsx(Hn,{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 ix(e){return(e==null?void 0:e.model)??"OpenClaw default"}function sx(e){return(e==null?void 0:e.thinking)??"OpenClaw default"}function ax(e){return e?e.configured?"configured":e.summary:"n/a"}function ox(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 ss({intent:e,actionMode:t,compact:n=!1,display:r="mode"}){const s=ox(e,t),a=s.intentLabel==="work_allowed"?Ju:Do,o=r==="intent"?s.intentLabel:s.mode;return i.jsxs("span",{className:Q("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:Q("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 lx({job:e,session:t,sessionEvents:n,transcript:r,now:s,compact:a=!1}){var p;const o=yn(e.id),l=n??[],u=r??[],c=af(l),d=of(u),h=rs(e,s),m=is(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(as,{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(sr,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",e.id]}),i.jsx(wn,{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(Vn,{urls:e.github_urls,compact:!0}):i.jsx("p",{className:"text-xs text-muted",children:"No links recorded."})]})]})]}),i.jsxs("div",{className:Q("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-3"),children:[i.jsx(fe,{label:"Queue wait",value:Qe(m)}),i.jsx(fe,{label:e.status==="running"?"Running for":"Runtime",value:Qe(h)}),i.jsx(fe,{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:Q("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-3"),children:[i.jsx(fe,{label:"Model",value:ix(e.model_route)}),i.jsx(fe,{label:"Reasoning",value:sx(e.model_route)}),i.jsx(fe,{label:"Route",value:ax(e.model_route)})]}),i.jsx(ux,{job:e,compact:a}),i.jsxs("div",{className:Q("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-2 xl:grid-cols-4"),children:[i.jsx(fe,{label:"Created",value:i.jsx(Re,{value:e.created_at,compact:!0,relative:!0,now:s})}),i.jsx(fe,{label:"Started",value:e.started_at?i.jsx(Re,{value:e.started_at,compact:!0,relative:!0,now:s}):"n/a"}),i.jsx(fe,{label:"Updated",value:i.jsx(Re,{value:e.updated_at,compact:!0,relative:!0,now:s})}),i.jsx(fe,{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(w=>i.jsxs("div",{className:"min-w-0 border-l-2 border-primary pl-3",children:[i.jsx("div",{className:"text-sm font-semibold",children:w.phase}),i.jsx("div",{className:"font-mono text-xs text-muted",children:i.jsx(Re,{value:w.ts,relative:!0,now:s})}),i.jsx("div",{className:"break-words text-sm [overflow-wrap:anywhere]",children:w.summary}),w.detail?i.jsx("div",{className:"mt-1 break-words font-mono text-xs text-muted [overflow-wrap:anywhere]",children:w.detail}):null]},w.id)):i.jsx(ee,{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(zo,{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(fe,{label:"Session ID",value:t.id}),i.jsx(fe,{label:"Source",value:t.source})]}),i.jsx("p",{className:"break-words text-xs text-muted [overflow-wrap:anywhere]",children:t.detail})]}):i.jsx(ee,{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((w,v)=>i.jsx(dx,{event:w,defaultOpen:Za(w.eventType,e.status==="running",v,c.length),now:s},w.id)):i.jsx(ee,{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((w,v)=>i.jsx(cx,{entry:w,defaultOpen:Za(w.kind,e.status==="running",v,d.length),now:s},w.id)):i.jsx(ee,{text:e.status==="running"?"Waiting for live transcript entries...":"No OpenClaw transcript entries are available for this session."})})]})]})}function ux({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:Q("grid gap-2 text-sm sm:gap-3",t?"grid-cols-1":"grid-cols-2 xl:grid-cols-4"),children:[i.jsx(fe,{label:"Mode",value:i.jsx(ss,{intent:e.intent,actionMode:e.action_mode})}),i.jsx(fe,{label:"Intent",value:e.intent}),i.jsx(fe,{label:"Addressed",value:n?ro(r.addressed_to_agent):"n/a"}),i.jsx(fe,{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:ro(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 ro(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:Q("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 cx({entry:e,defaultOpen:t,now:n}){return i.jsx(Dl,{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 dx({event:e,defaultOpen:t,now:n}){return i.jsx(Dl,{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 Dl({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(mn,{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 io({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(Zn,{width:"100%",height:"100%",children:i.jsxs(Tr,{data:n,children:[i.jsx(er,{strokeDasharray:"3 3"}),i.jsx(tr,{dataKey:"name"}),i.jsx(nr,{tickFormatter:Qe}),i.jsx(rr,{formatter:r=>[Qe(Number(r)),e]}),i.jsx($t,{dataKey:"seconds",fill:"#0969da",radius:[4,4,0,0]})]})})})}function hx({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(ee,{text:"Loading job history..."}):r.length===0?i.jsx(ee,{text:n>0?"Job history has no valid creation dates.":"No job history available."}):i.jsx("div",{className:"h-56",children:i.jsx(Zn,{width:"100%",height:"100%",children:i.jsxs(Tr,{data:r,children:[i.jsx(er,{strokeDasharray:"3 3"}),i.jsx(tr,{dataKey:"day",minTickGap:16}),i.jsx(nr,{allowDecimals:!1}),i.jsx(rr,{formatter:s=>[Number(s),"jobs"]}),i.jsx($t,{dataKey:"count",fill:"#16a34a",radius:[4,4,0,0]})]})})})}function px({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:mx(u.bucket,r)})),l=a.reduce((u,c)=>u+c.seconds,0);return t&&o.length===0?i.jsx(ee,{text:"Loading runtime usage..."}):o.length===0?i.jsx(ee,{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(Gu,{className:"h-4 w-4","aria-hidden":!0}),i.jsxs("span",{children:[wr(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:Q("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(Zn,{width:"100%",height:"100%",children:i.jsxs(Tr,{data:o,children:[i.jsx(er,{strokeDasharray:"3 3"}),i.jsx(tr,{dataKey:"label",minTickGap:16,tick:{fontSize:11}}),i.jsx(nr,{tickFormatter:u=>wr(Number(u))}),i.jsx(wo,{}),i.jsx(rr,{formatter:(u,c)=>c==="Work"?[wr(Number(u)),"work"]:c==="Review"?[wr(Number(u)),"review"]:[Number(u),String(c)],labelFormatter:u=>String(u)}),i.jsx($t,{dataKey:"work_seconds",name:"Work",stackId:"runtime",fill:"#0969da",isAnimationActive:!1}),i.jsx($t,{dataKey:"review_seconds",name:"Review",stackId:"runtime",fill:"#8250df",radius:[4,4,0,0],isAnimationActive:!1})]})})})]})}function mx(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 wr(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 so(e){return Object.values(e).reduce((t,n)=>t+n,0)}function fx({data:e,loading:t}){if(t&&!e)return i.jsx(ee,{text:"Loading systemd units..."});if(!e)return i.jsx(ee,{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(Se,{tone:"error",text:e.errors[0]}):null,n.length===0?i.jsx(ee,{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(vr,{label:"Units",value:String(n.length)}),i.jsx(vr,{label:"Active",value:String(r)}),i.jsx(vr,{label:"Failed",value:String(s),tone:s>0?"bad":"neutral"}),i.jsx(vr,{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(xx,{unit:o},o.unit))})]})]})]})}function vr({label:e,value:t,tone:n="neutral"}){return i.jsxs("div",{className:Q("min-w-0 rounded-md border bg-white px-3 py-2",n==="bad"?"border-red-200":"border-border"),children:[i.jsx("div",{className:Q("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 xx({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(mn,{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:Q("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(ao,{label:"State",value:e.sub_state,detail:e.result||"unknown"}),i.jsx(ao,{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(gx,{unit:e.unit,active:t})})]})}function ao({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 gx({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=Ir(u);c&&r(d=>[...d.slice(-199),c])}),l.addEventListener("journal_error",u=>{const c=Ir(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(Se,{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 bx({data:e,loading:t}){var h,m,p,w,v,y;if(t&&!e)return i.jsx(ee,{text:"Loading process activity..."});if(!e)return i.jsx(ee,{text:"No process snapshot available."});const n=e.executor.children??[],r=n.flatMap(b=>zl(b)),s=r.reduce((b,S)=>b+S.cpu_ticks,0),a=r.reduce((b,S)=>b+wx(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:zn(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:Q("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 ",zn(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(si,{label:"PID",value:e.executor.pid?String(e.executor.pid):"n/a"}),i.jsx(si,{label:"Children",value:String(r.length)}),i.jsx(si,{label:"CPU ticks",value:String(s)})]})]})}),i.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[i.jsx(jr,{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(jr,{label:"Process activity",value:((w=e.signals)==null?void 0:w.process_activity.state)??(d!=null&&d.active_since_last_sample?"active":"quiet"),detail:d?`sample ${zn(d.ts)}`:"no sample"}),i.jsx(jr,{label:"Semantic progress",value:(v=e.signals)!=null&&v.semantic_progress.length?"recent":"none",detail:oo(e.running_jobs,"semantic_progress")}),i.jsx(jr,{label:"Visible progress",value:(y=e.signals)!=null&&y.visible_progress.length?"streaming":"none",detail:oo(e.running_jobs,"visible_progress")})]}),e.alerts.length>0?i.jsx(Se,{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(da,{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:[Bl(a)," I/O"]})]}),c.length>0?i.jsx("div",{className:"h-40",children:i.jsx(Zn,{width:"100%",height:"100%",children:i.jsxs(Gl,{data:c,children:[i.jsx(er,{strokeDasharray:"3 3"}),i.jsx(tr,{dataKey:"label",tick:!1}),i.jsx(nr,{allowDecimals:!1,tick:{fontSize:11}}),i.jsx(rr,{formatter:b=>[Number(b),"cpu ticks"]}),i.jsx(Jl,{type:"monotone",dataKey:"ticks",stroke:"#0f766e",strokeWidth:2,dot:{r:3},activeDot:{r:5},isAnimationActive:!1})]})})}):i.jsx(ee,{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(da,{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(Fl,{process:b},b.pid))}):i.jsx(ee,{text:"No child process detected for the executor."})]})]})]})}function yx({alerts:e,loading:t,now:n}){if(t&&!e)return i.jsx(ee,{text:"Loading monitor alerts..."});const r=e??[];return r.length===0?i.jsx(ee,{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(qi,{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:_l(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 Fl({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 ",Bl(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(Fl,{process:a},a.pid))}):null]})}function si({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 jr({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 oo(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 zl(e){return[e,...(e.children??[]).flatMap(t=>zl(t))]}function wx(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 Bl(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function fe({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 as({status:e}){const t=lf(e),n=e==="running"||e==="pending";return i.jsxs("span",{className:Q("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:Q("h-2.5 w-2.5 rounded-full",t.dot,n&&"animate-live-pulse"),"aria-hidden":!0}),e]})}function ee({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 Se({tone:e,text:t}){return i.jsx("div",{className:Q("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 ft({onClick:e,compactOnMobile:t=!1}){return i.jsxs("button",{className:Q("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(Ar,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:Q(t&&"hidden sm:inline"),children:"Refresh"})]})}const lo=document.getElementById("root");lo&&tu.createRoot(lo).render(i.jsx(T.StrictMode,{children:i.jsx(Eu,{client:Jm,children:i.jsx(Sf,{})})})); diff --git a/src/github_agent_bridge/dashboard_static/assets/index-lIzCm8Xd.js b/src/github_agent_bridge/dashboard_static/assets/index-lIzCm8Xd.js deleted file mode 100644 index 05ebcd0..0000000 --- a/src/github_agent_bridge/dashboard_static/assets/index-lIzCm8Xd.js +++ /dev/null @@ -1,187 +0,0 @@ -var Ls=e=>{throw TypeError(e)};var Dr=(e,t,n)=>t.has(e)||Ls("Cannot "+n);var g=(e,t,n)=>(Dr(e,t,"read from private field"),n?n.call(e):t.get(e)),U=(e,t,n)=>t.has(e)?Ls("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),M=(e,t,n,r)=>(Dr(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),X=(e,t,n)=>(Dr(e,t,"access private method"),n);var ur=(e,t,n,r)=>({set _(s){M(e,t,s,n)},get _(){return g(e,t,r)}});import{f as So,h as Co,g as Ri,r as ve,R as A,d as Wn,a as _r,C as Jn,X as Xn,Y as Yn,T as Zn,L as nl,B as $t,e as _o,c as Eo,b as Po}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 l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).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 Fr={exports:{}},jn={};/** - * @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 Ms;function Ro(){if(Ms)return jn;Ms=1;var e=So(),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 l(o,u,c){var d,p={},m=null,h=null;c!==void 0&&(m=""+c),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(h=u.ref);for(d in u)r.call(u,d)&&!a.hasOwnProperty(d)&&(p[d]=u[d]);if(o&&o.defaultProps)for(d in u=o.defaultProps,u)p[d]===void 0&&(p[d]=u[d]);return{$$typeof:t,type:o,key:m,ref:h,props:p,_owner:s.current}}return jn.Fragment=n,jn.jsx=l,jn.jsxs=l,jn}var Os;function Io(){return Os||(Os=1,Fr.exports=Ro()),Fr.exports}var i=Io(),cr={},Ds;function To(){if(Ds)return cr;Ds=1;var e=Co();return cr.createRoot=e.createRoot,cr.hydrateRoot=e.hydrateRoot,cr}var Ao=To();const Lo=Ri(Ao);var er=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(){}},Lt,jt,Zt,Qa,Mo=(Qa=class extends er{constructor(){super();U(this,Lt);U(this,jt);U(this,Zt);M(this,Zt,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){g(this,jt)||this.setEventListener(g(this,Zt))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,jt))==null||t.call(this),M(this,jt,void 0))}setEventListener(t){var n;M(this,Zt,t),(n=g(this,jt))==null||n.call(this),M(this,jt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){g(this,Lt)!==t&&(M(this,Lt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof g(this,Lt)=="boolean"?g(this,Lt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Lt=new WeakMap,jt=new WeakMap,Zt=new WeakMap,Qa),Ii=new Mo,Oo={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},kt,Pi,Va,Do=(Va=class{constructor(){U(this,kt,Oo);U(this,Pi,!1)}setTimeoutProvider(e){M(this,kt,e)}setTimeout(e,t){return g(this,kt).setTimeout(e,t)}clearTimeout(e){g(this,kt).clearTimeout(e)}setInterval(e,t){return g(this,kt).setInterval(e,t)}clearInterval(e){g(this,kt).clearInterval(e)}},kt=new WeakMap,Pi=new WeakMap,Va),At=new Do;function Fo(e){setTimeout(e,0)}var zo=typeof window>"u"||"Deno"in globalThis;function Ae(){}function Bo(e,t){return typeof e=="function"?e(t):e}function ti(e){return typeof e=="number"&&e>=0&&e!==1/0}function rl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rt(e,t){return typeof e=="function"?e(t):e}function Fe(e,t){return typeof e=="function"?e(t):e}function Fs(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:l,stale:o}=e;if(l){if(r){if(t.queryHash!==Ti(l,t.options))return!1}else if(!Dn(t.queryKey,l))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||s&&s!==t.state.fetchStatus||a&&!a(t))}function zs(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(On(t.options.mutationKey)!==On(a))return!1}else if(!Dn(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Ti(e,t){return((t==null?void 0:t.queryKeyHashFn)||On)(e)}function On(e){return JSON.stringify(e,(t,n)=>ri(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Dn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Dn(e[n],t[n])):!1}var qo=Object.prototype.hasOwnProperty;function il(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Bs(e)&&Bs(t);if(!r&&!(ri(e)&&ri(t)))return t;const a=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),o=l.length,u=r?new Array(o):{};let c=0;for(let d=0;d{At.setTimeout(t,e)})}function ii(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?il(e,t):t}function $o(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ho(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ai=Symbol();function sl(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ai?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function al(e,t){return typeof e=="function"?e(...t):!!e}function Ko(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 Fn=(()=>{let e=()=>zo;return{isServer(){return e()},setIsServer(t){e=t}}})();function si(){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 Qo=Fo;function Vo(){let e=[],t=0,n=o=>{o()},r=o=>{o()},s=Qo;const a=o=>{t?e.push(o):s(()=>{n(o)})},l=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(u=>{n(u)})})})};return{batch:o=>{let u;t++;try{u=o()}finally{t--,t||l()}return u},batchCalls:o=>(...u)=>{a(()=>{o(...u)})},schedule:a,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}var we=Vo(),en,Nt,tn,Ga,Go=(Ga=class extends er{constructor(){super();U(this,en,!0);U(this,Nt);U(this,tn);M(this,tn,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,Nt)||this.setEventListener(g(this,tn))}onUnsubscribe(){var t;this.hasListeners()||((t=g(this,Nt))==null||t.call(this),M(this,Nt,void 0))}setEventListener(t){var n;M(this,tn,t),(n=g(this,Nt))==null||n.call(this),M(this,Nt,t(this.setOnline.bind(this)))}setOnline(t){g(this,en)!==t&&(M(this,en,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return g(this,en)}},en=new WeakMap,Nt=new WeakMap,tn=new WeakMap,Ga),wr=new Go;function Wo(e){return Math.min(1e3*2**e,3e4)}function ll(e){return(e??"online")==="online"?wr.isOnline():!0}var ai=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ol(e){let t=!1,n=0,r;const s=si(),a=()=>s.status!=="pending",l=w=>{var v;if(!a()){const b=new ai(w);m(b),(v=e.onCancel)==null||v.call(e,b)}},o=()=>{t=!0},u=()=>{t=!1},c=()=>Ii.isFocused()&&(e.networkMode==="always"||wr.isOnline())&&e.canRun(),d=()=>ll(e.networkMode)&&e.canRun(),p=w=>{a()||(r==null||r(),s.resolve(w))},m=w=>{a()||(r==null||r(),s.reject(w))},h=()=>new Promise(w=>{var v;r=b=>{(a()||c())&&w(b)},(v=e.onPause)==null||v.call(e)}).then(()=>{var w;r=void 0,a()||(w=e.onContinue)==null||w.call(e)}),y=()=>{if(a())return;let w;const v=n===0?e.initialPromise:void 0;try{w=v??e.fn()}catch(b){w=Promise.reject(b)}Promise.resolve(w).then(p).catch(b=>{var j;if(a())return;const N=e.retry??(Fn.isServer()?0:3),_=e.retryDelay??Wo,S=typeof _=="function"?_(n,b):_,D=N===!0||typeof N=="number"&&nc()?void 0:h()).then(()=>{t?m(b):y()})})};return{promise:s,status:()=>s.status,cancel:l,continue:()=>(r==null||r(),s),cancelRetry:o,continueRetry:u,canStart:d,start:()=>(d()?y():h().then(y),s)}}var Mt,Wa,ul=(Wa=class{constructor(){U(this,Mt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ti(this.gcTime)&&M(this,Mt,At.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fn.isServer()?1/0:300*1e3))}clearGcTimeout(){g(this,Mt)!==void 0&&(At.clearTimeout(g(this,Mt)),M(this,Mt,void 0))}},Mt=new WeakMap,Wa);function Jo(e){return{onFetch:(t,n)=>{var d,p,m,h,y;const r=t.options,s=(m=(p=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,a=((h=t.state.data)==null?void 0:h.pages)||[],l=((y=t.state.data)==null?void 0:y.pageParams)||[];let o={pages:[],pageParams:[]},u=0;const c=async()=>{let w=!1;const v=_=>{Ko(_,()=>t.signal,()=>w=!0)},b=sl(t.options,t.fetchOptions),N=async(_,S,D)=>{if(w)return Promise.reject(t.signal.reason);if(S==null&&_.pages.length)return Promise.resolve(_);const B=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:S,direction:D?"backward":"forward",meta:t.options.meta};return v(T),T})(),L=await b(B),{maxPages:C}=t.options,O=D?Ho:$o;return{pages:O(_.pages,L,C),pageParams:O(_.pageParams,S,C)}};if(s&&a.length){const _=s==="backward",S=_?Xo:Us,D={pages:a,pageParams:l},j=S(r,D);o=await N(D,j,_)}else{const _=e??a.length;do{const S=u===0?l[0]??r.initialPageParam:Us(r,o);if(u>0&&S==null)break;o=await N(o,S),u++}while(u<_)}return o};t.options.persister?t.fetchFn=()=>{var w,v;return(v=(w=t.options).persister)==null?void 0:v.call(w,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Us(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 Xo(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}var nn,Ot,rn,Ue,Dt,be,Hn,Ft,De,cl,ut,Ja,Yo=(Ja=class extends ul{constructor(t){super();U(this,De);U(this,nn);U(this,Ot);U(this,rn);U(this,Ue);U(this,Dt);U(this,be);U(this,Hn);U(this,Ft);M(this,Ft,!1),M(this,Hn,t.defaultOptions),this.setOptions(t.options),this.observers=[],M(this,Dt,t.client),M(this,Ue,g(this,Dt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,M(this,Ot,Hs(this.options)),this.state=t.state??g(this,Ot),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return g(this,nn)}get promise(){var t;return(t=g(this,be))==null?void 0:t.promise}setOptions(t){if(this.options={...g(this,Hn),...t},t!=null&&t._type&&M(this,nn,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Hs(this.options);n.data!==void 0&&(this.setState($s(n.data,n.dataUpdatedAt)),M(this,Ot,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&g(this,Ue).remove(this)}setData(t,n){const r=ii(this.state.data,t,this.options);return X(this,De,ut).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,De,ut).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=g(this,be))==null?void 0:r.promise;return(s=g(this,be))==null||s.cancel(t),n?n.then(Ae).catch(Ae):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return g(this,Ot)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Fe(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ai||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Rt(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:!rl(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=g(this,be))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=g(this,be))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),g(this,Ue).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,be)&&(g(this,Ft)||X(this,De,cl).call(this)?g(this,be).cancel({revert:!0}):g(this,be).cancelRetry()),this.scheduleGc()),g(this,Ue).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||X(this,De,ut).call(this,{type:"invalidate"})}async fetch(t,n){var c,d,p,m,h,y,w,v,b,N,_;if(this.state.fetchStatus!=="idle"&&((c=g(this,be))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(g(this,be))return g(this,be).continueRetry(),g(this,be).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(D=>D.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,s=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(M(this,Ft,!0),r.signal)})},a=()=>{const S=sl(this.options,n),j=(()=>{const B={client:g(this,Dt),queryKey:this.queryKey,meta:this.meta};return s(B),B})();return M(this,Ft,!1),this.options.persister?this.options.persister(S,j,this):S(j)},o=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:g(this,Dt),state:this.state,fetchFn:a};return s(S),S})(),u=g(this,nn)==="infinite"?Jo(this.options.pages):this.options.behavior;u==null||u.onFetch(o,this),M(this,rn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&X(this,De,ut).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta}),M(this,be,ol({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:S=>{S instanceof ai&&S.revert&&this.setState({...g(this,rn),fetchStatus:"idle"}),r.abort()},onFail:(S,D)=>{X(this,De,ut).call(this,{type:"failed",failureCount:S,error:D})},onPause:()=>{X(this,De,ut).call(this,{type:"pause"})},onContinue:()=>{X(this,De,ut).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const S=await g(this,be).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(h=(m=g(this,Ue).config).onSuccess)==null||h.call(m,S,this),(w=(y=g(this,Ue).config).onSettled)==null||w.call(y,S,this.state.error,this),S}catch(S){if(S instanceof ai){if(S.silent)return g(this,be).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw X(this,De,ut).call(this,{type:"error",error:S}),(b=(v=g(this,Ue).config).onError)==null||b.call(v,S,this),(_=(N=g(this,Ue).config).onSettled)==null||_.call(N,this.state.data,S,this),S}finally{this.scheduleGc()}}},nn=new WeakMap,Ot=new WeakMap,rn=new WeakMap,Ue=new WeakMap,Dt=new WeakMap,be=new WeakMap,Hn=new WeakMap,Ft=new WeakMap,De=new WeakSet,cl=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ut=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,...dl(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...$s(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return M(this,rn,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),we.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),g(this,Ue).notify({query:this,type:"updated",action:t})})},Ja);function dl(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ll(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $s(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Hs(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,Kn,_e,zt,sn,ct,St,Qn,an,ln,Bt,qt,Ct,on,re,Rn,li,oi,ui,ci,di,hi,pi,hl,Xa,Zo=(Xa=class extends er{constructor(t,n){super();U(this,re);U(this,Te);U(this,Y);U(this,Kn);U(this,_e);U(this,zt);U(this,sn);U(this,ct);U(this,St);U(this,Qn);U(this,an);U(this,ln);U(this,Bt);U(this,qt);U(this,Ct);U(this,on,new Set);this.options=n,M(this,Te,t),M(this,St,null),M(this,ct,si()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(g(this,Y).addObserver(this),Ks(g(this,Y),this.options)?X(this,re,Rn).call(this):this.updateResult(),X(this,re,ci).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return mi(g(this,Y),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return mi(g(this,Y),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,X(this,re,di).call(this),X(this,re,hi).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 Fe(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,re,pi).call(this),g(this,Y).setOptions(this.options),n._defaulted&&!ni(this.options,n)&&g(this,Te).getQueryCache().notify({type:"observerOptionsUpdated",query:g(this,Y),observer:this});const s=this.hasListeners();s&&Qs(g(this,Y),r,this.options,n)&&X(this,re,Rn).call(this),this.updateResult(),s&&(g(this,Y)!==r||Fe(this.options.enabled,g(this,Y))!==Fe(n.enabled,g(this,Y))||Rt(this.options.staleTime,g(this,Y))!==Rt(n.staleTime,g(this,Y)))&&X(this,re,li).call(this);const a=X(this,re,oi).call(this);s&&(g(this,Y)!==r||Fe(this.options.enabled,g(this,Y))!==Fe(n.enabled,g(this,Y))||a!==g(this,Ct))&&X(this,re,ui).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)&&(M(this,_e,r),M(this,sn,this.options),M(this,zt,g(this,Y).state)),r}getCurrentResult(){return g(this,_e)}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,ct).status==="pending"&&g(this,ct).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){g(this,on).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,re,Rn).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),g(this,_e)))}createResult(t,n){var C;const r=g(this,Y),s=this.options,a=g(this,_e),l=g(this,zt),o=g(this,sn),c=t!==r?t.state:g(this,Kn),{state:d}=t;let p={...d},m=!1,h;if(n._optimisticResults){const O=this.hasListeners(),T=!O&&Ks(t,n),E=O&&Qs(t,r,n,s);(T||E)&&(p={...p,...dl(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:y,errorUpdatedAt:w,status:v}=p;h=p.data;let b=!1;if(n.placeholderData!==void 0&&h===void 0&&v==="pending"){let O;a!=null&&a.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(O=a.data,b=!0):O=typeof n.placeholderData=="function"?n.placeholderData((C=g(this,ln))==null?void 0:C.state.data,g(this,ln)):n.placeholderData,O!==void 0&&(v="success",h=ii(a==null?void 0:a.data,O,n),m=!0)}if(n.select&&h!==void 0&&!b)if(a&&h===(l==null?void 0:l.data)&&n.select===g(this,Qn))h=g(this,an);else try{M(this,Qn,n.select),h=n.select(h),h=ii(a==null?void 0:a.data,h,n),M(this,an,h),M(this,St,null)}catch(O){M(this,St,O)}g(this,St)&&(y=g(this,St),h=g(this,an),w=Date.now(),v="error");const N=p.fetchStatus==="fetching",_=v==="pending",S=v==="error",D=_&&N,j=h!==void 0,L={status:v,fetchStatus:p.fetchStatus,isPending:_,isSuccess:v==="success",isError:S,isInitialLoading:D,isLoading:D,data:h,dataUpdatedAt:p.dataUpdatedAt,error:y,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>c.dataUpdateCount||p.errorUpdateCount>c.errorUpdateCount,isFetching:N,isRefetching:N&&!_,isLoadingError:S&&!j,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:S&&j,isStale:Li(t,n),refetch:this.refetch,promise:g(this,ct),isEnabled:Fe(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const O=L.data!==void 0,T=L.status==="error"&&!O,E=P=>{T?P.reject(L.error):O&&P.resolve(L.data)},V=()=>{const P=M(this,ct,L.promise=si());E(P)},F=g(this,ct);switch(F.status){case"pending":t.queryHash===r.queryHash&&E(F);break;case"fulfilled":(T||L.data!==F.value)&&V();break;case"rejected":(!T||L.error!==F.reason)&&V();break}}return L}updateResult(){const t=g(this,_e),n=this.createResult(g(this,Y),this.options);if(M(this,zt,g(this,Y).state),M(this,sn,this.options),g(this,zt).data!==void 0&&M(this,ln,g(this,Y)),ni(n,t))return;M(this,_e,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!g(this,on).size)return!0;const l=new Set(a??g(this,on));return this.options.throwOnError&&l.add("error"),Object.keys(g(this,_e)).some(o=>{const u=o;return g(this,_e)[u]!==t[u]&&l.has(u)})};X(this,re,hl).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&X(this,re,ci).call(this)}},Te=new WeakMap,Y=new WeakMap,Kn=new WeakMap,_e=new WeakMap,zt=new WeakMap,sn=new WeakMap,ct=new WeakMap,St=new WeakMap,Qn=new WeakMap,an=new WeakMap,ln=new WeakMap,Bt=new WeakMap,qt=new WeakMap,Ct=new WeakMap,on=new WeakMap,re=new WeakSet,Rn=function(t){X(this,re,pi).call(this);let n=g(this,Y).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ae)),n},li=function(){X(this,re,di).call(this);const t=Rt(this.options.staleTime,g(this,Y));if(Fn.isServer()||g(this,_e).isStale||!ti(t))return;const r=rl(g(this,_e).dataUpdatedAt,t)+1;M(this,Bt,At.setTimeout(()=>{g(this,_e).isStale||this.updateResult()},r))},oi=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(g(this,Y)):this.options.refetchInterval)??!1},ui=function(t){X(this,re,hi).call(this),M(this,Ct,t),!(Fn.isServer()||Fe(this.options.enabled,g(this,Y))===!1||!ti(g(this,Ct))||g(this,Ct)===0)&&M(this,qt,At.setInterval(()=>{(this.options.refetchIntervalInBackground||Ii.isFocused())&&X(this,re,Rn).call(this)},g(this,Ct)))},ci=function(){X(this,re,li).call(this),X(this,re,ui).call(this,X(this,re,oi).call(this))},di=function(){g(this,Bt)!==void 0&&(At.clearTimeout(g(this,Bt)),M(this,Bt,void 0))},hi=function(){g(this,qt)!==void 0&&(At.clearInterval(g(this,qt)),M(this,qt,void 0))},pi=function(){const t=g(this,Te).getQueryCache().build(g(this,Te),this.options);if(t===g(this,Y))return;const n=g(this,Y);M(this,Y,t),M(this,Kn,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},hl=function(t){we.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(g(this,_e))}),g(this,Te).getQueryCache().notify({query:g(this,Y),type:"observerResultsUpdated"})})},Xa);function eu(e,t){return Fe(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Fe(t.retryOnMount,e)===!1)}function Ks(e,t){return eu(e,t)||e.state.data!==void 0&&mi(e,t,t.refetchOnMount)}function mi(e,t,n){if(Fe(t.enabled,e)!==!1&&Rt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Li(e,t)}return!1}function Qs(e,t,n,r){return(e!==t||Fe(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Li(e,n)}function Li(e,t){return Fe(t.enabled,e)!==!1&&e.isStaleByTime(Rt(t.staleTime,e))}function tu(e,t){return!ni(e.getCurrentResult(),t)}var Vn,Ze,Ne,Ut,et,vt,Ya,nu=(Ya=class extends ul{constructor(t){super();U(this,et);U(this,Vn);U(this,Ze);U(this,Ne);U(this,Ut);M(this,Vn,t.client),this.mutationId=t.mutationId,M(this,Ne,t.mutationCache),M(this,Ze,[]),this.state=t.state||ru(),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,Ze).includes(t)||(g(this,Ze).push(t),this.clearGcTimeout(),g(this,Ne).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){M(this,Ze,g(this,Ze).filter(n=>n!==t)),this.scheduleGc(),g(this,Ne).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){g(this,Ze).length||(this.state.status==="pending"?this.scheduleGc():g(this,Ne).remove(this))}continue(){var t;return((t=g(this,Ut))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,o,u,c,d,p,m,h,y,w,v,b,N,_,S,D,j,B;const n=()=>{X(this,et,vt).call(this,{type:"continue"})},r={client:g(this,Vn),meta:this.options.meta,mutationKey:this.options.mutationKey};M(this,Ut,ol({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,C)=>{X(this,et,vt).call(this,{type:"failed",failureCount:L,error:C})},onPause:()=>{X(this,et,vt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>g(this,Ne).canRun(this)}));const s=this.state.status==="pending",a=!g(this,Ut).canStart();try{if(s)n();else{X(this,et,vt).call(this,{type:"pending",variables:t,isPaused:a}),g(this,Ne).config.onMutate&&await g(this,Ne).config.onMutate(t,this,r);const C=await((o=(l=this.options).onMutate)==null?void 0:o.call(l,t,r));C!==this.state.context&&X(this,et,vt).call(this,{type:"pending",context:C,variables:t,isPaused:a})}const L=await g(this,Ut).start();return await((c=(u=g(this,Ne).config).onSuccess)==null?void 0:c.call(u,L,t,this.state.context,this,r)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,L,t,this.state.context,r)),await((h=(m=g(this,Ne).config).onSettled)==null?void 0:h.call(m,L,null,this.state.variables,this.state.context,this,r)),await((w=(y=this.options).onSettled)==null?void 0:w.call(y,L,null,t,this.state.context,r)),X(this,et,vt).call(this,{type:"success",data:L}),L}catch(L){try{await((b=(v=g(this,Ne).config).onError)==null?void 0:b.call(v,L,t,this.state.context,this,r))}catch(C){Promise.reject(C)}try{await((_=(N=this.options).onError)==null?void 0:_.call(N,L,t,this.state.context,r))}catch(C){Promise.reject(C)}try{await((D=(S=g(this,Ne).config).onSettled)==null?void 0:D.call(S,void 0,L,this.state.variables,this.state.context,this,r))}catch(C){Promise.reject(C)}try{await((B=(j=this.options).onSettled)==null?void 0:B.call(j,void 0,L,t,this.state.context,r))}catch(C){Promise.reject(C)}throw X(this,et,vt).call(this,{type:"error",error:L}),L}finally{g(this,Ne).runNext(this)}}},Vn=new WeakMap,Ze=new WeakMap,Ne=new WeakMap,Ut=new WeakMap,et=new WeakSet,vt=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),we.batch(()=>{g(this,Ze).forEach(r=>{r.onMutationUpdate(t)}),g(this,Ne).notify({mutation:this,type:"updated",action:t})})},Ya);function ru(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var dt,Ve,Gn,Za,iu=(Za=class extends er{constructor(t={}){super();U(this,dt);U(this,Ve);U(this,Gn);this.config=t,M(this,dt,new Set),M(this,Ve,new Map),M(this,Gn,0)}build(t,n,r){const s=new nu({client:t,mutationCache:this,mutationId:++ur(this,Gn)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){g(this,dt).add(t);const n=dr(t);if(typeof n=="string"){const r=g(this,Ve).get(n);r?r.push(t):g(this,Ve).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(g(this,dt).delete(t)){const n=dr(t);if(typeof n=="string"){const r=g(this,Ve).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,Ve).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=dr(t);if(typeof n=="string"){const r=g(this,Ve).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=dr(t);if(typeof n=="string"){const s=(r=g(this,Ve).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(){we.batch(()=>{g(this,dt).forEach(t=>{this.notify({type:"removed",mutation:t})}),g(this,dt).clear(),g(this,Ve).clear()})}getAll(){return Array.from(g(this,dt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>zs(n,r))}findAll(t={}){return this.getAll().filter(n=>zs(t,n))}notify(t){we.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return we.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ae))))}},dt=new WeakMap,Ve=new WeakMap,Gn=new WeakMap,Za);function dr(e){var t;return(t=e.options.scope)==null?void 0:t.id}var tt,el,su=(el=class extends er{constructor(t={}){super();U(this,tt);this.config=t,M(this,tt,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??Ti(s,n);let l=this.get(a);return l||(l=new Yo({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){g(this,tt).has(t.queryHash)||(g(this,tt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=g(this,tt).get(t.queryHash);n&&(t.destroy(),n===t&&g(this,tt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){we.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return g(this,tt).get(t)}getAll(){return[...g(this,tt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Fs(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Fs(t,r)):n}notify(t){we.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){we.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){we.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},tt=new WeakMap,el),de,_t,Et,un,cn,Pt,dn,hn,tl,au=(tl=class{constructor(e={}){U(this,de);U(this,_t);U(this,Et);U(this,un);U(this,cn);U(this,Pt);U(this,dn);U(this,hn);M(this,de,e.queryCache||new su),M(this,_t,e.mutationCache||new iu),M(this,Et,e.defaultOptions||{}),M(this,un,new Map),M(this,cn,new Map),M(this,Pt,0)}mount(){ur(this,Pt)._++,g(this,Pt)===1&&(M(this,dn,Ii.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,de).onFocus())})),M(this,hn,wr.subscribe(async e=>{e&&(await this.resumePausedMutations(),g(this,de).onOnline())})))}unmount(){var e,t;ur(this,Pt)._--,g(this,Pt)===0&&((e=g(this,dn))==null||e.call(this),M(this,dn,void 0),(t=g(this,hn))==null||t.call(this),M(this,hn,void 0))}isFetching(e){return g(this,de).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return g(this,_t).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=g(this,de).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=g(this,de).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Rt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return g(this,de).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,de).get(r.queryHash),a=s==null?void 0:s.state.data,l=Bo(t,a);if(l!==void 0)return g(this,de).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return we.batch(()=>g(this,de).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,de).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=g(this,de);we.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=g(this,de);return we.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=we.batch(()=>g(this,de).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Ae).catch(Ae)}invalidateQueries(e,t={}){return we.batch(()=>(g(this,de).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=we.batch(()=>g(this,de).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,de).build(this,t);return n.isStaleByTime(Rt(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 wr.isOnline()?g(this,_t).resumePausedMutations():Promise.resolve()}getQueryCache(){return g(this,de)}getMutationCache(){return g(this,_t)}getDefaultOptions(){return g(this,Et)}setDefaultOptions(e){M(this,Et,e)}setQueryDefaults(e,t){g(this,un).set(On(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...g(this,un).values()],n={};return t.forEach(r=>{Dn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){g(this,cn).set(On(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...g(this,cn).values()],n={};return t.forEach(r=>{Dn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...g(this,Et).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ti(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===Ai&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...g(this,Et).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){g(this,de).clear(),g(this,_t).clear()}},de=new WeakMap,_t=new WeakMap,Et=new WeakMap,un=new WeakMap,cn=new WeakMap,Pt=new WeakMap,dn=new WeakMap,hn=new WeakMap,tl),pl=ve.createContext(void 0),ml=e=>{const t=ve.useContext(pl);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},lu=({client:e,children:t})=>(ve.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(pl.Provider,{value:e,children:t})),fl=ve.createContext(!1),ou=()=>ve.useContext(fl);fl.Provider;function uu(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var cu=ve.createContext(uu()),du=()=>ve.useContext(cu),hu=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?al(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},pu=e=>{ve.useEffect(()=>{e.clearReset()},[e])},mu=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||al(n,[e.error,r])),fu=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))}},xu=(e,t)=>e.isLoading&&e.isFetching&&!t,gu=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Vs=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function bu(e,t,n){var m,h,y,w;const r=ou(),s=du(),a=ml(),l=a.defaultQueryOptions(e);(h=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||h.call(m,l);const o=a.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",fu(l),hu(l,s,o),pu(s);const u=!a.getQueryCache().get(l.queryHash),[c]=ve.useState(()=>new t(a,l)),d=c.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(ve.useSyncExternalStore(ve.useCallback(v=>{const b=p?c.subscribe(we.batchCalls(v)):Ae;return c.updateResult(),b},[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),ve.useEffect(()=>{c.setOptions(l)},[l,c]),gu(l,d))throw Vs(l,c,s);if(mu({result:d,errorResetBoundary:s,throwOnError:l.throwOnError,query:o,suspense:l.suspense}))throw d.error;if((w=(y=a.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||w.call(y,l,d),l.experimental_prefetchInRender&&!Fn.isServer()&&xu(d,r)){const v=u?Vs(l,c,s):o==null?void 0:o.promise;v==null||v.catch(Ae).finally(()=>{c.updateResult()})}return l.notifyOnChangeProps?d:c.trackResult(d)}function ge(e,t){return bu(e,Zo)}/** - * @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(),xl=(...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 wu={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 vu=ve.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:l,...o},u)=>ve.createElement("svg",{ref:u,...wu,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:xl("lucide",s),...o},[...l.map(([c,d])=>ve.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 ae=(e,t)=>{const n=ve.forwardRef(({className:r,...s},a)=>ve.createElement(vu,{ref:a,iconNode:t,className:xl(`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 zn=ae("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 ju=ae("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 gl=ae("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 Mi=ae("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 mn=ae("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 fn=ae("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 Bn=ae("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 bl=ae("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 Gs=ae("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 pn=ae("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 yl=ae("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 ku=ae("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 Nu=ae("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 vr=ae("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 tr=ae("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 Su=ae("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 Oi=ae("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 qn=ae("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 Cu=ae("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 _u=ae("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 wl=ae("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 vl=ae("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 Eu=ae("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 fi=ae("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 Di=ae("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 Pu=ae("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 Kt=ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Ru(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Iu=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Tu=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Au={};function Ws(e,t){return(Au.jsx?Tu:Iu).test(e)}const Lu=/[ \t\n\f\r]/g;function Mu(e){return typeof e=="object"?e.type==="text"?Js(e.value):!1:Js(e)}function Js(e){return e.replace(Lu,"")===""}class nr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}nr.prototype.normal={};nr.prototype.property={};nr.prototype.space=void 0;function jl(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new nr(n,r,t)}function xi(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 Ou=0;const K=Qt(),xe=Qt(),gi=Qt(),R=Qt(),se=Qt(),Ht=Qt(),Oe=Qt();function Qt(){return 2**++Ou}const bi=Object.freeze(Object.defineProperty({__proto__:null,boolean:K,booleanish:xe,commaOrSpaceSeparated:Oe,commaSeparated:Ht,number:R,overloadedBoolean:gi,spaceSeparated:se},Symbol.toStringTag,{value:"Module"})),zr=Object.keys(bi);class Fi extends Me{constructor(t,n,r,s){let a=-1;if(super(t,n),Xs(this,"space",s),typeof r=="number")for(;++a4&&n.slice(0,4)==="data"&&qu.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Ys,Hu);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Ys.test(a)){let l=a.replace(Bu,$u);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=Fi}return new s(r,t)}function $u(e){return"-"+e.toLowerCase()}function Hu(e){return e.charAt(1).toUpperCase()}const Ku=jl([kl,Du,Cl,_l,El],"html"),zi=jl([kl,Fu,Cl,_l,El],"svg");function Qu(e){return e.join(" ").trim()}var Wt={},Br,Zs;function Vu(){if(Zs)return Br;Zs=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,o=/^\s+|\s+$/g,u=` -`,c="/",d="*",p="",m="comment",h="declaration";function y(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var N=1,_=1;function S(F){var P=F.match(t);P&&(N+=P.length);var q=F.lastIndexOf(u);_=~q?F.length-q:_+F.length}function D(){var F={line:N,column:_};return function(P){return P.position=new j(F),C(),P}}function j(F){this.start=F,this.end={line:N,column:_},this.source=b.source}j.prototype.content=v;function B(F){var P=new Error(b.source+":"+N+":"+_+": "+F);if(P.reason=F,P.filename=b.source,P.line=N,P.column=_,P.source=v,!b.silent)throw P}function L(F){var P=F.exec(v);if(P){var q=P[0];return S(q),v=v.slice(q.length),P}}function C(){L(n)}function O(F){var P;for(F=F||[];P=T();)P!==!1&&F.push(P);return F}function T(){var F=D();if(!(c!=v.charAt(0)||d!=v.charAt(1))){for(var P=2;p!=v.charAt(P)&&(d!=v.charAt(P)||c!=v.charAt(P+1));)++P;if(P+=2,p===v.charAt(P-1))return B("End of comment missing");var q=v.slice(2,P-2);return _+=2,S(q),v=v.slice(P),_+=2,F({type:m,comment:q})}}function E(){var F=D(),P=L(r);if(P){if(T(),!L(s))return B("property missing ':'");var q=L(a),W=F({type:h,property:w(P[0].replace(e,p)),value:q?w(q[0].replace(e,p)):p});return L(l),W}}function V(){var F=[];O(F);for(var P;P=E();)P!==!1&&(F.push(P),O(F));return F}return C(),V()}function w(v){return v?v.replace(o,p):p}return Br=y,Br}var ea;function Gu(){if(ea)return Wt;ea=1;var e=Wt&&Wt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.default=n;const t=e(Vu());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),o=typeof s=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:c,value:d}=u;o?s(c,d,u):d&&(a=a||{},a[c]=d)}),a}return Wt}var kn={},ta;function Wu(){if(ta)return kn;ta=1,Object.defineProperty(kn,"__esModule",{value:!0}),kn.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)},l=function(c,d){return d.toUpperCase()},o=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,o):c=c.replace(r,o),c.replace(t,l))};return kn.camelCase=u,kn}var Nn,na;function Ju(){if(na)return Nn;na=1;var e=Nn&&Nn.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(Gu()),n=Wu();function r(s,a){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(o,u){o&&u&&(l[(0,n.camelCase)(o,a)]=u)}),l}return r.default=r,Nn=r,Nn}var Xu=Ju();const Yu=Ri(Xu),Pl=Rl("end"),Bi=Rl("start");function Rl(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 Zu(e){const t=Bi(e),n=Pl(e);if(t&&n)return{start:t,end:n}}function Tn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ra(e.position):"start"in e||"end"in e?ra(e):"line"in e||"column"in e?yi(e):""}function yi(e){return ia(e&&e.line)+":"+ia(e&&e.column)}function ra(e){return yi(e&&e.start)+"-"+yi(e&&e.end)}function ia(e){return e&&typeof e=="number"?e:1}class Ce extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},l=!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&&(l=!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 o=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=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=Tn(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=l&&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}}Ce.prototype.file="";Ce.prototype.name="";Ce.prototype.reason="";Ce.prototype.message="";Ce.prototype.stack="";Ce.prototype.column=void 0;Ce.prototype.line=void 0;Ce.prototype.ancestors=void 0;Ce.prototype.cause=void 0;Ce.prototype.fatal=void 0;Ce.prototype.place=void 0;Ce.prototype.ruleId=void 0;Ce.prototype.source=void 0;const qi={}.hasOwnProperty,ec=new Map,tc=/[A-Z]/g,nc=new Set(["table","tbody","thead","tfoot","tr"]),rc=new Set(["td","th"]),Il="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ic(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=dc(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"?zi:Ku,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Tl(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function Tl(e,t,n){if(t.type==="element")return sc(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ac(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return oc(e,t,n);if(t.type==="mdxjsEsm")return lc(e,t);if(t.type==="root")return uc(e,t,n);if(t.type==="text")return cc(e,t)}function sc(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=zi,e.schema=s),e.ancestors.push(t);const a=Ll(e,t.tagName,!1),l=pc(e,t);let o=$i(e,t);return nc.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!Mu(u):!0})),Al(e,l,a,t),Ui(l,o),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function ac(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)}Un(e,t.position)}function lc(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Un(e,t.position)}function oc(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=zi,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:Ll(e,t.name,!0),l=mc(e,t),o=$i(e,t);return Al(e,l,a,t),Ui(l,o),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function uc(e,t,n){const r={};return Ui(r,$i(e,t)),e.create(t,e.Fragment,r,n)}function cc(e,t){return t.value}function Al(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ui(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function dc(e,t,n){return r;function r(s,a,l,o){const c=Array.isArray(l.children)?n:t;return o?c(a,l,o):c(a,l)}}function hc(e,t){return n;function n(r,s,a,l){const o=Array.isArray(a.children),u=Bi(r);return t(s,a,l,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function pc(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&qi.call(t.properties,s)){const a=fc(e,s,t.properties[s]);if(a){const[l,o]=a;e.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&rc.has(t.tagName)?r=o:n[l]=o}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function mc(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 l=a.expression;l.type;const o=l.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Un(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 o=r.value.data.estree.body[0];o.type,a=e.evaluater.evaluateExpression(o.expression)}else Un(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function $i(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:ec;for(;++rs?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a0?(rt(e,e.length,0,t),e):t}const la={}.hasOwnProperty;function kc(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 Xt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const nt=It(/[A-Za-z]/),ze=It(/[\dA-Za-z]/),Cc=It(/[#-'*+\--9=?A-Z^-~]/);function wi(e){return e!==null&&(e<32||e===127)}const vi=It(/\d/),_c=It(/[\dA-Fa-f]/),Ec=It(/[!-/:-@[-`{-~]/);function H(e){return e!==null&&e<-2}function Le(e){return e!==null&&(e<0||e===32)}function ee(e){return e===-2||e===-1||e===32}const Pc=It(new RegExp("\\p{P}|\\p{S}","u")),Rc=It(/\s/);function It(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function gn(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&a<57344){const o=e.charCodeAt(n+1);a<56320&&o>56319&&o<57344?(l=String.fromCharCode(a,o),s=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function oe(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(u){return ee(u)?(e.enter(n),o(u)):t(u)}function o(u){return ee(u)&&a++l))return;const B=t.events.length;let L=B,C,O;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(C){O=t.events[L][1].end;break}C=!0}for(b(r),j=B;j_;){const D=n[S];t.containerState=D[1],D[0].exit.call(t,e)}n.length=_}function N(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function Mc(e,t,n){return oe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ua(e){if(e===null||Le(e)||Rc(e))return 1;if(Pc(e))return 2}function Ki(e,t,n){const r=[];let s=-1;for(;++s1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},m={...e[n][1].start};ca(p,-u),ca(m,u),l={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},o={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:{...l.start},end:{...o.end}},e[r][1].end={...l.start},e[n][1].start={...o.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=$e(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=$e(c,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",a,t]]),c=$e(c,Ki(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=$e(c,[["exit",a,t],["enter",o,t],["exit",o,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=$e(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,rt(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&ee(j)?oe(e,N,"linePrefix",a+1)(j):N(j)}function N(j){return j===null||H(j)?e.check(da,w,S)(j):(e.enter("codeFlowValue"),_(j))}function _(j){return j===null||H(j)?(e.exit("codeFlowValue"),N(j)):(e.consume(j),_)}function S(j){return e.exit("codeFenced"),t(j)}function D(j,B,L){let C=0;return O;function O(P){return j.enter("lineEnding"),j.consume(P),j.exit("lineEnding"),T}function T(P){return j.enter("codeFencedFence"),ee(P)?oe(j,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):E(P)}function E(P){return P===o?(j.enter("codeFencedFenceSequence"),V(P)):L(P)}function V(P){return P===o?(C++,j.consume(P),V):C>=l?(j.exit("codeFencedFenceSequence"),ee(P)?oe(j,F,"whitespace")(P):F(P)):L(P)}function F(P){return P===null||H(P)?(j.exit("codeFencedFence"),B(P)):L(P)}}}function Vc(e,t,n){const r=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Ur={name:"codeIndented",tokenize:Wc},Gc={partial:!0,tokenize:Jc};function Wc(e,t,n){const r=this;return s;function s(c){return e.enter("codeIndented"),oe(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?l(c):n(c)}function l(c){return c===null?u(c):H(c)?e.attempt(Gc,l,u)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||H(c)?(e.exit("codeFlowValue"),l(c)):(e.consume(c),o)}function u(c){return e.exit("codeIndented"),t(c)}}function Jc(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):H(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):oe(e,a,"linePrefix",5)(l)}function a(l){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):H(l)?s(l):n(l)}}const Xc={name:"codeText",previous:Zc,resolve:Yc,tokenize:ed};function Yc(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&&Sn(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),Sn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Sn(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(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function ql(e,t,n,r,s,a,l,o,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return p;function p(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||wi(b)?n(b):(e.enter(r),e.enter(l),e.enter(o),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(o),e.enter("chunkString",{contentType:"string"}),h(b))}function h(b){return b===62?(e.exit("chunkString"),e.exit(o),m(b)):b===null||b===60||H(b)?n(b):(e.consume(b),b===92?y:h)}function y(b){return b===60||b===62||b===92?(e.consume(b),h):h(b)}function w(b){return!d&&(b===null||b===41||Le(b))?(e.exit("chunkString"),e.exit(o),e.exit(l),e.exit(r),t(b)):d999||h===null||h===91||h===93&&!u||h===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(a),e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):H(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(h))}function p(h){return h===null||h===91||h===93||H(h)||o++>999?(e.exit("chunkString"),d(h)):(e.consume(h),u||(u=!ee(h)),h===92?m:p)}function m(h){return h===91||h===92||h===93?(e.consume(h),o++,p):p(h)}}function $l(e,t,n,r,s,a){let l;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(s),e.consume(m),e.exit(s),l=m===40?41:m,u):n(m)}function u(m){return m===l?(e.enter(s),e.consume(m),e.exit(s),e.exit(r),t):(e.enter(a),c(m))}function c(m){return m===l?(e.exit(a),u(l)):m===null?n(m):H(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),oe(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===l||m===null||H(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?p:d)}function p(m){return m===l||m===92?(e.consume(m),d):d(m)}}function An(e,t){let n;return r;function r(s){return H(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):ee(s)?oe(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const od={name:"definition",tokenize:cd},ud={partial:!0,tokenize:dd};function cd(e,t,n){const r=this;let s;return a;function a(h){return e.enter("definition"),l(h)}function l(h){return Ul.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function o(h){return s=Xt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):n(h)}function u(h){return Le(h)?An(e,c)(h):c(h)}function c(h){return ql(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return e.attempt(ud,p,p)(h)}function p(h){return ee(h)?oe(e,m,"whitespace")(h):m(h)}function m(h){return h===null||H(h)?(e.exit("definition"),r.parser.defined.push(s),t(h)):n(h)}}function dd(e,t,n){return r;function r(o){return Le(o)?An(e,s)(o):n(o)}function s(o){return $l(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return ee(o)?oe(e,l,"whitespace")(o):l(o)}function l(o){return o===null||H(o)?t(o):n(o)}}const hd={name:"hardBreakEscape",tokenize:pd};function pd(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return H(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const md={name:"headingAtx",resolve:fd,tokenize:xd};function fd(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"},rt(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function xd(e,t,n){let r=0;return s;function s(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),l(d)}function l(d){return d===35&&r++<6?(e.consume(d),l):d===null||Le(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||H(d)?(e.exit("atxHeading"),t(d)):ee(d)?oe(e,o,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),o(d))}function c(d){return d===null||d===35||Le(d)?(e.exit("atxHeadingText"),o(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"],pa=["pre","script","style","textarea"],bd={concrete:!0,name:"htmlFlow",resolveTo:vd,tokenize:jd},yd={partial:!0,tokenize:Nd},wd={partial:!0,tokenize:kd};function vd(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 jd(e,t,n){const r=this;let s,a,l,o,u;return c;function c(x){return d(x)}function d(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),p}function p(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):nt(x)?(e.consume(x),l=String.fromCharCode(x),v):n(x)}function m(x){return x===45?(e.consume(x),s=2,h):x===91?(e.consume(x),s=5,o=0,y):nt(x)?(e.consume(x),s=4,r.interrupt?t:f):n(x)}function h(x){return x===45?(e.consume(x),r.interrupt?t:f):n(x)}function y(x){const je="CDATA[";return x===je.charCodeAt(o++)?(e.consume(x),o===je.length?r.interrupt?t:E:y):n(x)}function w(x){return nt(x)?(e.consume(x),l=String.fromCharCode(x),v):n(x)}function v(x){if(x===null||x===47||x===62||Le(x)){const je=x===47,We=l.toLowerCase();return!je&&!a&&pa.includes(We)?(s=1,r.interrupt?t(x):E(x)):gd.includes(l.toLowerCase())?(s=6,je?(e.consume(x),b):r.interrupt?t(x):E(x)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):a?N(x):_(x))}return x===45||ze(x)?(e.consume(x),l+=String.fromCharCode(x),v):n(x)}function b(x){return x===62?(e.consume(x),r.interrupt?t:E):n(x)}function N(x){return ee(x)?(e.consume(x),N):O(x)}function _(x){return x===47?(e.consume(x),O):x===58||x===95||nt(x)?(e.consume(x),S):ee(x)?(e.consume(x),_):O(x)}function S(x){return x===45||x===46||x===58||x===95||ze(x)?(e.consume(x),S):D(x)}function D(x){return x===61?(e.consume(x),j):ee(x)?(e.consume(x),D):_(x)}function j(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),u=x,B):ee(x)?(e.consume(x),j):L(x)}function B(x){return x===u?(e.consume(x),u=null,C):x===null||H(x)?n(x):(e.consume(x),B)}function L(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||Le(x)?D(x):(e.consume(x),L)}function C(x){return x===47||x===62||ee(x)?_(x):n(x)}function O(x){return x===62?(e.consume(x),T):n(x)}function T(x){return x===null||H(x)?E(x):ee(x)?(e.consume(x),T):n(x)}function E(x){return x===45&&s===2?(e.consume(x),q):x===60&&s===1?(e.consume(x),W):x===62&&s===4?(e.consume(x),le):x===63&&s===3?(e.consume(x),f):x===93&&s===5?(e.consume(x),me):H(x)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(yd,Pe,V)(x)):x===null||H(x)?(e.exit("htmlFlowData"),V(x)):(e.consume(x),E)}function V(x){return e.check(wd,F,Pe)(x)}function F(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),P}function P(x){return x===null||H(x)?V(x):(e.enter("htmlFlowData"),E(x))}function q(x){return x===45?(e.consume(x),f):E(x)}function W(x){return x===47?(e.consume(x),l="",pe):E(x)}function pe(x){if(x===62){const je=l.toLowerCase();return pa.includes(je)?(e.consume(x),le):E(x)}return nt(x)&&l.length<8?(e.consume(x),l+=String.fromCharCode(x),pe):E(x)}function me(x){return x===93?(e.consume(x),f):E(x)}function f(x){return x===62?(e.consume(x),le):x===45&&s===2?(e.consume(x),f):E(x)}function le(x){return x===null||H(x)?(e.exit("htmlFlowData"),Pe(x)):(e.consume(x),le)}function Pe(x){return e.exit("htmlFlow"),t(x)}}function kd(e,t,n){const r=this;return s;function s(l){return H(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function Nd(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Er,t,n)}}const Sd={name:"htmlText",tokenize:Cd};function Cd(e,t,n){const r=this;let s,a,l;return o;function o(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),D):f===63?(e.consume(f),_):nt(f)?(e.consume(f),L):n(f)}function c(f){return f===45?(e.consume(f),d):f===91?(e.consume(f),a=0,y):nt(f)?(e.consume(f),N):n(f)}function d(f){return f===45?(e.consume(f),h):n(f)}function p(f){return f===null?n(f):f===45?(e.consume(f),m):H(f)?(l=p,W(f)):(e.consume(f),p)}function m(f){return f===45?(e.consume(f),h):p(f)}function h(f){return f===62?q(f):f===45?m(f):p(f)}function y(f){const le="CDATA[";return f===le.charCodeAt(a++)?(e.consume(f),a===le.length?w:y):n(f)}function w(f){return f===null?n(f):f===93?(e.consume(f),v):H(f)?(l=w,W(f)):(e.consume(f),w)}function v(f){return f===93?(e.consume(f),b):w(f)}function b(f){return f===62?q(f):f===93?(e.consume(f),b):w(f)}function N(f){return f===null||f===62?q(f):H(f)?(l=N,W(f)):(e.consume(f),N)}function _(f){return f===null?n(f):f===63?(e.consume(f),S):H(f)?(l=_,W(f)):(e.consume(f),_)}function S(f){return f===62?q(f):_(f)}function D(f){return nt(f)?(e.consume(f),j):n(f)}function j(f){return f===45||ze(f)?(e.consume(f),j):B(f)}function B(f){return H(f)?(l=B,W(f)):ee(f)?(e.consume(f),B):q(f)}function L(f){return f===45||ze(f)?(e.consume(f),L):f===47||f===62||Le(f)?C(f):n(f)}function C(f){return f===47?(e.consume(f),q):f===58||f===95||nt(f)?(e.consume(f),O):H(f)?(l=C,W(f)):ee(f)?(e.consume(f),C):q(f)}function O(f){return f===45||f===46||f===58||f===95||ze(f)?(e.consume(f),O):T(f)}function T(f){return f===61?(e.consume(f),E):H(f)?(l=T,W(f)):ee(f)?(e.consume(f),T):C(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,V):H(f)?(l=E,W(f)):ee(f)?(e.consume(f),E):(e.consume(f),F)}function V(f){return f===s?(e.consume(f),s=void 0,P):f===null?n(f):H(f)?(l=V,W(f)):(e.consume(f),V)}function F(f){return f===null||f===34||f===39||f===60||f===61||f===96?n(f):f===47||f===62||Le(f)?C(f):(e.consume(f),F)}function P(f){return f===47||f===62||Le(f)?C(f):n(f)}function q(f){return f===62?(e.consume(f),e.exit("htmlTextData"),e.exit("htmlText"),t):n(f)}function W(f){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),pe}function pe(f){return ee(f)?oe(e,me,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):me(f)}function me(f){return e.enter("htmlTextData"),l(f)}}const Qi={name:"labelEnd",resolveAll:Rd,resolveTo:Id,tokenize:Td},_d={tokenize:Ad},Ed={tokenize:Ld},Pd={tokenize:Md};function Rd(e){let t=-1;const n=[];for(;++t=3&&(c===null||H(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===s?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),ee(c)?oe(e,o,"whitespace")(c):o(c))}}const Ie={continuation:{tokenize:Kd},exit:Vd,name:"list",tokenize:Hd},Ud={partial:!0,tokenize:Gd},$d={partial:!0,tokenize:Qd};function Hd(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,l=0;return o;function o(h){const y=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:vi(h)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(br,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return n(h)}function u(h){return vi(h)&&++l<10?(e.consume(h),u):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Er,r.interrupt?n:d,e.attempt(Ud,m,p))}function d(h){return r.containerState.initialBlankLine=!0,a++,m(h)}function p(h){return ee(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),m):n(h)}function m(h){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function Kd(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Er,s,a);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,oe(e,t,"listItemIndent",r.containerState.size+1)(o)}function a(o){return r.containerState.furtherBlankLines||!ee(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt($d,t,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,oe(e,e.attempt(Ie,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Qd(e,t,n){const r=this;return oe(e,s,"listItemIndent",r.containerState.size+1);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function Vd(e){e.exit(this.containerState.type)}function Gd(e,t,n){const r=this;return oe(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const l=r.events[r.events.length-1];return!ee(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const ma={name:"setextUnderline",resolveTo:Wd,tokenize:Jd};function Wd(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 l={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",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Jd(e,t,n){const r=this;let s;return a;function a(c){let d=r.events.length,p;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){p=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),s=c,l(c)):n(c)}function l(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===s?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),ee(c)?oe(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||H(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Xd={tokenize:Yd};function Yd(e){const t=this,n=e.attempt(Er,r,e.attempt(this.parser.constructs.flowInitial,s,oe(e,e.attempt(this.parser.constructs.flow,s,e.attempt(rd,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 Zd={resolveAll:Kl()},eh=Hl("string"),th=Hl("text");function Hl(e){return{resolveAll:Kl(e==="text"?nh:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,l,o);return l;function l(d){return c(d)?a(d):o(d)}function o(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 p=s[d];let m=-1;if(p)for(;++m-1){const o=l[0];typeof o=="string"?l[0]=o.slice(r):l.shift()}a>0&&l.push(e[s].slice(0,a))}return l}function fh(e,t){let n=-1;const r=[];let s;for(;++n0){const Re=$.tokenStack[$.tokenStack.length-1];(Re[1]||xa).call($,void 0,Re[0])}for(I.position={start:bt(k.length>0?k[0][1].start:{line:1,column:1,offset:0}),end:bt(k.length>0?k[k.length-2][1].end:{line:1,column:1,offset:0})},te=-1;++te0&&(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 Ph(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rh(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ih(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=gn(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,o+=1,e.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function Th(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 Ah(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Gl(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 l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function Lh(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gl(e,t);const s={src:gn(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 Mh(e,t){const n={src:gn(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 Oh(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 Dh(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gl(e,t);const s={href:gn(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 Fh(e,t){const n={href:gn(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 zh(e,t,n){const r=e.all(t),s=n?Bh(n):Wl(t),a={},l=[];if(typeof t.checked=="boolean"){const d=r[0];let p;d&&d.type==="element"&&d.tagName==="p"?p=d:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o1}function qh(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 l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Bi(t.children[1]),u=Pl(t.children[t.children.length-1]);o&&u&&(l.position={start:o,end:u}),s.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function Qh(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,o=l?l.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(ya(t.slice(s),s>0,!1)),a.join("")}function ya(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===ga||a===ba;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===ga||a===ba;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function Wh(e,t){const n={type:"text",value:Gh(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Jh(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Xh={blockquote:Ch,break:_h,code:Eh,delete:Ph,emphasis:Rh,footnoteReference:Ih,heading:Th,html:Ah,imageReference:Lh,image:Mh,inlineCode:Oh,linkReference:Dh,link:Fh,listItem:zh,list:qh,paragraph:Uh,root:$h,strong:Hh,table:Kh,tableCell:Vh,tableRow:Qh,text:Wh,thematicBreak:Jh,toml:hr,yaml:hr,definition:hr,footnoteDefinition:hr};function hr(){}const Jl=-1,Pr=0,Ln=1,jr=2,Vi=3,Gi=4,Wi=5,Ji=6,Xl=7,Yl=8,Yh=typeof self=="object"?self:globalThis,wa=(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 Yh[e](t)},Zh=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,l]=t[s];switch(a){case Pr:case Jl:return n(l,s);case Ln:{const o=n([],s);for(const u of l)o.push(r(u));return o}case jr:{const o=n({},s);for(const[u,c]of l)o[r(u)]=r(c);return o}case Vi:return n(new Date(l),s);case Gi:{const{source:o,flags:u}=l;return n(new RegExp(o,u),s)}case Wi:{const o=n(new Map,s);for(const[u,c]of l)o.set(r(u),r(c));return o}case Ji:{const o=n(new Set,s);for(const u of l)o.add(r(u));return o}case Xl:{const{name:o,message:u}=l;return n(wa(o,u),s)}case Yl:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:o}=new Uint8Array(l);return n(new DataView(o),l)}}return n(wa(a,l),s)};return r},va=e=>Zh(new Map,e)(0),Jt="",{toString:ep}={},{keys:tp}=Object,Cn=e=>{const t=typeof e;if(t!=="object"||!e)return[Pr,t];const n=ep.call(e).slice(8,-1);switch(n){case"Array":return[Ln,Jt];case"Object":return[jr,Jt];case"Date":return[Vi,Jt];case"RegExp":return[Gi,Jt];case"Map":return[Wi,Jt];case"Set":return[Ji,Jt];case"DataView":return[Ln,n]}return n.includes("Array")?[Ln,n]:n.includes("Error")?[Xl,n]:[jr,n]},pr=([e,t])=>e===Pr&&(t==="function"||t==="symbol"),np=(e,t,n,r)=>{const s=(l,o)=>{const u=r.push(l)-1;return n.set(o,u),u},a=l=>{if(n.has(l))return n.get(l);let[o,u]=Cn(l);switch(o){case Pr:{let d=l;switch(u){case"bigint":o=Yl,d=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return s([Jl],l)}return s([o,d],l)}case Ln:{if(u){let m=l;return u==="DataView"?m=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(l)),s([u,[...m]],l)}const d=[],p=s([o,d],l);for(const m of l)d.push(a(m));return p}case jr:{if(u)switch(u){case"BigInt":return s([u,l.toString()],l);case"Boolean":case"Number":case"String":return s([u,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const d=[],p=s([o,d],l);for(const m of tp(l))(e||!pr(Cn(l[m])))&&d.push([a(m),a(l[m])]);return p}case Vi:return s([o,l.toISOString()],l);case Gi:{const{source:d,flags:p}=l;return s([o,{source:d,flags:p}],l)}case Wi:{const d=[],p=s([o,d],l);for(const[m,h]of l)(e||!(pr(Cn(m))||pr(Cn(h))))&&d.push([a(m),a(h)]);return p}case Ji:{const d=[],p=s([o,d],l);for(const m of l)(e||!pr(Cn(m)))&&d.push(a(m));return p}}const{message:c}=l;return s([o,{name:u,message:c}],l)};return a},ja=(e,{json:t,lossy:n}={})=>{const r=[];return np(!(t||n),!!t,new Map,r)(e),r},kr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?va(ja(e,t)):structuredClone(e):(e,t)=>va(ja(e,t));function rp(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 ip(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function sp(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||rp,r=e.options.footnoteBackLabel||ip,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u0&&y.push({type:"text",value:" "});let N=typeof n=="string"?n:n(u,h);typeof N=="string"&&(N={type:"text",value:N}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,h),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const N=v.children[v.children.length-1];N&&N.type==="text"?N.value+=" ":v.children.push({type:"text",value:" "}),v.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),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...kr(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` -`}]}}const Zl=(function(e){if(e==null)return up;if(typeof e=="function")return Rr(e);if(typeof e=="object")return Array.isArray(e)?ap(e):lp(e);if(typeof e=="string")return op(e);throw new Error("Expected function, string, or object as test")});function ap(e){const t=[];let n=-1;for(;++n":""))+")"})}return m;function m(){let h=eo,y,w,v;if((!t||a(u,c,d[d.length-1]||void 0))&&(h=mp(n(u,d)),h[0]===ka))return h;if("children"in u&&u.children){const b=u;if(b.children&&h[0]!==hp)for(w=(r?b.children.length:-1)+l,v=d.concat(b);w>-1&&w0&&n.push({type:"text",value:` -`}),n}function Na(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Sa(e,t){const n=xp(e,t),r=n.one(e,void 0),s=sp(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:` -`},s),a}function vp(e,t){return e&&"run"in e?async function(n,r){const s=Sa(n,{file:r,...t});await e.run(s,r)}:function(n,r){return Sa(n,{file:r,...e||t})}}function Ca(e){if(e)throw e}var Hr,_a;function jp(){if(_a)return Hr;_a=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"),p=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!p)return!1;var m;for(m in c);return typeof m>"u"||e.call(c,m)},l=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},o=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return Hr=function u(){var c,d,p,m,h,y,w=arguments[0],v=1,b=arguments.length,N=!1;for(typeof w=="boolean"&&(N=w,w=arguments[1]||{},v=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});vl.length;let u;o&&l.push(s);try{u=e.apply(this,l)}catch(c){const d=c;if(o&&n)throw d;return s(d)}o||(u&&u.then&&typeof u.then=="function"?u.then(a,s):u instanceof Error?s(u):a(u))}function s(l,...o){n||(n=!0,t(l,...o))}function a(l){s(null,l)}}const Ye={basename:Cp,dirname:_p,extname:Ep,join:Pp,sep:"/"};function Cp(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');rr(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 l=-1,o=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else l<0&&(a=!0,l=s+1),o>-1&&(e.codePointAt(s)===t.codePointAt(o--)?o<0&&(r=s):(o=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function _p(e){if(rr(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 Ep(e){rr(e);let t=e.length,n=-1,r=0,s=-1,a=0,l;for(;t--;){const o=e.codePointAt(t);if(o===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),o===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 Pp(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Ip(e,t){let n="",r=0,s=-1,a=0,l=-1,o,u;for(;++l<=e.length;){if(l2){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=l,a=0;continue}}else if(n.length>0){n="",r=0,s=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),r=l-s-1;s=l,a=0}else o===46&&a>-1?a++:a=-1}return n}function rr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Tp={cwd:Ap};function Ap(){return"/"}function Si(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Lp(e){if(typeof e=="string")e=new URL(e);else if(!Si(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 Mp(e)}function Mp(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[h,...y]=d;const w=r[m][1];Ni(w)&&Ni(h)&&(h=Kr(!0,w,h)),r[m]=[c,h,...y]}}}}const zp=new Xi().freeze();function Wr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Jr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Xr(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 Pa(e){if(!Ni(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ra(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function mr(e){return Bp(e)?e:new no(e)}function Bp(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function qp(e){return typeof e=="string"||Up(e)}function Up(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $p="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ia=[],Ta={allowDangerousHtml:!0},Hp=/^(https?|ircs?|mailto|xmpp)$/i,Kp=[{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 Qp(e){const t=Vp(e),n=Gp(e);return Wp(t.runSync(t.parse(n),n),e)}function Vp(e){const t=e.rehypePlugins||Ia,n=e.remarkPlugins||Ia,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ta}:Ta;return zp().use(Sh).use(n).use(vp,r).use(t)}function Gp(e){const t=e.children||"",n=new no;return typeof t=="string"&&(n.value=t),n}function Wp(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,l=t.skipHtml,o=t.unwrapDisallowed,u=t.urlTransform||Jp;for(const d of Kp)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+$p+d.id,void 0);return to(e,c),ic(e,{Fragment:i.Fragment,components:s,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function c(d,p,m){if(d.type==="raw"&&m&&typeof p=="number")return l?m.children.splice(p,1):m.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let h;for(h in qr)if(Object.hasOwn(qr,h)&&Object.hasOwn(d.properties,h)){const y=d.properties[h],w=qr[h];(w===null||w.includes(d.tagName))&&(d.properties[h]=u(String(y||""),h,d))}}if(d.type==="element"){let h=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!h&&r&&typeof p=="number"&&(h=!r(d,p,m)),h&&m&&typeof p=="number")return o&&d.children?m.children.splice(p,1,...d.children):m.children.splice(p,1),p}}}function Jp(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||Hp.test(e.slice(0,t))?e:""}const Yi="-",Xp=e=>{const t=Zp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const o=l.split(Yi);return o[0]===""&&o.length!==1&&o.shift(),ro(o,t)||Yp(l)},getConflictingClassGroupIds:(l,o)=>{const u=n[l]||[];return o&&r[l]?[...u,...r[l]]:u}}},ro=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?ro(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(Yi);return(l=t.validators.find(({validator:o})=>o(a)))==null?void 0:l.classGroupId},Aa=/^\[(.+)\]$/,Yp=e=>{if(Aa.test(e)){const t=Aa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Zp=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return tm(Object.entries(e.classGroups),n).forEach(([a,l])=>{Ci(l,r,a,t)}),r},Ci=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:La(t,s);a.classGroupId=n;return}if(typeof s=="function"){if(em(s)){Ci(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([a,l])=>{Ci(l,La(t,a),n,r)})})},La=(e,t)=>{let n=e;return t.split(Yi).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},em=e=>e.isThemeGetter,tm=(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(([l,o])=>[t+l,o])):a);return[n,s]}):e,nm=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(a,l)=>{n.set(a,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let l=n.get(a);if(l!==void 0)return l;if((l=r.get(a))!==void 0)return s(a,l),l},set(a,l){n.has(a)?n.set(a,l):s(a,l)}}},io="!",rm=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],a=t.length,l=o=>{const u=[];let c=0,d=0,p;for(let v=0;vd?p-d:void 0;return{modifiers:u,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:w}};return n?o=>n({className:o,parseClassName:l}):l},im=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},sm=e=>({cache:nm(e.cacheSize),parseClassName:rm(e),...Xp(e)}),am=/\s+/,lm=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,a=[],l=e.trim().split(am);let o="";for(let u=l.length-1;u>=0;u-=1){const c=l[u],{modifiers:d,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:h}=n(c);let y=!!h,w=r(y?m.substring(0,h):m);if(!w){if(!y){o=c+(o.length>0?" "+o:o);continue}if(w=r(m),!w){o=c+(o.length>0?" "+o:o);continue}y=!1}const v=im(d).join(":"),b=p?v+io:v,N=b+w;if(a.includes(N))continue;a.push(N);const _=s(w,y);for(let S=0;S<_.length;++S){const D=_[S];a.push(b+D)}o=c+(o.length>0?" "+o:o)}return o};function om(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rp(d),e());return n=sm(c),r=n.cache.get,s=n.cache.set,a=o,o(u)}function o(u){const c=r(u);if(c)return c;const d=lm(u,n);return s(u,d),d}return function(){return a(om.apply(null,arguments))}}const ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ao=/^\[(?:([a-z-]+):)?(.+)\]$/i,cm=/^\d+\/\d+$/,dm=new Set(["px","full","screen"]),hm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pm=/\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$/,mm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ot=e=>Yt(e)||dm.has(e)||cm.test(e),yt=e=>bn(e,"length",Nm),Yt=e=>!!e&&!Number.isNaN(Number(e)),Yr=e=>bn(e,"number",Yt),_n=e=>!!e&&Number.isInteger(Number(e)),gm=e=>e.endsWith("%")&&Yt(e.slice(0,-1)),G=e=>ao.test(e),wt=e=>hm.test(e),bm=new Set(["length","size","percentage"]),ym=e=>bn(e,bm,lo),wm=e=>bn(e,"position",lo),vm=new Set(["image","url"]),jm=e=>bn(e,vm,Cm),km=e=>bn(e,"",Sm),En=()=>!0,bn=(e,t,n)=>{const r=ao.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Nm=e=>pm.test(e)&&!mm.test(e),lo=()=>!1,Sm=e=>fm.test(e),Cm=e=>xm.test(e),_m=()=>{const e=ue("colors"),t=ue("spacing"),n=ue("blur"),r=ue("brightness"),s=ue("borderColor"),a=ue("borderRadius"),l=ue("borderSpacing"),o=ue("borderWidth"),u=ue("contrast"),c=ue("grayscale"),d=ue("hueRotate"),p=ue("invert"),m=ue("gap"),h=ue("gradientColorStops"),y=ue("gradientColorStopPositions"),w=ue("inset"),v=ue("margin"),b=ue("opacity"),N=ue("padding"),_=ue("saturate"),S=ue("scale"),D=ue("sepia"),j=ue("skew"),B=ue("space"),L=ue("translate"),C=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",G,t],E=()=>[G,t],V=()=>["",ot,yt],F=()=>["auto",Yt,G],P=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>["start","end","center","between","around","evenly","stretch"],me=()=>["","0",G],f=()=>["auto","avoid","all","avoid-page","page","left","right","column"],le=()=>[Yt,G];return{cacheSize:500,separator:":",theme:{colors:[En],spacing:[ot,yt],blur:["none","",wt,G],brightness:le(),borderColor:[e],borderRadius:["none","","full",wt,G],borderSpacing:E(),borderWidth:V(),contrast:le(),grayscale:me(),hueRotate:le(),invert:me(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[gm,yt],inset:T(),margin:T(),opacity:le(),padding:E(),saturate:le(),scale:le(),sepia:me(),skew:le(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",G]}],container:["container"],columns:[{columns:[wt]}],"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:[...P(),G]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],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",_n,G]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",G]}],grow:[{grow:me()}],shrink:[{shrink:me()}],order:[{order:["first","last","none",_n,G]}],"grid-cols":[{"grid-cols":[En]}],"col-start-end":[{col:["auto",{span:["full",_n,G]},G]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[En]}],"row-start-end":[{row:["auto",{span:[_n,G]},G]}],"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",G]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",G]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...pe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...pe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...pe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"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",G,t]}],"min-w":[{"min-w":[G,t,"min","max","fit"]}],"max-w":[{"max-w":[G,t,"none","full","min","max","fit","prose",{screen:[wt]},wt]}],h:[{h:[G,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[G,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[G,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[G,t,"auto","min","max","fit"]}],"font-size":[{text:["base",wt,yt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yr]}],"font-family":[{font:[En]}],"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",G]}],"line-clamp":[{"line-clamp":["none",Yt,Yr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ot,G]}],"list-image":[{"list-image":["none",G]}],"list-style-type":[{list:["none","disc","decimal",G]}],"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:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ot,yt]}],"underline-offset":[{"underline-offset":["auto",ot,G]}],"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",G]}],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",G]}],"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:[...P(),wm]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ym]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jm]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...q(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:q()}],"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:["",...q()]}],"outline-offset":[{"outline-offset":[ot,G]}],"outline-w":[{outline:[ot,yt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[ot,yt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",wt,km]}],"shadow-color":[{shadow:[En]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",wt,G]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[p]}],saturate:[{saturate:[_]}],sepia:[{sepia:[D]}],"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":[p]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",G]}],duration:[{duration:le()}],ease:[{ease:["linear","in","out","in-out",G]}],delay:[{delay:le()}],animate:[{animate:["none","spin","ping","pulse","bounce",G]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[_n,G]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",G]}],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",G]}],"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",G]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ot,yt,Yr]}],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"]}}},Em=um(_m),_i={status:"",repo:"",thread:"",action:"",intent:"",actor:""},Pm=new au({defaultOptions:{queries:{retry:1}}}),Ma=12,Rm=12,Im=10080*60*1e3,Tm=1e3,oo=Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function Q(...e){return Em(_o(e))}async function ne(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 Ke(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 Am=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}),Lm=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});function ir(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Mm(e){const t=ir(e);return t?Am.format(t):e??""}function Mn(e){const t=ir(e);return t?Lm.format(t):e??""}function uo(e,t){const n=ir(e);if(!n)return e??"";const r=t-n.getTime(),s=Math.abs(r);if(s>Im)return Mn(e);const a=r>=0?"ago":"from now",l=Math.round(s/1e3);if(l<45)return r>=0?"just now":"soon";if(l<90)return`1m ${a}`;const o=Math.round(l/60);if(o<60)return`${o}m ${a}`;if(o<90)return`1h ${a}`;const u=Math.round(o/60);return u<24?`${u}h ${a}`:u<36?`1d ${a}`:`${Math.round(u/24)}d ${a}`}function Ee({value:e,compact:t=!1,relative:n=!1,now:r=Date.now()}){const s=ir(e);return s?i.jsx("time",{dateTime:s.toISOString(),title:`UTC: ${s.toISOString()}`,children:n?uo(e,r):t?Mn(e):Mm(e)}):i.jsx(i.Fragment,{children:e??""})}function co(e,t){const n=ir(e);return n?Math.max(0,Math.floor((t-n.getTime())/1e3)):null}function Zi(e,t){return e.status==="running"?co(e.started_at,t)??e.runtime_seconds:e.runtime_seconds}function es(e,t){return e.status==="pending"?co(e.created_at,t)??e.queue_wait_seconds:e.queue_wait_seconds}function Om(e){const[t,n]=A.useState(()=>Date.now());return A.useEffect(()=>{if(!e)return;n(Date.now());const r=window.setInterval(()=>n(Date.now()),Tm);return()=>window.clearInterval(r)},[e]),t}function Dm(e){return(e??"").split(/\r?\n/).map(n=>n.trim()).find(Boolean)??""}function Nr(e,t,n=1){const r=Dm(t),s=n>1?` (${n})`:"";return r?`${e}${s}: ${r}`:`${e}${s}`}function Sr(e){return e==="openclaw_stdout"||e==="openclaw_stderr"}function ho(e){return e.map(t=>t==null?void 0:t.trim()).filter(Boolean).join(` -`)}function Fm(e){const t=[];for(const n of e){const r=t[t.length-1];if(r&&Sr(n.event_type)&&r.eventType===n.event_type){r.count+=1,r.meta=n.ts,r.detail=ho([r.detail,n.detail]),r.summary=Nr(n.summary,r.detail,r.count);continue}t.push({id:String(n.id),badge:n.event_type,meta:n.ts,summary:Sr(n.event_type)?Nr(n.summary,n.detail):n.summary,detail:n.detail,eventType:n.event_type,count:1})}return t}function zm(e){const t=[];return e.forEach((n,r)=>{const s=t[t.length-1];if(s&&Sr(n.kind)&&s.kind===n.kind){s.count+=1,s.meta=n.timestamp,s.text=ho([s.text,n.text]),s.summary=Nr(`${n.role} · ${n.kind}`,s.text,s.count);return}t.push({id:`${n.timestamp??"entry"}-${r}`,badge:n.title,meta:n.timestamp,summary:Sr(n.kind)?Nr(`${n.role} · ${n.kind}`,n.text):`${n.role} · ${n.kind}`,text:n.text,kind:n.kind,count:1})}),t}function Oa(e,t,n,r){return e==="openclaw_stdout"?!1:t||n>=r-2}function Bm(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 qm(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 Um(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 $m(e=oo){return`/api/metrics/summary?timezone=${encodeURIComponent(e)}`}function it(e){try{const t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"?t.href:"#"}catch{return"#"}}function yr(){return"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}function Hm(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="github-agent-bridge:push")}function Km(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 Vm(e,t){const n=Da(t);return e.some(r=>Da(r)===n)?e:[...e,t]}function Da(e){return`${e.timestamp??""}:${e.role}:${e.kind}:${e.title}:${e.text}`}function Gm(e){return["claimed","dispatch_started","dispatch_finished","done","blocked","denied","waiting_approval"].includes(e)}function In(e){return["blocked","denied","waiting_approval"].includes(e)}function Ei(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 Wm(e=window.location.pathname){const t=e.match(/^\/jobs\/(\d+)\/?$/);return t?Number(t[1]):null}function Jm(e=window.location.pathname){return/^\/knowledge\/?$/.test(e)}function Xm(e=window.location.pathname){return/^\/mcp\/?$/.test(e)}function Ym(e=window.location.pathname){return/^\/system\/?$/.test(e)}function Zm(e=window.location.pathname){return/^\/webhooks\/?$/.test(e)}function po(e){return e.startsWith("repo:")?e.slice(5):e}function Fa(e){return Object.values(e).some(t=>t.trim()!=="")}function ef(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 tf(){var te,Re,Je,Be,ft,xt,ke,lt,qe,rs,is,ss,as,ls,os,us,cs,ds,hs,ps,ms,fs,xs,gs,bs,ys,ws,vs,js,ks,Ns,Ss,Cs,_s,Es,Ps,Rs,Is,Ts;const e=ml(),[t,n]=A.useState(_i),[r,s]=A.useState(Ma),a=A.useRef(!1),[l,o]=A.useState(""),[u,c]=A.useState("proposed"),[d,p]=A.useState(null),[m,h]=A.useState(""),[y,w]=A.useState(()=>window.location.pathname),[v,b]=A.useState(null),N=Wm(y),_=N!==null,S=Jm(y),D=Xm(y),j=Ym(y),B=Zm(y),L=!_&&!S&&!D&&!j&&!B,C=N,O=ge({queryKey:["metrics",oo],queryFn:()=>ne($m()),enabled:L||j}),T=ge({queryKey:["dashboard-status"],queryFn:()=>ne("/api/status")}),E=ge({queryKey:["me"],queryFn:()=>ne("/api/me"),refetchInterval:!1}),V=ge({queryKey:["web-push-config"],queryFn:()=>ne("/api/web-push/config"),enabled:!!((te=E.data)!=null&&te.user)}),F=ge({queryKey:["about"],queryFn:()=>ne("/api/about")}),P=ge({queryKey:["job-actors"],queryFn:()=>ne("/api/jobs/actors"),enabled:L}),q=ge({queryKey:["jobs",t,r],queryFn:()=>ne(qm(t,r)),enabled:L,placeholderData:z=>z}),W=ge({queryKey:["processes"],queryFn:()=>ne("/api/processes"),enabled:j}),pe=ge({queryKey:["systemd"],queryFn:()=>ne("/api/systemd"),enabled:j}),me=ge({queryKey:["alerts"],queryFn:()=>ne("/api/alerts"),enabled:j}),f=ge({queryKey:["webhook-status"],queryFn:()=>ne("/api/webhooks/github/status"),enabled:B&&!!((Je=(Re=E.data)==null?void 0:Re.user)!=null&&Je.is_admin&&((Be=T.data)!=null&&Be.webhook_configured))}),le=ge({queryKey:["knowledge",l,u],queryFn:()=>ne(Um(l,u)),enabled:S}),Pe=ge({queryKey:["mcp-tokens"],queryFn:()=>ne("/api/mcp/tokens"),enabled:D&&!!((ft=E.data)!=null&&ft.user)}),x=ge({queryKey:["mcp-users"],queryFn:()=>ne("/api/mcp/users"),enabled:D&&!!((xt=E.data)!=null&&xt.user)}),je=ge({queryKey:["job",C],queryFn:()=>ne(`/api/jobs/${C}`),enabled:C!==null}),We=ge({queryKey:["job-session",C],queryFn:()=>ne(`/api/jobs/${C}/session`),enabled:C!==null}),fe=ge({queryKey:["job-session-events",C],queryFn:()=>ne(`/api/jobs/${C}/session/events`),enabled:C!==null}),pt=ge({queryKey:["job-session-transcript",C],queryFn:()=>ne(`/api/jobs/${C}/session/transcript`),enabled:C!==null}),Qe=A.useCallback(async z=>{const ie=await ne(`/api/jobs/${z}/retry`,{method:"POST"});e.setQueryData(["job",z],{job:ie.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]})},[e]),st=A.useCallback(async z=>{const ie=await ne(`/api/jobs/${z}/dismiss`,{method:"POST"});e.setQueryData(["job",z],{job:ie.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]})},[e]),at=A.useCallback(async(z,ie)=>{const ce=await ne(`/api/jobs/${z}/cancel`,{method:"POST",body:JSON.stringify({reason:ie||""})});e.setQueryData(["job",z],{job:ce.job}),e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["metrics"]}),e.invalidateQueries({queryKey:["dashboard-status"]})},[e]),Tt=A.useCallback(async(z,ie)=>{await ne(`/api/knowledge/proposals/${encodeURIComponent(z)}/${ie}`,{method:"POST"}),e.invalidateQueries({queryKey:["knowledge"]}),e.invalidateQueries({queryKey:["dashboard-status"]})},[e]),Ir=A.useCallback(async z=>{await ne(`/api/knowledge/rules/${encodeURIComponent(z)}`,{method:"DELETE"}),e.invalidateQueries({queryKey:["knowledge"]})},[e]),Tr=A.useCallback(async(z,ie)=>{await ne(`/api/knowledge/rules/${encodeURIComponent(z)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:ie})}),e.invalidateQueries({queryKey:["knowledge"]})},[e]),Ar=A.useCallback(async(z,ie)=>{const ce=await ne("/api/mcp/tokens",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:z,user_login:ie||void 0})});return e.invalidateQueries({queryKey:["mcp-tokens"]}),ce},[e]),sr=A.useCallback(async(z,ie)=>{await ne(`/api/mcp/tokens/${encodeURIComponent(z)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_login:ie})}),e.invalidateQueries({queryKey:["mcp-tokens"]}),e.invalidateQueries({queryKey:["mcp-users"]})},[e]),ar=A.useCallback(async z=>{await ne(`/api/mcp/tokens/${encodeURIComponent(z)}`,{method:"DELETE"}),e.invalidateQueries({queryKey:["mcp-tokens"]})},[e]),Vt=A.useCallback(async z=>{const ie={refresh:"/api/autoupdate/refresh",apply:"/api/autoupdate/apply",complete:"/api/autoupdate/complete-pending"}[z];p(z),h("");try{await ne(ie,{method:"POST"}),e.invalidateQueries({queryKey:["dashboard-status"]})}catch(ce){e.invalidateQueries({queryKey:["dashboard-status"]}),h(ce instanceof Error?ce.message:String(ce))}finally{p(null)}},[e]),Lr=A.useCallback(async()=>{var As;const z=(As=V.data)==null?void 0:As.public_key;if(!z)throw new Error("web_push_not_configured");if(!yr())throw new Error("web_push_not_supported");if(await window.Notification.requestPermission()!=="granted")throw new Error("notification_permission_denied");const ce=await navigator.serviceWorker.register("/service-worker.js"),No=await ce.pushManager.getSubscription()??await ce.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Km(z)});await ne("/api/web-push/subscriptions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(No.toJSON())}),e.invalidateQueries({queryKey:["web-push-config"]})},[e,(ke=V.data)==null?void 0:ke.public_key]),lr=A.useCallback(async()=>{if(!yr())return;const ie=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(!ie)return;const ce=ie.endpoint;await ie.unsubscribe(),await ne("/api/web-push/subscriptions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:ce})}),e.invalidateQueries({queryKey:["web-push-config"]})},[e]);A.useEffect(()=>{var z;!((z=V.data)!=null&&z.status.enabled)||!yr()||navigator.serviceWorker.register("/service-worker.js").catch(()=>{})},[(lt=V.data)==null?void 0:lt.status.enabled]),A.useEffect(()=>{if(C===null)return;const z=new EventSource(`/api/jobs/${C}/session/stream`);return z.addEventListener("session_event",ie=>{const ce=Cr(ie);ce&&(e.setQueryData(["job-session-events",C],gt=>({events:Qm((gt==null?void 0:gt.events)??[],ce)})),Gm(ce.event_type)&&(e.invalidateQueries({queryKey:["job",C]}),e.invalidateQueries({queryKey:["jobs"]})))}),z.addEventListener("transcript_entry",ie=>{const ce=Cr(ie);!ce||ce.job_id!==C||e.setQueryData(["job-session-transcript",C],gt=>({entries:Vm((gt==null?void 0:gt.entries)??[],ce.entry)}))}),z.onerror=()=>{e.invalidateQueries({queryKey:["job",C]}),e.invalidateQueries({queryKey:["job-session-events",C]}),e.invalidateQueries({queryKey:["job-session-transcript",C]})},()=>z.close()},[C,e]),A.useEffect(()=>{const z=()=>{w(window.location.pathname)};return window.addEventListener("popstate",z),()=>window.removeEventListener("popstate",z)},[]),A.useEffect(()=>{if(!("serviceWorker"in navigator))return;const z=ie=>{if(!Hm(ie.data))return;const ce={...ie.data.payload,id:Date.now(),receivedAt:Date.now()};b(ce),ce.job_id&&(e.invalidateQueries({queryKey:["jobs"]}),e.invalidateQueries({queryKey:["job",ce.job_id]}),e.invalidateQueries({queryKey:["metrics"]}))};return navigator.serviceWorker.addEventListener("message",z),()=>navigator.serviceWorker.removeEventListener("message",z)},[e]),A.useEffect(()=>{if(!v)return;const z=window.setTimeout(()=>b(null),12e3);return()=>window.clearTimeout(z)},[v]);const or=A.useCallback(z=>{window.history.pushState({},"",yn(z)),w(window.location.pathname)},[]),vn=A.useCallback(z=>{window.history.pushState({},"",z),w(window.location.pathname)},[]),mt=((qe=O.data)==null?void 0:qe.metrics.status_counts)??{},Gt=((rs=q.data)==null?void 0:rs.jobs)??[],Mr=A.useCallback(z=>{n(z),s(Ma),a.current=!1},[]);A.useEffect(()=>{q.isFetching||(a.current=!1)},[q.isFetching]);const Or=A.useCallback(()=>{a.current||(a.current=!0,s(z=>z+Rm))},[]),k=C?((is=je.data)==null?void 0:is.job)??null:null,I=Gt.some(z=>z.status==="running"||z.status==="pending")||(k==null?void 0:k.status)==="running"||(k==null?void 0:k.status)==="pending"||!!((ss=W.data)!=null&&ss.running_jobs.length),$=Om(I),J=i.jsx(pf,{selectedJobId:C,selectedJob:k,loading:je.isLoading,error:je.error,session:(as=We.data)==null?void 0:as.session,sessionEvents:(ls=fe.data)==null?void 0:ls.events,transcript:(os=pt.data)==null?void 0:os.entries,now:$});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(nf,{about:F.data})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[i.jsx(Sf,{config:V.data,loading:V.isLoading,onEnable:Lr,onDisable:lr}),i.jsx(Nf,{user:(us=E.data)==null?void 0:us.user,loading:E.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(uf,{isDashboardRoute:L,isSystemRoute:j,isKnowledgeRoute:S,isMcpRoute:D,isWebhooksRoute:B,showWebhooks:!!((ds=(cs=E.data)==null?void 0:cs.user)!=null&&ds.is_admin&&((hs=T.data)!=null&&hs.webhook_configured)),knowledgeBadgeCount:((fs=(ms=(ps=T.data)==null?void 0:ps.metrics)==null?void 0:ms.knowledge)==null?void 0:fs.proposed)??0,onNavigate:vn}),i.jsx(Cf,{notification:v,onDismiss:()=>b(null),onNavigate:vn}),N!==null?i.jsx(hf,{jobId:N,detail:J,selectedJob:k,user:(xs=E.data)==null?void 0:xs.user,onBackToDashboard:()=>vn("/"),onRetry:Qe,onDismiss:st,onCancel:at,onRefresh:()=>{je.refetch(),We.refetch(),fe.refetch(),pt.refetch()}}):S?i.jsx(mf,{data:le.data,loading:le.isLoading,error:le.error,repo:l,status:u,user:(gs=E.data)==null?void 0:gs.user,now:$,onRepoChange:o,onStatusChange:c,onApprove:z=>Tt(z,"approve"),onReject:z=>Tt(z,"reject"),onUpdateRuleScope:Tr,onDeleteRule:Ir,onRefresh:()=>le.refetch()}):D?i.jsx(wf,{tokens:(bs=Pe.data)==null?void 0:bs.tokens,loading:Pe.isLoading,error:Pe.error,user:(ys=E.data)==null?void 0:ys.user,ownerOptions:((ws=x.data)==null?void 0:ws.users)??[],dashboardUrl:(vs=T.data)==null?void 0:vs.dashboard_url,dashboardUrlSource:(js=T.data)==null?void 0:js.dashboard_url_source,now:$,onCreate:Ar,onUpdateOwner:sr,onRevoke:ar,onRefresh:()=>Pe.refetch()}):B?i.jsx(cf,{status:f.data,loading:f.isLoading,error:f.error,onRefresh:()=>f.refetch()}):j?i.jsx(df,{processes:W.data,processesLoading:W.isLoading,processesError:W.error,systemd:pe.data,systemdLoading:pe.isLoading,systemdError:pe.error,alerts:(ks=me.data)==null?void 0:ks.alerts,alertsLoading:me.isLoading,alertsError:me.error,now:$,onRefreshProcesses:()=>W.refetch(),onRefreshSystemd:()=>pe.refetch(),onRefreshAlerts:()=>me.refetch()}):i.jsxs(i.Fragment,{children:[O.error?i.jsx(Se,{tone:"error",text:O.error.message}):null,T.error?i.jsx(Se,{tone:"error",text:T.error.message}):null,i.jsx(rf,{state:(Ns=T.data)==null?void 0:Ns.autoupdate,isAdmin:!!((Cs=(Ss=E.data)==null?void 0:Ss.user)!=null&&Cs.is_admin),runningAction:d,actionError:m,onRefresh:()=>Vt("refresh"),onApply:()=>Vt("apply"),onCompletePending:()=>Vt("complete")}),i.jsxs("section",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Summary metrics",children:[i.jsx(He,{title:"Pending",value:mt.pending??0,icon:i.jsx(bl,{className:"h-5 w-5"})}),i.jsx(He,{title:"Running",value:mt.running??0,icon:i.jsx(zn,{className:"h-5 w-5"})}),i.jsx(He,{title:"Blocked",value:mt.blocked??0,icon:i.jsx(Di,{className:"h-5 w-5"})}),i.jsx(He,{title:"Done",value:mt.done??0,icon:i.jsx(fn,{className:"h-5 w-5"})})]}),i.jsxs("section",{className:"grid gap-3",children:[i.jsx(_f,{count:Gt.length,limit:r,loading:q.isLoading,onRefresh:()=>q.refetch()}),i.jsxs(ye,{title:"Recent jobs",flushHeader:!0,children:[i.jsx(Ef,{filters:t,actorOptions:((_s=P.data)==null?void 0:_s.actors)??[],onChange:Mr}),q.error?i.jsx(Se,{tone:"error",text:q.error.message}):null,i.jsx(Rf,{jobs:Gt,loading:q.isLoading,loadingMore:q.isFetching&&!q.isLoading,hasMore:Gt.length>=r,onLoadMore:Or,onViewJob:or,now:$,user:(Es=E.data)==null?void 0:Es.user,onRetry:Qe,onDismiss:st,onCancel:at})]}),i.jsx(ye,{title:"Runtime usage",action:i.jsx(ht,{onClick:()=>O.refetch()}),children:i.jsx(Hf,{usage:(Ps=O.data)==null?void 0:Ps.metrics.runtime_usage,loading:O.isLoading,totalJobs:Ua(mt)})})]}),i.jsxs("section",{className:"grid gap-4 xl:grid-cols-3",children:[i.jsx(ye,{title:"Runtime percentiles",children:i.jsx(qa,{label:"runtime",values:(Rs=O.data)==null?void 0:Rs.metrics.runtime_seconds})}),i.jsx(ye,{title:"Jobs per day",children:i.jsx($f,{values:(Is=O.data)==null?void 0:Is.metrics.by_created_day,loading:O.isLoading,totalJobs:Ua(mt)})}),i.jsx(ye,{title:"Queue wait percentiles",children:i.jsx(qa,{label:"queue wait",values:(Ts=O.data)==null?void 0:Ts.metrics.queue_wait_seconds})})]})]})]})]})}function nf({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:it(e.repository_url),rel:"noreferrer",target:"_blank",children:[i.jsx(pn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"GitHub"]}):null]})}function rf({state:e,isAdmin:t,runningAction:n=null,actionError:r="",onRefresh:s,onApply:a,onCompletePending:l}){var v,b,N,_,S,D,j,B,L,C,O;if(!e)return null;const o=(b=(v=e==null?void 0:e.target)==null?void 0:v.tag_name)==null?void 0:b.trim();if(!t||!o||(e==null?void 0:e.decision)==="noop")return null;const u=sf(e.decision),c=((N=e.queue)==null?void 0:N.active_total)??0,d=af((_=e.classification)==null?void 0:_.risk),p=lf((S=e.target)==null?void 0:S.body),m=((j=(D=e.classification)==null?void 0:D.migration_files)==null?void 0:j.length)??0,h=((L=(B=e.classification)==null?void 0:B.risky_files)==null?void 0:L.length)??0,y=!!(e.executor_reload_pending&&e.dashboard_applied_at&&l),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(Di,{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:o}),(C=e.target)!=null&&C.url?i.jsxs("a",{className:"inline-flex items-center gap-1 text-xs font-semibold text-amber-800 hover:underline",href:it(e.target.url),rel:"noreferrer",target:"_blank",children:[i.jsx(pn,{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(Oi,{className:Q("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 ${o}? This can restart bridge services according to the recorded safe plan.`)&&(a==null||a())},children:[i.jsx(fn,{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:l,children:[i.jsx(qn,{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(Zr,{label:"Impact",value:d}),i.jsx(Zr,{label:"Active jobs",value:String(c)}),i.jsx(Zr,{label:"Admin only",value:"autoupdate"})]})]}),e.blocked_reason||e.executor_reload_pending||m>0||h>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,h>0?i.jsxs("span",{className:"rounded-sm border border-amber-300 bg-white px-2 py-1",children:[h," executor/shared file",h===1?"":"s"]}):null]}):null,p?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(of,{markdown:p})]}):null,(O=e.warnings)!=null&&O.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 Zr({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 sf(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 af(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 lf(e){return(e??"").trim()}function of({markdown:e}){return i.jsx("div",{className:"mt-1 text-sm leading-relaxed text-amber-950",children:i.jsx(Qp,{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:it(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 uf({isDashboardRoute:e,isSystemRoute:t=!1,isKnowledgeRoute:n,isMcpRoute:r=!1,isWebhooksRoute:s=!1,showWebhooks:a=!1,knowledgeBadgeCount:l=0,onNavigate:o}){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(Pn,{href:"/",active:e,onNavigate:o,children:[i.jsx(vl,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"Jobs"})]}),i.jsxs(Pn,{href:"/system",active:t,onNavigate:o,children:[i.jsx(Nu,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"System"})]}),a?i.jsxs(Pn,{href:"/webhooks",active:s,onNavigate:o,children:[i.jsx(zn,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"Webhooks"})]}):null,i.jsxs(Pn,{href:"/knowledge",active:n,onNavigate:o,children:[i.jsx(Mi,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"Knowledge"}),l>0?i.jsx("span",{className:Q("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":`${l} proposed knowledge ${l===1?"item":"items"}`,children:l}):null]}),i.jsxs(Pn,{href:"/mcp",active:r,onNavigate:o,children:[i.jsx(vr,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{children:"MCP"})]})]})}function cf({status:e,loading:t,error:n,onRefresh:r}){var u,c,d,p,m;const s=Object.values((e==null?void 0:e.receipts)??{}).reduce((h,y)=>h+y,0),[a,l]=A.useState("overview"),o=[{id:"overview",label:"Overview"},{id:"hooks",label:"Hooks",count:(u=e==null?void 0:e.hooks)==null?void 0:u.length},{id:"deliveries",label:"Deliveries",count:(c=e==null?void 0:e.recent_deliveries)==null?void 0:c.length}];return i.jsxs("section",{className:"grid gap-4",children:[i.jsx(mo,{icon:i.jsx(zn,{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(ht,{onClick:r})}),n?i.jsx(Se,{tone:"error",text:n.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:o.map(h=>i.jsxs("button",{type:"button",role:"tab","aria-selected":a===h.id,className:Q("inline-flex h-8 items-center gap-2 rounded px-3 text-sm font-semibold",a===h.id?"bg-primary text-white":"text-muted hover:bg-slate-50 hover:text-foreground"),onClick:()=>l(h.id),children:[h.label,h.count!==void 0?i.jsx("span",{className:"rounded border border-current/30 px-1 font-mono text-[10px]",children:h.count}):null]},h.id))}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Webhook status",children:[i.jsx(He,{title:"Receipts",value:s,icon:i.jsx(zn,{className:"h-5 w-5"})}),i.jsx(He,{title:"Duplicates",value:(e==null?void 0:e.duplicate_deliveries)??0,icon:i.jsx(Oi,{className:"h-5 w-5"})}),i.jsx(He,{title:"Cross-source matches",value:(e==null?void 0:e.cross_source_matches)??0,icon:i.jsx(tr,{className:"h-5 w-5"})}),i.jsx(He,{title:"Mode",value:t?"…":(e==null?void 0:e.mode)??"unknown",icon:i.jsx(yl,{className:"h-5 w-5"})})]}),a==="overview"?i.jsxs(i.Fragment,{children:[i.jsx(ye,{title:"Delivery activity",children:(d=e==null?void 0:e.timeseries)!=null&&d.length?i.jsx("div",{className:"h-72","aria-label":"Webhook deliveries over time",children:i.jsx(Wn,{width:"100%",height:"100%",children:i.jsxs(_r,{data:e.timeseries,children:[i.jsx(Jn,{strokeDasharray:"3 3"}),i.jsx(Xn,{dataKey:"bucket"}),i.jsx(Yn,{allowDecimals:!1}),i.jsx(Zn,{}),i.jsx(nl,{}),i.jsx($t,{dataKey:"observed",stackId:"deliveries",fill:"#2563eb"}),i.jsx($t,{dataKey:"duplicate",stackId:"deliveries",fill:"#f59e0b"}),i.jsx($t,{dataKey:"unsupported",stackId:"deliveries",fill:"#94a3b8"})]})})}):i.jsx(Z,{text:"Time-series data is not available yet. Receipt totals remain visible below."})}),i.jsx(ye,{title:"Receipt states",children:t?i.jsx(Z,{text:"Loading webhook status..."}):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(([h],[y])=>h.localeCompare(y)).map(([h,y])=>i.jsx(he,{label:h,value:y},h))}):i.jsx(Z,{text:"No webhook deliveries observed yet."})})]}):null,a==="hooks"?i.jsx(ye,{title:"Hook inventory",children:(p=e==null?void 0:e.hooks)!=null&&p.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:"Target"}),i.jsx("th",{className:"px-3 py-2",children:"State"}),i.jsx("th",{className:"px-3 py-2",children:"Events"}),i.jsx("th",{className:"px-3 py-2",children:"Last ping"}),i.jsx("th",{className:"px-3 py-2",children:"Last delivery"})]})}),i.jsx("tbody",{children:e.hooks.map(h=>i.jsxs("tr",{className:"border-b border-border/70 last:border-0",children:[i.jsxs("td",{className:"px-3 py-3",children:[i.jsx("div",{className:"font-semibold",children:h.target}),i.jsxs("div",{className:"font-mono text-xs text-muted",children:[h.target_type," · #",h.id]})]}),i.jsx("td",{className:"px-3 py-3",children:i.jsx("span",{className:Q("rounded border px-2 py-1 text-xs font-semibold",h.status==="receiving"?"border-emerald-200 bg-emerald-50 text-emerald-700":h.status==="inactive"?"border-red-200 bg-red-50 text-red-700":"border-slate-200 bg-slate-50 text-slate-600"),children:h.status})}),i.jsx("td",{className:"max-w-xs px-3 py-3 text-xs text-muted",children:h.events.join(", ")||"All events"}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs text-muted",children:h.last_ping_at??"Never"}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs text-muted",children:h.last_event_at??"Never"})]},h.id))})]})}):i.jsx(Z,{text:"No hook inventory is available. A signed ping is required before a hook can appear here."})}):null,a==="deliveries"?i.jsx(ye,{title:"Recent deliveries",children:(m=e==null?void 0:e.recent_deliveries)!=null&&m.length?i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full min-w-[760px] 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:"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.recent_deliveries.map(h=>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:h.created_at}),i.jsxs("td",{className:"px-3 py-3 font-semibold",children:[h.event_name,h.action?` · ${h.action}`:""]}),i.jsx("td",{className:"px-3 py-3",children:h.repository??"—"}),i.jsx("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:h.status})}),i.jsx("td",{className:"max-w-[14rem] truncate px-3 py-3 font-mono text-xs text-muted",title:h.delivery_id,children:h.delivery_id})]},h.delivery_id))})]})}):i.jsx(Z,{text:"No delivery details are available for this window."})}):null]})}function df({processes:e,processesLoading:t,processesError:n,systemd:r,systemdLoading:s,systemdError:a,alerts:l,alertsLoading:o,alertsError:u,now:c,onRefreshProcesses:d,onRefreshSystemd:p,onRefreshAlerts:m}){return i.jsxs("section",{className:"grid gap-4","aria-label":"Bridge system",children:[i.jsxs(ye,{title:"Systemd",action:i.jsx(ht,{onClick:p}),children:[a?i.jsx(Se,{tone:"error",text:a.message}):null,i.jsx(Qf,{data:r,loading:s})]}),i.jsxs(ye,{title:"Process activity",action:i.jsx(ht,{onClick:d}),children:[n?i.jsx(Se,{tone:"error",text:n.message}):null,i.jsx(Wf,{data:e,loading:t})]}),i.jsxs(ye,{title:"Monitor alerts",action:i.jsx(ht,{onClick:m}),children:[u?i.jsx(Se,{tone:"error",text:u.message}):null,i.jsx(Jf,{alerts:l,loading:o,now:c})]})]})}function Pn({href:e,active:t,children:n,onNavigate:r}){return i.jsx("a",{className:Q("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 hf({jobId:e,detail:t,selectedJob:n,user:r,onBackToDashboard:s,onRetry:a,onDismiss:l,onCancel:o,onRefresh:u}){const[c,d]=A.useState(!1),[p,m]=A.useState(!1),[h,y]=A.useState(!1),w=!!(r!=null&&r.is_admin&&n&&In(n.status)),v=!!(n&&Ei(n,r)),b=c?"Retrying...":"Retry",N=p?"Dismissing...":"Dismiss",_=h?"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:S=>{S.defaultPrevented||S.button!==0||S.metaKey||S.ctrlKey||S.altKey||S.shiftKey||(S.preventDefault(),s())},children:[i.jsx(ju,{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(qn,{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:p,onClick:async()=>{if(window.confirm(`Dismiss job #${e}?`)){m(!0);try{await l(e)}finally{m(!1)}}},children:[i.jsx(fn,{className:"h-4 w-4","aria-hidden":!0}),N]}):null,v?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:h,onClick:async()=>{const S=window.prompt(`Cancel job #${e}? Optional reason:`);if(S!==null){y(!0);try{await o(e,S)}finally{y(!1)}}},children:[i.jsx(Kt,{className:"h-4 w-4","aria-hidden":!0}),_]}):null,i.jsx(ht,{onClick:u})]})]}),i.jsx(ye,{title:`Job #${e}`,className:"p-3 sm:p-4",children:t})]})}function pf({selectedJobId:e,selectedJob:t,loading:n,error:r,session:s,sessionEvents:a,transcript:l,now:o}){return t?i.jsx(zf,{job:t,session:s,sessionEvents:a,transcript:l,now:o}):e!==null&&n?i.jsx(Z,{text:"Loading selected job..."}):e!==null&&r?i.jsx(Se,{tone:"error",text:`Job #${e}: ${r.message}`}):i.jsx(Z,{text:"Select a job to inspect its timeline, worklog and GitHub links."})}function mf({data:e,loading:t,error:n,repo:r,status:s,user:a,now:l,onRepoChange:o,onStatusChange:u,onApprove:c,onReject:d,onUpdateRuleScope:p,onDeleteRule:m,onRefresh:h}){const y=(e==null?void 0:e.summary)??{},[w,v]=A.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(Mi,{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(ht,{onClick:h})]}),n?i.jsx(Se,{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(He,{title:"Proposed",value:y.proposed??0,icon:i.jsx(bl,{className:"h-5 w-5"})}),i.jsx(He,{title:"Approved",value:y.approved??0,icon:i.jsx(fn,{className:"h-5 w-5"})}),i.jsx(He,{title:"Rules",value:y.rules??0,icon:i.jsx(wl,{className:"h-5 w-5"})}),i.jsx(He,{title:"Events",value:y.events??0,icon:i.jsx(zn,{className:"h-5 w-5"})})]}),i.jsx(ye,{title:"Filters",className:"p-3",children:i.jsxs("div",{className:Q("grid gap-3",w==="proposals"?"md:grid-cols-[minmax(0,1fr)_220px]":"md:grid-cols-[minmax(0,1fr)]"),children:[i.jsx(Ge,{label:"Repository",children:i.jsxs("select",{className:"control",value:r,onChange:N=>o(N.target.value),children:[i.jsx("option",{value:"",children:"All repositories"}),((e==null?void 0:e.repositories)??[]).map(N=>i.jsx("option",{value:N,children:N},N))]})}),w==="proposals"?i.jsx(Ge,{label:"Proposal status",children:i.jsxs("select",{className:"control",value:s,onChange:N=>u(N.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(ye,{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(N=>i.jsxs("button",{className:Q("inline-flex h-8 items-center gap-1.5 rounded px-2.5 text-xs font-semibold",w===N.id?"bg-primary text-white":"text-muted hover:bg-slate-50 hover:text-foreground"),type:"button",role:"tab","aria-label":`${N.label} (${N.count})`,"aria-selected":w===N.id,onClick:()=>v(N.id),children:[i.jsx("span",{children:N.label}),i.jsx("span",{className:Q("rounded-sm border px-1 font-mono text-[10px]",w===N.id?"border-white/40 text-white":"border-border text-muted"),children:N.count})]},N.id))}),children:[w==="proposals"?i.jsx(ff,{proposals:(e==null?void 0:e.proposals)??[],loading:t,isAdmin:!!(a!=null&&a.is_admin),now:l,onApprove:c,onReject:d}):null,w==="rules"?i.jsx(bf,{rules:(e==null?void 0:e.rules)??[],loading:t,now:l,onUpdateRuleScope:p,onDeleteRule:m}):null,w==="events"?i.jsx(yf,{events:(e==null?void 0:e.events)??[],loading:t,now:l}):null]})]})}function ff({proposals:e,loading:t,isAdmin:n,now:r,onApprove:s,onReject:a}){const[l,o]=A.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(xo,{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(xf,{event:u.source_event}):i.jsxs("p",{className:"font-mono text-xs text-muted",children:["Source event ",u.event_id]}),u.error?i.jsx(Se,{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:l===u.id,onClick:async()=>{o(u.id);try{await s(u.id)}finally{o(null)}},children:[i.jsx(fn,{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:l===u.id,onClick:async()=>{o(u.id);try{await a(u.id)}finally{o(null)}},children:[i.jsx(Kt,{className:"h-4 w-4","aria-hidden":!0}),"Reject"]})]}):null]},u.id))})}function xf({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(wn,{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:yn(e.source_job_id),children:[i.jsx(tr,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",e.source_job_id]}):null,e.github_urls.length>0?i.jsx($n,{urls:e.github_urls,compact:!0}):i.jsx("span",{className:"font-mono text-xs text-muted",children:"No GitHub link"})]})}function gf(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 bf({rules:e,loading:t,now:n,onUpdateRuleScope:r,onDeleteRule:s}){const[a,l]=A.useState(null),[o,u]=A.useState(null),[c,d]=A.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(p=>{const m=p.source_event_details??[],h=m[0],y=h?h.trigger_actor||(h.actor!=="github"?h.actor:null):null,w=m.flatMap(S=>S.github_urls??[]),v=gf(p.scope),b=o===p.id,N=a===p.id,_=!!p.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(xo,{scope:p.scope,type:p.type,confidence:p.confidence,status:`${p.observations} observation${p.observations===1?"":"s"}`,timestamp:p.last_seen,now:n}),_?i.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[b?i.jsxs(i.Fragment,{children:[i.jsx(Ge,{label:"Scope",children:i.jsx("select",{className:"control h-8 min-w-[180px] py-1 text-xs",value:c,disabled:N,onChange:S=>d(S.target.value),children:v.map(S=>i.jsx("option",{value:S.value,children:S.label},S.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:N||c===p.scope,title:"Save scope",onClick:async()=>{if(c!==p.scope){l(p.id);try{await r(p.id,c),u(null)}finally{l(null)}}},children:[i.jsx(Cu,{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:N,title:"Cancel scope edit",onClick:()=>{u(null),d("")},children:[i.jsx(Kt,{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:N,title:"Edit scope",onClick:()=>{u(p.id),d(p.scope)},children:[i.jsx(Su,{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:N,onClick:async()=>{if(window.confirm("Delete this curated rule?")){l(p.id);try{await s(p.id)}finally{l(null)}}},children:[i.jsx(fi,{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:p.rule}),i.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[i.jsx(wn,{actor:y,avatarUrl:h==null?void 0:h.trigger_actor_avatar_url,framed:!0}),h!=null&&h.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:yn(h.source_job_id),children:[i.jsx(tr,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",h.source_job_id]}):null,w.length>0?i.jsx($n,{urls:w,compact:!0}):i.jsx("span",{className:"font-mono text-xs text-muted",children:"No GitHub link"})]})]},p.id)})})}function yf({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(mn,{className:"h-3.5 w-3.5 shrink-0 transition-transform group-open:rotate-180","aria-hidden":!0}),i.jsx("span",{className:"truncate",children:po(r.scope)})]}),i.jsx("span",{className:"shrink-0 font-mono text-xs text-muted",children:i.jsx(Ee,{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(wn,{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:yn(r.source_job_id),children:[i.jsx(tr,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",r.source_job_id]}):null,r.github_urls.length>0?i.jsx($n,{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($n,{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 wf({tokens:e,loading:t,error:n,user:r,ownerOptions:s,dashboardUrl:a,dashboardUrlSource:l,now:o,onCreate:u,onUpdateOwner:c,onRevoke:d,onRefresh:p}){const[m,h]=A.useState(""),[y,w]=A.useState(""),[v,b]=A.useState(!1),[N,_]=A.useState(null),[S,D]=A.useState(null),[j,B]=A.useState(null),[L,C]=A.useState(""),O=e??[],T=s.find(P=>P.login===y);A.useEffect(()=>{var P;r!=null&&r.is_admin&&(y&&s.some(q=>q.login===y)||w((r==null?void 0:r.login)||((P=s[0])==null?void 0:P.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(/\/$/,""),V=`${E}/mcp`,F=`${E}/api/mcp`;return i.jsxs("div",{className:"grid min-w-0 gap-4",children:[i.jsx(mo,{icon:i.jsx(vr,{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(ht,{onClick:p})}),n?i.jsx(Se,{tone:"error",text:n.message}):null,L?i.jsx(Se,{tone:"error",text:L}):null,i.jsx(vf,{dashboardUrl:V,endpointUrl:F,dashboardUrlSource:l??"request"}),j?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(Kt,{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:j.token})]}):null,i.jsx(ye,{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 P=>{P.preventDefault();const q=m.trim();if(q){b(!0),C("");try{const W=await u(q,r!=null&&r.is_admin?y:void 0);B(W),h("")}catch(W){C(W instanceof Error?W.message:String(W))}finally{b(!1)}}},children:[i.jsx(Ge,{label:"Token name",children:i.jsx("input",{className:"control",value:m,placeholder:"local agent",disabled:v,onChange:P=>h(P.target.value)})}),r!=null&&r.is_admin?i.jsxs(Ge,{label:"Owner",children:[i.jsx(fo,{ariaLabel:"Owner",value:y,ownerOptions:s,disabled:v||s.length===0,selectedSuffix:P=>P.login===(r==null?void 0:r.login)?" (you)":"",emptyLabel:"No known users",onChange:w}),T?i.jsxs("span",{className:"font-normal text-muted",children:["Token will be linked to @",T.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:v||!m.trim()||!!(r!=null&&r.is_admin&&!y),children:[i.jsx(vr,{className:"h-4 w-4","aria-hidden":!0}),v?"Creating...":"Create token"]})]})}),i.jsx(ye,{title:"Active tokens",children:i.jsx(jf,{tokens:O,loading:t,now:o,ownerOptions:s,canManageOwners:!!(r!=null&&r.is_admin),revokingId:N,updatingOwnerId:S,onUpdateOwner:async(P,q)=>{D(P),C("");try{await c(P,q)}catch(W){C(W instanceof Error?W.message:String(W))}finally{D(null)}},onRevoke:async P=>{if(window.confirm("Revoke this MCP token?")){_(P),C("");try{await d(P)}catch(q){C(q instanceof Error?q.message:String(q))}finally{_(null)}}}})})]})}function vf({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,l=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(ye,{title:"Connect an agent",children:[s?i.jsx(Se,{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(pn,{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(pn,{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:l})]})]}),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(vr,{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(Mi,{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 mo({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 jf({tokens:e,loading:t,now:n,ownerOptions:r,canManageOwners:s,revokingId:a,updatingOwnerId:l,onUpdateOwner:o,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(za,{token:c,ownerOptions:r,disabled:l===c.id,onUpdateOwner:o}):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(he,{label:"Created",value:i.jsx(Ee,{value:c.created_at,relative:!0,now:n})}),i.jsx(he,{label:"Last used",value:c.last_used_at?i.jsx(Ee,{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(fi,{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(za,{token:c,ownerOptions:r,disabled:l===c.id,onUpdateOwner:o}):c.user_login?`@${c.user_login}`:"unassigned"}),i.jsx("td",{className:"px-3 py-3 font-mono text-xs",children:i.jsx(Ee,{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(Ee,{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(fi,{className:"h-4 w-4","aria-hidden":!0}),a===c.id?"Revoking...":"Revoke"]})})]},c.id))})]})})]})}function za({token:e,ownerOptions:t,disabled:n,onUpdateOwner:r}){const s=e.user_login??"";return i.jsx(fo,{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 fo({value:e,ownerOptions:t,disabled:n,onChange:r,ariaLabel:s,selectedSuffix:a,emptyLabel:l,size:o="default"}){const u=t.find(d=>d.login===e),c=u?`@${u.login}${(a==null?void 0:a(u))??""}`:l;return i.jsxs("div",{className:Q("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":"",o==="compact"?"h-8 w-44 max-w-full px-2":"h-9 w-full px-2.5"),children:[i.jsx("span",{className:Q("pointer-events-none flex shrink-0 items-center justify-center",o==="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:it(u.avatar_url),alt:"",referrerPolicy:"no-referrer"}):i.jsx(Bn,{className:Q("text-muted",o==="compact"?"h-4 w-4":"h-5 w-5"),"aria-hidden":!0})}),i.jsx("span",{className:Q("pointer-events-none min-w-0 flex-1 truncate font-mono",u?"text-foreground":"text-muted",o==="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:l}):null,t.map(d=>i.jsxs("option",{value:d.login,children:["@",d.login,(a==null?void 0:a(d))??""]},d.login))]}),i.jsx(mn,{className:Q("pointer-events-none shrink-0 text-muted",o==="compact"?"h-3.5 w-3.5":"h-4 w-4"),"aria-hidden":!0})]})}function $n({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:Q("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:it(s),"aria-label":s,rel:"noreferrer",target:"_blank",children:[i.jsx(pn,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),i.jsx("span",{className:"truncate",children:t?kf(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 kf(e){try{const t=new URL(e);return t.pathname.replace(/^\//,"")+t.hash}catch{return e}}function xo({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:po(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(Ee,{value:s,relative:!0,now:a})})]})}function Nf({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(Bn,{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:it(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(wl,{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 Sf({config:e,loading:t,onEnable:n,onDisable:r}){const[s,a]=A.useState(!1),[l,o]=A.useState(""),u=!!(e!=null&&e.status.enabled),c=typeof navigator<"u"&&typeof window<"u"&&yr(),d=t||s||!(e!=null&&e.configured)||!c,p=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:Q("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":p,title:l||p,disabled:d,onClick:async()=>{a(!0),o("");try{u?await r():await n()}catch(m){o(m instanceof Error?m.message:String(m))}finally{a(!1)}},children:i.jsx(gl,{className:Q("h-4 w-4",s&&"animate-live-pulse"),"aria-hidden":!0})})})}function Cf({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?yn(e.job_id):"/"),l=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(gl,{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(Kt,{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(),l?n(a):window.open(it(a),"_blank","noopener,noreferrer")},children:[i.jsx(pn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Open"]})]})]})})}function _f({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(ht,{onClick:r,compactOnMobile:!0})]})}function ye({title:e,action:t,children:n,className:r,flushHeader:s=!1}){return i.jsxs("section",{className:Q("min-w-0 rounded-lg border border-border bg-panel p-4 shadow-sm",r),children:[i.jsxs("div",{className:Q("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 He({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 Ef({filters:e,actorOptions:t,onChange:n}){const[r,s]=A.useState(e);A.useEffect(()=>s(e),[e]);const a=ef(e),l=Fa(e)||Fa(r),o=()=>{s(_i),n(_i)};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(ku,{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:[l?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(),o()},children:[i.jsx(qn,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Clear filters"]}):null,i.jsx(mn,{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(Ge,{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(Ge,{label:"Repository",children:i.jsx("input",{className:"control",value:r.repo,placeholder:"owner/repo",onChange:u=>s({...r,repo:u.target.value})})}),i.jsx(Ge,{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(Ge,{label:"Action",children:i.jsx("input",{className:"control",value:r.action,placeholder:"reply_comment",onChange:u=>s({...r,action:u.target.value})})}),i.jsx(Ge,{label:"Actor",className:"xl:col-span-2",children:i.jsx(Pf,{value:r.actor,options:t,onChange:u=>s({...r,actor:u})})}),i.jsx(Ge,{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:!l,onClick:o,children:[i.jsx(qn,{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(_u,{className:"h-4 w-4","aria-hidden":!0}),"Apply"]})]})]})]})}function Pf({value:e,options:t,onChange:n}){const[r,s]=A.useState(!1),a=e.trim().replace(/^@/,"").toLowerCase(),l=t.filter(u=>!a||u.login.toLowerCase().includes(a)).slice(0,8),o=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:[o?i.jsx("img",{className:"h-5 w-5 shrink-0 rounded-full bg-slate-100",src:it(o.avatar_url??""),alt:`${o.login} avatar`,referrerPolicy:"no-referrer"}):i.jsx(Bn,{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(Kt,{className:"h-3.5 w-3.5","aria-hidden":!0})}):null]}),r&&l.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:l.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:it(u.avatar_url),alt:`${u.login} avatar`,referrerPolicy:"no-referrer"}):i.jsx(Bn,{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 Ge({label:e,children:t,className:n}){return i.jsxs("label",{className:Q("grid min-w-0 gap-1 text-xs font-semibold text-muted",n),children:[e,t]})}function Rf({jobs:e,loading:t,loadingMore:n=!1,hasMore:r=!1,onLoadMore:s,onViewJob:a,now:l,user:o,onRetry:u,onDismiss:c,onCancel:d}){const[p,m]=A.useState(null),[h,y]=A.useState(null),[w,v]=A.useState(null),b=A.useRef(!1),N=A.useRef(n),_=!!(o!=null&&o.is_admin&&u),S=!!(o!=null&&o.is_admin&&c);A.useEffect(()=>{N.current&&!n&&(b.current=!1),N.current=n},[n]);const D=A.useCallback(()=>{b.current||(b.current=!0,s==null||s())},[s]),j=A.useCallback(async C=>{if(u){m(C);try{await u(C)}finally{m(null)}}},[u]),B=A.useCallback(async C=>{if(c){y(C);try{await c(C)}finally{y(null)}}},[c]),L=A.useCallback(async(C,O)=>{if(d){v(C);try{await d(C,O)}finally{v(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(C=>i.jsx(Lf,{job:C,onViewJob:a,now:l,canRetry:_&&In(C.status),retrying:p===C.id,onRetry:j,canDismiss:S&&In(C.status),dismissing:h===C.id,onDismiss:B,canCancel:!!(d&&Ei(C,o)),cancelling:w===C.id,onCancel:L},C.id)),i.jsx(Tf,{hasMore:r,loading:n,onLoadMore:D})]}),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(C=>i.jsx(If,{job:C,now:l,onViewJob:a,canRetry:_&&In(C.status),retrying:p===C.id,onRetry:j,canDismiss:S&&In(C.status),dismissing:h===C.id,onDismiss:B,canCancel:!!(d&&Ei(C,o)),cancelling:w===C.id,onCancel:L},C.id))})]}),i.jsx(Af,{hasMore:r,loading:n,onLoadMore:D})]})]})}function If({job:e,now:t,onViewJob:n,canRetry:r,retrying:s,onRetry:a,canDismiss:l,dismissing:o,onDismiss:u,canCancel:c,cancelling:d,onCancel:p}){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(ns,{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(ts,{intent:e.intent,actionMode:e.action_mode,display:"intent",compact:!0})})]}),i.jsx("td",{className:"px-3 py-3",children:i.jsx(wn,{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:Ke(es(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:Ke(Zi(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(Ee,{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(go,{jobId:e.id,canRetry:r,retrying:s,onRetry:a,compact:!0}),i.jsx(bo,{jobId:e.id,canDismiss:l,dismissing:o,onDismiss:u,compact:!0}),i.jsx(yo,{jobId:e.id,canCancel:c,cancelling:d,onCancel:p,compact:!0})]})})]})}function Tf({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(mn,{className:"h-4 w-4","aria-hidden":!0}),t?"Loading more jobs...":"Load more jobs"]})}function Af({hasMore:e,loading:t,onLoadMore:n}){const r=A.useRef(null);return A.useEffect(()=>{const s=r.current;if(!s||!e||t||!n)return;if(!("IntersectionObserver"in window)){n();return}const a=new IntersectionObserver(l=>{l.some(o=>o.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 Lf({job:e,onViewJob:t,now:n,canRetry:r,retrying:s,onRetry:a,canDismiss:l,dismissing:o,onDismiss:u,canCancel:c,cancelling:d,onCancel:p}){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(ts,{intent:e.intent,actionMode:e.action_mode,compact:!0,display:"intent"}),i.jsx(wn,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url})]})]}),i.jsx(ns,{status:e.status})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[i.jsx(he,{label:"Wait",value:Ke(es(e,n))}),i.jsx(he,{label:"Runtime",value:Ke(Zi(e,n))}),i.jsx(he,{label:"Updated",value:i.jsx(Ee,{value:e.updated_at,compact:!0,relative:!0,now:n})})]})]}),r||l||c?i.jsxs("div",{className:"flex flex-wrap gap-2 border-t border-border px-3 py-2",children:[i.jsx(go,{jobId:e.id,canRetry:r,retrying:s,onRetry:a}),i.jsx(bo,{jobId:e.id,canDismiss:l,dismissing:o,onDismiss:u}),i.jsx(yo,{jobId:e.id,canCancel:c,cancelling:d,onCancel:p})]}):null]})}function go({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:Q("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 l=>{l.stopPropagation(),window.confirm(`Retry job #${e}?`)&&await r(e)},children:[i.jsx(qn,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:Q(s&&"sr-only"),children:a})]})}function bo({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:Q("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 l=>{l.stopPropagation(),window.confirm(`Dismiss job #${e}?`)&&await r(e)},children:[i.jsx(fn,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:Q(s&&"sr-only"),children:a})]})}function yo({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:Q("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 l=>{l.stopPropagation();const o=window.prompt(`Cancel job #${e}? Optional reason:`);o!==null&&await r(e,o)},children:[i.jsx(Kt,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:Q(s&&"sr-only"),children:a})]})}function wn({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:it(t),alt:e?`${e} avatar`:"",referrerPolicy:"no-referrer"}):i.jsx(Bn,{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 Mf(e){return(e==null?void 0:e.model)??"OpenClaw default"}function Of(e){return(e==null?void 0:e.thinking)??"OpenClaw default"}function Df(e){return e?e.configured?"configured":e.summary:"n/a"}function Ff(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 ts({intent:e,actionMode:t,compact:n=!1,display:r="mode"}){const s=Ff(e,t),a=s.intentLabel==="work_allowed"?Pu:yl,l=r==="intent"?s.intentLabel:s.mode;return i.jsxs("span",{className:Q("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}: ${l}`,children:[i.jsx(a,{className:Q("h-3.5 w-3.5 shrink-0",n&&"h-3 w-3"),"aria-hidden":!0}),i.jsx("span",{className:"truncate font-mono",children:l})]})}function zf({job:e,session:t,sessionEvents:n,transcript:r,now:s,compact:a=!1}){var h;const l=yn(e.id),o=n??[],u=r??[],c=Fm(o),d=zm(u),p=Zi(e,s),m=es(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(ns,{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:l,children:[i.jsx(tr,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",e.id]}),i.jsx(wn,{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($n,{urls:e.github_urls,compact:!0}):i.jsx("p",{className:"text-xs text-muted",children:"No links recorded."})]})]})]}),i.jsxs("div",{className:Q("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-3"),children:[i.jsx(he,{label:"Queue wait",value:Ke(m)}),i.jsx(he,{label:e.status==="running"?"Running for":"Runtime",value:Ke(p)}),i.jsx(he,{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:Q("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-3"),children:[i.jsx(he,{label:"Model",value:Mf(e.model_route)}),i.jsx(he,{label:"Reasoning",value:Of(e.model_route)}),i.jsx(he,{label:"Route",value:Df(e.model_route)})]}),i.jsx(Bf,{job:e,compact:a}),i.jsxs("div",{className:Q("grid gap-2 text-sm sm:gap-3",a?"grid-cols-1":"grid-cols-2 xl:grid-cols-4"),children:[i.jsx(he,{label:"Created",value:i.jsx(Ee,{value:e.created_at,compact:!0,relative:!0,now:s})}),i.jsx(he,{label:"Started",value:e.started_at?i.jsx(Ee,{value:e.started_at,compact:!0,relative:!0,now:s}):"n/a"}),i.jsx(he,{label:"Updated",value:i.jsx(Ee,{value:e.updated_at,compact:!0,relative:!0,now:s})}),i.jsx(he,{label:"Finished",value:e.finished_at?i.jsx(Ee,{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?(h=e.worklog)==null?void 0:h.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(Ee,{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(vl,{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(he,{label:"Session ID",value:t.id}),i.jsx(he,{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(Uf,{event:y,defaultOpen:Oa(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(qf,{entry:y,defaultOpen:Oa(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 Bf({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:Q("grid gap-2 text-sm sm:gap-3",t?"grid-cols-1":"grid-cols-2 xl:grid-cols-4"),children:[i.jsx(he,{label:"Mode",value:i.jsx(ts,{intent:e.intent,actionMode:e.action_mode})}),i.jsx(he,{label:"Intent",value:e.intent}),i.jsx(he,{label:"Addressed",value:n?Ba(r.addressed_to_agent):"n/a"}),i.jsx(he,{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(Xe,{label:"Classifier",value:n.enabled?"enabled":"disabled"}),i.jsx(Xe,{label:"Applied",value:Ba(r.applied)}),i.jsx(Xe,{label:"Confidence",value:a}),i.jsx(Xe,{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(Xe,{label:"LLM",value:`${r.action??"n/a"} / ${r.work_intent??"n/a"}`}),i.jsx(Xe,{label:"Scope",value:r.scope||"n/a"})]}),r.main_request?i.jsx(Xe,{label:"Main request",value:r.main_request}):null,r.subordinate_reason?i.jsx(Xe,{label:"Subordinate reason",value:r.subordinate_reason}):null,r.reason?i.jsx(Xe,{label:"Reason",value:r.reason}):null,n.error?i.jsx(Xe,{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 Ba(e){return e===!0?"yes":e===!1?"no":"n/a"}function Xe({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:Q("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 qf({entry:e,defaultOpen:t,now:n}){return i.jsx(wo,{badge:e.badge,meta:i.jsx(Ee,{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 Uf({event:e,defaultOpen:t,now:n}){return i.jsx(wo,{badge:e.badge,meta:i.jsx(Ee,{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 wo({badge:e,meta:t,count:n,summary:r,defaultOpen:s,children:a}){const[l,o]=A.useState(!!s);return i.jsxs("details",{className:"group min-w-0 rounded border border-border bg-slate-50/60",open:l,onToggle:u=>o(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(mn,{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 qa({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(Wn,{width:"100%",height:"100%",children:i.jsxs(_r,{data:n,children:[i.jsx(Jn,{strokeDasharray:"3 3"}),i.jsx(Xn,{dataKey:"name"}),i.jsx(Yn,{tickFormatter:Ke}),i.jsx(Zn,{formatter:r=>[Ke(Number(r)),e]}),i.jsx($t,{dataKey:"seconds",fill:"#0969da",radius:[4,4,0,0]})]})})})}function $f({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(Wn,{width:"100%",height:"100%",children:i.jsxs(_r,{data:r,children:[i.jsx(Jn,{strokeDasharray:"3 3"}),i.jsx(Xn,{dataKey:"day",minTickGap:16}),i.jsx(Yn,{allowDecimals:!1}),i.jsx(Zn,{formatter:s=>[Number(s),"jobs"]}),i.jsx($t,{dataKey:"count",fill:"#16a34a",radius:[4,4,0,0]})]})})})}function Hf({usage:e,loading:t,totalJobs:n}){const[r,s]=A.useState("day"),a=(e==null?void 0:e[r])??[],l=a.map(u=>({...u,label:Kf(u.bucket,r)})),o=a.reduce((u,c)=>u+c.seconds,0);return t&&l.length===0?i.jsx(Z,{text:"Loading runtime usage..."}):l.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(Eu,{className:"h-4 w-4","aria-hidden":!0}),i.jsxs("span",{children:[fr(o)," 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:Q("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(Wn,{width:"100%",height:"100%",children:i.jsxs(_r,{data:l,children:[i.jsx(Jn,{strokeDasharray:"3 3"}),i.jsx(Xn,{dataKey:"label",minTickGap:16,tick:{fontSize:11}}),i.jsx(Yn,{tickFormatter:u=>fr(Number(u))}),i.jsx(nl,{}),i.jsx(Zn,{formatter:(u,c)=>c==="Work"?[fr(Number(u)),"work"]:c==="Review"?[fr(Number(u)),"review"]:[Number(u),String(c)],labelFormatter:u=>String(u)}),i.jsx($t,{dataKey:"work_seconds",name:"Work",stackId:"runtime",fill:"#0969da",isAnimationActive:!1}),i.jsx($t,{dataKey:"review_seconds",name:"Review",stackId:"runtime",fill:"#8250df",radius:[4,4,0,0],isAnimationActive:!1})]})})})]})}function Kf(e,t){if(t==="month"){const[a,l]=e.split("-").map(Number);return!a||!l?e:new Intl.DateTimeFormat(void 0,{month:"short",year:"numeric"}).format(new Date(a,l-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 fr(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 Ua(e){return Object.values(e).reduce((t,n)=>t+n,0)}function Qf({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(l=>l.active_state==="active").length,s=n.filter(l=>l.active_state==="failed"||l.result==="failed").length,a=n.filter(l=>l.kind==="timer").length;return i.jsxs("div",{className:"grid min-w-0 gap-3",children:[e.errors.length>0?i.jsx(Se,{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(xr,{label:"Units",value:String(n.length)}),i.jsx(xr,{label:"Active",value:String(r)}),i.jsx(xr,{label:"Failed",value:String(s),tone:s>0?"bad":"neutral"}),i.jsx(xr,{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(l=>i.jsx(Vf,{unit:l},l.unit))})]})]})]})}function xr({label:e,value:t,tone:n="neutral"}){return i.jsxs("div",{className:Q("min-w-0 rounded-md border bg-white px-3 py-2",n==="bad"?"border-red-200":"border-border"),children:[i.jsx("div",{className:Q("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 Vf({unit:e}){const[t,n]=A.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:l=>n(l.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(mn,{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:Q("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($a,{label:"State",value:e.sub_state,detail:e.result||"unknown"}),i.jsx($a,{label:"PID",value:e.main_pid?String(e.main_pid):"n/a",detail:Ke(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(Gf,{unit:e.unit,active:t})})]})}function $a({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 Gf({unit:e,active:t}){const[n,r]=A.useState([]),[s,a]=A.useState(""),l=A.useRef(null);return A.useEffect(()=>{if(!t){r([]),a("");return}r([]),a("");const o=new EventSource(`/api/systemd/journal/stream?unit=${encodeURIComponent(e)}`);return o.addEventListener("journal_line",u=>{const c=Cr(u);c&&r(d=>[...d.slice(-199),c])}),o.addEventListener("journal_error",u=>{const c=Cr(u);a((c==null?void 0:c.error)??"journal stream failed")}),o.onerror=()=>{},()=>o.close()},[t,e]),A.useEffect(()=>{const o=l.current;o&&(o.scrollTop=o.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(Se,{tone:"error",text:s}):null,i.jsx("div",{ref:l,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((o,u)=>i.jsx("div",{className:"break-words [overflow-wrap:anywhere]",children:o.line},`${o.unit}-${u}`)):i.jsx("div",{className:"text-slate-400",children:"No journal lines received yet."})})]})}function Wf({data:e,loading:t}){var p,m,h,y,w,v;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=>jo(b)),s=r.reduce((b,N)=>b+N.cpu_ticks,0),a=r.reduce((b,N)=>b+Xf(N),0),l=e.executor.service==="active",o=r.slice(0,8).map(b=>({label:`pid ${b.pid}`,ticks:b.cpu_ticks})),u=(e.samples??[]).map(b=>({label:Mn(b.ts),ticks:b.cpu_ticks,io:b.io_bytes,active:b.active_since_last_sample?"active":"quiet"})),c=u.length>0?u:o,d=(p=e.samples)==null?void 0:p[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:Q("inline-flex h-6 items-center rounded-full border px-2 text-xs font-semibold",l?"border-emerald-300 bg-emerald-50 text-emerald-700":"border-slate-300 bg-white text-slate-600"),children:l?"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," ",Ke(b.age_seconds)]},b.id))}):null,d?i.jsxs("p",{className:"mt-1 text-xs text-muted",children:["Last persisted sample ",Mn(d.ts)," · ",d.active_since_last_sample?"activity observed":`quiet ${Ke(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(ei,{label:"PID",value:e.executor.pid?String(e.executor.pid):"n/a"}),i.jsx(ei,{label:"Children",value:String(r.length)}),i.jsx(ei,{label:"CPU ticks",value:String(s)})]})]})}),i.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[i.jsx(gr,{label:"Live process",value:((m=e.signals)==null?void 0:m.live_process.state)??(r.length>0?"live":"no_child_process"),detail:`${((h=e.signals)==null?void 0:h.live_process.child_count)??r.length} children`}),i.jsx(gr,{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 ${Mn(d.ts)}`:"no sample"}),i.jsx(gr,{label:"Semantic progress",value:(w=e.signals)!=null&&w.semantic_progress.length?"recent":"none",detail:Ha(e.running_jobs,"semantic_progress")}),i.jsx(gr,{label:"Visible progress",value:(v=e.signals)!=null&&v.visible_progress.length?"streaming":"none",detail:Ha(e.running_jobs,"visible_progress")})]}),e.alerts.length>0?i.jsx(Se,{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(Gs,{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:[ko(a)," I/O"]})]}),c.length>0?i.jsx("div",{className:"h-40",children:i.jsx(Wn,{width:"100%",height:"100%",children:i.jsxs(Eo,{data:c,children:[i.jsx(Jn,{strokeDasharray:"3 3"}),i.jsx(Xn,{dataKey:"label",tick:!1}),i.jsx(Yn,{allowDecimals:!1,tick:{fontSize:11}}),i.jsx(Zn,{formatter:b=>[Number(b),"cpu ticks"]}),i.jsx(Po,{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(Gs,{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(vo,{process:b},b.pid))}):i.jsx(Z,{text:"No child process detected for the executor."})]})]})]})}function Jf({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(Di,{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:uo(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 vo({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 ",ko(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(vo,{process:a},a.pid))}):null]})}function ei({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 gr({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 Ha(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} ${Ke(r.age_seconds??null)}`}function jo(e){return[e,...(e.children??[]).flatMap(t=>jo(t))]}function Xf(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 ko(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function he({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 ns({status:e}){const t=Bm(e),n=e==="running"||e==="pending";return i.jsxs("span",{className:Q("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:Q("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 Se({tone:e,text:t}){return i.jsx("div",{className:Q("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 ht({onClick:e,compactOnMobile:t=!1}){return i.jsxs("button",{className:Q("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(Oi,{className:"h-4 w-4","aria-hidden":!0}),i.jsx("span",{className:Q(t&&"hidden sm:inline"),children:"Refresh"})]})}const Ka=document.getElementById("root");Ka&&Lo.createRoot(Ka).render(i.jsx(A.StrictMode,{children:i.jsx(lu,{client:Pm,children:i.jsx(tf,{})})})); diff --git a/src/github_agent_bridge/dashboard_static/index.html b/src/github_agent_bridge/dashboard_static/index.html index 3854573..e5c72f5 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/src/github_agent_bridge/queue.py b/src/github_agent_bridge/queue.py index 84f5aa6..034fabd 100644 --- a/src/github_agent_bridge/queue.py +++ b/src/github_agent_bridge/queue.py @@ -815,6 +815,10 @@ def _ensure_columns(self, con: sqlite3.Connection) -> None: con.execute(f"ALTER TABLE {table} ADD COLUMN {column} {definition}") def _ensure_indexes(self, con: sqlite3.Connection) -> None: + if con.execute("SELECT 1 FROM sqlite_master WHERE type='table' AND name='webhook_shadow_receipts'").fetchone() is not None: + con.execute( + "CREATE INDEX IF NOT EXISTS idx_webhook_shadow_delivery_page ON webhook_shadow_receipts(created_at DESC, delivery_id DESC)" + ) if con.execute("SELECT 1 FROM sqlite_master WHERE type='table' AND name='mcp_tokens'").fetchone() is not None: con.execute( "CREATE INDEX IF NOT EXISTS idx_mcp_tokens_user ON mcp_tokens(user_login, revoked_at, created_at)" diff --git a/src/github_agent_bridge/sql/schema.sql b/src/github_agent_bridge/sql/schema.sql index 814c608..a61bcbb 100644 --- a/src/github_agent_bridge/sql/schema.sql +++ b/src/github_agent_bridge/sql/schema.sql @@ -76,6 +76,7 @@ CREATE TABLE IF NOT EXISTS webhook_shadow_receipts ( ); CREATE INDEX IF NOT EXISTS idx_webhook_shadow_event_key ON webhook_shadow_receipts(event_key); CREATE INDEX IF NOT EXISTS idx_webhook_shadow_created ON webhook_shadow_receipts(created_at); +CREATE INDEX IF NOT EXISTS idx_webhook_shadow_delivery_page ON webhook_shadow_receipts(created_at DESC, delivery_id DESC); CREATE TABLE IF NOT EXISTS webhook_hooks ( hook_id TEXT PRIMARY KEY, target TEXT NOT NULL, diff --git a/tests/test_webhook.py b/tests/test_webhook.py index 6812d02..5610420 100644 --- a/tests/test_webhook.py +++ b/tests/test_webhook.py @@ -4,9 +4,11 @@ import hmac import json import sqlite3 +from datetime import UTC, datetime, timedelta from fastapi.testclient import TestClient +from github_agent_bridge import backend from github_agent_bridge.backend import DashboardConfig, _encode_session, _sign, create_app @@ -142,11 +144,18 @@ def test_webhook_status_requires_dashboard_admin(tmp_path): ) client = TestClient(create_app(config)) - assert client.get("/api/webhooks/github/status").status_code == 401 + paths = ( + "/api/webhooks/github/status", + "/api/webhooks/github/summary", + "/api/webhooks/github/timeseries", + "/api/webhooks/github/hooks", + "/api/webhooks/github/deliveries", + ) + assert {client.get(path).status_code for path in paths} == {401} client.cookies.set("gab_dashboard_session", _sign(config, _encode_session({"login": "alice"}))) - assert client.get("/api/webhooks/github/status").status_code == 403 + assert {client.get(path).status_code for path in paths} == {403} client.cookies.set("gab_dashboard_session", _sign(config, _encode_session({"login": "operator"}, is_admin=True))) - assert client.get("/api/webhooks/github/status").status_code == 200 + assert {client.get(path).status_code for path in paths} == {200} assert client.get("/api/status").json()["webhook_configured"] is True @@ -156,7 +165,7 @@ def test_dashboard_status_hides_webhook_tab_when_not_configured(tmp_path): assert client.get("/api/status").json()["webhook_configured"] is False -def test_webhook_status_exposes_real_hook_inventory_deliveries_and_timeseries(tmp_path): +def test_webhook_monitoring_endpoints_keep_summary_light_and_return_real_data(tmp_path): db = tmp_path / "bridge.sqlite3" client = TestClient(create_app(DashboardConfig(db=db, require_auth=False, webhook_secrets=(SECRET,)))) ping = json.dumps({ @@ -168,22 +177,84 @@ def test_webhook_status_exposes_real_hook_inventory_deliveries_and_timeseries(tm assert client.post("/api/webhooks/github", content=ping, headers=hook_headers(ping, delivery="ping-1", event="ping", hook_id="42")).status_code == 200 assert client.post("/api/webhooks/github", content=delivery, headers=hook_headers(delivery, delivery="delivery-1", event="issue_comment", hook_id="42")).status_code == 200 - response = client.get("/api/webhooks/github/status") + summary = client.get("/api/webhooks/github/summary").json() + assert summary == { + "mode": "shadow", "configured": True, + "receipts": {"observed": 1, "unsupported": 1}, + "duplicate_deliveries": 0, "cross_source_matches": 0, + } + assert client.get("/api/webhooks/github/status").json() == summary - assert response.status_code == 200 - status = response.json() - assert status["hooks"] == [{ + hooks = client.get("/api/webhooks/github/hooks").json()["hooks"] + assert hooks == [{ "id": "42", "target": "gisce", "target_type": "organization", "active": True, "events": ["issue_comment", "pull_request_review"], - "last_ping_at": status["hooks"][0]["last_ping_at"], - "last_event_at": status["hooks"][0]["last_event_at"], "status": "receiving", + "last_ping_at": hooks[0]["last_ping_at"], + "last_event_at": hooks[0]["last_event_at"], "status": "receiving", }] - assert status["hooks"][0]["last_ping_at"] - assert status["hooks"][0]["last_event_at"] - assert status["recent_deliveries"][0]["delivery_id"] == "delivery-1" - assert status["recent_deliveries"][0]["hook_id"] == "42" - assert status["timeseries"][0]["observed"] == 1 - assert status["timeseries"][0]["unsupported"] == 1 + assert hooks[0]["last_ping_at"] + assert hooks[0]["last_event_at"] + + first_page = client.get("/api/webhooks/github/deliveries", params={"limit": 1}).json() + assert len(first_page["deliveries"]) == 1 + assert first_page["next_cursor"] + second_page = client.get( + "/api/webhooks/github/deliveries", + params={"limit": 1, "cursor": first_page["next_cursor"]}, + ).json() + deliveries = first_page["deliveries"] + second_page["deliveries"] + assert {item["delivery_id"] for item in deliveries} == {"ping-1", "delivery-1"} + assert next(item for item in deliveries if item["delivery_id"] == "delivery-1")["hook_id"] == "42" + assert second_page["next_cursor"] is None + + now = datetime.now(UTC) + timeseries = client.get("/api/webhooks/github/timeseries", params={ + "from": (now - timedelta(days=1)).isoformat(), + "to": (now + timedelta(days=1)).isoformat(), + "bucket": "hour", + }).json() + assert timeseries["bucket"] == "hour" + assert timeseries["points"][0]["observed"] == 1 + assert timeseries["points"][0]["unsupported"] == 1 + + +def test_webhook_monitoring_rejects_unbounded_ranges_and_invalid_cursors(tmp_path): + client = TestClient(create_app(DashboardConfig( + db=tmp_path / "bridge.sqlite3", require_auth=False, webhook_secrets=(SECRET,), + ))) + + response = client.get("/api/webhooks/github/timeseries", params={ + "from": "2020-01-01T00:00:00Z", "to": "2022-01-01T00:00:00Z", "bucket": "day", + }) + assert response.status_code == 400 + assert response.json()["detail"] == "time_range_too_large" + assert client.get("/api/webhooks/github/deliveries", params={"cursor": "invalid"}).status_code == 400 + + +def test_webhook_monitoring_initializes_schema_once_per_app(tmp_path, monkeypatch): + initializations = 0 + queue_class = backend.JobQueue + + def counting_queue(path): + nonlocal initializations + initializations += 1 + return queue_class(path) + + monkeypatch.setattr(backend, "JobQueue", counting_queue) + payload = issue_comment_payload() + client = TestClient(create_app(DashboardConfig( + db=tmp_path / "bridge.sqlite3", require_auth=False, webhook_secrets=(SECRET,), + ))) + + assert client.post("/api/webhooks/github", content=payload, headers=signed_headers(payload)).status_code == 200 + for path in ( + "/api/webhooks/github/summary", + "/api/webhooks/github/timeseries", + "/api/webhooks/github/hooks", + "/api/webhooks/github/deliveries", + ): + assert client.get(path).status_code == 200 + assert initializations == 1 def test_webhook_receipt_retention_removes_expired_delivery_details(tmp_path): @@ -197,7 +268,8 @@ def test_webhook_receipt_retention_removes_expired_delivery_details(tmp_path): con.execute("UPDATE webhook_shadow_receipts SET created_at='2020-01-01T00:00:00+00:00'") client.post("/api/webhooks/github", content=payload, headers=signed_headers(payload, delivery="new")) - assert [item["delivery_id"] for item in client.get("/api/webhooks/github/status").json()["recent_deliveries"]] == ["new"] + deliveries = client.get("/api/webhooks/github/deliveries").json()["deliveries"] + assert [item["delivery_id"] for item in deliveries] == ["new"] def test_existing_webhook_receipt_schema_is_migrated_for_hook_inventory(tmp_path): @@ -217,7 +289,10 @@ def test_existing_webhook_receipt_schema_is_migrated_for_hook_inventory(tmp_path ) assert response.status_code == 200 - assert client.get("/api/webhooks/github/status").json()["hooks"][0]["id"] == "84" + assert client.get("/api/webhooks/github/hooks").json()["hooks"][0]["id"] == "84" + with sqlite3.connect(db) as con: + indexes = {row[1] for row in con.execute("PRAGMA index_list(webhook_shadow_receipts)")} + assert "idx_webhook_shadow_delivery_page" in indexes def test_submitted_review_uses_same_canonical_key_as_email_ingestion(tmp_path):